Sfs instance lost (Null reference)

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

Moderators: Lapo, Bax

braza
Posts: 32
Joined: 02 Jan 2014, 21:50

Sfs instance lost (Null reference)

Postby braza » 14 Dec 2014, 02:14

Hi!
Once in a while, usually during debugging, which means one of the parties is not responding anymore, Unity client receives

NullReferenceException: Object reference not set to an instance of an object
NetworkManager.FixedUpdate () (at Assets/Scripts/Framework/NetworkManager.cs:82)


at sfs.ProcessEvents();

Network manager is as per tutorials. So I'm really curious how could reference be lost..
User avatar
Lapo
Site Admin
Posts: 20915
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Sfs instance lost (Null reference)

Postby Lapo » 14 Dec 2014, 10:40

Me too. I have no idea. :)
You should probably check the code in the NetworkManager and make sure there aren't conditions in which the sfs variable is set to null

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
braza
Posts: 32
Joined: 02 Jan 2014, 21:50

Re: Sfs instance lost (Null reference)

Postby braza » 17 Jan 2015, 17:09

Lapo wrote:Me too. I have no idea. :)
You should probably check the code in the NetworkManager and make sure there aren't conditions in which the sfs variable is set to null

thanks

well, if I just search for this sfs reference usages, there's no any place in my code that assignes it to null... ok, I'll keep investigating
brendan7
Posts: 43
Joined: 10 Feb 2014, 17:40

Re: Sfs instance lost (Null reference)

Postby brendan7 » 19 Jan 2015, 23:54

I've been getting this too. It only happens on android after a long pause>resume in which the sfs client stays connected. I never assign the sfsClient as null.

So far my solution is to re-initiate the client and any dependent systems, which still has issues of its own, so finding the root problem would be great
User avatar
Lapo
Site Admin
Posts: 20915
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Sfs instance lost (Null reference)

Postby Lapo » 20 Jan 2015, 11:14

I am not an Android expert... but it sounds like an app life cycle problem.
Maybe here you can read about tools to help you find out what is going on --> https://developer.android.com/training/ ... emory.html
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 2 guests