function init() {
trace("Initialization Zone Level Extension")
zone=_server.getCurrentZone();
}
function handleRequest(cmd, params, user, fromRoom) {
trace("Zone Level Extension received request: cmd="+cmd+" params="+params+" user="+user+" fromRoom="+fromRoom);
switch (cmd) {
case "setrv":
trace("Room "+zone.getRoom(fromRoom).getName()+" variable changed: "+params.name+". Setting the variable and sending broadcast for all users.");
_server.setRoomVariables(zone.getRoom(fromRoom), user, [params], false, false);
var response={}
response._cmd="chgrv"
response.r_id=fromRoom
response.name=params.name
response.val=params.val
_server.sendResponse(response, fromRoom, null, zone.getUserList().toArray())
break;
}
}
trace("Initialization Zone Level Extension")
zone=_server.getCurrentZone();
}
function handleRequest(cmd, params, user, fromRoom) {
trace("Zone Level Extension received request: cmd="+cmd+" params="+params+" user="+user+" fromRoom="+fromRoom);
switch (cmd) {
case "setrv":
trace("Room "+zone.getRoom(fromRoom).getName()+" variable changed: "+params.name+". Setting the variable and sending broadcast for all users.");
_server.setRoomVariables(zone.getRoom(fromRoom), user, [params], false, false);
var response={}
response._cmd="chgrv"
response.r_id=fromRoom
response.name=params.name
response.val=params.val
_server.sendResponse(response, fromRoom, null, zone.getUserList().toArray())
break;
}
}
Комментариев нет:
Отправить комментарий