Example #1
0
        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);
        }
Example #2
0
 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);
 }
 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);
 }
Example #4
0
 protected override void OnWrite()
 {
     GameNetworkMessage.WriteNetworkPeerReferenceToPacket(this.Peer);
     GameNetworkMessage.WriteUintToPacket(this.ComponentId, CompressionBasic.PeerComponentCompressionInfo);
 }
 protected override void OnWrite()
 {
     GameNetworkMessage.WriteMissionObjectReferenceToPacket(this.MissionObject);
     GameNetworkMessage.WriteUintToPacket(this.Color, CompressionGeneric.ColorCompressionInfo);
     GameNetworkMessage.WriteUintToPacket(this.Color2, CompressionGeneric.ColorCompressionInfo);
 }