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


C# PacketWriter.WriteUInt64方法代码示例

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


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

示例1: 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

示例2: HandleObjectDestroy

        public static PacketWriter HandleObjectDestroy(ref WorldClass session, ulong guid)
        {
            PacketWriter objectDestroy = new PacketWriter(LegacyMessage.ObjectDestroy);

            objectDestroy.WriteUInt64(guid);
            objectDestroy.WriteUInt8(0);

            return objectDestroy;
        }
开发者ID:owner-gamers,项目名称:Arctium,代码行数:9,代码来源:ObjectHandler.cs

示例3: HandleObjectDestroy

        public static void HandleObjectDestroy(ref WorldClass session)
        {
            PacketWriter objectDestroy = new PacketWriter(LegacyMessage.ObjectDestroy);

            objectDestroy.WriteUInt64(session.Character.Guid);
            objectDestroy.WriteUInt8(0);

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

示例4: HandleChatMessageSay

        public static void HandleChatMessageSay(ref PacketReader packet, ref WorldClass session)
        {
            BitUnpack BitUnpack = new BitUnpack(packet);

            int language = packet.ReadInt32();

            uint messageLength = BitUnpack.GetBits<uint>(9);
            string chatMessage = packet.ReadString(messageLength);

            PacketWriter messageChat = new PacketWriter(LegacyMessage.MessageChat);

            ulong guid = WorldMgr.Session.Character.Guid;

            messageChat.WriteUInt8(1);
            messageChat.WriteInt32(language);
            messageChat.WriteUInt64(guid);
            messageChat.WriteUInt32(0);
            messageChat.WriteUInt64(guid);
            messageChat.WriteUInt32(messageLength + 1);
            messageChat.WriteCString(chatMessage);
            messageChat.WriteUInt16(0);

            session.Send(messageChat);
        }
开发者ID:Gargash,项目名称:Arctium,代码行数:24,代码来源:ChatHandler.cs

示例5: HandleLogoutComplete

        public static void HandleLogoutComplete(ref PacketReader packet, ref WorldClass session)
        {
            var pChar = session.Character;

            ObjectMgr.SavePositionToDB(pChar);

            PacketWriter logoutComplete = new PacketWriter(LegacyMessage.LogoutComplete);
            session.Send(ref logoutComplete);

            // Destroy object after logout
            PacketWriter objectDestroy = new PacketWriter(LegacyMessage.ObjectDestroy);

            objectDestroy.WriteUInt64(pChar.Guid);
            objectDestroy.WriteUInt8(0);

            WorldMgr.SendToAllInMap(pChar.Guid, objectDestroy);
            WorldMgr.DeleteSession(pChar.Guid);
        }
开发者ID:CastielS,项目名称:Mists-of-Pandaria,代码行数:18,代码来源:LogoutHandler.cs

示例6: SendMessageByType

        public static void SendMessageByType(ref WorldClass session, MessageType type, int language, string chatMessage, bool Broadcast = false)
        {
            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);
            if (Broadcast)
            {
                Globals.WorldMgr.SendToInRangeCharacter(session.Character, messageChat);
                session.Send(ref messageChat);
            }
            else
                session.Send(ref messageChat);
        }
开发者ID:Mathias1000,项目名称:Arctium,代码行数:21,代码来源:ChatHandler.cs

示例7: HandleTalkToGossip

        public static void HandleTalkToGossip(ref PacketReader packet, ref WorldClass session)
        {
            var guid = packet.ReadUInt64();
            var gossipData = GossipMgr.GetGossip<Creature>(ObjectGuid.GetGuid(guid));

            if (gossipData != null)
            {
                PacketWriter gossipMessage = new PacketWriter(LegacyMessage.GossipMessage);

                gossipMessage.WriteUInt64(guid);
                gossipMessage.WriteInt32(gossipData.Id);
                gossipMessage.WriteInt32(gossipData.FriendshipFactionID);
                gossipMessage.WriteInt32(gossipData.TextID);
                gossipMessage.WriteInt32(gossipData.OptionsCount);
                gossipMessage.WriteInt32(gossipData.QuestsCount);

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

示例8: HandleEquipError

        public static void HandleEquipError(ref WorldClass session, InventoryResult msg)
        {
            PacketWriter inventoryFail = new PacketWriter(JAMCMessage.InventoryChangeFailure);

            inventoryFail.WriteUInt8((byte)msg);

            if (msg != InventoryResult.EQUIP_ERR_OK)
            {
                inventoryFail.WriteUInt64(0);       // used for item1 guid
                inventoryFail.WriteUInt64(0);       // used for item2 guid
                inventoryFail.WriteUInt8(0);        // bag type subclass, used with EQUIP_ERR_EVENT_AUTOEQUIP_BIND_CONFIRM and EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG2
            }

            session.Send(ref inventoryFail);
        }
开发者ID:Mathias1000,项目名称:Arctium,代码行数:15,代码来源:CharacterHandler.cs


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