well, i've been looking for a simple way to make it work, and now i've made something very simple using PTaH extention.
how it works?
this is very simple just follow the steps:
1- make an autoupdate script:
- this is what i use for server crash but it can also used to make your server update it's self on server quit :
Spoiler
Code:
@echo off
goto update
:update
cd /d "SteamCmdFolderDir"
//kills All Running Srcds task (Delete this if you have more than 1 server running.)
taskkill /F /IM srcds.exe
echo Updating Server ...
start /wait steamcmd.exe +login anonymous +app_update 740 +quit
timeout 5 /nobreak
echo =======================
echo = Server Has Updated! =
echo =======================
goto reload
:reload
cd /d "YourDir\Counter-Strike Global Offensive Beta - Dedicated Server"
echo Starting Server ...
start /wait srcds.exe -console -game csgo -usercon -ip "IPADDRESS" -port PORT +game_type 0 +game_mode 1 +mapgroup MAPGROUP_NAME +map MAPNAME +hostname "HOSTNAME"
echo Server Has Crashed %time% >> log.txt
echo =================================== >> log.txt
echo restarting server in 5 seconds.
echo restarting server in 5 seconds. >> log.txt
timeout 5
goto update
2- Server update detection:
- it's also very simple , just use PTaH and The attached plugin so your server will get the first chance to update it's self!
Spoiler
PHP Code:
#pragma semicolon 1 #include <PTaH>
public Plugin myinfo = { name = "Server Auto-Update Detector", author = "noBrain", version = "1.2", };
public void OnPluginStart() { RegConsoleCmd("say", Command_Say); RegConsoleCmd("say_team", Command_Say); PTaH(PTaH_ServerConsolePrint, Hook, ServerConsolePrint); } public Action ServerConsolePrint(const char[] sMessage) { int Players = GetClientCount(false); if (StrContains(sMessage, "MasterRequestRestart") != -1 && Players == 0) { PrintToServer("[SM] An Update Detected ! Restarting Server In 5 Seconds!"); PrintToChatAll("[SM] An Update Detected ! Restarting Server In 5 Seconds!"); ServerCommand("quit"); } return Plugin_Continue; } public Action Command_Say(int client, int args) { char Message[512]; GetCmdArgString(Message, sizeof(Message)); if(StrContains(Message, "MasterRequestRestart") != -1) { PrintToChat(client, "[SM] Blocked Expression."); return Plugin_Handled; } return Plugin_Continue; }
so that's it, your server will update it self each time!
NOTE : i've blocked players from typing MasterRequestRestart , cause it can be used by players to shutdown your server and also your server needs to be empty to get updated ..
this way might look very noobish but at least it's what's possible for windows (or what i know ).