Firing events from different RoomExtensions in the same Zone
Posted: 02 Nov 2011, 05:30
I have two extensions: one for lobby, one for game. The lobby extension is permanent (it is always there, created upon the server startup). The game room extension is created upon the creation of the room itself.
From the lobby, I created a game room using the following code:
Now, I fire a an ExtensionRequest from the game room:
Here is my stacktrace:

I wonder why the lobby extension gets fired as well? I want the game room extension only to get fired.
The game extension init() method:
The lobby extension init() method:
I am using Windows 7 (32bit) and SFS2X RC3 CE.
Thanks a lot for your help
From the lobby, I created a game room using the following code:
Code: Select all
SFSGameSettings settings = new SFSGameSettings("BigTwo Game");
if (((SfsClient) getApplicationContext()).getSelectedGame().equals(getString(R.string.bigTwo))) {
settings.setExtension(new RoomExtension(CardGameConstants.bigTwoGameExtensionId, CardGameConstants.bigTwoGameExtensionClass));
settings.setGame(true);
settings.setMaxSpectators(4);
settings.setMaxUsers(4);
settings.setMinPlayersToStartGame(4);
settings.setName("testsss");
settings.setPublic(true);
}
sfsClient.send(new LeaveRoomRequest());
sfsClient.send(new CreateSFSGameRequest(settings));
finish();
startActivity(new Intent(RoomActivity.this, BigTwoActivity.class));Code: Select all
sfsClient.send(new ExtensionRequest("getPlayerPosition", null));
I wonder why the lobby extension gets fired as well? I want the game room extension only to get fired.
The game extension init() method:
Code: Select all
addRequestHandler("getPlayerPosition", GetPlayerPositionHandler.class);
addEventHandler(SFSEventType.USER_JOIN_ROOM, JoinHandler.class);
addEventHandler(SFSEventType.USER_LEAVE_ROOM, LeaveHandler.class);Code: Select all
addEventHandler(SFSEventType.USER_LOGIN, LoginHandler.class);Thanks a lot for your help