• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonrubyphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

This is a fork of Zandronum for TSPG.


Commit MetaInfo

Revisión37dc3489e51284193fb9be92cba092f3d7ab11e5 (tree)
Tiempo2018-03-17 01:41:51
AutorSean Baggaley <sean@csnx...>
CommiterSean Baggaley

Log Message

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"

Cambiar Resumen

Diferencia incremental

diff -r 637a1b77fcf7 -r 37dc3489e512 src/c_cvars.h
--- a/src/c_cvars.h Fri Mar 16 07:40:18 2018 +0000
+++ b/src/c_cvars.h Fri Mar 16 16:41:51 2018 +0000
@@ -81,6 +81,13 @@
8181 CVAR_UNSYNCED_USERINFO = 524288,
8282 };
8383
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+
8491 union UCVarValue
8592 {
8693 bool Bool;
diff -r 637a1b77fcf7 -r 37dc3489e512 src/sv_main.cpp
--- a/src/sv_main.cpp Fri Mar 16 07:40:18 2018 +0000
+++ b/src/sv_main.cpp Fri Mar 16 16:41:51 2018 +0000
@@ -290,6 +290,10 @@
290290 CVAR( Bool, sv_forcelogintojoin, false, CVAR_ARCHIVE|CVAR_NOSETBYACS )
291291 CVAR( Bool, sv_useticbuffer, true, CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_DEBUGONLY )
292292
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+
293297 // [TSPG]
294298 #if defined( SERVER_ONLY ) && defined( SERVER_BLACKLIST )
295299 CUSTOM_CVAR( String, sv_adminlistfile, "adminlist.txt", CVAR_ARCHIVE|CVAR_NOSETBYACS|CVAR_NOSET )
@@ -1354,15 +1358,18 @@
13541358
13551359 // [TSPG]
13561360 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;
13571364
13581365 // Send welcome message.
13591366 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 );
13611368 SERVER_PrintfPlayer( g_lCurrentClient, "\\cnThis server is running \\cj%s %s (TSPGv%s)\n", GAMENAME, GetVersionStringRev(), TSPG_VERSION_STR);
13621369 SERVER_PrintfPlayer( g_lCurrentClient, "\\cn Compiled on \\cj%s\\cn at \\cj%s\n", __DATE__, __TIME__ );
13631370 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");
13661373
13671374 SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, "\\cg %s\n", sv_hostname.GetGenericRep(CVAR_String).String);
13681375 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);
diff -r 637a1b77fcf7 -r 37dc3489e512 src/sv_master.cpp
--- a/src/sv_master.cpp Fri Mar 16 07:40:18 2018 +0000
+++ b/src/sv_master.cpp Fri Mar 16 16:41:51 2018 +0000
@@ -685,9 +685,25 @@
685685 SERVERCONSOLE_UpdateBroadcasting( );
686686 }
687687
688+CVAR(String, tspg_branding_hostnameprefix, "", CVAR_SERVERINFO|TSPG_NOSET);
689+
688690 // Name of this server on launchers.
689691 CUSTOM_CVAR( String, sv_hostname, "Unnamed " GAMENAME " server", CVAR_ARCHIVE|CVAR_NOSETBYACS )
690692 {
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+
691707 SERVERCONSOLE_UpdateTitleString( (const char *)self );
692708 }
693709
diff -r 637a1b77fcf7 -r 37dc3489e512 src/version.h
--- a/src/version.h Fri Mar 16 07:40:18 2018 +0000
+++ b/src/version.h Fri Mar 16 16:41:51 2018 +0000
@@ -140,7 +140,7 @@
140140 // The maximum length of one save game description for the menus.
141141 #define SAVESTRINGSIZE 24
142142
143-#define TSPG_VERSION 5
143+#define TSPG_VERSION 6
144144
145145 #ifdef TSPG_DEBUG
146146 #define TSPG_VERSION_STR SAVEVERSTRINGIFY(TSPG_VERSION) "-dbg"