NFive / plugin-sessionmanager

NFive server session manager plugin
GNU Lesser General Public License v3.0
0 stars 5 forks source link

Convar maxclients #1

Closed ByteServer closed 6 years ago

ByteServer commented 6 years ago

SessionManager gives me an error when OnRequest is happening is it a fault from my end? i can fix it by replacing this.Configuration.MaxClients with (ushort)32

Thanks

IgiCodes commented 6 years ago

Could you post the full error? I don't get any errors myself

ByteServer commented 6 years ago

Oh yeah sorry, here you go igi 👍 and i have also pulled every Nfive reference and compiled them, so should be up to date ?

2018-09-09T14:02:28 [Debug] [Events] Fire: "request:maxPlayers" with 0 payload(s): Failed to instantiate instance of script NFive.Server.Program: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at NFive.SessionManager.SessionController.<.ctor>b__7_0 () [0x00000] in <65bacec716734e7b8e578154a74075cb>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00048] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000e7] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at NFive.Server.Events.EventManager+Subscription.Handle[TReturn] (System.Object[] args) [0x00000] in :0 at NFive.Server.Events.EventManager.InternalRequest[TReturn] (System.String event, System.Object[] args) [0x00069] in :0 at NFive.Server.Events.EventManager.Request[TReturn] (System.String event) [0x00000] in :0 at NFive.Queue.QueueController..ctor (NFive.SDK.Core.Diagnostics.ILogger logger, NFive.SDK.Server.Events.IEventManager events, NFive.SDK.Server.Rpc.IRpcHandler rpc, NFive.Queue.Configuration configuration) [0x00097] in <79a2cf618adb444db6e5fe3cd9a3d4d4>:0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007a] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00213] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00095] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Activator.CreateInstance (System.Type type, System.Object[] args) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at NFive.Server.Program..ctor () [0x00455] in :0 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00014] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic) [0x000a8] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00009] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Threading.StackCrawlMark& stackMark) [0x00027] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00020] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at System.Activator.CreateInstance (System.Type type) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 at CitizenFX.Core.InternalManager.CreateAssemblyInternal (System.Byte[] assemblyData, System.Byte[] symbolData) [0x00069] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\InternalManager.cs:86

IgiCodes commented 6 years ago

Do you have a plugin-sessionmanager.yml file inside of your nfive config folder? Recent changes to session manager have made it a configurable controller and I'm guessing that nfive isn't playing nicely when a config isn't available.

ByteServer commented 6 years ago

Yeah i have the yml file in the config folder, but its empty just like the plugin-queue.yml i realised that when it started complaining about configuration files haha 😄.. Well maybe it will fix itself in a future update 😀

JoeBiellik commented 6 years ago

I was just able to recreate this issue with the following:

nfpm setup
nfpm install NFive/plugin-sessionmanager
nfpm install NFive/plugin-queue
nfpm start

You get an missing file error as config/plugin-sessionmanager.yml and config/plugin-queue.yml don't exist, creating empty files gives @ByteServer's error.

Adding the following solves the issue:

plugin-sessionmanager.yml:

connection_timeout: 60000
reconnect_grace: 120000

plugin-queue.yml:

disconnect_grace: 60000
connection_timeout: 60000
deferral_delay: 500
max_clients: 5
queue_when_not_full: false
server_name: "test"

This issue is down to how nfpm handles config management, and should be fixed soon at package manager level.

ByteServer commented 6 years ago

Well damn, Joe saves the day, thanks mate! 😄 👍 So it was just a config file issue. But anyways many thanks, and i am a very big fan of your projects, so keep up the good work guys, cant wait to see more from you two 👀