extern const char *buildstring;
const char *buildstring =
-#ifndef NO_BUILD_TIMESTAMPS
-__TIME__ " " __DATE__ " "
-#endif
-#ifdef SVNREVISION
-STRINGIFY(SVNREVISION)
+#ifdef VCREVISION
+STRINGIFY(VCREVISION)
#else
"-"
#endif
+#ifndef NO_BUILD_TIMESTAMPS
+//" " __TIME__
+" " __DATE__
+#endif
#ifdef BUILDTYPE
" " STRINGIFY(BUILDTYPE)
#endif
fpsmax = cls.td_onesecondmaxfps;
// LadyHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max
Con_Printf("%i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
- Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | run %d | result %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), buildstring, cls.demoname, cmdline.string, benchmark_runs + 1, frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
+ Log_Printf("benchmark.log", "date %s | enginedate %s | demo %s | commandline %s | run %d | result %i frames %5.7f seconds %5.7f fps, one-second fps min/avg/max: %.0f %.0f %.0f (%i seconds)\n", Sys_TimeString("%Y-%m-%d %H:%M:%S"), engineversion, cls.demoname, cmdline.string, benchmark_runs + 1, frames, time, totalfpsavg, fpsmin, fpsavg, fpsmax, cls.td_onesecondavgcount);
if (Sys_CheckParm("-benchmark"))
{
++benchmark_runs;
static void Host_Version_f(cmd_state_t *cmd)
{
- Con_Printf("Version: %s build %s\n", gamename, buildstring);
+ Con_Printf("Version: %s\n", engineversion);
}
static void Host_Framerate_c(cvar_t *var)
static void Host_Init (void)
{
int i;
- const char* os;
char vabuf[1024];
host.hook.ConnectLocal = NULL;
FS_Init();
// construct a version string for the corner of the console
- os = DP_OS_NAME;
- dpsnprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
+ dpsnprintf (engineversion, sizeof (engineversion), "%s %s%s, buildstring: %s", gamename, DP_OS_NAME, cls.state == ca_dedicated ? " dedicated" : "", buildstring);
Con_Printf("%s\n", engineversion);
// initialize process nice level
# Link
-LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -DSVNREVISION=`{ test -d .svn && svnversion; } || { test -d .git && git describe --always; } || echo -` -DBUILDTYPE=debug
-LDFLAGS_PROFILE=-g -pg -fprofile-arcs $(OPTIM_RELEASE) -DSVNREVISION=`{ test -d .svn && svnversion; } || { test -d .git && git describe --always; } || echo -` -DBUILDTYPE=profile
-LDFLAGS_RELEASE=$(OPTIM_RELEASE) -DSVNREVISION=`{ test -d .svn && svnversion; } || { test -d .git && git describe --always; } || echo -` -DBUILDTYPE=release
+
+# not checking for .git directory before running `git describe` because that would stop it working in a subdirectory
+VCREVISION=$(shell { test -d .svn && svnversion; } || git describe --always --dirty='~' 2>/dev/null || echo -)
+
+LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -DVCREVISION=$(VCREVISION) -DBUILDTYPE=debug
+LDFLAGS_PROFILE=-g -pg -fprofile-arcs $(OPTIM_RELEASE) -DVCREVISION=$(VCREVISION) -DBUILDTYPE=profile
+LDFLAGS_RELEASE=$(OPTIM_RELEASE) -DVCREVISION=$(VCREVISION) -DBUILDTYPE=release
##### UNIX specific variables #####
for (players = 0, i = 0;i < svs.maxclients;i++)
if (svs.clients[i].active)
players++;
+
print ("host: %s\n", Cvar_VariableString (&cvars_all, "hostname", CF_SERVER));
- print ("version: %s build %s (gamename %s)\n", gamename, buildstring, gamenetworkfiltername);
+ print ("version: %s\n", engineversion);
print ("protocol: %i (%s)\n", Protocol_NumberForEnum(sv.protocol), Protocol_NameForEnum(sv.protocol));
print ("map: %s\n", sv.name);
print ("timing: %s\n", SV_TimingReport(vabuf, sizeof(vabuf)));
SZ_Clear (&client->netconnection->message);
MSG_WriteByte (&client->netconnection->message, svc_print);
- dpsnprintf (message, sizeof (message), "\nServer: %s build %s (progs %i crc)\n", gamename, buildstring, prog->filecrc);
+ dpsnprintf (message, sizeof (message), "\nServer: %s (progs %i crc)\n", engineversion, prog->filecrc);
MSG_WriteString (&client->netconnection->message,message);
SV_StopDemoRecording(client); // to split up demos into different files