Skip to content

Commit

Permalink
ABOUT: Further changes to version display
Browse files Browse the repository at this point in the history
  • Loading branch information
deurk committed Apr 16, 2020
1 parent 2d0b997 commit 12629b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
20 changes: 10 additions & 10 deletions include/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,39 @@

#if defined(_WIN32)
#define QW_PLATFORM "Windows"
#define QW_PLATFORM_SHORT "(w)"
#define QW_PLATFORM_SHORT "w"

#elif defined(__FreeBSD__)
#define QW_PLATFORM "FreeBSD"
#define QW_PLATFORM_SHORT "(f)"
#define QW_PLATFORM_SHORT "f"

#elif defined(__OpenBSD__)
#define QW_PLATFORM "OpenBSD"
#define QW_PLATFORM_SHORT "(o)"
#define QW_PLATFORM_SHORT "o"

#elif defined(__NetBSD__)
#define QW_PLATFORM "NetBSD"
#define QW_PLATFORM_SHORT "(n)"
#define QW_PLATFORM_SHORT "n"

#elif defined(__DragonFly__)
#define QW_PLATFORM "DragonFly"
#define QW_PLATFORM_SHORT "(d)"
#define QW_PLATFORM_SHORT "d"

#elif defined(__linux__)
#define QW_PLATFORM "Linux"
#define QW_PLATFORM_SHORT "(l)"
#define QW_PLATFORM_SHORT "l"

#elif defined(__sun__)
#define QW_PLATFORM "SunOS"
#define QW_PLATFORM_SHORT "(s)"
#define QW_PLATFORM_SHORT "s"

#elif defined(__APPLE__)
#define QW_PLATFORM "MacOS"
#define QW_PLATFORM_SHORT "(m)"
#define QW_PLATFORM_SHORT "m"

#else
#define QW_PLATFORM "Unknown"
#define QW_PLATFORM_SHORT "(u)"
#define QW_PLATFORM_SHORT "u"
#endif

#define MOD_NAME ("KTX")
Expand All @@ -82,7 +82,7 @@
#define MOD_SERVERINFO_DATE_KEY ("ktxdate")
#define MOD_SERVERINFO_URL_KEY ("ktxurl")
#define MOD_URL ("https://github.com/deurk/ktx")
#define GIT_COMMIT ("unknown")
#define GIT_COMMIT ("")

// qqshka - hmm, seems in C this is macros
#undef max
Expand Down
6 changes: 5 additions & 1 deletion src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1410,13 +1410,17 @@ void ShowVersion()

G_sprint(self, 2, "\n%s\n", redtext("SERVER:"));
G_sprint(self, 2, "%s\n", cvar_string("version"));
// mvdsvdate and mvdsvurl keys for now, but maybe should be srvdate and srvurl if any other server can support ktx (is it still the case?)
if (strlen(ezinfokey(world, "mvdsvdate")))
G_sprint(self, 2, "Build date: %s\n", ezinfokey(world, "mvdsvdate"));
if (strlen(ezinfokey(world, "mvdsvurl")))
G_sprint(self, 2, "Home Page: %s\n", redtext(ezinfokey(world, "mvdsvurl")));

G_sprint(self, 2, "\n%s\n", redtext("MOD:"));
G_sprint(self, 2, ("%s %s (%s build %s)\n"), MOD_NAME, MOD_VERSION, QW_PLATFORM, GIT_COMMIT);
G_sprint(self, 2, ("%s %s "), MOD_NAME, MOD_VERSION);
if (strlen(GIT_COMMIT))
G_sprint(self, 2, ("(build %s/%s)"), GIT_COMMIT, QW_PLATFORM_SHORT);
G_sprint(self, 2, ("\n"));
G_sprint(self, 2, "Build date: %s\n", MOD_BUILD_DATE);
G_sprint(self, 2, "Home Page: %s\n", redtext(MOD_URL));

Expand Down
2 changes: 1 addition & 1 deletion src/motd.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void PMOTDThink()

strlcat(buf, "\n\235\236\236\236\236\236\236\236\236\236\236\236\236\236\236\237\n\n", sizeof(buf));
strlcat(buf, va("Running %s %s\n%s\n\n", redtext(MOD_NAME), dig3s("%s", MOD_VERSION), redtext(MOD_URL)), sizeof(buf));
strlcat(buf, va("Type \"%s\" for help on available commands", redtext("commands")), sizeof(buf));
strlcat(buf, va("Type \"%s\" for help\non available commands", redtext("commands")), sizeof(buf));

G_centerprint ( PROG_TO_EDICT( self->s.v.owner ), "%s", buf);

Expand Down

0 comments on commit 12629b0

Please sign in to comment.