How to Join Second Player in dyanamic Game Room Multiplayer

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
bambam
Posts: 4
Joined: 08 Jul 2011, 12:18

How to Join Second Player in dyanamic Game Room Multiplayer

Post by bambam »

Hi,

I have do not use any UI Tag, like as sfb:Connector, sfb:ChatBox and sfb:RoomList. For Login purpose use LoginRequest class and pass the user name . After login need create one Default Room then Game room. Presently i have pass the Default room no ,group name using RoomList class. Then create one game room Using RoomSettings class,Use groupId, extension properties. Then send request using CreateRoomRequest class method. My code is

settingRoom = new RoomSettings(GAME_ROOM_NAME);
settingRoom.groupId = GROUP_ID;
settingRoom.maxUsers = MAX_USERS;
settingRoom.extension = new RoomExtension(EXTENSION_ID, EXTENSIONS_CLASS)
var request:CreateRoomRequest = new CreateRoomRequest(settingRoom, true, sfs.lastJoinedRoom);
sfs.send(request);

When first player enter the room then show Waiting for Second player, that good but when Second player browser run then display errors

sfs.mySelf. isPlayer = <exception thrown by getter>
sfs.mySelf.isSpectator = <exception thrown by getter>
sfs.mySelf.playerId = <exception thrown by getter>

I have use same default roomname, game room name, EXTENSION_ID and EXTENSIONS_CLASS, but different user name. Please clarify this problem is Java side/ SFS/ Action Script and How to resolve this issue.
Also how to enter another player in game Room, what is name of sfs class/method those have work just like a Play button mention in sfb:RoomList class( Ref SFSTris2X example(Tic-Tac game) provided SFS) and play the game (whiteout any UI intersection .)?

Please give me any solution

Thanks
Bambam
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Please check the SimpleChat or AdvancedChat examples distributed in the SFS2X package.
Paolo Bax
The SmartFoxServer Team
Post Reply