Exemplo n.º 1
0
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.Character             = (BasicCharacterObject)GameNetworkMessage.ReadObjectReferenceFromPacket(MBObjectManager.Instance, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
            this.Monster               = (Monster)GameNetworkMessage.ReadObjectReferenceFromPacket(MBObjectManager.Instance, CompressionBasic.GUIDCompressionInfo, ref bufferReadValid);
            this.AgentIndex            = GameNetworkMessage.ReadAgentIndexFromPacket(CompressionMission.AgentCompressionInfo, ref bufferReadValid);
            this.MountAgentIndex       = GameNetworkMessage.ReadAgentIndexFromPacket(CompressionMission.AgentCompressionInfo, ref bufferReadValid);
            this.Peer                  = GameNetworkMessage.ReadNetworkPeerReferenceFromPacket(ref bufferReadValid);
            this.SpawnEquipment        = new Equipment();
            this.SpawnMissionEquipment = new MissionEquipment();
            for (EquipmentIndex index = EquipmentIndex.WeaponItemBeginSlot; index < EquipmentIndex.NumAllWeaponSlots; ++index)
            {
                this.SpawnMissionEquipment[index] = ModuleNetworkData.ReadWeaponReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid);
            }
            for (EquipmentIndex equipmentIndex = EquipmentIndex.NumAllWeaponSlots; equipmentIndex < EquipmentIndex.NumEquipmentSetSlots; ++equipmentIndex)
            {
                this.SpawnEquipment.AddEquipmentToSlotWithoutAgent(equipmentIndex, ModuleNetworkData.ReadItemReferenceFromPacket(MBObjectManager.Instance, ref bufferReadValid));
            }
            this.IsPlayerAgent       = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.BodyPropertiesSeed  = !this.IsPlayerAgent ? GameNetworkMessage.ReadIntFromPacket(CompressionGeneric.RandomSeedCompressionInfo, ref bufferReadValid) : 0;
            this.BodyPropertiesValue = GameNetworkMessage.ReadBodyPropertiesFromPacket(ref bufferReadValid);
            this.IsFemale            = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid);
            this.Team           = GameNetworkMessage.ReadTeamReferenceFromPacket(ref bufferReadValid);
            this.Position       = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Direction      = GameNetworkMessage.ReadVec2FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid).Normalized();
            this.FormationIndex = GameNetworkMessage.ReadIntFromPacket(CompressionOrder.FormationClassCompressionInfo, ref bufferReadValid);
            this.ClothingColor1 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
            this.ClothingColor2 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }
        protected override bool OnRead()
        {
            bool bufferReadValid = true;

            this.AgentIndex       = GameNetworkMessage.ReadAgentIndexFromPacket(CompressionMission.AgentCompressionInfo, ref bufferReadValid);
            this.HorseItem        = ModuleNetworkData.ReadItemReferenceFromPacket(Game.Current.ObjectManager, ref bufferReadValid);
            this.HorseHarnessItem = ModuleNetworkData.ReadItemReferenceFromPacket(Game.Current.ObjectManager, ref bufferReadValid);
            this.Position         = GameNetworkMessage.ReadVec3FromPacket(CompressionBasic.PositionCompressionInfo, ref bufferReadValid);
            this.Direction        = GameNetworkMessage.ReadVec2FromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid);
            return(bufferReadValid);
        }