public void toRoom(int roomId) { NetCore.Instance.RegisterAction(NetProto.Api.ENetMsgId.room_get_table_ack, (tableAction) => { RoomGetTableAck tableAck = (RoomGetTableAck)tableAction; MainData.Instance().roomId = roomId; MainData.Instance().tableInfo = tableAck.Table; for (int i = 0; i < tableAck.Table.Players.Count; i++) { PlayerInfo info = tableAck.Table.Players[i]; if (UserManager.Instance().authModel.user_id == info.Id) { MainData.Instance().selfInfo = info; break; } } Debug.Log("牌桌id: " + MainData.Instance().tableInfo.Id); Application.LoadLevel("dynamic_room"); }); mainHandle.roomPlayerJoinReq(roomId); }
/** * 查询牌桌信息回复 (当玩家加入牌桌后,服务器会向此用户推送牌桌信息) */ public object roomGetTableAck(byte[] data) { RoomGetTableAck tableAction = RoomGetTableAck.Parser.ParseFrom(data); return(tableAction); }