map vote message fixed (when using custom game times)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6999 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lucas GAUTHERON
2012-12-27 10:41:42 +00:00
parent 54d4d949e4
commit ff4bb6c8e5
4 changed files with 14 additions and 4 deletions
+10 -3
View File
@@ -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;
}
+2
View File
@@ -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,
+1
View File
@@ -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<char> &privstr, vector<char> &pubstr);
+1 -1
View File
@@ -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;