Jump to content

Restart game servers


LFA

Recommended Posts

  • 1 year later...
  • Replies 50
  • Created
  • Last Reply
  • 1 month later...

been poking at this for a while now. cant seem to find the error. i am using the code exactly the same as first post (for restarting specific service id) with the exception of useraction = false and gameid = 10.

 

i am getting this error:

 

Objects.Service.GetServices: The underlying connection was closed: Unable to connect to the remote server.

 

Error: An exception occurred while executing the script Exception has been thrown out by the target of an invocation. Object refrence not set to an instance of an object.

 

any ideas?

Link to comment
Share on other sites

"Unable to connect to the remote server" means the master monitor is not running or it can't connect for some reason. Is your master server behind a hardware firewall?

 

right now all of the servers are on one dedicated box. the entire machine is behind a firewall. its configed to allow connections directly to the process (example: c:/gamefolder/css/srcds/exe)

 

*edit*

 

ok i turned off the firewall and restarted the monitor for good measure. still not working >.<

Link to comment
Share on other sites

  • 2 months later...
  • 4 months later...

iam using:

 

REM Restart All Game Servers

REM http://clientforums.tcadmin.com/showthread.php?t=201

 

 

<tcascript>

<language name="VB" />

<waitForUserAction value="true"/>

 

<scriptCode><![CDATA[

 

Imports System

Imports TCAdminSDK.Objects

 

Public Class RestartGameServers

Public Shared Sub Main()

'Get a list of all services

Dim services() As Service = Service.GetServicesByUserId("Incognito-Kille")

for each s as Service in services

If s.CurrentStatus = ServiceStatus.Running Then

Console.WriteLine("Restarting " & s.ServiceID)

s.Stop()

Threading.Thread.CurrentThread.Sleep(1000)

s.Start()

'Wait a few seconds before restarting the

'next service to avoid high loads on server

Threading.Thread.CurrentThread.Sleep(10000)

End If

next

 

Console.WriteLine("Done. Press any key to continue.")

End Sub

End Class

 

]]></scriptCode>

 

</tcascript>

 

 

 

is it possible to add more UserID's to that script?

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 months later...

Archived

This topic is now archived and is closed to further replies.

  • Who's Online   0 Members, 0 Anonymous, 29 Guests (See full list)

    • There are no registered users currently online

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use