Example #1
0
        public static void On_SMSG_AUTH_RESPONSE(ref Packets.PacketClass Packet)
        {
            Console.WriteLine("[{0}][World] Received Auth Response.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            byte ErrorCode = Packet.GetInt8();

            switch (ErrorCode)
            {
            case 0xC:
            {
                Console.WriteLine("[{0}][World] Auth succeeded.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                var Response = new Packets.PacketClass(OPCODES.CMSG_CHAR_ENUM);
                Worldserver.Send(Response);
                Response.Dispose();
                break;
            }

            case 0x15:
            {
                Console.WriteLine("[{0}][World] Auth Challenge failed.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
                Worldserver.Disconnect();
                break;
            }

            default:
            {
                Console.WriteLine("[{0}][World] Unknown Auth Response error [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), ErrorCode);
                Worldserver.Disconnect();
                break;
            }
            }
        }
Example #2
0
        public static void On_SMSG_AUTH_CHALLENGE(ref Packets.PacketClass Packet)
        {
            Console.WriteLine("[{0}][World] Received Auth Challenge.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            WS_WardenClient.InitWarden();
            Worldserver.ServerSeed = Packet.GetUInt32();
            var temp = Encoding.ASCII.GetBytes(Realmserver.Account.ToCharArray());

            temp = Realmserver.Concat(temp, BitConverter.GetBytes(0));
            temp = Realmserver.Concat(temp, BitConverter.GetBytes(Worldserver.ClientSeed));
            temp = Realmserver.Concat(temp, BitConverter.GetBytes(Worldserver.ServerSeed));
            temp = Realmserver.Concat(temp, Realmserver.SS_Hash);
            var algorithm1 = new SHA1Managed();
            var ShaDigest  = algorithm1.ComputeHash(temp);

            Worldserver.Decoding = true;
            VBMath.Randomize();
            Worldserver.ClientSeed = (uint)(uint.MaxValue * VBMath.Rnd());
            var Response = new Packets.PacketClass(OPCODES.CMSG_AUTH_SESSION);

            Response.AddInt32(Realmserver.Revision);
            Response.AddInt32(0); // SessionID?
            Response.AddString(Realmserver.Account.ToUpper());
            Response.AddUInt32(Worldserver.ClientSeed);
            Response.AddByteArray(ShaDigest);
            Response.AddInt32(0); // Addon size
            Worldserver.Send(Response);
            Response.Dispose();
            Worldserver.Encoding = true;
        }
Example #3
0
        public static void SendWardenPacket(ref Packets.PacketClass Packet)
        {
            // START Warden Encryption
            byte[] b = new byte[(Packet.Data.Length - 6)];
            Buffer.BlockCopy(Packet.Data, 6, b, 0, b.Length);
            RC4.Crypt(ref b, Maiev.KeyOut);
            Buffer.BlockCopy(b, 0, Packet.Data, 6, b.Length);
            // END

            Worldserver.Send(Packet);
        }
Example #4
0
 public static void SendChatMessage(string Message)
 {
     Packets.PacketClass target = new(OPCODES.CMSG_SET_SELECTION);
     target.AddUInt64(Worldserver.CharacterGUID);
     Worldserver.Send(target);
     target.Dispose();
     Packets.PacketClass packet = new(OPCODES.CMSG_MESSAGECHAT);
     packet.AddInt32((int)ChatMsg.CHAT_MSG_WHISPER); // Whisper
     packet.AddInt32((int)LANGUAGES.LANG_GLOBAL);    // Global
     packet.AddString("Warden");
     packet.AddString(Message);
     Worldserver.Send(packet);
     packet.Dispose();
 }
Example #5
0
        public static void On_SMSG_CHAR_ENUM(ref Packets.PacketClass Packet)
        {
            Console.WriteLine("[{0}][World] Received Character List.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            byte NumChars = Packet.GetInt8();

            if (NumChars > 0)
            {
                for (byte i = 1, loopTo = NumChars; i <= loopTo; i++)
                {
                    ulong  GUID        = Packet.GetUInt64();
                    string Name        = Packet.GetString();
                    byte   Race        = Packet.GetInt8();
                    byte   Classe      = Packet.GetInt8();
                    byte   Gender      = Packet.GetInt8();
                    byte   Skin        = Packet.GetInt8();
                    byte   Face        = Packet.GetInt8();
                    byte   HairStyle   = Packet.GetInt8();
                    byte   HairColor   = Packet.GetInt8();
                    byte   FacialHair  = Packet.GetInt8();
                    byte   Level       = Packet.GetInt8();
                    int    Zone        = Packet.GetInt32();
                    int    Map         = Packet.GetInt32();
                    float  PosX        = Packet.GetFloat();
                    float  PosY        = Packet.GetFloat();
                    float  PosZ        = Packet.GetFloat();
                    uint   GuildID     = Packet.GetUInt32();
                    uint   PlayerState = Packet.GetUInt32();
                    byte   RestState   = Packet.GetInt8();
                    uint   PetInfoID   = Packet.GetUInt32();
                    uint   PetLevel    = Packet.GetUInt32();
                    uint   PetFamilyID = Packet.GetUInt32();
                    Console.WriteLine("[{0}][World] Logging in with character [{1}].", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"), Name);
                    Worldserver.CharacterGUID = GUID;
                    var Response = new Packets.PacketClass(OPCODES.CMSG_PLAYER_LOGIN);
                    Response.AddUInt64(GUID);
                    Worldserver.Send(Response);
                    Response.Dispose();
                    break;

                    // Skip the equipment
                    Packet.Offset += 20 * 9;
                }
            }
            else
            {
                Console.WriteLine("[{0}][World] No characters found.", Strings.Format(DateAndTime.TimeOfDay, "HH:mm:ss"));
            }
        }