Exemple #1
0
 public void Set(T New)
 {
     if (IsValid(New))
     {
         if (Networker.IsServer)
         {
             Underlying = New;
             Networker.SendToAll(Header, "Set", Serialize(Underlying), EntityID);
         }
         else
         {
             Networker.SendToServer(Header, "SetRequest", Serialize(New), EntityID);
         }
     }
 }
Exemple #2
0
 public void Set(T New)
 {
     if (IsValid(New))
     {
         if (Networker.IsServer && !New.Equals(Underlying))
         {
             Underlying = New;
             if (MyAPIGateway.Multiplayer.MultiplayerActive)
             {
                 Networker.SendToAll(Header, "Set", Serialize(Underlying), EntityID);
             }
         }
         else
         {
             Networker.SendToServer(Header, "SetRequest", Serialize(New), EntityID);
         }
     }
     else
     {
         LaserTools.SessionCore.DebugWrite($"AutoSet[{Entity.DisplayName}]", $"Invalid value supplied: {New.ToString()}");
     }
 }