Beispiel #1
0
 private byte[] ConvertRequestToByteArray(RegisterResultRequest request)
 {
     _packetWriter.WriteByte(request.PacketId);
     _packetWriter.WriteString(request.Nickname);
     _packetWriter.WriteBool(request.Registered);
     return(_packetWriter.GetBytes());
 }
Beispiel #2
0
        private byte[] ConvertRequestToByteArray(RegisterRequest request, string nickname)
        {
            _packetWriter.WriteByte(request.PacketId);
            _packetWriter.WriteGuid(request.UniqueId);
            _packetWriter.WriteString(nickname);

            return(_packetWriter.GetBytes());
        }
Beispiel #3
0
        private byte[] ConvertRequestToByteArray(OutgoingMessageRequest request)
        {
            var reponseRequest = new IncomingMessageRequest(request.Nickname, request.Message, request.Destination, request.PrivateMessage);

            _packetWriter.WriteByte(reponseRequest.PacketId);
            _packetWriter.WriteString(reponseRequest.Nickname);
            _packetWriter.WriteString(reponseRequest.Message);
            _packetWriter.WriteBool(reponseRequest.Destination != null);
            if (reponseRequest.Destination != null)
            {
                _packetWriter.WriteString(reponseRequest.Destination);
                _packetWriter.WriteBool(reponseRequest.PrivateMessage);
            }
            return(_packetWriter.GetBytes());
        }
        private byte[] ConvertRequestToByteArray(OutgoingMessageRequest request)
        {
            _packetWriter.WriteByte(request.PacketId);
            _packetWriter.WriteString(request.Nickname);

            if (request.Message.StartsWith("/p") || request.Message.StartsWith("/m"))
            {
                WriteTargetedMessages(request);
            }
            else
            {
                WriteGlobalMessage(request);
            }

            return(_packetWriter.GetBytes());
        }