r2953 - in trunk/data/qcsrc: common menu-div0test server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Nov 15 08:22:19 EST 2007
Author: div0
Date: 2007-11-15 08:22:18 -0500 (Thu, 15 Nov 2007)
New Revision: 2953
Modified:
trunk/data/qcsrc/common/mapinfo.qc
trunk/data/qcsrc/menu-div0test/menu.qc
trunk/data/qcsrc/server/gamecommand.qc
Log:
Prepare a "building map information" screen in menu; make server command "sv_cmd make_mapinfo" so a dedicated server can be instructed to build all mapinfos too.
Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc 2007-11-15 10:39:22 UTC (rev 2952)
+++ trunk/data/qcsrc/common/mapinfo.qc 2007-11-15 13:22:18 UTC (rev 2953)
@@ -88,7 +88,7 @@
_MapInfo_filtered = MapInfo_FilterGametype_Recursive(gametype, 0, _MapInfo_globcount);
if(!_MapInfo_filtered)
{
- dprint("Autogenerated a .mapinfo, bailing out to avoid loop counter\n");
+ dprint("Autogenerated a .mapinfo, doing the rest later.\n");
return 0;
}
_MapInfo_filtered = strzone(_MapInfo_filtered);
Modified: trunk/data/qcsrc/menu-div0test/menu.qc
===================================================================
--- trunk/data/qcsrc/menu-div0test/menu.qc 2007-11-15 10:39:22 UTC (rev 2952)
+++ trunk/data/qcsrc/menu-div0test/menu.qc 2007-11-15 13:22:18 UTC (rev 2953)
@@ -18,7 +18,12 @@
void() m_init =
{
dprint_load();
+}
+void() m_init_delayed =
+{
+ dprint_load();
+
menuLoadedMaplist = 0;
MapInfo_Enumerate();
if(!MapInfo_FilterGametype(MAPINFO_TYPE_ALL))
@@ -113,7 +118,8 @@
float realFrametime;
if(!menuLoadedMaplist)
{
- m_init();
+ // TODO draw an info image about this situation
+ m_init_delayed();
return;
}
t = gettime();
Modified: trunk/data/qcsrc/server/gamecommand.qc
===================================================================
--- trunk/data/qcsrc/server/gamecommand.qc 2007-11-15 10:39:22 UTC (rev 2952)
+++ trunk/data/qcsrc/server/gamecommand.qc 2007-11-15 13:22:18 UTC (rev 2953)
@@ -1,5 +1,20 @@
string GotoMap(string m);
+void make_mapinfo_Think()
+{
+ MapInfo_Enumerate(); // just in case
+ if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL))
+ {
+ print("Done rebuiling mapinfos.\n");
+ remove(self);
+ }
+ else
+ {
+ self.think = make_mapinfo_Think;
+ self.nextthink = time;
+ }
+}
+
void GameCommand(string command)
{
float argc;
@@ -11,6 +26,7 @@
print(" adminmsg clientnumber \"message\"\n");
print(" teamstatus\n");
print(" printstats\n");
+ print(" make_mapinfo\n");
GameCommand_Ban("help");
GameCommand_Generic("help");
return;
@@ -34,6 +50,16 @@
return;
}
+ if(argv(0) == "make-mapinfo")
+ {
+ entity e;
+ e = spawn();
+ e.classname = "make_mapinfo";
+ e.think = make_mapinfo_Think;
+ e.nextthink = time;
+ return;
+ }
+
if(argv(0) == "warp") if(argc == 2) if(cvar("g_campaign"))
{
CampaignLevelWarp(stof(argv(1)));
More information about the nexuiz-commits
mailing list