html5-client-listener

*We assure you that we do not spam. You may receive occasional emails from us.
 You can always unsubscribe.
Html5

HTML5 Client Listeners

AppWarp.Events.OnConnectDone
  
   /**
   * Invoked in response to a connect request.
   * @param event:number
   */
  function onConnectDone(event)
{
    if(event == AppWarp.ResultCode.Success)
    {
        console.log("Connected")
    }
    else if(event == AppWarp.ResultCode.AuthError)
    {
        console.log("AuthError");
    }
    else if(event == AppWarp.ResultCode.ResourceNotFound)
    {
        console.log("ResourceNotFound");
    }
    else if(event == AppWarp.ResultCode.ResourceMoved)
    {
        console.log("ResourceMoved");
    }
    else if(event == AppWarp.ResultCode.BadRequest)
    {
        console.log("BadRequest");
    }
    else if(event == AppWarp.ResultCode.UnknownError)
    {
        console.log("UnknownError");
    }
    else if(event == AppWarp.ResultCode.ResultSizeError)
    {
        console.log("ResultSizeError");
    }
    else if(event == AppWarp.ResultCode.SuccessRecovered)
    {
        console.log("SuccessRecovered");
    }
    else if(event == AppWarp.ResultCode.ConnectionErrorRecoverable)
    {
        console.log("ConnectionErrorRecoverable");
    }
    else if(event == AppWarp.ResultCode.UserPausedError)
    {
        console.log("UserPausedError");
    }
    else if(event == AppWarp.ResultCode.AutoRecovering)
    {
        console.log("AutoRecovering");
    }
}
    
AppWarp.Events.onDisconnectDone
  
  /**
   * Invoked in response to a disconnect request.
   * @param event:number
   */
  function onDisconnectDone(res) {
    if(res == AppWarp.ResultCode.Success)
    {
         console.log("Disconnected");
    }else
    {
         console.log("Error in disconnection");
    }	
}
AppWarp.Events.onSubscribeRoomDone
  
   /**
   * Invoked in response to a subscribeRoom request.
   * @param event:Room
   */
  
