Page 1 of 1

user count change

Posted: 20 Apr 2011, 20:15
by iceshaft07
Hey all--

I am trying to get server negotiations set up after a user joins a room.

The negotiation is really simple, and I have it working for 3 other protocols (I run the same set of calls for Bluetooth, Unity Networking, and Smart Fox)-- that section of the code works just fine.

However, I am having difficulty getting the negotiations to work-- I need the negotiations to run whenever a player joins a room, on both my 'client' (a person who joins a room) and my 'server' (the room creator).

The problem is that I can't get the events dispatched from a user to join a room run.

Here are the 3 that I have tried:

Code: Select all

	smartFox.AddEventListener(SFSEvent.USER_ENTER_ROOM, HandleCountChange);
	smartFox.AddEventListener(SFSEvent.ROOM_JOIN, HandleCountChange);
	smartFox.AddEventListener(SFSEvent.USER_COUNT_CHANGE, HandleCountChange);
The problem is that my negotiations are not being run on the 'client' (person who joined the room). The seem to work just fine on the 'server' (person who created the room). I've checked the documentation, and it leaves the actual functioning of the above dispatched events very ambiguous.

Thanks for you help!

Posted: 20 Apr 2011, 20:23
by iceshaft07
I find that two scripts (one which manages the Lobby, and the other which manages my game) both have similar code-- the count change gets called in one script, but not the other.

I read the docs and do not recall seeing anything about only having a single function per event...

Any Ideas?