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