/** * Events */ void OnMessage (SocketIOEvent e) { Response.Message msg = e.Deserialize<Response.Message> (); if (msg.key == "InstanceDataLoaded") { // Special case Models.InstanceData ins = e.Deserialize<Models.InstanceData> (); msg.str1 = JsonWriter.Serialize (ins); } if (messageReceived != null) { messageReceived (NetMessage.Create (msg.key, msg.str1, msg.str2, msg.val)); } }
void OnUpdateDuration (SocketIOEvent e) { Response.Duration msg = e.Deserialize<Response.Duration> (); Debug.Log("OnUpdateDuration: " + msg.duration); if(messageReceived != null) messageReceived (NetMessage.Create ("UpdateDuration", msg.duration)); }
void OnUpdateRoomList (SocketIOEvent e) { if (roomListResult != null) { Response.RoomList msg = e.Deserialize<Response.RoomList> (); roomListResult (msg.ToDictionary ()); } }