Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

kuldip
Posts: 5
Joined: 07 Feb 2022, 04:14

Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Postby kuldip » 07 Feb 2022, 04:30

We have a situation where trying to call Sfs2X.SmartFox.EnableLagMonitor on our smartfox object is resulting in an exception "Object reference not set to an instance of an object." that is caught and logged. This does not happen very frequently so we are unable to reproduce it. The Smartfox object is not null and IsConnected state is also true. Any idea where the issue might be?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Postby Lapo » 07 Feb 2022, 08:00

Hi,
the LagMonitor should be activated after a successful login. It may be that your client side logic does not handle the state of "non logged in" correctly?

What version of the API are you using by the way?

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
kuldip
Posts: 5
Joined: 07 Feb 2022, 04:14

Re: Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Postby kuldip » 07 Feb 2022, 09:06

Our version is Smartfox 1.7.13.0

We are calling the function upon SFSEvent.ROOM_JOIN , which means login must have happened for room to be joined in.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Postby Lapo » 07 Feb 2022, 12:53

which means login must have happened for room to be joined in.

Yes, definitely.

Is there any way in which you can replicate the issue?
Also do you have a full stack trace of the Exception when it occurs?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
kuldip
Posts: 5
Joined: 07 Feb 2022, 04:14

Re: Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Postby kuldip » 07 Feb 2022, 14:12

As of now, we have been unable to replicate the issue.

The error encountered is "Object reference not set to an instance of an object."

The stacktrace looks like this (have substituted the program namespace using [ProgramNameSpace]) -
Sfs2X.SmartFox.EnableLagMonitor (System.Boolean enabled, System.Int32 interval, System.Int32 queueSize) [0x00000] in <00000000000000000000000000000000>:0 \n at [ProgramNameSpace].SFSEventManager.RoomJoinFunction () [0x00000] in <00000000000000000000000000000000>:0 \n at Sfs2X.Core.EventListenerDelegate.Invoke (Sfs2X.Core.BaseEvent evt) [0x00000] in <00000000000000000000000000000000>:0 \n at Sfs2X.Core.EventDispatcher.DispatchEvent (Sfs2X.Core.BaseEvent evt) [0x00000] in <00000000000000000000000000000000>:0 \n at Sfs2X.SmartFox.ProcessEvents () [0x00000] in <00000000000000000000000000000000>:0

[ProgramNameSpace].SFSEventManager.RoomJoinFunction () is called when the function attached to the listener SFSEvent.ROOM_JOIN is called (and nothing else is called before it after ROOM_JOIN happens).
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Getting Object reference not set to an instance of an object in Sfs2X.SmartFox.EnableLagMonitor

Postby Lapo » 07 Feb 2022, 16:04

Thanks, definitely very odd.
Is it possible to see what the client side ROOM_JOIN event handler does?
If you prefer you can contact us via our support@... email box.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 26 guests