Raised This Month: $32 Target: $400
 8% 

[TF2] Automatic Steam Update


Post New Thread Reply   
 
Thread Tools Display Modes
cool_myll
SourceMod Donor
Join Date: Aug 2011
Old 10-31-2011 , 07:23   Re: [ANY] Automatic Steam Update
Reply With Quote #11

Yeah same thing. I am waiting for a windows solution. Why is the autoupdate command only works on linux?
__________________
cool_myll is offline
duydangle
Senior Member
Join Date: May 2010
Old 10-31-2011 , 12:21   Re: [ANY] Automatic Steam Update
Reply With Quote #12

Quote:
Originally Posted by cool_myll View Post
Yeah same thing. I am waiting for a windows solution. Why is the autoupdate command only works on linux?
Maybe because of the system. The system in linux is more flexible. In linux srcds run like a script, while in windows it runs like a program. In linux when the script shutdown, there are another script check update. In windows the program quits, and that's the end.

//Bad English
duydangle is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 10-31-2011 , 18:10   Re: [ANY] Automatic Steam Update
Reply With Quote #13

Just realized, this will work in Windows, provided you use this batch file to run it. You can't use this with a game server provider, you need to have actual access to the machine.

Code:
@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) Using HldsUpdateTool to check for updates.
start /wait C:\Path\To\HldsUpdateTool.exe -command update -game tf
echo (%time%) srcds started.
start /wait C:\Path\To\srcds.exe -console -game tf +map ctf_2fort +maxplayers 24
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds
This is a modified version of the watchdog found at srcds.com. Obviously, you need to set your paths and command lines, but it should work alongside the plugin fine.
__________________
Dr. McKay is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-02-2011 , 19:24   Re: [ANY] Automatic Steam Update
Reply With Quote #14

Updated to 1.1.0. Added the ability to disallow new connections to the server during the timer (disabled by default), and the plugin now creates and loads its own config file.
__________________
Dr. McKay is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-02-2011 , 22:52   Re: [ANY] Automatic Steam Update
Reply With Quote #15

Updated to 1.2.0. The plugin now properly checks if the server is populated with actual human players or just bots when a restart is requested.
__________________
Dr. McKay is offline
psychonic

BAFFLED
Join Date: May 2008
Old 11-18-2011 , 09:51   Re: [ANY] Automatic Steam Update
Reply With Quote #16

@ Dr. McKay

Timer callbacks should return an explicit Plugin_Continue or Plugin_Stop for clarity (although anything other than Stop acts as continue for repeating timers). Handled implies Stop for other callback types and I'm not sure what behavior you were going for on a couple of the returns.

It also seems that there could be race conditions with multiple instances of the main timer running if the map is changed (because iirc, steam update check happens at map change). Perhaps just adding the TIMER_FLAG_NO_MAPCHANGE flag would be sufficient in your use case.

P.S. I do like the postpone option. That's handy.
psychonic is offline
mgftw
New Member
Join Date: Nov 2011
Old 11-18-2011 , 13:53   Re: [ANY] Automatic Steam Update
Reply With Quote #17

Quote:
Originally Posted by duydangle View Post
Maybe because of the system. The system in linux is more flexible. In linux srcds run like a script, while in windows it runs like a program. In linux when the script shutdown, there are another script check update. In windows the program quits, and that's the end.

//Bad English
No, it's because in Linux you can delete or overwrite files even when they are in use. In Windows when the gameserver is running most files are locked so they can't be updated. It's just the outdated filesystem in Windows preventing this.

I can't see any reason anyway to run srcds under Windows while there is a Linux version as well
mgftw is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-18-2011 , 16:06   Re: [ANY] Automatic Steam Update
Reply With Quote #18

Quote:
Originally Posted by psychonic View Post
@ Dr. McKay

Timer callbacks should return an explicit Plugin_Continue or Plugin_Stop for clarity (although anything other than Stop acts as continue for repeating timers). Handled implies Stop for other callback types and I'm not sure what behavior you were going for on a couple of the returns.

It also seems that there could be race conditions with multiple instances of the main timer running if the map is changed (because iirc, steam update check happens at map change). Perhaps just adding the TIMER_FLAG_NO_MAPCHANGE flag would be sufficient in your use case.

P.S. I do like the postpone option. That's handy.
Updated to use Plugin_Continue instead of Plugin_Handled.

I don't forsee any race conditions happening. When the timer is started, is sets suspendPlugin = true, which causes it to ignore any further master server restart requests until the timer is aborted (and the delay time has expired).
__________________
Dr. McKay is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 11-18-2011 , 16:10   Re: [ANY] Automatic Steam Update
Reply With Quote #19

Updated to 1.3.0. Timer callback now returns Plugin_Continue instead of Plugin_Handled.
__________________
Dr. McKay is offline
nightrider
SourceMod Donor
Join Date: Dec 2008
Old 11-18-2011 , 20:37   Re: [ANY] Automatic Steam Update
Reply With Quote #20

very nice ... thank you.
I have got to try this out on my Windows server.

Love the user name Dr. McKay... lol
__________________
[SIGPIC][/SIGPIC] the pantless
I am the Night Rider!, I'm a fuel-injected suicide machine.
I am a rocker! I am a roller!, I am an out-of-controller!



Last edited by nightrider; 11-18-2011 at 20:48.
nightrider is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode