Exemple #1
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"));
            }
        }