Jump to content

Delete PunkBuster Screen Shots (Americas Army Example)


swish

Recommended Posts

Base example from LFA, Modified by me for PB Screen Shots ;)

 

Create deletepbss.aspx in C:\Your-TCAdmin-DIR\Web\Templates\Default

 

To use for diffrent games just change Dim relativePath As String = "system\pb\svss" to the screen shots path

<%
       '''''''''''''''''''''''''''''''''''''''''''
       'Variables
       '''''''''''''''''''''''''''''''''''''''''''

       Dim pageTitle As String = "Delete Punkbuster Screen Shots"
       Dim stopGameServer As Boolean = False
       Dim relativePath As String = "system\pb\svss"
       Dim newline as String = chr(13) & chr(10)
       Dim command As String = "del %path%\*.png" & newline & "del %path%\*.htm"
       Dim startMessage As String = "Deleting Punkbuster Screen Shots...<br>"
       Dim endMessage As String = "All Screen Shots have been deleted.<br><br>You can close this window."

       '''''''''''''''''''''''''''''''''''''''''''
       '''''''''''''''''''''''''''''''''''''''''''

       Response.Write("<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
       Response.Write("<HTML><TITLE>" & pageTitle & "</TITLE><BODY bgcolor=""#000000""><font face=""Lucida Console"" size=""2"" color=""#FFFFFF"">")

       If TCAdminSDK.Web.Session.IsAuthenticated Then
           Dim serviceid As String = Request.QueryString("serviceid")
           Dim service As New TCAdminSDK.Objects.Service
           service.ServiceID = serviceid
           If service.Find Then

               Dim path As String = System.IO.Path.Combine(service.AutomationFilesPath, relativePath)
               command = command.Replace("%path%", path)

               Response.Write(startMessage)
               Response.Flush()

               If service.UserID = TCAdminSDK.Web.Session.CurrentUser Or TCAdminSDK.Web.Session.CurrentUserType = TCAdminSDK.Objects.UserType.Admin Or TCAdminSDK.Web.Session.CurrentUserType = TCAdminSDK.Objects.UserType.SubAdmin Then

                   Dim serviceWasRunning As Boolean = False
                   If stopGameServer And service.CurrentStatus = TCAdminSDK.Objects.ServiceStatus.Running Then
                       Response.Write("Stopping the game server...")
                       Response.Flush()

                       service.Stop()
                       serviceWasRunning = True
                   End If

                   Dim serverplugin As TCAdminBase.Plugins.IGenericPlugIn = TCAdminSDK.Remote.InstanceCreator.GetPluginFromServer(service.ServerID, "TCAdminMonitor.StandardPlugins.RemoteServers.ServerUtilities")
                   serverplugin.Execute(New Object() {"ExecuteScript", service.WorkingDirectory, command})

                   If serviceWasRunning Then
                       Response.Write("Starting the game server...")
                       Response.Flush()
                       service.Start()
                   End If
               End If

               Response.Write(endMessage)
               Response.Flush()
           End If
       End If

       Response.Write("</font></BODY></HTML>")
%>

Create a Custom Link with Following Variables:

 

Page: Game Server Home Page
Visible for: Any PB game that takes Screen Shots
URL: javascript:void OpenConsoleWindow('deletepbss.aspx?serviceid=%serviceid%','deletepbss%serviceid%','This will delete all Punkbuster Screen Shots. Do you want to continue?')
Icon Text: Delete Punkbuster Screen Shots
Mouse Over: Delete Punkbuster Screen Shots
Place After: Whereever you want it

Edited by LFA
Link to comment
Share on other sites

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