public static void HandlePlayerLogin(ref PacketReader packet, WorldClass session)
        {
            byte[] guidMask  = { 1, 0, 7, 2, 5, 6, 4, 3 };
            byte[] guidBytes = { 7, 6, 0, 1, 4, 3, 2, 5 };

            BitUnpack GuidUnpacker = new BitUnpack(packet);

            var unknown = packet.Read <float>();
            var guid    = GuidUnpacker.GetPackedValue(guidMask, guidBytes);

            Log.Message(LogType.Debug, "Character with Guid: {0}, AccountId: {1} tried to enter the world.", guid, session.Account.Id);

            session.Character = new Character(guid);

            if (!WorldMgr.AddSession(guid, ref session))
            {
                Log.Message(LogType.Error, "A Character with Guid: {0} is already logged in", guid);
                return;
            }

            WorldMgr.WriteAccountDataTimes(AccountDataMasks.CharacterCacheMask, ref session);

            MiscHandler.HandleMessageOfTheDay(ref session);
            TimeHandler.HandleLoginSetTimeSpeed(ref session);
            SpecializationHandler.HandleUpdateTalentData(ref session);
            SpellHandler.HandleSendKnownSpells(ref session);
            MiscHandler.HandleUpdateActionButtons(ref session);

            if (session.Character.LoginCinematic)
            {
                CinematicHandler.HandleStartCinematic(ref session);
            }

            ObjectHandler.HandleUpdateObjectCreate(ref session);
        }
示例#2
0
        public static void HandlePlayerLogin(ref PacketReader packet, ref WorldClass session)
        {
            byte[] guidMask  = { 5, 7, 6, 1, 2, 3, 4, 0 };
            byte[] guidBytes = { 6, 4, 3, 5, 0, 2, 7, 1 };

            BitUnpack GuidUnpacker = new BitUnpack(packet);

            ulong guid = GuidUnpacker.GetGuid(guidMask, guidBytes);

            Log.Message(LogType.DEBUG, "Character with Guid: {0}, AccountId: {1} tried to enter the world.", guid, session.Account.Id);

            session.Character = new Character(guid);

            WorldMgr.AddSession(guid, ref session);
            WorldMgr.WriteAccountData(AccountDataMasks.CharacterCacheMask, ref session);

            MiscHandler.HandleMessageOfTheDay(ref session);
            SpellHandler.HandleSendKnownSpells(ref session);

            if (session.Character.LoginCinematic)
            {
                CinematicHandler.HandleStartCinematic(ref session);
            }

            ObjectHandler.HandleUpdateObject(ref session);
        }