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

            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, ref session);
            WorldMgr.Session  = session;

            SpellMgr.LoadSpells();
            WorldMgr.WriteAccountData(AccountDataMasks.CharacterCacheMask, ref session);

            PacketWriter motd = new PacketWriter(LegacyMessage.MessageOfTheDay);

            motd.WriteUInt32(3);

            motd.WriteCString("Arctium MoP test");
            motd.WriteCString("Welcome to our MoP server test.");
            motd.WriteCString("Your development team =)");
            session.Send(motd);

            SpellHandler.SendSendKnownSpells();
            UpdateHandler.HandleUpdateObject(ref packet, ref session);
        }
Example #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);
        }
Example #3
0
        public static void HandleObjectUpdateFailed(ref PacketReader packet, ref WorldClass session)
        {
            byte[] guidMask = { 6, 1, 7, 5, 0, 4, 2, 3 };
            byte[] guidBytes = { 2, 3, 7, 4, 5, 1, 0, 6 };

            BitUnpack GuidUnpacker = new BitUnpack(packet);

            ulong guid = GuidUnpacker.GetGuid(guidMask, guidBytes);
            Log.Message(LogType.DEBUG, "ObjectUpdate failed for object with Guid {0}", guid);
        }
Example #4
0
        public static void HandleSetSelection(ref PacketReader packet, ref WorldClass session)
        {
            byte[] guidMask = { 3, 1, 7, 2, 6, 4, 0, 5 };
            byte[] guidBytes = { 4, 1, 5, 2, 6, 7, 0, 3 };

            BitUnpack GuidUnpacker = new BitUnpack(packet);

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

            var sess = WorldMgr.GetSession(session.Character.Guid);
            sess.Character.TargetGuid = fullGuid;

            if (guid == 0)
                Log.Message(LogType.DEBUG, "Character (Guid: {0}) removed current selection.", session.Character.Guid);
            else
                Log.Message(LogType.DEBUG, "Character (Guid: {0}) selected a {1} (Guid: {2}, Id: {3}).", session.Character.Guid, ObjectGuid.GetGuidType(fullGuid), guid, ObjectGuid.GetId(fullGuid));
        }
        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.Sessions.Add(session.Character.Guid, 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);
        }
Example #6
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);

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

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

            MiscHandler.HandleMessageOfTheDay(ref session);
            TimeHandler.HandleSendNewTimeSpeed(ref session);
            SpecializationHandler.HandleTalentUpdate(ref session);
            SpellHandler.HandleSendKnownSpells(ref session);
            MiscHandler.HandleUpdateActionButtons(ref session);

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

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

            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, ref session);
            WorldMgr.Session = session;

            SpellMgr.LoadSpells();
            WorldMgr.WriteAccountData(AccountDataMasks.CharacterCacheMask, ref session);

            PacketWriter motd = new PacketWriter(LegacyMessage.MessageOfTheDay);
            motd.WriteUInt32(3);

            motd.WriteCString("Arctium MoP test");
            motd.WriteCString("Welcome to our MoP server test.");
            motd.WriteCString("Your development team =)");
            session.Send(motd);

            SpellHandler.SendSendKnownSpells();
            UpdateHandler.HandleUpdateObject(ref packet, ref session);
        }