Jump to content

Wich port to open when Firewall is actived


iLight

Recommended Posts

You need to open the rcon port for the game(s) in question, each game has its own rcon they don't all run on the same port.

 

 

Studeggle is correct so if a game runs on 27015 then the Rcon port is 27015. Keep in mind some games use seperate Rcon ports but most use the same port as the gameport.

Link to comment
Share on other sites

Yep, put the following in a batch file (.bat):

 

FOR /L %%A IN (27000,1,27040) DO netsh firewall add portopening UDP %%A "SRCDS Port "%%A
FOR /L %%A IN (27000,1,27040) DO netsh firewall add portopening TCP %%A "SRCDS RCON Port "%%A

 

Should be self explanatory on how to modify for other ports

 

Edit: I see you're talking about the TCAdmin scripts run on setup/removal. You can still do this, but replace the ports with the port variables in TCAdmin. I prefer just to run a port opening script once and be done. Having ports open but with nothing listening on them isn't a security risk.

Link to comment
Share on other sites

Go to Admin Home > System Settings > Supported Games

select your req game

Install/Uninstall Scripts

 

Install Script:

netsh firewall add allowedprogram "%gameserverexe%" %serverip%_%serverport% ENABLE

 

Uninstall Script:

netsh firewall del allowedprogram "%gameserverexe%"

Link to comment
Share on other sites

  • 11 months later...
You will have to add the ports manually, regretfully you can't rerun the install scripts, which is annoying if you add a new feature to the install script such as port opening.

 

to run install scripts again just use the following tcascript (made by Luis) :

 

<tcascript>
<language name="VB" />
<waitForUserAction value="true"/>

<scriptCode><![CDATA[

Imports System

Class ExecuteScript
   Public Shared Sub Main()
       Dim services() As TCAdminSDK.Objects.Service = TCAdminSDK.Objects.Service.GetServicesByServerId(TCAdminSDK.Info.GetThisServerId())

       If Not services Is Nothing Then
           For Each service As TCAdminSDK.Objects.Service In services
               Try
                       Dim game As New TCAdminSDK.Objects.Game
                       game.GameID = service.GameId
                       game.Find()

                       Dim script As String = game.InstallScript()

                       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 server as new TCAdminSDK.Objects.Server
		server.ServerId = service.ServerID
		server.Find()
		Console.WriteLine("Executing script on server {0}:", server.DisplayName)
		Console.WriteLine(servicescript)
                       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)
               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

Archived

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

  • Who's Online   0 Members, 0 Anonymous, 11 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