コード例 #1
0
 private void TorchOnGameStateChanged(MySandboxGame game, TorchGameState newstate)
 {
     if (newstate == TorchGameState.Loading && MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
     {
         var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
         LogManager.GetCurrentClassLogger().Info($"Remote API started on port {myRemoteServer.Port}");
     }
 }
コード例 #2
0
 /// <inheritdoc />
 public override void Attach()
 {
     if (MySandboxGame.ConfigDedicated.RemoteApiEnabled && !string.IsNullOrEmpty(MySandboxGame.ConfigDedicated.RemoteSecurityKey))
     {
         var myRemoteServer = new MyRemoteServer(MySandboxGame.ConfigDedicated.RemoteApiPort, MySandboxGame.ConfigDedicated.RemoteSecurityKey);
         LogManager.GetCurrentClassLogger().Info($"Remote API started on port {myRemoteServer.Port}");
     }
     base.Attach();
 }