[nexuiz-commits] r6244 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Mar 21 18:12:11 EDT 2009
Author: div0
Date: 2009-03-21 18:12:11 -0400 (Sat, 21 Mar 2009)
New Revision: 6244
Modified:
trunk/data/qcsrc/server/extensions.qh
trunk/data/qcsrc/server/gamecommand.qc
Log:
DP_QC_GETTIME, sv_cmd time
Modified: trunk/data/qcsrc/server/extensions.qh
===================================================================
--- trunk/data/qcsrc/server/extensions.qh 2009-03-21 20:47:35 UTC (rev 6243)
+++ trunk/data/qcsrc/server/extensions.qh 2009-03-21 22:12:11 UTC (rev 6244)
@@ -763,6 +763,19 @@
//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo
//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component.
+//DP_QC_GETTIME
+//idea: tZork
+//darkplaces implementation: tZork, div0
+//constant definitions:
+float GETTIME_FRAMESTART = 0; // time of start of frame
+float GETTIME_REALTIME = 1; // current time (may be OS specific)
+float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
+float GETTIME_UPTIME = 3; // time since start of the engine
+//builtin definitions:
+float(float tmr) gettime = #519;
+//description:
+//some timers to query...
+
//DP_QC_MINMAXBOUND
//idea: LordHavoc
//darkplaces implementation: LordHavoc
Modified: trunk/data/qcsrc/server/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/server/gamecommand.qc 2009-03-21 20:47:35 UTC (rev 6243)
+++ trunk/data/qcsrc/server/gamecommand.qc 2009-03-21 22:12:11 UTC (rev 6244)
@@ -859,6 +859,18 @@
return;
}
+ if(argv(0) == "time")
+ {
+ print("time = ", ftos(time), "\n");
+ print("frame start = ", ftos(gettime(GETTIME_FRAMESTART)), "\n");
+ print("realtime = ", ftos(gettime(GETTIME_REALTIME)), "\n");
+ print("hires = ", ftos(gettime(GETTIME_HIRES)), "\n");
+ print("uptime = ", ftos(gettime(GETTIME_UPTIME)), "\n");
+ print("localtime = ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y"), "\n");
+ print("gmtime = ", strftime(FALSE, "%a %b %e %H:%M:%S %Z %Y"), "\n");
+ return;
+ }
+
print("Invalid command. For a list of supported commands, try sv_cmd help.\n");
}
More information about the nexuiz-commits
mailing list