function onSubscribeRoomDone(event){
    console.log("onSubscribeRoomDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}  
AppWarp.Events.onUnSubscribeRoomDone
  
  /**
   * Invoked in response to a UnSubscribeRoom request.
   * @param event:Room
   */
  function onUnsubscribeRoomDone(event){
    console.log("onUnSubscribeRoomDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
} 
AppWarp.Events.onJoinRoomDone
  
  /**
   * Invoked in response to a joinRoom request.
   * @param event:Room
   */
 function onJoinRoomDone(event){
    console.log("onJoinRoomDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}  
AppWarp.Events.onLeaveRoomDone
  
  /**
   * Invoked in response to a leaveRoom request.
   * @param event:Room
   */
 function onLeaveRoomDone(event){
    console.log("onLeaveRoomDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}  
AppWarp.Events.onGetLiveRoomInfoDone
  
  /**
   * Invoked in response to a getLiveRoomInfo request.
   * @param event:Room
   */
 function onGetLiveRoomInfoDone(event){   
    console.log("onGetLiveRoomInfoDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.lockProperties){
                console.log("lockProperties:"+event.json.lockProperties+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.properties){
                console.log("properties:"+event.json.properties+"")
            }
            if(event.json.usernames){
                console.log("usernames:"+event.json.usernames+"")
            }
        }
    }      
} 
AppWarp.Events.onSetCustomRoomDataDone
  
  /**
   * Invoked in response to a setCustomRoomData request.
   * @param event:LiveRoom
   */
function onSetCustomRoomDataDone(event){
    console.log("onSetCustomRoomDataDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.lockProperties){
                console.log("lockProperties:"+event.json.lockProperties+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.properties){
                console.log("properties:"+event.json.properties+"")
            }
            if(event.json.usernames){
                console.log("usernames:"+event.json.usernames+"")
            }
        }
    }
} 
AppWarp.Events.onUpdatePropertyDone
  
  /**
   * Invoked in response to add property to any room
   * @param event:LiveRoom
   */
  function onUpdatePropertyDone(event){
    console.log("onUpdatePropertyDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.lockProperties){
                console.log("lockProperties:"+event.json.lockProperties+"")
            }
            if(event.json.properties){
                console.log("properties:"+event.json.properties+"")
            }
            if(event.json.usernames){
                console.log("usernames:"+event.json.usernames+"")
            }
        }
    }
} 
AppWarp.Events.onLockPropertiesDone
  
  /**
   * Invoked when the response for LockProperties request is received.
   * @param result:number
   */
  function onLockPropertiesDone(result){
    console.log("onLockPropertiesDone : " + result);  
}  
AppWarp.Events.onSetNextTurnDone
  
  /**
   * Invoked when a response for a SetNextTurn request is received.
   * @param result:number
   */
 function onSetNextTurnDone(result){
    console.log("onSetNextTurnDone: " + result);  
}
 
AppWarp.Events.onDeleteRoomDone
  
   /**
   * Invoked in response to a deleteRoom request.
   * @param event:Room
   */
 function onDeleteRoomDone(event){
    console.log("onDeleteRoomDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onGetAllRoomsDone
  
  /**
   * Invoked in response to a getAllRooms request.
   * @param event:AllRoomsEvent
   */
 function onGetAllRoomsDone(event){
    console.log("onGetAllRoomsDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json.ids){
            console.log(" info:")
            console.log(event.json.ids)
        }
    }
}
AppWarp.Events.onUnlockPropertiesDone
  
  /**
   *  Invoked when the response for UnlockProperties request is received.
   * @param result:number
   */
 function onUnlockPropertiesDone(result){
    console.log("onUnlockPropertiesDone : " + result);
}
AppWarp.Events.onCreateRoomDone
  
  /**
   * Invoked in response to a createRoom request.
   * @param event:Room
   */
 function onCreateRoomDone(event){
    console.log("onCreateRoomDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("max users:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onGetOnlineUsersDone
  
  /**
   * Invoked in response to a getOnlineUsers request.
   * @param event:AllUsersEvent
   */
  function onGetOnlineUsersDone(event){
    console.log("onGetOnlineUsersDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" userList:")
            console.log(event.json.names)
        }
    }
}  
AppWarp.Events.onGetLiveUserInfoDone
  
  /**
   * Invoked in response to a getLiveUserInfo request.
   * @param event:LiveUser
   */
  function onGetLiveUserInfoDone(event){
    console.log("onGetLiveUserInfoDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.custom){
                console.log("custom:"+event.json.custom+"")
            }
        }
    }
}
AppWarp.Events.onSetCustomUserDataDone
  
  /**
   * Invoked in response to a setCustomRoomData request.
   * @param event:LiveUser
   */
 function onSetCustomUserDataDone(event){
    console.log("onSetCustomUserDataDone: " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.custom){
                console.log("Custom Data:"+event.json.custom+"")
            }
            if(event.json.name){
                console.log("username :"+event.json.name+"")
            }
        }
    }
}
AppWarp.Events.onGetMatchedRoomsDone
  
   /**
   * Invoked in response to a getMatchMaking Rooms request.
   * @param event:MatchedRoomEvent
   */ 
function onGetMatchedRoomsDone(event){
    console.log("onGetMatchedRoomsDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        var jsonData = event.json;
        if(event.json){
            console.log(" info:")
            for (var keys in jsonData)
            {
                console.log("isAdmin:"+jsonData[keys].isAdmin+"")
                console.log("maxUsers:"+jsonData[keys].maxUsers+"")
                console.log("name:"+jsonData[keys].name+"")
                console.log("owner:"+jsonData[keys].owner+"")
            }
        }
    }
}  
AppWarp.Events.onJoinLobbyDone
  
   /**
   * Invoked in response to a joinLobby request.
   * @param event:Lobby
   */
  function onJoinLobbyDone(event){
    console.log("onJoinLobbyDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.isPrimary){
                console.log("isPrimary:"+event.json.isPrimary+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onLeaveLobbyDone
  
  /**
   * Invoked in response to a leaveLobby request.
   * @param event:Lobby
   */
 function onLeaveLobbyDone(event){
    console.log("onLeaveLobbyDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.isPrimary){
                console.log("isPrimary:"+event.json.isPrimary+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onSubscribeLobbyDone
  
  /**
   * Invoked in response to a subscribeLobby request.
   * @param event:Lobby
   */
  function onSubscribeLobbyDone(event){
    console.log("onSubscribeLobbyDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.isPrimary){
                console.log("isPrimary:"+event.json.isPrimary+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onUnSubscribeLobbyDone
  
  /**
   * Invoked in response to a UnSubscribeLobby request.
   * @param event:Lobby
   */
 function onUnsubscribeLobbyDone(event){
    console.log("onUnsubscribeLobbyDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.isPrimary){
                console.log("isPrimary:"+event.json.isPrimary+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onGetLiveLobbyInfoDone
  
  /**
   * Invoked in response to a getLiveLobbyInfo request.
   * @param event:LiveRoom
   */
 function onGetLiveLobbyInfoDone(event){
    console.log("onGetLiveLobbyInfoDone : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.lockProperties){
                console.log("lockProperties:"+event.json.lockProperties+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.properties){
                console.log("properties:"+event.json.properties+"")
            }
            if(event.json.usernames){
                console.log("usernames:"+event.json.usernames+"")
            }
        }
    }
}  
AppWarp.Events.onSendUpdateDone
  
   /**
   * Result of SendUpdatePeers request. The result value maps to a WarpResponseResultCode
   * @param result:number
   */
  function onSendUpdateDone(result){
    console.log("onSendUpdateDone : " + result);
}  
AppWarp.Events.onSendChatDone
  
   /**
   * Result of SendChat request. The result value maps to a WarpResponseResultCode
   * @param result:number
   */
 function onSendChatDone(result){
    console.log("onSendChatDone : " + result);
}
AppWarp.Events.onSendPrivateChatDone
  
  /**
   * Result of SendPrivateChat request. The result value maps to a WarpResponseResultCode
   * @param result:number
   */
  function onSendPrivateChatDone(result){
    console.log("onSendPrivateChatDone : " + result);
}  
AppWarp.Events.onGetOnlineUsersCountDone
  
   /**
   * Result of getOnlineUsersCount request. The result value maps to a WarpResponseResultCode.
   * @param result:number
  *  @param count: number
   */ 
function onGetOnlineUsersCountDone(result,count)
{
    console.log("onGetOnlineUsersCountDone : "+result);
    console.log("Count : "+count);
}
AppWarp.Events.onGetAllRoomsCountDone
  
   /**
   * Result of getAllRoomsCount request. The result value maps to a WarpResponseResultCode.
   * @param result:number
  *  @param count: number
   */
function onGetAllRoomsCountDone(result,count)
{
    console.log("onGetAllRoomsCountDone: "+result);
    console.log("Count : "+count);
}
AppWarp.Events.onJoinAndSubscribeRoomDone
  
  /**
   * Invoked in response to a joinAndSubscribeRoom request.
   * @param event:room
   */
  function onJoinAndSubscribeRoomDone(event){
   console.log("onJoinAndSubscribeRoomDone : " + event.res);
    if(event.json){
       console.log("info:")
        if(event.json.id){
           console.log("id:"+event.json.id)
        }
        if(event.json.maxUsers){
            console.log("max users:"+event.json.maxUsers)
        }
        if(event.json.name){
           console.log(name:"+event.json.name)
        }
        if(event.json.owner){
            console.log("owner:"+event.json.owner)
        }   
    }
}
AppWarp.Events.onLeaveAndUnsubscribeRoomDone
  
  /**
   * Invoked in response to a leaveAndUnsubscribeRoom request.
   * @param event:room
   */
  function onLeaveAndUnsubscribeRoomDone(event){
   console.log("onLeaveAndUnsubscribeRoomDone: " + event.res);
    if(event.json){
       console.log("info:")
        if(event.json.id){
           console.log("id:"+event.json.id)
        }
        if(event.json.maxUsers){
            console.log("max users:"+event.json.maxUsers)
        }
        if(event.json.name){
           console.log(name:"+event.json.name)
        }
        if(event.json.owner){
            console.log("owner:"+event.json.owner)
        }   
    }
}
AppWarp.Events.onUserStatusDone
  
  /**
   * Invoked in response to a getUserStatus request.
   * @param event:user
   */
function onUserStatusDone(event) {
   console.log("onUserStatusDone : " + event.res +"   Status:"+event.json.status);
    if(event.json.username!=undefined){
        console.log("username:"+event.json.username)
    }
}
AppWarp.Events.onGetChatHistoryDone
  
  /**
   * Invoked in response to a getChatHistory request.
    * @param resultCode:number
  *  @param event: room
   */
function onGetChatHistoryDone(resultCode,event){ {
 console.log("onGetChatHistoryDone: " + resultCode);
if(resultCode == 0){
 console.log("Required data  :",event)
}
}
AppWarp.Events.onRoomCreated
    /**
   * Invoked when a room is created. Lobby subscribers will receive this.
   * @param event:Room
   */
  function onRoomCreated(event){
    console.log("onRoomCreated : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onRoomDestroyed
  /**
   * Invoked when a room is deleted. Lobby subscribers will receive this.
   * @param event:Room
   */
  
function onRoomDestroyed(event){
    console.log("onRoomDestroyed : " + event.res);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
        }
    }
}
AppWarp.Events.onUserLeftRoom
  /**
   * Invoked when a user leaves a room. Lobby and the concerned room subscribers 
   * will receive this.
   * @param event:Room
   * @param username:String
   */
 function onUserLeftRoom(event, username){
    console.log("onUserLeftRoom : " + event.res);
    console.log("username   : " + username);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.user){
                console.log("user:"+event.json.user+"")
            }
        }
    } 
}
AppWarp.Events.onUserJoinedRoom
  /**
   * Invoked when a user joins a room. Lobby and the concerned room subscribers 
   * will receive this.
   * @param event:Room
   * @param username:string
   */
function onUserJoinedRoom(event, username){
    console.log("onUserJoinedRoom : " + event.res);
    console.log("username   : " + username);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.user){
                console.log("user:"+event.json.user+"")
            }
        }
    } 
}
AppWarp.Events.onUserLeftLobby
  /**
   * Invoked when a user leaves a lobby. Lobby subscribers will receive this.
   * @param event:Lobby
   * @param username:string
   */
  function onUserLeftLobby(event, username){
    console.log("onUserLeftLobby : " + event.res);
    console.log("username : " + username);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.isPrimary){
                console.log("isPrimary:"+event.json.isPrimary+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.user){
                console.log("user:"+event.json.user+"")
            }
        }
    } 
}
AppWarp.Events.onUserJoinedLobby
  /**
   * Invoked when a user joins a lobby. Lobby subscribers will receive this.
   * @param event:Lobby
   * @param username:string
   */
  function onUserJoinedLobby(event, username){
    console.log("onUserJoinedLobby : " + event.res);
    console.log("username : " + username);
    if(event.res == AppWarp.ResultCode.Success)
    {
        if(event.json){
            console.log(" info:")
            if(event.json.id){
                console.log("id:"+event.json.id+"")
            }
            if(event.json.isPrimary){
                console.log("isPrimary:"+event.json.isPrimary+"")
            }
            if(event.json.maxUsers){
                console.log("maxUsers:"+event.json.maxUsers+"")
            }
            if(event.json.name){
                console.log("name:"+event.json.name+"")
            }
            if(event.json.owner){
                console.log("owner:"+event.json.owner+"")
            }
            if(event.json.user){
                console.log("user:"+event.json.user+"")
            }
        }
    } 
}    
AppWarp.Events.onChatReceived
  /**
   * Invoked when a joined user sends a chat. Rooms subscribers will receive this.
   * @param event:Chat
   */
  function onChatReceived(event)
{
    console.log("Sender : "+event.getSender() );
    console.log("Chat : "+event.getChat()  );
}
AppWarp.Events.onUpdatePeersReceived
  /**
   * Invoked when a joined user sends a updatePeers request. Rooms subscribers 
   * will receive this.
   * @param update:Uint8Array
   */
  function onUpdatePeersReceived(update){
    var chatdata = String.fromCharCode.apply(null, update);
    console.log("onUpdatePeersReceived : " + chatdata);
}
AppWarp.Events.onUserChangeRoomProperty
  /**
   * Invoked when a user change room property. Lobby and the concerned room subscribers will receive this.
   * @param username:string
   * @param properties:json
   * @param lockTable:json
   */
  function onUserChangeRoomProperty(username,properties, lockTable){
    console.log("username: " + username);
    console.log("properties: " + properties);
    console.log("lockTable: " + lockTable);
} 
AppWarp.Events.onPrivateChatReceived
  /**
   * Invoked when a private chat is received
   * @param sender:string
   * @param chat:string
   */
  function onPrivateChatReceived(sender, chat){
   console.log("Sender: " +sender);
   console.log("Chat: " +chat);
}
  
AppWarp.Events.onMoveCompleted
  /**
   * Invoked when a user makes a move in a turn based room
   * @param move:Move
   */
 function onMoveCompleted(move){
    console.log("Move : " +move);
}  
AppWarp.Events.onSendMoveDone
  
   /**
   * Invoked in response to a sendMove request.
   * @param event:number
   */
 function onSendMoveDone(event){
    console.log("onSendMoveDone : " + event);
}
AppWarp.Events.onStartGameDone
  
   /**
   * Invoked in response to a startGame request.
   * @param event:number
   */
  function onStartGameDone(event){
    console.log("onStartGameDone : " + event);
}
AppWarp.Events.onStopGameDone
  
   /**
   * Invoked in response to a stopGame request.
   * @param event:number
   */
  function onStopGameDone(event){
    console.log("onStopGameDone : " + event);
}
AppWarp.Events.onGetMoveHistoryDone
  
   /**
   * Invoked in response to a onGetMoveHistoryDone request.
   * @param res:number
   * @param moves:Move[]
   */

  function onGetMoveHistoryDone(res, moves){
   console.log("onGetMoveHistoryDone: " + res);
   console.log("moves: " + moves);
}
AppWarp.Events.onSendPrivateUpdateDone
  
   /**
   * Result of SendPrivateUpdate request. The result value maps to a WarpResponseResultCode.
   * @param result:number
   */

   function onSendPrivateUpdateDone(result){
    console.log("onSendPrivateUpdateDone : " + result);
}
AppWarp.Events.onUserResumed
  
   /**
   * Invoked when a user's connectivity is restored. Subscribers of the users location will receive this.
   * @param id:string
   * @param isLobby:boolean
   * @param user:string
   */

function onUserResumed(id, isLobby, user){
    console.log("ID : "+id);
    console.log("isLobby : "+isLobby);
    console.log("user : "+user);
}
AppWarp.Events.onUserPaused
  
   /**
   * Invoked to indicate that a user has lost connectivity. Subscribers of the users location will receive this.
   * @param id:string
   * @param isLobby:boolean
   * @param user:string
   */
 function onUserPaused(id, isLobby, user){
    console.log("ID : "+id);
    console.log("isLobby : "+isLobby);
    console.log("user : "+user);
}
AppWarp.Events.onGameStarted
  
   /**
   * Invoked when a game starts
   * @param sender:string
   * @param room:string
   * @param nextTurn:string
   */
  function onGameStarted(sender, room, nextTurn){
    console.log("Sender : "+sender);
    console.log("Room : "+room);
    console.log("nextTurn : "+nextTurn);
}
 
AppWarp.Events.onGameStopped
  
   /**
   * Invoked when game stops.
   * @param sender:string
   * @param room:string
   */
   
function onGameStopped(sender, room){
    console.log("Sender : "+sender);
    console.log("Room : "+room);
}  
AppWarp.Events.onPrivateUpdateReceived
  
   /**
   * Invoked when a private update message is received.
   * @param userName:string
   * @param msg:string
   */
   
function onPrivateUpdateReceived(userName, msg){
    console.log("Username: "+userName);
    console.log("Message: "+msg);
}
AppWarp.Events.onNextTurnRequested
  
   /**
   * Invoked when a next turn request sent by server.
   * @param lastTurn:string
   */
   function onNextTurnRequested(lastTurn){
    console.log("lastTurn : "+lastTurn);
}