static public void SendMakeRoom(string Name) { CREATE_ROOM_REQ person = new CREATE_ROOM_REQ { VarName = ByteString.CopyFrom(Helper.ToByteString(Name)), }; using (MemoryStream stream = new MemoryStream()) { person.WriteTo(stream); client.WritePacket((int)PROTOCOL.IdPktCreateRoomReq, stream.ToArray(), stream.ToArray().Length); } }
static public void SendMakeRoom(string Name) { if (client == null || client.socket == null || client.socket.Connected == false) { return; } CREATE_ROOM_REQ person = new CREATE_ROOM_REQ { VarName = Name, }; using (MemoryStream stream = new MemoryStream()) { person.WriteTo(stream); client.WritePacket((int)PROTOCOL.IdPktCreateRoomReq, stream.ToArray(), stream.ToArray().Length); } }