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.Peer = GameNetworkMessage.ReadNetworkPeerReferenceFromPacket(ref bufferReadValid); this.ComponentId = GameNetworkMessage.ReadUintFromPacket(CompressionBasic.PeerComponentCompressionInfo, ref bufferReadValid); return(bufferReadValid); }
protected override bool OnRead() { bool bufferReadValid = true; this.MissionObject = GameNetworkMessage.ReadMissionObjectReferenceFromPacket(ref bufferReadValid); this.Color = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid); this.Color2 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid); return(bufferReadValid); }
public virtual bool ReadFromNetwork() { bool bufferReadValid = true; this.GameEntity.SetVisibilityExcludeParents(GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)); if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)) { MatrixFrame frame = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid); this.GameEntity.SetFrame(ref frame); if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)) { this._firstFrame = this.GameEntity.GetFrame(); this._lastSynchedFrame = GameNetworkMessage.ReadMatrixFrameFromPacket(ref bufferReadValid); this.SetSynchState(SynchedMissionObject.SynchState.SynchronizeFrameOverTime); this._duration = GameNetworkMessage.ReadFloatFromPacket(CompressionMission.FlagCapturePointDurationCompressionInfo, ref bufferReadValid); this._timer = 0.0f; if (this._duration.ApproximatelyEqualsTo(0.0f)) { this._duration = 0.1f; } } } if ((NativeObject)this.GameEntity.Skeleton != (NativeObject)null && GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)) { int animationIndex = GameNetworkMessage.ReadIntFromPacket(CompressionBasic.AnimationIndexCompressionInfo, ref bufferReadValid); float animationSpeedMultiplier = GameNetworkMessage.ReadFloatFromPacket(CompressionBasic.AnimationSpeedCompressionInfo, ref bufferReadValid); float parameter = GameNetworkMessage.ReadFloatFromPacket(CompressionBasic.UnitVectorCompressionInfo, ref bufferReadValid); this.GameEntity.Skeleton.SetAnimationAtChannel(animationIndex, 0, animationSpeedMultiplier, 0.0f); this.GameEntity.Skeleton.SetAnimationParameterAtChannel(0, parameter); if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)) { this.GameEntity.Skeleton.TickAnimationsAndForceUpdate(1f / 1000f, this.GameEntity.GetGlobalFrame(), true); this.GameEntity.PauseSkeletonAnimation(); } else { this.GameEntity.ResumeSkeletonAnimation(); } } if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)) { uint color1 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid); uint color2 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid); if (bufferReadValid) { this.GameEntity.SetColor(color1, color2, "use_team_color"); } } if (GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid)) { this.SetDisabledAndMakeInvisible(); } return(bufferReadValid); }
protected override bool OnRead() { bool bufferReadValid = true; this.Team = GameNetworkMessage.ReadMBTeamReferenceFromPacket(CompressionMission.TeamCompressionInfo, ref bufferReadValid); this.Side = (BattleSideEnum)GameNetworkMessage.ReadIntFromPacket(CompressionMission.TeamSideCompressionInfo, ref bufferReadValid); this.Color = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid); this.Color2 = GameNetworkMessage.ReadUintFromPacket(CompressionGeneric.ColorCompressionInfo, ref bufferReadValid); this.BannerCode = GameNetworkMessage.ReadStringFromPacket(ref bufferReadValid); this.IsPlayerGeneral = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid); this.IsPlayerSergeant = GameNetworkMessage.ReadBoolFromPacket(ref bufferReadValid); return(bufferReadValid); }