Пример #1
0
        public static void Connect(PacketReader packet, PacketBuilder builder, ClientHandler client, EventHandler events)
        {
            //byte[] b;

            var server  = packet.ReadByte();
            var channel = packet.ReadByte();

            uint   key  = 0x34BC821B;
            ushort step = 0x05D5;

            var timestamp = (uint)client.Metadata["timestamp"];
            var count     = (ushort)client.Metadata["count"];

            builder.New(0x8C);
            {
                builder += (int)key;
                builder += (int)timestamp;
                builder += (short)count;
                builder += (short)step;

                //b = builder.Data;
            }

            client.Send(builder, "Connect2Svr");

            client.ChangeKey(key, step);
        }
Пример #2
0
        /*
         * Connect2Svr Packet
         * -------------------------
         * Client2Server Structure:
         *
         * ushort   : magic code
         * ushort   : size
         * int      : padding
         * ushort   : opcode
         *
         * uint     : auth key          #timestamp
         * -------------------------
         * Server2Client Structure:
         *
         * ushort   : magic code
         * ushort   : size
         * ushort   : opcode
         *
         * uint     : xor seed
         * uint     : auth key          #timestamp
         * ushort   : index             #user idx
         * ushort   : xor key index
         */
        #endregion

        public static void Connect(PacketReader packet, PacketBuilder builder, ClientHandler client, EventHandler events)
        {
            uint   key  = 0x49B4DDD1;
            ushort step = 0x1621;

            uint   timestamp = (uint)client.Metadata["timestamp"];
            ushort count     = (ushort)client.Metadata["count"];

            builder.New(0x65);
            {
                builder += key;         // XOR Seed
                builder += timestamp;   // AuthKey
                builder += count;       // Index
                builder += step;        // XOR Key Index
            }

            client.ChangeKey(key, step);

            client.Send(builder, "Connect2Svr");
        }