public void sendMsg(GameLianQiProtocol pID, msgLianQiReqAbandon msg, Action <Message> action) { JsonObject jsonMsg = new JsonObject(); jsonMsg.Add("seat", msg.seat); sendMsg(pID, jsonMsg, action); }
public void removePushMsgEventListener(GameLianQiProtocol pID) { System.Object route; if (ROUTE_MAP.TryGetValue("P" + (int)pID, out route)) { _connection.removeEventListeners(route.ToString()); } }
//需要手动调用添加服务器push给客户端的消息,不同的界面请添加不同的消息回调 public void addPushMsgEventListener(GameLianQiProtocol pID, Action <Message> action) { System.Object route; if (ROUTE_MAP.TryGetValue("P" + (int)pID, out route)) { _connection.on(route.ToString(), action); } }
public void sendMsg(GameLianQiProtocol pID, msgLianQiReqMove msg, Action <Message> action) { JsonObject jsonMsg = new JsonObject(); jsonMsg.Add("seat", msg.seat); jsonMsg.Add("x", msg.x); jsonMsg.Add("y", msg.y); jsonMsg.Add("direction", (int)msg.direction); sendMsg(pID, jsonMsg, action); }
private void sendMsg(GameLianQiProtocol pID, JsonObject msg, Action <Message> action) { sendMsg((uint)pID, msg, action); }