Пример #1
0
	void OnUpdateRoomList (SocketIOEvent e) {
		if (roomListResult != null) {
			Response.RoomList msg = e.Deserialize<Response.RoomList> ();
			roomListResult (msg.ToDictionary ());
		}
	}
Пример #2
0
	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));
		
	}
Пример #3
0
	/**
	 *	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));
		}
	}