to be a player or to be a spectator

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
d3m0nlogic
Posts: 32
Joined: 19 Aug 2010, 22:44
Location: Santa Monica

to be a player or to be a spectator

Post 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:
Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

See here for the proper uses of those methods
Smartfox's forum is my daily newspaper.
d3m0nlogic
Posts: 32
Joined: 19 Aug 2010, 22:44
Location: Santa Monica

Post 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...
Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis
d3m0nlogic
Posts: 32
Joined: 19 Aug 2010, 22:44
Location: Santa Monica

Post 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....
Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Is the room that you are executing the 'switchPlayer/switchSpectator' to a game room?
Smartfox's forum is my daily newspaper.
d3m0nlogic
Posts: 32
Joined: 19 Aug 2010, 22:44
Location: Santa Monica

Post by d3m0nlogic »

Yes sir they are. isGame="true" on all of the room in the config.xml
Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post 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?
Smartfox's forum is my daily newspaper.
d3m0nlogic
Posts: 32
Joined: 19 Aug 2010, 22:44
Location: Santa Monica

Post 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.
Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Hm.. I'm not 100% why you're getting no player indices. Could you check your AdminTool to confirm this?
Smartfox's forum is my daily newspaper.
d3m0nlogic
Posts: 32
Joined: 19 Aug 2010, 22:44
Location: Santa Monica

Post by d3m0nlogic »

The admin tool is where I was looking....

:? :? :? :? :? :? :?
Abyssus abyssum invocat,Ad hominem Ad Libitur..Non Conserva me ab animam inferno...liberate tutame ex inferis
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post 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.
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply