elite90 Posted May 31, 2009 Share Posted May 31, 2009 I'm looking to run the Uninstall Script for every server and be able to run the Install Script for every server. If anyone knows how to code that, thanks. Link to comment Share on other sites More sharing options...
Guest louise Posted May 31, 2009 Share Posted May 31, 2009 For what exactly ? Firewalls .... making cookies ..??? Link to comment Share on other sites More sharing options...
elite90 Posted May 31, 2009 Author Share Posted May 31, 2009 Removing firewall entries (opening ports makes more sense) and setting up a fast download site for each server (using IIS) Link to comment Share on other sites More sharing options...
elite90 Posted June 2, 2009 Author Share Posted June 2, 2009 Anyone? I will pay $50 if someone wants to code it thanks Link to comment Share on other sites More sharing options...
Guest louise Posted June 3, 2009 Share Posted June 3, 2009 For firewalls its netsh firewall add allowedprogram "%gameserverexe%" %serverip%_%serverport% ENABLE netsh firewall del allowedprogram "%gameserverexe%" Ports something like this netsh firewall add portopening UDP %serverport% UDP-%serverport% netsh firewall add portopening UDP %queryport% UDP-%queryport% netsh firewall add portopening ALL %rconport% ALL-%rconport% netsh firewall add portopening UDP %primary_customport1% UDP-%primary_customport1% netsh firewall add portopening UDP %primary_customport2% UDP-%primary_customport2% Link to comment Share on other sites More sharing options...
elite90 Posted June 3, 2009 Author Share Posted June 3, 2009 Thanks, but I'm looking to actually run those commands for every server that is on our TCAdmin. Link to comment Share on other sites More sharing options...
GS-Liam Posted June 3, 2009 Share Posted June 3, 2009 For firewalls its netsh firewall add allowedprogram "%gameserverexe%" %serverip%_%serverport% ENABLE netsh firewall del allowedprogram "%gameserverexe%" Ports something like this netsh firewall add portopening UDP %serverport% UDP-%serverport% netsh firewall add portopening UDP %queryport% UDP-%queryport% netsh firewall add portopening ALL %rconport% ALL-%rconport% netsh firewall add portopening UDP %primary_customport1% UDP-%primary_customport1% netsh firewall add portopening UDP %primary_customport2% UDP-%primary_customport2% Is this for opening the ports with windows firewall? Cheers Link to comment Share on other sites More sharing options...
elite90 Posted June 3, 2009 Author Share Posted June 3, 2009 Yeah, those are for Windows Firewall. Link to comment Share on other sites More sharing options...
Guest louise Posted June 3, 2009 Share Posted June 3, 2009 Simple put them in your Install/Uninstall Scripts and when it gets install it will auto add / or remove itsself If servers are already on there you need to manually add them Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted June 3, 2009 Share Posted June 3, 2009 if servers are allready on you can just remotely conenct to the machine, then restart all the servers on that machine and you will be prompted to allow every application 1 by 1. Link to comment Share on other sites More sharing options...
elite90 Posted June 3, 2009 Author Share Posted June 3, 2009 Ok, I need to automate adding existing servers. I am setting up fast download URL on 300+ servers, so manual isn't really possible. I assume that it would be possible to make a tca script that runs the commands foreach server. Thanks Link to comment Share on other sites More sharing options...
elite90 Posted June 5, 2009 Author Share Posted June 5, 2009 Thank you to the person that gave me this. Change Dim gameid As String = "TCXXXXXXXXXXXXXX" to the game ID that you want it to execute the scripts on. To execute the uninstall script, change Dim script As String = game.InstallScript() to Dim script As String = game.UninstallScript() <tcascript> <language name="VB" /> <waitForUserAction value="true"/> <scriptCode><![CDATA[ Imports System Class ExecuteScript Public Shared Sub Main() Dim gameid As String = "TCXXXXXXXXXXXXXX" Dim game As New TCAdminSDK.Objects.Game Dim services() As TCAdminSDK.Objects.Service = TCAdminSDK.Objects.Service.GetServices() game.GameID = gameid game.Find() Dim script As String = game.InstallScript() If Not services Is Nothing Then For Each service As TCAdminSDK.Objects.Service In services Try If service.GameID = gameid Then Dim user As New TCAdminSDK.Objects.User(service.UserID) 'Load dynamic values Dim DynamicValues As TCAdminSDK.Remote.Plugins.GSAutomation.GameServerDynamicValues With DynamicValues .GameName = game.Name .GameServerShortName = game.ShortName .ServerIP = service.ServerIP .ServerPort = service.ServerPort .QueryPort = service.ServerQueryPort .RCONPort = service.ServerRCONPort .CustomPort1 = service.CustomPort1 .CustomPort2 = service.CustomPort2 .CustomPort3 = service.CustomPort3 .CustomPort4 = service.CustomPort4 .CustomPort5 = service.CustomPort5 .Slots = service.Slots .HostName = String.Empty .RCONPassword = String.Empty .PrivatePassword = String.Empty .IsPrivate = service.Private .UserFilesPath = service.UserFilePath .GameFilesPath = service.AutomationFilesPath .OwnerUserID = service.UserID .OwnerName = user.FullName .OwnerPassword = TCAdminBase.Encryption.DecryptString128Bit(user.Password) .PrimaryServiceID = service.PrimaryServiceID .Application = service.Application .GameKey = service.GameKey End With Dim servicescript As String = TCAdminSDK.Remote.Plugins.GSAutomation.ReplaceGameServerValues(script, DynamicValues) Dim su As TCAdminBase.Plugins.IGenericPlugIn = TCAdminSDK.Remote.InstanceCreator.GetPluginFromServer(service.ServerID, "TCAdminMonitor.StandardPlugins.RemoteServers.ServerUtilities") Dim exitcode As Integer = su.Execute(New Object() {"ExecuteScript", service.WorkingDirectory, servicescript}) Console.WriteLine("Executed script on {0} with exit code {1}", service.UniqueDisplayNameWithOwner, exitcode) End If Catch ex As Exception Console.WriteLine("-------------------------") Console.WriteLine("Error executing script on {0}: {1}", service.UniqueDisplayNameWithOwner, ex.ToString()) Console.WriteLine("-------------------------") End Try Next End If Console.WriteLine("Finished.") End Sub End Class ]]></scriptCode> </tcascript> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.