Some short clarifications ....
Posted: 18 Sep 2008, 09:25
hi
in our application each game type on the client, has its own class, and which manages the gameplay etc etc ... when that class needs to send a message to the server , we use the above code ...
couple of questions .....
1]GAME_EXTENSION , is this required , or is there a way for the server to get this info from the room id which is being sent ... this.getRoomId() ...
2]it seems we can sent any message to any room event if i am not in it ... for example if the above code i did
and the game 99 existed for the extension .. i would get a
handleRequest called on in the extension instance of game 99 .....
to avoid this .. i have had to write this code ..
Is this cross room chatter by design .... , or am I doing something wrong ......
last but by far not the least ... everyone talks about the extensionHelper ,,is it available to the server side for AS extensions ... how can i use i the same in AS .....
Code: Select all
smartFoxObject.sendXtMessage(GAME_EXTENSION, cmd, obj, SmartFoxClient.XTMSG_TYPE_JSON,this.getRoomId())
couple of questions .....
1]GAME_EXTENSION , is this required , or is there a way for the server to get this info from the room id which is being sent ... this.getRoomId() ...
2]it seems we can sent any message to any room event if i am not in it ... for example if the above code i did
Code: Select all
smartFoxObject.sendXtMessage(GAME_EXTENSION, cmd, obj, SmartFoxClient.XTMSG_TYPE_JSON,99)
and the game 99 existed for the extension .. i would get a
handleRequest called on in the extension instance of game 99 .....
to avoid this .. i have had to write this code ..
Code: Select all
function handleRequest(cmd, params, user, fromRoom) {
var isInRoom = isUserInRoom(user)
trace("handleRequest(" + cmd + ") fromRoom = " + fromRoom + " isInRoom= " + isInRoom);
if(isInRoom == false)
{
traceEx("**** CROSS ROOM ERROR ****");
return;
}
}
last but by far not the least ... everyone talks about the extensionHelper ,,is it available to the server side for AS extensions ... how can i use i the same in AS .....