modeacronmys used client-wide
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1959 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
int nextmode = 0; // nextmode becomes gamemode after next map load
|
||||
VAR(gamemode, 1, 0, 0);
|
||||
VARP(modeacronyms, 0, 0, 1);
|
||||
|
||||
flaginfo flaginfos[2];
|
||||
|
||||
@@ -569,7 +570,7 @@ void startmap(const char *name) // called just after a map load
|
||||
showscores(false);
|
||||
intermission = false;
|
||||
minutesremaining = -1;
|
||||
if(*clientmap) conoutf("game mode is \"%s\"", modestr(gamemode));
|
||||
if(*clientmap) conoutf("game mode is \"%s\"", modestr(gamemode, modeacronyms));
|
||||
if(firstrun && name && name[0])
|
||||
{
|
||||
execfile("config/firstrun.cfg");
|
||||
@@ -672,7 +673,7 @@ char *votestring(int type, char *arg1, char *arg2)
|
||||
s_sprintf(out)(msg, atoi(arg1) == 0 ? "disable" : "enable");
|
||||
break;
|
||||
case SA_MAP:
|
||||
s_sprintf(out)(msg, arg1, modestr(atoi(arg2)));
|
||||
s_sprintf(out)(msg, arg1, modestr(atoi(arg2), modeacronyms));
|
||||
break;
|
||||
default:
|
||||
s_sprintf(out)(msg, arg1, arg2);
|
||||
|
||||
@@ -93,7 +93,7 @@ void filtertext(char *dst, const char *src, bool whitespace, int len)
|
||||
*dst = '\0';
|
||||
}
|
||||
|
||||
const char *modenames[] =
|
||||
const char *modefullnames[] =
|
||||
{
|
||||
"team deathmatch", "coopedit", "deathmatch", "survivor",
|
||||
"team survivor", "ctf", "pistol frenzy", "bot team deathmatch", "bot deathmatch", "last swiss standing",
|
||||
@@ -108,8 +108,9 @@ const char *modeacronymnames[] =
|
||||
|
||||
const char *voteerrors[] = { "voting is currently disabled", "there is already a vote pending", "already voted", "can't vote that often", "this vote is not allowed in the current environment (singleplayer/multiplayer)" };
|
||||
|
||||
const char *modestr(int n) { return (n>=0 && (size_t)n < sizeof(modenames)/sizeof(modenames[0])) ? modenames[n] : "unknown"; }
|
||||
const char *acronymmodestr(int n) { return (n>=0 && (size_t)n < sizeof(modeacronymnames)/sizeof(modeacronymnames[0])) ? modeacronymnames[n] : "unknown"; }
|
||||
const char *fullmodestr(int n) { return (n>=0 && (size_t)n < sizeof(modefullnames)/sizeof(modefullnames[0])) ? modefullnames[n] : "unknown"; }
|
||||
const char *acronymmodestr(int n) { return (n>=0 && (size_t)n < sizeof(modeacronymnames)/sizeof(modeacronymnames[0])) ? modeacronymnames[n] : "n/a"; }
|
||||
const char *modestr(int n, bool acronyms) { return acronyms ? acronymmodestr (n) : fullmodestr(n); }
|
||||
const char *voteerrorstr(int n) { return (n>=0 && (size_t)n < sizeof(voteerrors)/sizeof(voteerrors[0])) ? voteerrors[n] : "unknown"; }
|
||||
|
||||
char msgsizesl[] = // size inclusive message token, 0 for variable or not-checked sizes
|
||||
|
||||
+2
-2
@@ -521,9 +521,9 @@ extern void scrolldoc(int i);
|
||||
#endif
|
||||
|
||||
// server
|
||||
extern int modeacronyms;
|
||||
extern void localservertoclient(int chan, uchar *buf, int len);
|
||||
extern const char *modestr(int n);
|
||||
extern const char *acronymmodestr(int n);
|
||||
extern const char *modestr(int n, bool acronyms = false);
|
||||
extern const char *voteerrorstr(int n);
|
||||
extern void fatal(const char *s, ...);
|
||||
extern void initserver(bool dedicated, int uprate, const char *sdesc, const char *ip, int port, const char *master, const char *passwd, int maxcl, const char *maprot, const char *adminpwd, const char *srvmsg, int scthreshold);
|
||||
|
||||
@@ -137,7 +137,7 @@ void renderscores(void *menu, bool init)
|
||||
if(getclientmap()[0])
|
||||
{
|
||||
bool fldrprefix = !strncmp(getclientmap(), "maps/", strlen("maps/"));
|
||||
s_sprintf(modeline)("\"%s\" on map %s", modestr(gamemode), fldrprefix ? getclientmap()+strlen("maps/") : getclientmap());
|
||||
s_sprintf(modeline)("\"%s\" on map %s", modestr(gamemode, modeacronyms), fldrprefix ? getclientmap()+strlen("maps/") : getclientmap());
|
||||
}
|
||||
|
||||
extern int minutesremaining;
|
||||
|
||||
@@ -457,8 +457,6 @@ int sicompare(serverinfo **ap, serverinfo **bp)
|
||||
|
||||
void *servmenu = NULL;
|
||||
|
||||
VARP(modeacronyms, 0, 0, 1);
|
||||
|
||||
void refreshservers(void *menu, bool init)
|
||||
{
|
||||
if(init)
|
||||
@@ -480,7 +478,7 @@ void refreshservers(void *menu, bool init)
|
||||
if(si.address.host != ENET_HOST_ANY && si.ping != 9999)
|
||||
{
|
||||
if(si.protocol!=PROTOCOL_VERSION) s_sprintf(si.full)("%s:%d [%s protocol]", si.name, si.port, si.protocol<PROTOCOL_VERSION ? "older" : "newer");
|
||||
else if(si.map[0]) s_sprintf(si.full)("%d\t%d/%d\t%s, %s: %s:%d %s", si.ping, si.numplayers, si.maxclients, si.map, modeacronyms ? acronymmodestr(si.mode) : modestr(si.mode), si.name, si.port, si.sdesc);
|
||||
else if(si.map[0]) s_sprintf(si.full)("%d\t%d/%d\t%s, %s: %s:%d %s", si.ping, si.numplayers, si.maxclients, si.map, modestr(si.mode, modeacronyms), si.name, si.port, si.sdesc);
|
||||
else s_sprintf(si.full)("%d\t%d/%d\tempty: %s:%d %s", si.ping, si.numplayers, si.maxclients, si.name, si.port, si.sdesc);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user