Exemplo n.º 1
0
 /// <summary>
 /// Updates a variable or sends a request to server (if called clientside).
 /// </summary>
 public void Set(T New)
 {
     if (MyAPIGateway.Multiplayer.IsServer && MyAPIGateway.Multiplayer.MultiplayerActive)
     {
         Networker.SendToAll(SenderName, "Update", Serialize(New));
         Data = New;
     }
     else
     {
         Networker.SendToServer(SenderName, "UpdateRequest", Serialize(New));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Asks the server for actual value.
 /// </summary>
 public void Ask()
 {
     Networker.SendToServer(SenderName, "Get", null);
 }