当前位置: 首页>>代码示例>>C#>>正文


C# PacketWriter.WriteUInt32方法代码示例

本文整理汇总了C#中Framework.Network.Packets.PacketWriter.WriteUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# PacketWriter.WriteUInt32方法的具体用法?C# PacketWriter.WriteUInt32怎么用?C# PacketWriter.WriteUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Framework.Network.Packets.PacketWriter的用法示例。


在下文中一共展示了PacketWriter.WriteUInt32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleSendKnownSpells

        public static void HandleSendKnownSpells(ref WorldClass session)
        {
            Character pChar = session.Character;

            var specializationSpells = SpecializationMgr.GetSpecializationSpells(pChar);
            var specializationSpellCount = ((specializationSpells != null) ? specializationSpells.Count : 0);

            var talentSpells = SpecializationMgr.GetTalentSpells(pChar, pChar.ActiveSpecGroup);
            var talentSpellCount = ((talentSpells != null) ? talentSpells.Count : 0);

            int count = pChar.SpellList.Count + specializationSpellCount + talentSpellCount;

            PacketWriter writer = new PacketWriter(ServerMessage.SendKnownSpells);
            BitPack BitPack = new BitPack(writer);

            BitPack.Write(1);
            BitPack.Write(count, 22);
            BitPack.Flush();

            pChar.SpellList.ForEach(spell =>
                writer.WriteUInt32(spell.SpellId));

            if (specializationSpells != null)
                specializationSpells.ForEach(spell => writer.WriteUInt32(spell.Spell));

            if (talentSpells != null)
                talentSpells.ForEach(spell => writer.WriteUInt32(spell));

            session.Send(ref writer);
        }
开发者ID:RashKim,项目名称:Arctium,代码行数:30,代码来源:SpellHandler.cs

示例2: HandleAuthChallenge

        public static void HandleAuthChallenge(ref PacketReader packet, ref WorldClass session)
        {
            PacketWriter authChallenge = new PacketWriter(ServerMessage.AuthChallenge, true);

            for (int i = 0; i < 8; i++)
                authChallenge.WriteUInt32(0);

            authChallenge.WriteUInt32((uint)new Random(DateTime.Now.Second).Next(1, 0xFFFFFFF));
            authChallenge.WriteUInt8(1);

            session.Send(ref authChallenge);
        }
开发者ID:australopitheque,项目名称:Arctium,代码行数:12,代码来源:AuthenticationHandler.cs

示例3: HandleRealmSplitStateResponse

        public static void HandleRealmSplitStateResponse(ref PacketReader packet, ref WorldClass session)
        {
            uint realmSplitState = 0;

            PacketWriter realmSplitStateResp = new PacketWriter(LegacyMessage.RealmSplitStateResponse);

            realmSplitStateResp.WriteUInt32(packet.ReadUInt32());
            realmSplitStateResp.WriteUInt32(realmSplitState);
            realmSplitStateResp.WriteCString("01/01/01");

            session.Send(ref realmSplitStateResp);
        }
开发者ID:jesus01,项目名称:Arctium,代码行数:12,代码来源:TimeHandler.cs

示例4: SendMessageByType

        public static void SendMessageByType(ref WorldClass session, MessageType type, int language, string chatMessage)
        {
            PacketWriter messageChat = new PacketWriter(LegacyMessage.MessageChat);
            ulong guid = session.Character.Guid;

            messageChat.WriteUInt8((byte)type);
            messageChat.WriteInt32(language);
            messageChat.WriteUInt64(guid);
            messageChat.WriteUInt32(0);
            messageChat.WriteUInt64(guid);
            messageChat.WriteUInt32((uint)chatMessage.Length + 1);
            messageChat.WriteCString(chatMessage);
            messageChat.WriteUInt16(0);

            session.Send(ref messageChat);
        }
开发者ID:Krogonos,项目名称:Mop-5.1.0-Core,代码行数:16,代码来源:ChatHandler.cs

示例5: HandleDBQueryBulk

        public static void HandleDBQueryBulk(ref PacketReader packet, ref WorldClass session)
        {
            var type = (DBTypes)packet.ReadUInt32();
            var unknown = packet.ReadInt32();
            var id = packet.ReadInt32();

            switch (type)
            {
                case DBTypes.BroadcastText:
                {
                    var broadCastText = GossipMgr.GetBroadCastText<Creature>(id);

                    PacketWriter dbReply = new PacketWriter(JAMCMessage.DBReply);
                    BitPack BitPack = new BitPack(dbReply);

                    var textLength = broadCastText.Text.Length;
                    var alternativeTextLength = broadCastText.AlternativeText.Length;
                    var size = 48;

                    if (textLength == 0 || alternativeTextLength == 0)
                        size += 1;

                    size += textLength + alternativeTextLength;

                    dbReply.WriteUInt32((uint)size);
                    dbReply.WriteInt32(broadCastText.Id);
                    dbReply.WriteInt32(broadCastText.Language);

                    dbReply.WriteUInt16((ushort)broadCastText.Text.Length);
                    dbReply.WriteString(broadCastText.Text);

                    dbReply.WriteUInt16((ushort)broadCastText.AlternativeText.Length);
                    dbReply.WriteString(broadCastText.AlternativeText);

                    broadCastText.Emotes.ForEach(emote => dbReply.WriteInt32(emote));

                    dbReply.WriteUInt32(1);

                    dbReply.WriteUInt32(0);    // UnixTime, last change server side
                    dbReply.WriteUInt32((uint)DBTypes.BroadcastText);
                    dbReply.WriteInt32(broadCastText.Id);

                    session.Send(ref dbReply);
                    break;
                }
            }
        }
开发者ID:Mathias1000,项目名称:Arctium,代码行数:47,代码来源:GossipHandler.cs

