void OnResponseEnterRoom(Notification note) { using (ByteBuffer buff = new ByteBuffer(note.GetBytes())) { int state = buff.ReadInt32(); if (state == -1) { Debug.Log("has same roleid in room"); } else { GameClientData.GameRoom = GameRoomSvo.Read(buff.ReadBytes()); Debug.Log(1); } Debug.Log("[client] OnResponseEnterRoom "); } }
void OnRequestEnterRoom(Notification note) { Message msg = note.GetMessage(); using (ByteBuffer buff = new ByteBuffer(note.GetBytes())) { long roleId = buff.ReadInt64(); string name = buff.ReadString(); int state = GameServerData.EnterGameRoom(roleId, name); msg.Reply(PtMessagePackage.Build((int)S2CMessageId.ResponseEnterRoom, new ByteBuffer().WriteInt32(state).WriteBytes(GameRoomSvo.Write(GameServerData.GameRoom)).Getbuffer())); //Debug.Log("[server] OnRequestEnterRoom !" + roleId); } }