• 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ón475f13ff7f0474d70b0a134434b7d113b23abf70 (tree)
Tiempo2017-08-23 22:24:44
Autorcsnxs <sean@csnx...>
Commitercsnxs

Log Message

Backport server info, !music, !maplist from kpatch; add proper versioning for the TSPG build

Cambiar Resumen

Diferencia incremental

diff -r 4536c8acfef4 -r 475f13ff7f04 src/sv_main.cpp
--- a/src/sv_main.cpp Mon Aug 07 19:47:24 2017 +0100
+++ b/src/sv_main.cpp Wed Aug 23 14:24:44 2017 +0100
@@ -124,6 +124,7 @@
124124 #include "p_enemy.h"
125125 #include "network/packetarchive.h"
126126 #include "p_lnspec.h"
127+#include "maprotation.h"
127128
128129 //*****************************************************************************
129130 // MISC CRAP THAT SHOULDN'T BE HERE BUT HAS TO BE BECAUSE OF SLOPPY CODING
@@ -170,6 +171,7 @@
170171 static bool server_Puke( BYTESTREAM_s *pByteStream );
171172 static bool server_MorphCheat( BYTESTREAM_s *pByteStream );
172173 static bool server_CheckForClientMinorCommandFlood( ULONG ulClient );
174+static void SendMaplistToPlayer(ULONG ulPlayer); // [K6]
173175 static bool server_CheckJoinPassword( const FString& clientPassword );
174176 static bool server_InfoCheat( BYTESTREAM_s* pByteStream );
175177 static bool server_CheckLogin( const ULONG ulClient );
@@ -240,6 +242,9 @@
240242 // [BB] List of all sector links created by calls to Sector_SetLink.
241243 static TArray<SECTORLINK_s> g_SectorLinkList;
242244
245+// [TSPG]
246+static char *g_pszStartupTime;
247+
243248 // [RC] File to log packets to.
244249 #ifdef CREATE_PACKET_LOG
245250 static FILE *PacketLogFile = NULL;
@@ -477,6 +482,9 @@
477482
478483 sprintf( g_szCurrentFont, "SmallFont" );
479484
485+ time_t rawtime = time(NULL);
486+ g_pszStartupTime = ctime(&rawtime);
487+
480488 #ifdef CREATE_PACKET_LOG
481489
482490 // [RC] Create the packet log.
@@ -1162,6 +1170,13 @@
11621170 else
11631171 Printf( "%s: %s\n", players[ulPlayer].userinfo.GetName(), pszString );
11641172 }
1173+
1174+ if (stricmp("!music", pszString) == 0 && gamestate == GS_LEVEL)
1175+ SERVER_Printf(PRINT_HIGH, "%s\n", SERVER_GetMapMusic());
1176+
1177+ if (stricmp("!maplist", pszString) == 0)
1178+ SendMaplistToPlayer(ulPlayer);
1179+
11651180 if( sv_markchatlines && sv_logfiletimestampOldValue )
11661181 sv_logfiletimestamp = true;
11671182 }
@@ -1348,8 +1363,65 @@
13481363 // Tell the client that we're about to send him a snapshot of the level.
13491364 SERVERCOMMANDS_BeginSnapshot( g_lCurrentClient );
13501365
1366+ // [TSPG]
1367+ const char *owner = Args->CheckValue("-owner");
1368+
13511369 // Send welcome message.
1352- SERVER_PrintfPlayer( g_lCurrentClient, "Version %s Server\n", DOTVERSIONSTR );
1370+ SERVER_PrintfPlayer( g_lCurrentClient, "\n" );
1371+ SERVER_PrintfPlayer( g_lCurrentClient, "\\cnWelcome to \\cjThe Sentinel's Playground\\cn!\n", DOTVERSIONSTR );
1372+ SERVER_PrintfPlayer( g_lCurrentClient, "\\cnThis server is running \\cj%s %s (TSPGv%s)\n", GAMENAME, GetVersionStringRev(), TSPG_VERSION_STR);
1373+ SERVER_PrintfPlayer( g_lCurrentClient, "\\cn Compiled on \\cj%s\\cn at \\cj%s\n", __DATE__, __TIME__ );
1374+ if (owner) SERVER_PrintfPlayer(g_lCurrentClient, "\\cnThis server was started by \\cj%s\\cn at \\cj%s", owner, g_pszStartupTime);
1375+ SERVER_PrintfPlayer(g_lCurrentClient, "\\cnIf you wish to host your own server on TSPG, visit \\cjallfearthesentinel.net\\cn!\n", owner);
1376+ SERVER_PrintfPlayer(g_lCurrentClient, "\n\\cfServer information:\n", owner);
1377+
1378+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, "\\cg %s\n", sv_hostname.GetGenericRep(CVAR_String).String);
1379+ 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);
1380+ if (instagib)
1381+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Instagib mode\n");
1382+ if (buckshot)
1383+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Buckshot mode\n");
1384+ if ((GAMEMODE_GetFlags(GAMEMODE_GetCurrentMode()) & GMF_PLAYERSONTEAMS) || cooperative)
1385+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Team damage factor: %lu%%\n", ((LONG)teamdamage.GetGenericRep(CVAR_Float).Float * 100));
1386+ if (fraglimit)
1387+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Frag limit: %d\n", fraglimit.GetGenericRep(CVAR_Int));
1388+ if (pointlimit)
1389+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Point limit: %d\n", pointlimit.GetGenericRep(CVAR_Int));
1390+ if (winlimit)
1391+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Win limit: %d\n", winlimit.GetGenericRep(CVAR_Int));
1392+ if (duellimit)
1393+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Duel limit: %d\n", duellimit.GetGenericRep(CVAR_Int));
1394+ if (timelimit)
1395+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Time limit: %d\n", timelimit.GetGenericRep(CVAR_Int));
1396+ if (GAMEMODE_GetFlags(GAMEMODE_GetCurrentMode()) & GMF_PLAYERSONTEAMS)
1397+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " %d teams\n", sv_maxteams.GetGenericRep(CVAR_Int));
1398+
1399+ FString FSVoting;
1400+ if (sv_nocallvote.GetGenericRep(CVAR_Int).Int != 1)
1401+ {
1402+ if (!sv_nomapvote)
1403+ FSVoting.AppendFormat(" map");
1404+ if (!sv_nochangemapvote)
1405+ FSVoting.AppendFormat(" changemap");
1406+ if (!sv_nokickvote)
1407+ FSVoting.AppendFormat(" kick");
1408+ if (!sv_noduellimitvote)
1409+ FSVoting.AppendFormat(" duellimit");
1410+ if (!sv_nofraglimitvote)
1411+ FSVoting.AppendFormat(" fraglimit");
1412+ if (!sv_nopointlimitvote)
1413+ FSVoting.AppendFormat(" pointlimit");
1414+ if (!sv_notimelimitvote)
1415+ FSVoting.AppendFormat(" timelimit");
1416+ if (!sv_nowinlimitvote)
1417+ FSVoting.AppendFormat(" winlimit");
1418+ }
1419+
1420+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Voting:%s\n", FSVoting.IsEmpty() ? " off" : FSVoting.GetChars());
1421+ if (sv_coop_damagefactor != 1.0f)
1422+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, " Coop damage factor: %.2f\n", static_cast<float> (sv_coop_damagefactor));
1423+
1424+ SERVER_PrintfPlayer(PRINT_HIGH, g_lCurrentClient, "\n");
13531425
13541426 // Send consoleplayer number.
13551427 SERVERCOMMANDS_SetConsolePlayer( g_lCurrentClient );
@@ -2956,6 +3028,7 @@
29563028 // Inform the other clients that this player has been disconnected.
29573029 SERVERCOMMANDS_DisconnectPlayer( ulClient );
29583030
3031+
29593032 // Potentially back up the player's score in the game, so that if he rejoins, he hasn't
29603033 // lost everything.
29613034 if ( bSaveInfo )
@@ -6659,6 +6732,21 @@
66596732 }
66606733
66616734 //*****************************************************************************
6735+// [K6]
6736+extern std::vector<MAPROTATIONENTRY_t> g_MapRotationEntries;
6737+static void SendMaplistToPlayer(ULONG ulPlayer)
6738+{
6739+ if (g_MapRotationEntries.size() == 0)
6740+ SERVER_PrintfPlayer(PRINT_HIGH, ulPlayer, "The map rotation list is empty.\n");
6741+ else
6742+ {
6743+ SERVER_PrintfPlayer(PRINT_HIGH, ulPlayer, "Map rotation list: \n");
6744+ for (ULONG ulIdx = 0; ulIdx < g_MapRotationEntries.size(); ulIdx++)
6745+ SERVER_PrintfPlayer(PRINT_HIGH, ulPlayer, "%lu. %s - %s\n", ulIdx + 1, g_MapRotationEntries[ulIdx].pMap->mapname, g_MapRotationEntries[ulIdx].pMap->LookupLevelName().GetChars());
6746+ }
6747+}
6748+
6749+//*****************************************************************************
66626750 // CONSOLE COMMANDS
66636751
66646752 CCMD( kick_idx )
diff -r 4536c8acfef4 -r 475f13ff7f04 src/sv_master.cpp
--- a/src/sv_master.cpp Mon Aug 07 19:47:24 2017 +0100
+++ b/src/sv_master.cpp Wed Aug 23 14:24:44 2017 +0100
@@ -128,9 +128,9 @@
128128 #ifndef _WIN32
129129 struct utsname u_name;
130130 if ( uname(&u_name) < 0 )
131- g_VersionWithOS.Format ( "%s", GetVersionStringRev() ); //error, no data
131+ g_VersionWithOS.Format ( "%s (TSPGv%d)", GetVersionStringRev(), TSPG_VERSION ); //error, no data
132132 else
133- g_VersionWithOS.Format ( "%s on %s %s", GetVersionStringRev(), u_name.sysname, u_name.release ); // "Linux 2.6.32.5-amd64" or "FreeBSD 9.0-RELEASE" etc
133+ g_VersionWithOS.Format ( "%s (TSPGv%d) on %s %s", GetVersionStringRev(), TSPG_VERSION, u_name.sysname, u_name.release ); // "Linux 2.6.32.5-amd64" or "FreeBSD 9.0-RELEASE" etc
134134 #endif
135135
136136 // [TP] Which wads will we broadcast as optional to launchers?
diff -r 4536c8acfef4 -r 475f13ff7f04 src/version.h
--- a/src/version.h Mon Aug 07 19:47:24 2017 +0100
+++ b/src/version.h Wed Aug 23 14:24:44 2017 +0100
@@ -140,4 +140,12 @@
140140 // The maximum length of one save game description for the menus.
141141 #define SAVESTRINGSIZE 24
142142
143+#define TSPG_VERSION 2
144+
145+#if defined(_DEBUG) || defined(NDEBUG)
146+#define TSPG_VERSION_STR SAVEVERSTRINGIFY(TSPG_VERSION) "-dbg"
147+#else
148+#define TSPG_VERSION_STR SAVEVERSTRINGIFY(TSPG_VERSION)
149+#endif
150+
143151 #endif //__VERSION_H__
diff -r 4536c8acfef4 -r 475f13ff7f04 src/win32/i_system.cpp
--- a/src/win32/i_system.cpp Mon Aug 07 19:47:24 2017 +0100
+++ b/src/win32/i_system.cpp Wed Aug 23 14:24:44 2017 +0100
@@ -659,7 +659,7 @@
659659 info.dwMajorVersion, info.dwMinorVersion,
660660 info.dwBuildNumber & 0xffff, info.szCSDVersion);
661661 // [K6/BB]
662- g_VersionWithOS.Format ( "%s on Windows %s (%lu.%lu.%lu)", GetVersionStringRev(), osname,
662+ g_VersionWithOS.Format ( "%s (TSPGv%s) on Windows %s (%lu.%lu.%lu)", GetVersionStringRev(), TSPG_VERSION_STR, osname,
663663 info.dwMajorVersion, info.dwMinorVersion,
664664 info.dwBuildNumber & 0xffff);
665665 }
@@ -670,7 +670,7 @@
670670 info.dwMajorVersion, info.dwMinorVersion,
671671 info.dwBuildNumber, info.szCSDVersion);
672672 // [K6/BB]
673- g_VersionWithOS.Format ( "%s on Windows %s (%lu.%lu.%lu)", GetVersionStringRev(), osname,
673+ g_VersionWithOS.Format ( "%s (TSPGv%s) on Windows %s (%lu.%lu.%lu)", GetVersionStringRev(), TSPG_VERSION_STR, osname,
674674 info.dwMajorVersion, info.dwMinorVersion,
675675 info.dwBuildNumber);
676676 }