/// <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)); } }
/// <summary> /// Asks the server for actual value. /// </summary> public void Ask() { Networker.SendToServer(SenderName, "Get", null); }