Пример #1
0
        private static unsafe void SendAuthResponse(AuthClient Client, string Address, ushort Port)
        {
            AuthResponse *Response = stackalloc AuthResponse[1];

            Response->Size      = (ushort)sizeof(AuthResponse);
            Response->Type      = 0x41F;
            Response->AccountID = Client.GetAccountID();

            uint Token = Response->AccountID | 0xAABB;

            Token  = Response->AccountID << 8 | Response->AccountID;
            Token ^= 0x4321;
            Token  = Token << 8 | Token;
            Response->LoginToken = Token;

            Response->Port = Port;
            for (int i = 0; i < 16; i++)
            {
                if (i >= Address.Length)
                {
                    Response->Address[i] = 0;
                }
                else
                {
                    Response->Address[i] = (sbyte)Address[i];
                }
            }
            Client.Send(Response, Response->Size);
        }
Пример #2
0
        private static unsafe void SendAuthReject(AuthClient Client, byte[] Payload)
        {
            AuthResponse *Response = stackalloc AuthResponse[1];

            Response->Size       = (ushort)sizeof(AuthResponse);
            Response->Type       = 0x41F;
            Response->AccountID  = 0;
            Response->LoginToken = 1;
            for (int i = 0; i < 16; i++)
            {
                if (i >= Payload.Length)
                {
                    Response->Address[i] = 0;
                }
                else
                {
                    Response->Address[i] = (sbyte)Payload[i];
                }
            }
            Client.Send(Response, Response->Size);
        }
Пример #3
0
        private static unsafe void SendAuthResponse(AuthClient Client, string Address, ushort Port)
        {
            AuthResponse* Response = stackalloc AuthResponse[1];
            Response->Size = (ushort)sizeof(AuthResponse);
            Response->Type = 0x41F;
            Response->AccountID = Client.GetAccountID();

            uint Token = Response->AccountID | 0xAABB;
            Token = Response->AccountID << 8 | Response->AccountID;
            Token ^= 0x4321;
            Token = Token << 8 | Token;
            Response->LoginToken = Token;

            Response->Port = Port;
            for (int i = 0; i < 16; i++)
            {
                if (i >= Address.Length)
                    Response->Address[i] = 0;
                else
                    Response->Address[i] = (sbyte)Address[i];
            }
            Client.Send(Response, Response->Size);
        }
Пример #4
0
 private static unsafe void SendAuthReject(AuthClient Client, byte[] Payload)
 {
     AuthResponse* Response = stackalloc AuthResponse[1];
     Response->Size = (ushort)sizeof(AuthResponse);
     Response->Type = 0x41F;
     Response->AccountID = 0;
     Response->LoginToken = 1;
     for (int i = 0; i < 16; i++)
     {
         if (i >= Payload.Length)
             Response->Address[i] = 0;
         else
             Response->Address[i] = (sbyte)Payload[i];
     }
     Client.Send(Response, Response->Size);
 }