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


C# PacketWriter.WriteGuid方法代码示例

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


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

示例1: HandleUpdateObject

        public static void HandleUpdateObject(ref PacketReader packet, ref WorldClass session)
        {
            Character character = session.Character;
            PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);  // Grml sandbox style...
            updateObject.WriteUInt8(1);
            updateObject.WriteGuid(character.Guid);
            updateObject.WriteUInt8(4);

            UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self | UpdateFlag.Unknown4;
            WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);
            character.WriteUpdateFields(ref updateObject);

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

示例2: HandleUpdateObjectCreate

        public static void HandleUpdateObjectCreate(ref WorldClass session)
        {
            WorldObject character = session.Character;
            PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);
            updateObject.WriteUInt8((byte)UpdateType.CreateObject);
            updateObject.WriteGuid(character.Guid);
            updateObject.WriteUInt8((byte)ObjectType.Player);

            UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
            WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

            character.WriteUpdateFields(ref updateObject);
            character.WriteDynamicUpdateFields(ref updateObject);

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

示例3: HandleNameCache

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

            ulong guid = packet.ReadUInt64();
            uint realmId = packet.ReadUInt32();

            PacketWriter nameCache = new PacketWriter(LegacyMessage.NameCache);

            nameCache.WriteGuid(guid);
            nameCache.WriteUInt8(0);
            nameCache.WriteCString(pChar.Name);
            nameCache.WriteUInt32(realmId);
            nameCache.WriteUInt8(pChar.Race);
            nameCache.WriteUInt8(pChar.Gender);
            nameCache.WriteUInt8(pChar.Class);
            nameCache.WriteUInt8(0);

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

示例4: HandleUpdateObjectValues

        public static void HandleUpdateObjectValues(ref WorldClass session)
        {
            WorldObject character = session.Character;
            PacketWriter updateObject = new PacketWriter(ServerMessage.ObjectUpdate);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);
            updateObject.WriteUInt8((byte)UpdateType.Values);
            updateObject.WriteGuid(character.Guid);

            character.WriteUpdateFields(ref updateObject);
            character.WriteDynamicUpdateFields(ref updateObject);

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

示例5: HandleUpdateObjectCreate

        public static void HandleUpdateObjectCreate(ref WorldClass session)
        {
            WorldObject character = session.Character;
            PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);
            updateObject.WriteUInt8((byte)UpdateType.CreateObject);
            updateObject.WriteGuid(character.Guid);
            updateObject.WriteUInt8((byte)ObjectType.Player);

            UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
            WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

            character.WriteUpdateFields(ref updateObject);
            character.WriteDynamicUpdateFields(ref updateObject);

            session.Send(ref updateObject);

            var tempSessions = new Dictionary<ulong, WorldClass>(WorldMgr.Sessions);
            tempSessions.Remove(character.Guid);

            if (tempSessions != null)
            {
                foreach (var s in tempSessions)
                {
                    if (s.Value.Character.CheckUpdateDistance(character))
                    {
                        updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                        updateObject.WriteUInt16((ushort)character.Map);
                        updateObject.WriteUInt32(1);
                        updateObject.WriteUInt8((byte)UpdateType.CreateObject);
                        updateObject.WriteGuid(character.Guid);
                        updateObject.WriteUInt8((byte)ObjectType.Player);

                        updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
                        WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

                        character.WriteUpdateFields(ref updateObject);
                        character.WriteDynamicUpdateFields(ref updateObject);

                        s.Value.Send(ref updateObject);
                    }
                }

                foreach (var s in tempSessions)
                {
                    WorldObject pChar = s.Value.Character;

                    if (character.CheckUpdateDistance(pChar))
                    {
                        character.ToCharacter().InRangeObjects.Add(pChar.Guid, pChar);

                        updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                        updateObject.WriteUInt16((ushort)pChar.Map);
                        updateObject.WriteUInt32(1);
                        updateObject.WriteUInt8((byte)UpdateType.CreateObject);
                        updateObject.WriteGuid(pChar.Guid);
                        updateObject.WriteUInt8((byte)ObjectType.Player);

                        updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
                        WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref pChar, updateFlags);

                        pChar.WriteUpdateFields(ref updateObject);
                        pChar.WriteDynamicUpdateFields(ref updateObject);

                        session.Send(ref updateObject);
                    }
                }
            }
        }
