static public void SendEnterRoom(int id) { ENTER_ROOM_REQ person = new ENTER_ROOM_REQ { VarId = id, }; using (MemoryStream stream = new MemoryStream()) { person.WriteTo(stream); client.WritePacket((int)PROTOCOL.IdPktEnterRoomReq, stream.ToArray(), stream.ToArray().Length); } }
static public void SendEnterRoom(int id) { if (client == null || client.socket == null || client.socket.Connected == false) { return; } ENTER_ROOM_REQ person = new ENTER_ROOM_REQ { VarRoomNumber = id, }; using (MemoryStream stream = new MemoryStream()) { person.WriteTo(stream); client.WritePacket((int)PROTOCOL.IdPktEnterRoomReq, stream.ToArray(), stream.ToArray().Length); } }