This is a fork of Zandronum for TSPG.
Revisión | 37dc3489e51284193fb9be92cba092f3d7ab11e5 (tree) |
---|---|
Tiempo | 2018-03-17 01:41:51 |
Autor | ![]() |
Commiter | Sean Baggaley |
Added various branding CVars
- tspg_branding_hostnameprefix - this value will be prepended to sv_hostname whenever it is changed e.g. "[TSPG]" (space between prefix and name is added automatically)
- tspg_branding_name - name of the server chain e.g. "The Sentinel's Playground"
- tspg_branding_short - short name of the chain e.g. "TSPG"
- tspg_branding_url - link to the chain's website e.g. "allfearthesentinel.net"
@@ -81,6 +81,13 @@ | ||
81 | 81 | CVAR_UNSYNCED_USERINFO = 524288, |
82 | 82 | }; |
83 | 83 | |
84 | +// [TSPG] reduces need of wrapping everything we want to block in a macro | |
85 | +#if defined( SERVER_ONLY ) && defined( SERVER_BLACKLIST ) | |
86 | +#define TSPG_NOSET CVAR_NOSET | |
87 | +#else | |
88 | +#define TSPG_NOSET 0 | |
89 | +#endif | |
90 | + | |
84 | 91 | union UCVarValue |
85 | 92 | { |
86 | 93 | bool Bool; |
@@ -290,6 +290,10 @@ | ||
290 | 290 | CVAR( Bool, sv_forcelogintojoin, false, CVAR_ARCHIVE|CVAR_NOSETBYACS ) |
291 | 291 | CVAR( Bool, sv_useticbuffer, true, CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_DEBUGONLY ) |
292 | 292 | |
293 | +CVAR( String, tspg_branding_name, "The Sentinel's Playground", CVAR_SERVERINFO|TSPG_NOSET ); | |
294 | +CVAR( String, tspg_branding_short, "TSPG", CVAR_SERVERINFO|TSPG_NOSET ); | |
295 | +CVAR( String, tspg_branding_url, "https://allfearthesentinel.net", CVAR_SERVERINFO|TSPG_NOSET ); | |
296 | + | |
293 | 297 | // [TSPG] |
294 | 298 | #if defined( SERVER_ONLY ) && defined( SERVER_BLACKLIST ) |
295 | 299 | CUSTOM_CVAR( String, sv_adminlistfile, "adminlist.txt", CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_NOSET ) |
@@ -1354,15 +1358,18 @@ | ||
1354 | 1358 | |
1355 | 1359 | // [TSPG] |
1356 | 1360 | const char *owner = Args->CheckValue("-owner"); |
1361 | + const char *brandingName = tspg_branding_name.GetGenericRep(CVAR_String).String; | |
1362 | + const char *brandingShort = tspg_branding_short.GetGenericRep(CVAR_String).String; | |
1363 | + const char *brandingUrl = tspg_branding_url.GetGenericRep(CVAR_String).String; | |
1357 | 1364 | |
1358 | 1365 | // Send welcome message. |
1359 | 1366 | SERVER_PrintfPlayer( g_lCurrentClient, "\n" ); |
1360 | - SERVER_PrintfPlayer( g_lCurrentClient, "\\cnWelcome to \\cjThe Sentinel's Playground\\cn!\n", DOTVERSIONSTR ); | |
1367 | + SERVER_PrintfPlayer( g_lCurrentClient, "\\cnWelcome to \\cj%s\\cn!\n", brandingName ); | |
1361 | 1368 | SERVER_PrintfPlayer( g_lCurrentClient, "\\cnThis server is running \\cj%s %s (TSPGv%s)\n", GAMENAME, GetVersionStringRev(), TSPG_VERSION_STR); |
1362 | 1369 | SERVER_PrintfPlayer( g_lCurrentClient, "\\cn Compiled on \\cj%s\\cn at \\cj%s\n", __DATE__, __TIME__ ); |
1363 | 1370 | if (owner) SERVER_PrintfPlayer(g_lCurrentClient, "\\cnThis server was started by \\cj%s\\cn at \\cj%s", owner, g_pszStartupTime); |
1364 | - SERVER_PrintfPlayer(g_lCurrentClient, "\\cnIf you wish to host your own server on TSPG, visit \\cjallfearthesentinel.net\\cn!\n", owner); | |
1365 | - SERVER_PrintfPlayer(g_lCurrentClient, "\n\\cfServer information:\n", owner); | |
1371 | + SERVER_PrintfPlayer(g_lCurrentClient, "\\cnIf you wish to host your own server on %s, visit \\cj%s\\cn!\n", brandingShort, brandingUrl); | |
1372 | + SERVER_PrintfPlayer(g_lCurrentClient, "\n\\cfServer information:\n"); | |
1366 | 1373 | |
1367 | 1374 | SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, "\\cg %s\n", sv_hostname.GetGenericRep(CVAR_String).String); |
1368 | 1375 | SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " dmflags=%lu dmflags2=%lu dmflags3=%lu compatflags=%lu compatflags2=%lu\n", (LONG)dmflags, (LONG)dmflags2, (LONG)zadmflags, (LONG)compatflags, (LONG)compatflags2); |
@@ -685,9 +685,25 @@ | ||
685 | 685 | SERVERCONSOLE_UpdateBroadcasting( ); |
686 | 686 | } |
687 | 687 | |
688 | +CVAR(String, tspg_branding_hostnameprefix, "", CVAR_SERVERINFO|TSPG_NOSET); | |
689 | + | |
688 | 690 | // Name of this server on launchers. |
689 | 691 | CUSTOM_CVAR( String, sv_hostname, "Unnamed " GAMENAME " server", CVAR_ARCHIVE|CVAR_NOSETBYACS ) |
690 | 692 | { |
693 | + static bool tspgPrefixLock = false; | |
694 | + if (tspgPrefixLock) | |
695 | + { | |
696 | + tspgPrefixLock = false; | |
697 | + return; | |
698 | + } | |
699 | + | |
700 | + tspgPrefixLock = true; | |
701 | + const char *val = sv_hostname.GetGenericRep(CVAR_String).String; | |
702 | + const char *pre = tspg_branding_hostnameprefix.GetGenericRep(CVAR_String).String; | |
703 | + FString newval; | |
704 | + newval.Format("%s %s", pre, val); | |
705 | + self = newval.GetChars(); | |
706 | + | |
691 | 707 | SERVERCONSOLE_UpdateTitleString( (const char *)self ); |
692 | 708 | } |
693 | 709 |
@@ -140,7 +140,7 @@ | ||
140 | 140 | // The maximum length of one save game description for the menus. |
141 | 141 | #define SAVESTRINGSIZE 24 |
142 | 142 | |
143 | -#define TSPG_VERSION 5 | |
143 | +#define TSPG_VERSION 6 | |
144 | 144 | |
145 | 145 | #ifdef TSPG_DEBUG |
146 | 146 | #define TSPG_VERSION_STR SAVEVERSTRINGIFY(TSPG_VERSION) "-dbg" |