Page 1 of 1

Spectator not working in _server.joinRoom()

Posted: 22 Dec 2011, 18:27
by Pippoflash
Hi,
I am trying to have users join a room as spectators via server side.

The room is created with following parameters:

Code: Select all

var TABLE_ROOM_PARAMS	= { 
	name:"GameRoom", 
	isGame:true, 
	maxU:4, // Set in creation
	maxS:9999, // Set in creatioin
	isLimbo:false, 
	uCount:true, 
	xtName:"RoomExt", 
	xtClass:"RoomFunTable.as" 
}; 
User joins room with following parameters:

Code: Select all

var spectator = true;
_server.joinRoom(user, oldId, leaveOld, roomId, null, false, true, null, spectator);
No matter what, user doesn't join as spectator.
The user.isSpectator() returns always false, and when 4 players are there, user can't join.

Am I missing something?
thank you very much

Posted: 22 Dec 2011, 18:42
by Pippoflash
Some more info:
- In admin tool I see that the correct number of spectators are allowed.
- I trace the action before joining, and the correct flags are set to have the user join as spectator.
- Joining fails, because user joins anyway as a player.
- If I increase number of maximum players it works, since user joins as player. (I could handle players as if they were spectators, but would this leave security flaws?)

Posted: 22 Dec 2011, 23:42
by rjgtav
Hi. I think something is wrong here. You're using a Server-Side Actionscript extension, correct?

If so, the joinRoom function is:

_server.joinRoom(user, oldId, leaveOld, roomId, null, spectator, sendUpdate)

Not the one you're using.