From: Samual Date: Fri, 6 Jan 2012 23:34:04 +0000 (-0500) Subject: Fix autoscreenshot system - don't use an alias anymore, but instead use the already... X-Git-Tag: xonotic-v0.6.0~188^2~16^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8011ac8854e8dd9d94dbaac3f3ca7bf319b51e54;p=xonotic%2Fxonotic-data.pk3dir.git Fix autoscreenshot system - don't use an alias anymore, but instead use the already added "cl_autoscreenshot" cvar to allow/disallow automatic screenshots. (helps prevent cheating) --- diff --git a/commands.cfg b/commands.cfg index 4edc2a85f..1f7e68458 100644 --- a/commands.cfg +++ b/commands.cfg @@ -289,10 +289,4 @@ alias vdoend "vdo endmatch" // rcon server commands // ====================== rcon_secure 1 -set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoauto movetored movetoblue movetoyellow movetopink" - -// ============================= -// other miscellaneous aliases -// ============================= -alias autoscreenshot "screenshot screenshots/autoscreenshot/${1 !}-${2 !}.jpg; echo \"^5A screenshot has been taken at request of the server.\"" - +set rcon_restricted_commands "restart fraglimit chmap gotomap endmatch reducematchtime extendmatchtime allready kick kickban \"sv_cmd bans\" \"sv_cmd unban *\" status \"sv_cmd teamstatus\" movetoauto movetored movetoblue movetoyellow movetopink" \ No newline at end of file diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index d99e9bede..7f85e4d04 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1540,7 +1540,7 @@ set cl_handicap 1 "the higher, the more damage you will receive (client setting) seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice." -seta cl_autoscreenshot 0 "client option to automatically take a screenshot once the map has ended (see also sv_autoscreenshot)" +seta cl_autoscreenshot 1 "Take a screenshot upon the end of a match... 0 = Disable completely, 1 = Allow sv_autoscreenshot to take a screenshot when requested, 2 = Always take an autoscreenshot anyway." // must be at the bottom of this file: // alias for switching the teamselect menu diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 24ffb68ad..93cea80ff 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1302,12 +1302,15 @@ float mapvote_initialized; void IntermissionThink() { FixIntermissionClient(self); - - if( (autocvar_sv_autoscreenshot || self.cvar_cl_autoscreenshot) + + float server_screenshot = (autocvar_sv_autoscreenshot && self.cvar_cl_autoscreenshot); + float client_screenshot = (self.cvar_cl_autoscreenshot == 2); + + if( (server_screenshot || client_screenshot) && ((self.autoscreenshot > 0) && (time > self.autoscreenshot)) ) { self.autoscreenshot = -1; - if(clienttype(self) == CLIENTTYPE_REAL) { stuffcmd(self, sprintf("\nautoscreenshot \"%s\" \"%s\"\n", GetMapname(), strftime(FALSE, "%s"))); } + if(clienttype(self) == CLIENTTYPE_REAL) { stuffcmd(self, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"", GetMapname(), strftime(FALSE, "%s"))); } return; }