m_ThreadCheck && !Thread::EqualsCurrentThreadID(m_Th

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

Post Reply
Fishypants
Posts: 57
Joined: 26 Oct 2010, 14:03
Location: South Pasadena California
Contact:

m_ThreadCheck && !Thread::EqualsCurrentThreadID(m_Th

Post by Fishypants »

Hey, I am getting this error:

m_ThreadCheck && !Thread::EqualsCurrentThreadID(m_ThreadID)
Error in file: ..\..\Runtime\Utilities\MemoryPool.cpp at line 117

What I am doing is basically recreating the island demo piece by piece. I have created a custom login and I get this error after I switch scenes. Unfortunately I have no idea of what or where this error belongs to.

One hunch I am having is that I know I need to assign myUserName and myUserId if I am using a custom login, right? Could this be the culprit?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

One hunch I have would be that you do not run the API in threadsafe mode (the queue mode, where you poll the API for responses in e.g. FixedUpdate)

Unity is not thread safe, and the API uses a separate thread to handle the network communication.

Basically all Unity usage of the SFS1 API should run in the queue mode. SFS2X defaults to this - but SFS1 doesnt due to historical reasons.

/T
Fishypants
Posts: 57
Joined: 26 Oct 2010, 14:03
Location: South Pasadena California
Contact:

Post by Fishypants »

Thanks for the reply Thomas,
How would I go about running it in threadsafe mode?
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Post by ThomasLund »

You need to do something like

smartFox = new SmartFoxClient();
smartFox.runInQueueMode = true;

void FixedUpdate() {
smartFox.ProcessEventQueue();
}
Post Reply