示例6: HandleUpdateClientCacheVersion

        public static void HandleUpdateClientCacheVersion(ref WorldClass session)
        {
            PacketWriter cacheVersion = new PacketWriter(LegacyMessage.UpdateClientCacheVersion);

            cacheVersion.WriteUInt32(0);

            session.Send(cacheVersion);
        }
开发者ID:boredtodeath,项目名称:Arctium,代码行数:8,代码来源:MiscHandler.cs

示例7: HandleTutorialFlags

        public static void HandleTutorialFlags(ref WorldClass session)
        {
            PacketWriter tutorialFlags = new PacketWriter(LegacyMessage.TutorialFlags);
            for (int i = 0; i < 8; i++)
                tutorialFlags.WriteUInt32(0);

            session.Send(ref tutorialFlags);
        }
开发者ID:MrAndis,项目名称:Arctium,代码行数:8,代码来源:TutorialHandler.cs

示例8: HandleCacheVersion

        public static void HandleCacheVersion(ref WorldClass session)
        {
            PacketWriter cacheVersion = new PacketWriter(ServerMessage.CacheVersion);

            cacheVersion.WriteUInt32(0);

            session.Send(ref cacheVersion);
        }
开发者ID:rodrigoalv,项目名称:Arctium-WoW,代码行数:8,代码来源:MiscHandler.cs

示例9: HandleMessageOfTheDay

        public static void HandleMessageOfTheDay(ref WorldClass 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(ref motd);
        }
开发者ID:Kinivus,项目名称:Arctium,代码行数:10,代码来源:MiscHandler.cs

示例10: HandlePong

        public static void HandlePong(ref PacketReader packet, ref WorldClass session)
        {
            uint sequence = packet.ReadUInt32();
            uint latency = packet.ReadUInt32();

            PacketWriter pong = new PacketWriter(JAMCCMessage.Pong);
            pong.WriteUInt32(sequence);

            session.Send(pong);
        }
开发者ID:boredtodeath,项目名称:Arctium,代码行数:10,代码来源:MiscHandler.cs

示例11: HandleRealmSplit

        public static void HandleRealmSplit(ref PacketReader packet, ref WorldClass session)
        {
            uint realmSplitState = 0;
            var date = "01/01/01";

            PacketWriter realmSplit = new PacketWriter(ServerMessage.RealmSplit);
            BitPack BitPack = new BitPack(realmSplit);

            BitPack.Write(date.Length, 7);
            realmSplit.WriteString(date);

            realmSplit.WriteUInt32(packet.Read<uint>());
            realmSplit.WriteUInt32(realmSplitState);

            session.Send(ref realmSplit);

            // Crash!!!
            // Wrong data sent...
            // AddonMgr.WriteAddonData(ref session);
        }
开发者ID:hellssiing,项目名称:Arctium,代码行数:20,代码来源:TimeHandler.cs

示例12: HandleRealmSplit

        public static void HandleRealmSplit(ref PacketReader packet, WorldClass session)
        {
            uint realmSplitState = 0;
            var date = "01/01/01";

            PacketWriter realmSplit = new PacketWriter(ServerMessage.RealmSplit);
            BitPack BitPack = new BitPack(realmSplit);

            realmSplit.WriteUInt32(packet.Read<uint>());
            realmSplit.WriteUInt32(realmSplitState);

            BitPack.Write(date.Length, 7);

            BitPack.Flush();

            realmSplit.WriteString(date);

            session.Send(ref realmSplit);

            AddonHandler.WriteAddonData(session);
        }
开发者ID:mansemino,项目名称:Arctium,代码行数:21,代码来源:TimeHandler.cs

示例13: HandleMoveSetCanFly

        public static void HandleMoveSetCanFly(ref WorldClass session)
        {
            PacketWriter setCanFly = new PacketWriter(JAMCMessage.MoveSetCanFly);
            BitPack BitPack = new BitPack(setCanFly, session.Character.Guid);

            BitPack.WriteGuidMask(7, 3, 1, 5, 0, 6, 2, 4);
            BitPack.Flush();

            setCanFly.WriteUInt32(0);

            BitPack.WriteGuidBytes(2, 6, 7, 1, 3, 4, 6, 0);
            session.Send(setCanFly);
        }
开发者ID:Gargash,项目名称:Arctium,代码行数:13,代码来源:MoveHandler.cs

示例14: HandleStartCinematic

        public static void HandleStartCinematic(ref WorldClass session)
        {
            Character pChar = session.Character;

            PacketWriter startCinematic = new PacketWriter(LegacyMessage.StartCinematic);

            startCinematic.WriteUInt32(DBCStorage.RaceStorage[pChar.Race].CinematicSequence);

            session.Send(ref startCinematic);

            if (pChar.LoginCinematic)
                DB.Characters.Execute("UPDATE characters SET loginCinematic = 0 WHERE guid = ?", pChar.Guid);
        }
开发者ID:CastielS,项目名称:Mists-of-Pandaria,代码行数:13,代码来源:CinematicHandler.cs

示例15: HandleStartCinematic

        public static void HandleStartCinematic(ref WorldClass session)
        {
            Character pChar = session.Character;

            PacketWriter startCinematic = new PacketWriter(ServerMessage.StartCinematic);

            startCinematic.WriteUInt32(CliDB.ChrRaces.Single(race => race.Id == pChar.Race).CinematicSequence);

            session.Send(ref startCinematic);

            if (pChar.LoginCinematic)
                DB.Characters.Execute("UPDATE characters SET loginCinematic = 0 WHERE guid = ?", pChar.Guid);
        }
开发者ID:australopitheque,项目名称:Arctium,代码行数:13,代码来源:CinematicHandler.cs


注:本文中的Framework.Network.Packets.PacketWriter.WriteUInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。