Spectator not working in _server.joinRoom()

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

Moderators: Lapo, Bax

Post Reply
Pippoflash
Posts: 135
Joined: 30 Jan 2006, 17:16
Contact:

Spectator not working in _server.joinRoom()

Post 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
-----------------------
www.pippoflash.com
-----------------------
Pippoflash
Posts: 135
Joined: 30 Jan 2006, 17:16
Contact:

Post 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?)
-----------------------
www.pippoflash.com
-----------------------
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post 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.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
Post Reply