开发者ID:owner-gamers,项目名称:Arctium,代码行数:73,代码来源:ObjectHandler.cs

示例6: HandleUpdateObject

        public static void HandleUpdateObject(ref WorldClass session)
        {
            WorldObject character = session.Character;
            PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);
            updateObject.WriteUInt8(1);
            updateObject.WriteGuid(character.Guid);
            updateObject.WriteUInt8(4);

            UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
            WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

            character.WriteUpdateFields(ref updateObject);
            character.WriteDynamicUpdateFields(ref updateObject);
            session.Send(ref updateObject);

            var tempSessions = new Dictionary<ulong, WorldClass>(WorldMgr.Sessions);
            tempSessions.Remove(character.Guid);

            if (tempSessions != null)
            {
                foreach (var s in tempSessions)
                {
                    if (character.Map != s.Value.Character.Map)
                        continue;

                    updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                    updateObject.WriteUInt16((ushort)character.Map);
                    updateObject.WriteUInt32(1);
                    updateObject.WriteUInt8(1);
                    updateObject.WriteGuid(character.Guid);
                    updateObject.WriteUInt8(4);

                    updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
                    WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

                    character.WriteUpdateFields(ref updateObject);
                    character.WriteDynamicUpdateFields(ref updateObject);

                    s.Value.Send(ref updateObject);
                }

                foreach (var s in tempSessions)
                {
                    WorldObject pChar = s.Value.Character;

                    if (pChar.Map != character.Map)
                        continue;

                    updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                    updateObject.WriteUInt16((ushort)pChar.Map);
                    updateObject.WriteUInt32(1);
                    updateObject.WriteUInt8(1);
                    updateObject.WriteGuid(pChar.Guid);
                    updateObject.WriteUInt8(4);

                    updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
                    WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref pChar, updateFlags);

                    pChar.WriteUpdateFields(ref updateObject);
                    pChar.WriteDynamicUpdateFields(ref updateObject);

                    session.Send(ref updateObject);
                }
            }

            character.AddCreatureSpawnsToWorld(ref session);
            character.AddGameObjectSpawnsToWorld(ref session);
        }
开发者ID:SgT-Fatality,项目名称:Arctium,代码行数:73,代码来源:ObjectHandler.cs

示例7: AddToWorld

        public void AddToWorld()
        {
            CreateFullGuid();
            CreateData(GameObject);

            Globals.SpawnMgr.AddSpawn(this, ref GameObject);

            SetGameObjectFields();

            WorldObject obj = this;
            UpdateFlag updateFlags = UpdateFlag.Rotation | UpdateFlag.StationaryPosition;

            foreach (var v in Globals.WorldMgr.Sessions)
            {
                Character pChar = v.Value.Character;

                if (pChar.CheckUpdateDistance(this))
                {
                    PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                    updateObject.WriteUInt16((ushort)Map);
                    updateObject.WriteUInt32(1);
                    updateObject.WriteUInt8(1);
                    updateObject.WriteGuid(Guid);
                    updateObject.WriteUInt8(5);

                    Globals.WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref obj, updateFlags);

                    WriteUpdateFields(ref updateObject);
                    WriteDynamicUpdateFields(ref updateObject);

                    v.Value.Send(ref updateObject);
                }
            }
        }
开发者ID:mcralfs,项目名称:Arctium,代码行数:35,代码来源:GameObjectSpawn.cs

示例8: HandleNameCache

        public static void HandleNameCache(ref PacketReader packet, ref WorldClass session)
        {
            ulong guid = packet.ReadUInt64();
            uint realmId = packet.ReadUInt32();

            var pSession = WorldMgr.GetSession(guid);
            if (pSession != null)
            {
                var pChar = pSession.Character;

                if (pChar != null)
                {
                    PacketWriter nameCache = new PacketWriter(LegacyMessage.NameCache);

                    nameCache.WriteGuid(guid);
                    nameCache.WriteUInt8(0);
                    nameCache.WriteCString(pChar.Name);
                    nameCache.WriteUInt32(realmId);
                    nameCache.WriteUInt8(pChar.Race);
                    nameCache.WriteUInt8(pChar.Gender);
                    nameCache.WriteUInt8(pChar.Class);
                    nameCache.WriteUInt8(0);

                    session.Send(ref nameCache);
                }
            }
        }
