diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index b4cbceb8..d4ba1e24 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -1304,7 +1304,7 @@ COMMAND(dropflag, ""); char *votestring(int type, const char *arg1, const char *arg2, const char *arg3) { - const char *msgs[] = { "kick player %s, reason: %s", "ban player %s, reason: %s", "remove all bans", "set mastermode to %s", "%s autoteam", "force player %s to team %s", "give admin to player %s", (arg3 && arg3[0] && arg3[0]!='0') ? "load map %s in mode %s%s for %s minutes" : "load map %s in mode %s%s", "%s demo recording for the next match", "stop demo recording", "clear all demos", "set server description to '%s'", "shuffle teams"}; + const char *msgs[] = { "kick player %s, reason: %s", "ban player %s, reason: %s", "remove all bans", "set mastermode to %s", "%s autoteam", "force player %s to team %s", "give admin to player %s", "load map %s in mode %s%s%s", "%s demo recording for the next match", "stop demo recording", "clear all demos", "set server description to '%s'", "shuffle teams"}; const char *msg = msgs[type]; char *out = newstring(MAXSTRLEN); out[MAXSTRLEN] = '\0'; @@ -1343,13 +1343,20 @@ char *votestring(int type, const char *arg1, const char *arg2, const char *arg3) case SA_MAP: { int n = atoi(arg2); + string timestr = ""; + if(arg3 && arg3[0]) + { + int time = atoi(arg3); + if(time > 0 && time != defaultgamelimit(n)) formatstring(timestr)(" for %d minutes", time); + } + if ( n >= GMODE_NUM ) { - formatstring(out)(msg, arg1, modestr(n, modeacronyms > 0)," (in the next game)", arg3); + formatstring(out)(msg, arg1, modestr(n, modeacronyms > 0)," (in the next game)", timestr); } else { - formatstring(out)(msg, arg1, modestr(n, modeacronyms > 0), "", arg3); + formatstring(out)(msg, arg1, modestr(n, modeacronyms > 0), "", timestr); } break; } diff --git a/source/src/protocol.cpp b/source/src/protocol.cpp index 85045370..210b1f53 100644 --- a/source/src/protocol.cpp +++ b/source/src/protocol.cpp @@ -317,6 +317,8 @@ const char *modestr(int n, bool acronyms) { return acronyms ? acronymmodestr (n) const char *voteerrorstr(int n) { return (n>=0 && (size_t)n < sizeof(voteerrors)/sizeof(voteerrors[0])) ? voteerrors[n] : "unknown"; } const char *mmfullname(int n) { return (n>=0 && n < MM_NUM) ? mmfullnames[n] : "unknown"; } +int defaultgamelimit(int gamemode) { return m_teammode ? 15 : 10; } + static const int msgsizes[] = // size inclusive message token, 0 for variable or not-checked sizes { SV_SERVINFO, 5, SV_WELCOME, 2, SV_INITCLIENT, 0, SV_POS, 0, SV_POSC, 0, SV_POSN, 0, SV_TEXT, 0, SV_TEAMTEXT, 0, SV_TEXTME, 0, SV_TEAMTEXTME, 0, SV_TEXTPRIVATE, 0, diff --git a/source/src/protos.h b/source/src/protos.h index 3fab02c6..1c51fba4 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -753,6 +753,7 @@ extern int stringsort(const char **a, const char **b); // protocol [client and server] extern const char *acronymmodestr(int n); extern const char *fullmodestr(int n); +extern int defaultgamelimit(int gamemode); // crypto // for AUTH extern void genprivkey(const char *seed, vector &privstr, vector &pubstr); diff --git a/source/src/server.cpp b/source/src/server.cpp index 93eae954..c71e86e6 100644 --- a/source/src/server.cpp +++ b/source/src/server.cpp @@ -1868,7 +1868,7 @@ void resetserver(const char *newname, int newmode, int newtime) smode = newmode; copystring(smapname, newname); - minremain = newtime > 0 ? newtime : (m_teammode ? 15 : 10); + minremain = newtime > 0 ? newtime : defaultgamelimit(newmode); gamemillis = 0; gamelimit = minremain*60000; arenaround = arenaroundstartmillis = 0;