I generally understand the basics of loading an extension, but I don't know how in this instance to attach this variable to a game room from within the extension as file. Also what would I have to write in the swf file?On the server side each User and Room object has carries a properties object where you can store any runtime values, status, flag etc... So you could use it for keeping the "inPlay" status of each room.
All you have to do is send a request from the client to your extension saying "join me in game room 10". The server side part will do all the necessary validation and either join the player or send back an error.
About real time updates of the status of each room ( game running, not running etc... ) you can send an additional update to your client that informs them about those status changes.
Do I load the extension here? or elsewhere? :
Code: Select all
function createRoom(name:String, pwd:String, max:Number) {
hideWindow("newGameWindow");
var gameRoom:Object = new Object();
gameRoom.name = name;
gameRoom.password = pwd;
gameRoom.maxUsers = 8;
gameRoom.isGame = true;
gameRoom.isTemp = true;
//
//
xt = {};
xt.name = "isInPlay_";
xt.script = "isInPlay_.as";
gameRoom.extension = xt;
//
smartfox.createRoom(gameRoom);
}
Code: Select all
smartfox.onRoomListUpdate = function(roomList:Object) {
roomList_lb.removeAll();
for (var i in roomList) {
var room:Room = roomList[i];
if (room.isGame()&room.isInPlay==false) {
roomList_lb.addItem(room.getName()+" ("+room.getUserCount()+")", room.getId());
}
}
roomList_lb.sortItemsBy("label", "ASC");
// Join the default room
this.joinRoom("The Entrance", "");
};
I have gone through the extension tutorials and examples and the solution to this problem isn't coming together in my mind with what I've gathered. Can you please help me out with this problem with specific syntax?
Jason