开发者ID:antiker,项目名称:Arctium,代码行数:27,代码来源:CacheHandler.cs

示例9: AddToWorld

        public void AddToWorld()
        {
            CreateFullGuid();
            CreateData(Creature);

            Globals.SpawnMgr.AddSpawn(this, ref Creature);

            SetCreatureFields();

            WorldObject obj = this;
            UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;

            foreach (var v in Globals.WorldMgr.Sessions)
            {
                Character pChar = v.Value.Character;
                if (pChar.Map != Map)
                    continue;

                PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                updateObject.WriteUInt16((ushort)Map);
                updateObject.WriteUInt32(1);
                updateObject.WriteUInt8(1);
                updateObject.WriteGuid(Guid);
                updateObject.WriteUInt8(3);

                Globals.WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref obj, updateFlags);

                WriteUpdateFields(ref updateObject);
                WriteDynamicUpdateFields(ref updateObject);

                v.Value.Send(ref updateObject);
            }
        }
开发者ID:jesus01,项目名称:Arctium,代码行数:34,代码来源:CreatureSpawn.cs

示例10: HandleUpdateObjectValues

        public static void HandleUpdateObjectValues(ref WorldClass session, bool broadcast = false, bool toself = true)
        {
            WorldObject character = session.Character;
            PacketWriter updateObject = new PacketWriter(ServerMessage.ObjectUpdate);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);
            updateObject.WriteUInt8((byte)UpdateType.Values);
            updateObject.WriteGuid(character.Guid);

            character.WriteUpdateFields(ref updateObject);
            character.WriteDynamicUpdateFields(ref updateObject);

            if (toself)
                session.Send(ref updateObject);

            if (broadcast)
                WorldMgr.SendToInRangeCharacter(character as Character, updateObject);
        }
开发者ID:mansemino,项目名称:Arctium,代码行数:19,代码来源:ObjectHandler.cs

示例11: HandleUpdateObject

        public static void HandleUpdateObject(ref WorldClass session)
        {
            Character character = session.Character;
            PacketWriter updateObject = new PacketWriter(LegacyMessage.UpdateObject);

            updateObject.WriteUInt16((ushort)character.Map);
            updateObject.WriteUInt32(1);
            updateObject.WriteUInt8(1);
            updateObject.WriteGuid(character.Guid);
            updateObject.WriteUInt8(4);

            UpdateFlag updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation | UpdateFlag.Self;
            WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

            character.WriteUpdateFields(ref updateObject);
            character.WriteDynamicUpdateFields(ref updateObject);

            session.Send(updateObject);

            var tempSession = WorldMgr.Sessions;
            tempSession.Remove(character.Guid);

            foreach (var s in tempSession)
            {
                if (character.Zone != s.Value.Character.Zone)
                    continue;

                updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                updateObject.WriteUInt16((ushort)character.Map);
                updateObject.WriteUInt32(1);
                updateObject.WriteUInt8(1);
                updateObject.WriteGuid(character.Guid);
                updateObject.WriteUInt8(4);

                updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
                WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

                character.WriteUpdateFields(ref updateObject);
                character.WriteDynamicUpdateFields(ref updateObject);

                s.Value.Send(updateObject);
            }

            foreach (var s in tempSession)
            {
                character = s.Value.Character;

                if (character.Zone != session.Character.Zone)
                    continue;

                updateObject = new PacketWriter(LegacyMessage.UpdateObject);

                updateObject.WriteUInt16((ushort)character.Map);
                updateObject.WriteUInt32(1);
                updateObject.WriteUInt8(1);
                updateObject.WriteGuid(character.Guid);
                updateObject.WriteUInt8(4);

                updateFlags = UpdateFlag.Alive | UpdateFlag.Rotation;
                WorldMgr.WriteUpdateObjectMovement(ref updateObject, ref character, updateFlags);

                character.WriteUpdateFields(ref updateObject);
                character.WriteDynamicUpdateFields(ref updateObject);

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


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