コード例 #1
0
ファイル: Emitters.cs プロジェクト: jeffvella/DefenseShields
 private void StorageSetup()
 {
     if (EmiState == null)
     {
         EmiState = new EmitterState(Emitter);
     }
     EmiState.StorageInit();
     EmiState.LoadState();
 }
コード例 #2
0
 private void SaveAndSendAll()
 {
     _firstSync = true;
     EmiState.SaveState();
     EmiState.NetworkUpdate();
     if (Session.Enforced.Debug >= 3)
     {
         Log.Line($"SaveAndSendAll: EmitterId [{Emitter.EntityId}]");
     }
 }
コード例 #3
0
 public override bool IsSerialized()
 {
     if (MyAPIGateway.Multiplayer.IsServer)
     {
         if (Emitter.Storage != null)
         {
             EmiState.SaveState();
         }
     }
     return(false);
 }
コード例 #4
0
 private void NeedUpdate()
 {
     EmiState.State.Mode          = (int)EmitterMode;
     EmiState.State.BoundingRange = ShieldComp?.DefenseShields?.BoundingRange ?? 0f;
     EmiState.State.Compatible    = (IsStatic && EmitterMode == EmitterType.Station) || (!IsStatic && EmitterMode != EmitterType.Station);
     EmiState.SaveState();
     if (Session.Instance.MpActive)
     {
         EmiState.NetworkUpdate();
     }
 }
コード例 #5
0
        private void StorageSetup()
        {
            if (EmiState == null)
            {
                EmiState = new EmitterState(Emitter);
            }
            EmiState.StorageInit();
            EmiState.LoadState();

            if (MyAPIGateway.Multiplayer.IsServer)
            {
                EmiState.State.ActiveEmitterId = 0;
                EmiState.State.Backup          = false;
                EmiState.State.Los             = true;
                if (EmiState.State.Suspend)
                {
                    EmiState.State.Suspend       = false;
                    EmiState.State.Link          = false;
                    EmiState.State.Mode          = -1;
                    EmiState.State.BoundingRange = -1;
                }
            }
        }