Page 1 of 1

to be a player or to be a spectator

Posted: 11 Sep 2010, 08:33
by d3m0nlogic
I 've been trying to get this to work... and no success at all...

int _pl = _room.switchSpectator(_userRef);

when I do this... the spectator doesn't get switch to a player.. and vice-versa when I use the other method>

Boolean inval = _room.switchPlayer(_userRef);


.... I think the server is laughing at me right now. :twisted: :twisted: :twisted:

Posted: 11 Sep 2010, 20:34
by BigFIsh
See here for the proper uses of those methods

Posted: 12 Sep 2010, 04:59
by d3m0nlogic
:mrgreen: :mrgreen: :mrgreen: AAAAhhhh! Ok. so ....not _room.method -->_helper.method


Got it. I will try it and get back to you. Thank you sir...

Posted: 13 Sep 2010, 19:36
by d3m0nlogic
and the server is still laughing :twisted: :twisted: :twisted: .. (doesn't work.)

I see no change in the amount of spectators in the room. And another curious thing is the player id for all players is 0. ?????!!?!?!

ugh....

Posted: 13 Sep 2010, 21:54
by BigFIsh
Is the room that you are executing the 'switchPlayer/switchSpectator' to a game room?

Posted: 13 Sep 2010, 22:51
by d3m0nlogic
Yes sir they are. isGame="true" on all of the room in the config.xml

Posted: 13 Sep 2010, 23:10
by BigFIsh
Weird - and the player indexes are all zero? It should automatically change when players enter/leaves a game room. May I ask what server version you have? Also, where (and when) about are you executing the spectatorSwitch method?

Posted: 13 Sep 2010, 23:18
by d3m0nlogic
1.6.6 with 6.9 patch. and I do the [switch]method after the user has join the room and wants to a play a game , it then switches(or supposed to switch) spectator to player the when the user leaves the room or sends a bad card the game will kick the user to the Lobby... which I have changed to game as well.

Posted: 14 Sep 2010, 00:28
by BigFIsh
Hm.. I'm not 100% why you're getting no player indices. Could you check your AdminTool to confirm this?

Posted: 14 Sep 2010, 16:54
by d3m0nlogic
The admin tool is where I was looking....

:? :? :? :? :? :? :?

Posted: 15 Sep 2010, 08:03
by Lapo
Just to make sure that this is not a bug with the admin tool you should perform a couple of extra checks.

Invoke the switchPlayer, then check the User playerId directly, by calling user.getPlayerIndex().

Also the client should receive the event and you should be able to double check the playerId on the client side too.