Kriszx Posted August 5, 2009 Share Posted August 5, 2009 I have Sourcersc for all the hl2 redirects and a config file that installs it as a secondary gaming service, which installs like an extra server. The client uploads his/her extras to the server, then starts the secondary and it will compress and upload to the redirect through FTP. This works pretty good, but of course the client cannot see the progress and know when it is done. Luis gave me the following to work with <% ''''''''''''''''''''''''''''''''''''''''''' 'Variables ''''''''''''''''''''''''''''''''''''''''''' Dim pageTitle As String = "Update Fast Download" Dim stopGameServer As Boolean = False Dim relativePath As String = "" Dim command As String = "cd %path%\SourceRSC" + vbnewline + "%path%\SourceRSC\SourceRSC.exe" Dim startMessage As String = "Updating fast download...<br>" Dim endMessage As String = "Fast download has been updated.<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>") %> I would like to have this as a Custom link button for them to click with a popup window just like HLDSupdatetool so they can see the progress. Any help would be appreciated. Thank you Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted August 6, 2009 Share Posted August 6, 2009 I got this 'almost' working, I created a custom link with the following url : javascript: void OpenConsoleWindow('/sourcersc.aspx?serviceid=%serviceid%') and placed sourcersc.aspx into Program Files\TCAdmin Control Panel\Web on my master server I edited the path for the exe, everything works pretty good but the page ends with the following : Your fast downloads are being synchronized with your game server files, this process can last a few minutes depending of the amount and size of files to synchronize, please wait... Server Error in '/' Application. Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off". <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration> Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL. <!-- Web.Config Configuration File --> <configuration> <system.web> <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/> </system.web> </configuration> I assume I will have to turn on error messages to check whats wrong. Note that apart from this it seems to be working as I got the files compressed and synchronized on my fast download space. Link to comment Share on other sites More sharing options...
dimitrifrom31 Posted August 6, 2009 Share Posted August 6, 2009 Ok it just times out because a key has to be pressed when SourceRSC.exe is done. need to find out how to close it automatically. Link to comment Share on other sites More sharing options...
Guest louise Posted August 6, 2009 Share Posted August 6, 2009 Contact http://www.brainless.us/forum Masher via the forums If you using this in your business you are breaking the licence terms he can supply you a version that is without the press any key to continue for a cost for a commercial licence and the edit for your code above it may still time out if it is a long install, you will need to change this + " this this + "start if you want the console to auto close add a java script at the bottom of your file Link to comment Share on other sites More sharing options...
Kriszx Posted August 6, 2009 Author Share Posted August 6, 2009 I have talked with Masher on this. Thanks Link to comment Share on other sites More sharing options...
Kriszx Posted August 7, 2009 Author Share Posted August 7, 2009 This works flawlessly. Thanks Luis and Dimitri for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.