protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject); GameNetworkMessage.WriteBoolToPacket(this.LocalSpace); GameNetworkMessage.WriteVec3ToPacket(this.Position, this.LocalSpace ? CompressionBasic.LocalPositionCompressionInfo : CompressionBasic.PositionCompressionInfo); GameNetworkMessage.WriteVec3ToPacket(this.Impulse, CompressionBasic.ImpulseCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteAgentReferenceToPacket(this.Agent); GameNetworkMessage.WriteMissionObjectReferenceToPacket((MissionObject)this.SpawnedItemEntity); GameNetworkMessage.WriteIntToPacket((int)this.SlotIndex, CompressionMission.ItemSlotCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.RemoveWeapon); }
public static void WriteWeaponReferenceToPacket(MissionWeapon weapon) { GameNetworkMessage.WriteBoolToPacket(weapon.IsEmpty); if (weapon.IsEmpty) { return; } GameNetworkMessage.WriteObjectReferenceToPacket((MBObjectBase)weapon.Item, CompressionBasic.GUIDCompressionInfo); GameNetworkMessage.WriteIntToPacket((int)weapon.RawDataForNetwork, CompressionGeneric.ItemDataValueCompressionInfo); GameNetworkMessage.WriteIntToPacket((int)weapon.ReloadPhase, CompressionMission.WeaponReloadPhaseCompressionInfo); GameNetworkMessage.WriteIntToPacket(weapon.CurrentUsageIndex, CompressionMission.WeaponUsageIndexCompressionInfo); int num1 = weapon.Banner != null ? 1 : 0; GameNetworkMessage.WriteBoolToPacket(num1 != 0); if (num1 != 0) { GameNetworkMessage.WriteStringToPacket(weapon.Banner.Serialize()); } MissionWeapon ammoWeapon = weapon.AmmoWeapon; int num2 = !ammoWeapon.IsEmpty ? 1 : 0; GameNetworkMessage.WriteBoolToPacket(num2 != 0); if (num2 == 0) { return; } GameNetworkMessage.WriteObjectReferenceToPacket((MBObjectBase)ammoWeapon.Item, CompressionBasic.GUIDCompressionInfo); GameNetworkMessage.WriteIntToPacket((int)ammoWeapon.RawDataForNetwork, CompressionGeneric.ItemDataValueCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteObjectReferenceToPacket((MBObjectBase)this.Character, CompressionBasic.GUIDCompressionInfo); GameNetworkMessage.WriteObjectReferenceToPacket((MBObjectBase)this.Monster, CompressionBasic.GUIDCompressionInfo); GameNetworkMessage.WriteIntToPacket(this.AgentIndex, CompressionMission.AgentCompressionInfo); GameNetworkMessage.WriteIntToPacket(this.MountAgentIndex, CompressionMission.AgentCompressionInfo); GameNetworkMessage.WriteNetworkPeerReferenceToPacket(this.Peer); for (EquipmentIndex index = EquipmentIndex.WeaponItemBeginSlot; index < EquipmentIndex.NumAllWeaponSlots; ++index) { ModuleNetworkData.WriteWeaponReferenceToPacket(this.SpawnMissionEquipment[index]); } for (EquipmentIndex equipmentIndex = EquipmentIndex.NumAllWeaponSlots; equipmentIndex < EquipmentIndex.NumEquipmentSetSlots; ++equipmentIndex) { ModuleNetworkData.WriteItemReferenceToPacket(this.SpawnEquipment.GetEquipmentFromSlot(equipmentIndex)); } GameNetworkMessage.WriteBoolToPacket(this.IsPlayerAgent); if (!this.IsPlayerAgent) { GameNetworkMessage.WriteIntToPacket(this.BodyPropertiesSeed, CompressionGeneric.RandomSeedCompressionInfo); } BodyProperties bodyProperties = this.BodyPropertiesValue; GameNetworkMessage.WriteBodyPropertiesToPacket(in bodyProperties); GameNetworkMessage.WriteBoolToPacket(this.IsFemale); GameNetworkMessage.WriteTeamReferenceToPacket(this.Team); GameNetworkMessage.WriteVec3ToPacket(this.Position, CompressionBasic.PositionCompressionInfo); GameNetworkMessage.WriteVec2ToPacket(this.Direction, CompressionBasic.UnitVectorCompressionInfo); GameNetworkMessage.WriteIntToPacket(this.FormationIndex, CompressionOrder.FormationClassCompressionInfo); GameNetworkMessage.WriteUintToPacket(this.ClothingColor1, CompressionGeneric.ColorCompressionInfo); GameNetworkMessage.WriteUintToPacket(this.ClothingColor2, CompressionGeneric.ColorCompressionInfo); }
protected override void OnWrite() { foreach (MultiplayerOptions.MultiplayerOption option in this._optionList) { MultiplayerOptions.OptionType optionType = option.OptionType; MultiplayerOptionsProperty optionProperty = optionType.GetOptionProperty(); switch (optionProperty.OptionValueType) { case MultiplayerOptions.OptionValueType.Bool: GameNetworkMessage.WriteBoolToPacket(optionType.GetBoolValue()); continue; case MultiplayerOptions.OptionValueType.Integer: case MultiplayerOptions.OptionValueType.Enum: GameNetworkMessage.WriteIntToPacket(optionType.GetIntValue(), new CompressionInfo.Integer(optionProperty.BoundsMin, optionProperty.BoundsMax, true)); continue; case MultiplayerOptions.OptionValueType.String: GameNetworkMessage.WriteStringToPacket(optionType.GetStrValue()); continue; default: continue; } } }
protected override void OnWrite() { GameNetworkMessage.WriteAgentReferenceToPacket(this.Agent); GameNetworkMessage.WriteBoolToPacket(this.IsLeftHand); GameNetworkMessage.WriteBoolToPacket(this.IsWieldedInstantly); GameNetworkMessage.WriteBoolToPacket(this.IsWieldedOnSpawn); GameNetworkMessage.WriteIntToPacket((int)this.WieldedItemIndex, CompressionMission.WieldSlotCompressionInfo); GameNetworkMessage.WriteIntToPacket(this.MainHandCurrentUsageIndex, CompressionMission.WeaponUsageIndexCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteBoolToPacket(this.AutoAssign); if (this.AutoAssign) { return; } GameNetworkMessage.WriteTeamReferenceToPacket(this.Team); }
protected override void OnWrite() { GameNetworkMessage.WriteMBTeamReferenceToPacket(this.Team, CompressionMission.TeamCompressionInfo); GameNetworkMessage.WriteIntToPacket((int)this.Side, CompressionMission.TeamSideCompressionInfo); GameNetworkMessage.WriteUintToPacket(this.Color, CompressionGeneric.ColorCompressionInfo); GameNetworkMessage.WriteUintToPacket(this.Color2, CompressionGeneric.ColorCompressionInfo); GameNetworkMessage.WriteStringToPacket(this.BannerCode); GameNetworkMessage.WriteBoolToPacket(this.IsPlayerGeneral); GameNetworkMessage.WriteBoolToPacket(this.IsPlayerSergeant); }
protected override void OnWrite() { ModuleNetworkData.WriteWeaponReferenceToPacket(this.Weapon); GameNetworkMessage.WriteMatrixFrameToPacket(this.Frame); GameNetworkMessage.WriteIntToPacket((int)this.WeaponSpawnFlags, CompressionMission.SpawnedItemWeaponSpawnFlagCompressionInfo); GameNetworkMessage.WriteIntToPacket(this.ForcedIndex, CompressionBasic.MissionObjectIDCompressionInfo); GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.ParentMissionObject); GameNetworkMessage.WriteBoolToPacket(this.IsVisible); GameNetworkMessage.WriteBoolToPacket(this.HasLifeTime); }
protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject); GameNetworkMessage.WriteBoolToPacket(this.ChannelNo == 1); GameNetworkMessage.WriteIntToPacket(this.AnimationIndex, CompressionBasic.AnimationIndexCompressionInfo); GameNetworkMessage.WriteBoolToPacket((double)this.AnimationSpeed != 1.0); if ((double)this.AnimationSpeed == 1.0) { return; } GameNetworkMessage.WriteFloatToPacket(this.AnimationSpeed, CompressionBasic.AnimationSpeedCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject); GameNetworkMessage.WriteIntToPacket(this.DestructionLevel, CompressionMission.UsableGameObjectDestructionStateCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.ForcedIndex != -1); if (this.ForcedIndex != -1) { GameNetworkMessage.WriteIntToPacket(this.ForcedIndex, CompressionBasic.MissionObjectIDCompressionInfo); } GameNetworkMessage.WriteFloatToPacket(this.BlowMagnitude, CompressionMission.UsableGameObjectBlowMagnitude); GameNetworkMessage.WriteVec3ToPacket(this.BlowPosition, CompressionBasic.PositionCompressionInfo); GameNetworkMessage.WriteVec3ToPacket(this.BlowDirection, CompressionMission.UsableGameObjectBlowDirection); }
protected override void OnWrite() { GameNetworkMessage.WriteIntToPacket(this.Message, CompressionMission.MultiplayerNotificationCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.HasParameterOne); if (!this.HasParameterOne) { return; } GameNetworkMessage.WriteIntToPacket(this.ParameterOne, CompressionMission.MultiplayerNotificationParameterCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.HasParameterTwo); if (!this.HasParameterTwo) { return; } GameNetworkMessage.WriteIntToPacket(this.ParameterTwo, CompressionMission.MultiplayerNotificationParameterCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteIntToPacket(this.MissileIndex, CompressionMission.MissileCompressionInfo); GameNetworkMessage.WriteIntToPacket((int)this.CollisionReaction, CompressionMission.MissileCollisionReactionCompressionInfo); GameNetworkMessage.WriteAgentReferenceToPacket(this.AttackerAgent); if (this.CollisionReaction == Mission.MissileCollisionReaction.Stick || this.CollisionReaction == Mission.MissileCollisionReaction.BounceBack) { int num = this.AttachedAgent != null ? 1 : 0; GameNetworkMessage.WriteBoolToPacket(num != 0); if (num != 0) { GameNetworkMessage.WriteAgentReferenceToPacket(this.AttachedAgent); GameNetworkMessage.WriteBoolToPacket(this.AttachedToShield); if (!this.AttachedToShield) { GameNetworkMessage.WriteIntToPacket((int)this.AttachedBoneIndex, CompressionMission.BoneIndexCompressionInfo); } } else { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.AttachedMissionObject); } } if (this.CollisionReaction != Mission.MissileCollisionReaction.BecomeInvisible && this.CollisionReaction != Mission.MissileCollisionReaction.PassThrough) { int num = this.AttachedAgent != null ? 1 : (this.AttachedMissionObject != null ? 1 : 0); GameNetworkMessage.WriteBoolToPacket(num != 0); if (num != 0) { GameNetworkMessage.WriteNonUniformTransformToPacket(this.AttachLocalFrame, CompressionBasic.BigRangeLowResLocalPositionCompressionInfo, CompressionBasic.LowResQuaternionCompressionInfo); } else { GameNetworkMessage.WriteNonUniformTransformToPacket(this.AttachLocalFrame, CompressionBasic.PositionCompressionInfo, CompressionBasic.LowResQuaternionCompressionInfo); } } if (this.CollisionReaction == Mission.MissileCollisionReaction.BounceBack) { GameNetworkMessage.WriteVec3ToPacket(this.BounceBackVelocity, CompressionMission.SpawnedItemVelocityCompressionInfo); GameNetworkMessage.WriteVec3ToPacket(this.BounceBackAngularVelocity, CompressionMission.SpawnedItemAngularVelocityCompressionInfo); } if (this.CollisionReaction != Mission.MissileCollisionReaction.Stick && this.CollisionReaction != Mission.MissileCollisionReaction.BounceBack) { return; } GameNetworkMessage.WriteIntToPacket(this.ForcedSpawnIndex, CompressionBasic.MissionObjectIDCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteNetworkPeerReferenceToPacket(this.Peer); GameNetworkMessage.WriteIntToPacket(this.VisualsIndex, CompressionMission.AgentOffsetCompressionInfo); GameNetworkMessage.WriteObjectReferenceToPacket((MBObjectBase)this.Character, CompressionBasic.GUIDCompressionInfo); bool flag = this.Equipment[EquipmentIndex.ArmorItemEndSlot].Item != null; GameNetworkMessage.WriteBoolToPacket(flag); for (EquipmentIndex equipmentIndex = EquipmentIndex.WeaponItemBeginSlot; equipmentIndex < (flag ? EquipmentIndex.NumEquipmentSetSlots : EquipmentIndex.ArmorItemEndSlot); ++equipmentIndex) { ModuleNetworkData.WriteItemReferenceToPacket(this.Equipment.GetEquipmentFromSlot(equipmentIndex)); } GameNetworkMessage.WriteIntToPacket(this.BodyPropertiesSeed, CompressionGeneric.RandomSeedCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.IsFemale); GameNetworkMessage.WriteIntToPacket(this.SelectedEquipmentSetIndex, CompressionBasic.MissionObjectIDCompressionInfo); GameNetworkMessage.WriteIntToPacket(this.TroopCountInFormation, CompressionBasic.PlayerCompressionInfo); }
public virtual void WriteToNetwork() { GameNetworkMessage.WriteBoolToPacket(this.GameEntity.GetVisibilityExcludeParents()); GameNetworkMessage.WriteBoolToPacket(this._initialSynchFlags.HasAnyFlag <SynchedMissionObject.SynchFlags>(SynchedMissionObject.SynchFlags.SynchTransform)); if (this._initialSynchFlags.HasAnyFlag <SynchedMissionObject.SynchFlags>(SynchedMissionObject.SynchFlags.SynchTransform)) { GameNetworkMessage.WriteMatrixFrameToPacket(this.GameEntity.GetFrame()); GameNetworkMessage.WriteBoolToPacket(this._synchState == SynchedMissionObject.SynchState.SynchronizeFrameOverTime); if (this._synchState == SynchedMissionObject.SynchState.SynchronizeFrameOverTime) { GameNetworkMessage.WriteMatrixFrameToPacket(this._lastSynchedFrame); GameNetworkMessage.WriteFloatToPacket(this._duration - this._timer, CompressionMission.FlagCapturePointDurationCompressionInfo); } } if ((NativeObject)this.GameEntity.Skeleton != (NativeObject)null) { string animationAtChannel = this.GameEntity.Skeleton.GetAnimationAtChannel(0); int num = !string.IsNullOrEmpty(animationAtChannel) ? 1 : 0; GameNetworkMessage.WriteBoolToPacket(num != 0 && this._initialSynchFlags.HasAnyFlag <SynchedMissionObject.SynchFlags>(SynchedMissionObject.SynchFlags.SynchAnimation)); if (num != 0 && this._initialSynchFlags.HasAnyFlag <SynchedMissionObject.SynchFlags>(SynchedMissionObject.SynchFlags.SynchAnimation)) { int animationIndexWithName = MBAnimation.GetAnimationIndexWithName(animationAtChannel); double animationSpeedAtChannel = (double)this.GameEntity.Skeleton.GetAnimationSpeedAtChannel(0); GameNetworkMessage.WriteIntToPacket(animationIndexWithName, CompressionBasic.AnimationIndexCompressionInfo); CompressionInfo.Float speedCompressionInfo = CompressionBasic.AnimationSpeedCompressionInfo; GameNetworkMessage.WriteFloatToPacket((float)animationSpeedAtChannel, speedCompressionInfo); GameNetworkMessage.WriteFloatToPacket(this.GameEntity.Skeleton.GetAnimationParameterAtChannel(0), CompressionBasic.UnitVectorCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.GameEntity.IsSkeletonAnimationPaused()); } } GameNetworkMessage.WriteBoolToPacket(this._initialSynchFlags.HasAnyFlag <SynchedMissionObject.SynchFlags>(SynchedMissionObject.SynchFlags.SyncColors)); if (this._initialSynchFlags.HasAnyFlag <SynchedMissionObject.SynchFlags>(SynchedMissionObject.SynchFlags.SyncColors)) { GameNetworkMessage.WriteUintToPacket(this.Color, CompressionGeneric.ColorCompressionInfo); GameNetworkMessage.WriteUintToPacket(this.Color2, CompressionGeneric.ColorCompressionInfo); } GameNetworkMessage.WriteBoolToPacket(this.IsDisabled); }
protected override void OnWrite() { GameNetworkMessage.WriteIntToPacket(this.MissileIndex, CompressionMission.MissileCompressionInfo); GameNetworkMessage.WriteAgentReferenceToPacket(this.Agent); GameNetworkMessage.WriteIntToPacket((int)this.WeaponIndex, CompressionMission.WieldSlotCompressionInfo); if (this.WeaponIndex == EquipmentIndex.None) { ModuleNetworkData.WriteMissileWeaponReferenceToPacket(this.Weapon); } GameNetworkMessage.WriteVec3ToPacket(this.Position, CompressionBasic.PositionCompressionInfo); GameNetworkMessage.WriteVec3ToPacket(this.Direction, CompressionBasic.UnitVectorCompressionInfo); GameNetworkMessage.WriteFloatToPacket(this.Speed, CompressionMission.MissileSpeedCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.HasRigidBody); if (this.HasRigidBody) { GameNetworkMessage.WriteRotationMatrixToPacket(this.Orientation); GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObjectToIgnore); } else { GameNetworkMessage.WriteVec3ToPacket(this.Orientation.f, CompressionBasic.UnitVectorCompressionInfo); } GameNetworkMessage.WriteBoolToPacket(this.IsPrimaryWeaponShot); }
protected override void OnWrite() { GameNetworkMessage.WriteStringToPacket(this.Message); GameNetworkMessage.WriteBoolToPacket(this.IsMessageTextId); }
protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject); GameNetworkMessage.WriteBoolToPacket(this.ChannelNo == 1); GameNetworkMessage.WriteFloatToPacket(this.Parameter, CompressionBasic.UnitVectorCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket((MissionObject)this.UsableGameObject); GameNetworkMessage.WriteBoolToPacket(this.IsDisabledForPlayers); }
protected override void OnWrite() { GameNetworkMessage.WriteBoolToPacket(this.SendMeBloodEvents); GameNetworkMessage.WriteBoolToPacket(this.SendMeSoundEvents); }
protected override void OnWrite() { GameNetworkMessage.WriteAgentReferenceToPacket(this.Agent); GameNetworkMessage.WriteIntToPacket(this.ComponentIndex, CompressionMission.AgentPrefabComponentIndexCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.Visibility); }
protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject); GameNetworkMessage.WriteIntToPacket((int)this.BodyFlags, CompressionBasic.FlagsCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.ApplyToChildren); }
protected override void OnWrite() { GameNetworkMessage.WriteBoolToPacket(this.InMission); GameNetworkMessage.WriteStringToPacket(this.GameType); GameNetworkMessage.WriteStringToPacket(this.Map); }
protected override void OnWrite() { GameNetworkMessage.WriteMBTeamReferenceToPacket(this.Team1, CompressionMission.TeamCompressionInfo); GameNetworkMessage.WriteMBTeamReferenceToPacket(this.Team2, CompressionMission.TeamCompressionInfo); GameNetworkMessage.WriteBoolToPacket(this.IsEnemyOf); }
protected override void OnWrite() { GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject); GameNetworkMessage.WriteBoolToPacket(this.Visible); }
protected override void OnWrite() { GameNetworkMessage.WriteAgentReferenceToPacket(this.Agent); GameNetworkMessage.WriteBoolToPacket(this.IsPlayer); }
protected override void OnWrite() { GameNetworkMessage.WriteAgentReferenceToPacket(this.Agent); GameNetworkMessage.WriteBoolToPacket(this.IsKilled); GameNetworkMessage.WriteIntToPacket(this.ActionCodeIndex.Index, CompressionBasic.ActionCodeCompressionInfo); }
protected override void OnWrite() { GameNetworkMessage.WriteNetworkPeerReferenceToPacket(this.Peer); GameNetworkMessage.WriteBoolToPacket(this.Accepted); }
protected override void OnWrite() { GameNetworkMessage.WriteBoolToPacket(this.IsDefendPressed); GameNetworkMessage.WriteIntToPacket((int)this.ForcedSlotIndexToDropWeaponFrom, CompressionMission.WieldSlotCompressionInfo); }