else
{
self.nextthink = time + 1;
- print("Waiting for _sv_init being set to 1 by initialization scripts...\n");
+ LOG_INFO("Waiting for _sv_init being set to 1 by initialization scripts...\n");
}
}
tracebox(o, '-1 -1 -1' * i, '1 1 1' * i, o - '0 0 32768', MOVE_WORLDONLY, world);
if(trace_fraction == 1)
continue;
- print(ftos(i), " -> ", vtos(trace_endpos), "\n");
+ LOG_INFO(ftos(i), " -> ", vtos(trace_endpos), "\n");
}
break;
continue;
if(argv(0) == "cd")
{
- print("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
- print(" cdtrack ", argv(2), "\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 cd loop command in .cfg file; put this line in mapinfo instead:\n");
+ LOG_INFO(" cdtrack ", argv(2), "\n");
}
else if(argv(0) == "fog")
{
- print("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
- print(" \"fog\" \"", s, "\"\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 fog command in .cfg file; put this line in worldspawn in the .map/.bsp/.ent file instead:\n");
+ LOG_INFO(" \"fog\" \"", s, "\"\n");
}
else if(argv(0) == "set")
{
- print("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
- print(" clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
+ LOG_INFO(" clientsettemp_for_type all ", argv(1), " ", argv(2), "\n");
}
else if(argv(0) != "//")
{
- print("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
- print(" clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
+ LOG_INFO("Found ^1UNSUPPORTED^7 set command in .cfg file; put this line in mapinfo instead:\n");
+ LOG_INFO(" clientsettemp_for_type all ", argv(0), " ", argv(1), "\n");
}
}
fclose(fd);
if(currentbots || autocvar_bot_number || player_count < autocvar_minplayers)
if(autocvar_g_maplist_check_waypoints)
{
- dprint("checkwp "); dprint(map);
+ LOG_TRACE("checkwp "); LOG_TRACE(map);
if(!fexists(strcat("maps/", map, ".waypoints")))
{
- dprint(": no waypoints\n");
+ LOG_TRACE(": no waypoints\n");
return false;
}
- dprint(": has waypoints\n");
+ LOG_TRACE(": has waypoints\n");
}
// open map size restriction file
- dprint("opensize "); dprint(map);
+ LOG_TRACE("opensize "); LOG_TRACE(map);
fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
if(fh >= 0)
{
float mapmin, mapmax;
- dprint(": ok, ");
+ LOG_TRACE(": ok, ");
mapmin = stof(fgets(fh));
mapmax = stof(fgets(fh));
fclose(fh);
if(player_count < mapmin)
{
- dprint("not enough\n");
+ LOG_TRACE("not enough\n");
return false;
}
if(player_count > mapmax)
{
- dprint("too many\n");
+ LOG_TRACE("too many\n");
return false;
}
- dprint("right size\n");
+ LOG_TRACE("right size\n");
return true;
}
- dprint(": not found\n");
+ LOG_TRACE(": not found\n");
return true;
}
return 0;
}
else
- dprint( "Couldn't select '", filename, "'..\n" );
+ LOG_TRACE( "Couldn't select '", filename, "'..\n" );
return 0;
}
{
float pass, i;
- dprint("Trying MaplistMethod_Iterate\n");
+ LOG_TRACE("Trying MaplistMethod_Iterate\n");
for(pass = 1; pass <= 2; ++pass)
{
float() MaplistMethod_Repeat = // fallback method
{
- dprint("Trying MaplistMethod_Repeat\n");
+ LOG_TRACE("Trying MaplistMethod_Repeat\n");
if(Map_Check(Map_Current, 2))
return Map_Current;
{
float i, imax;
- dprint("Trying MaplistMethod_Random\n");
+ LOG_TRACE("Trying MaplistMethod_Random\n");
imax = 42;
{
float i, j, imax, insertpos;
- dprint("Trying MaplistMethod_Shuffle\n");
+ LOG_TRACE("Trying MaplistMethod_Shuffle\n");
imax = 42;
insertpos = pow(random(), 1 / exponent); // ]0, 1]
insertpos = insertpos * (Map_Count - 1); // ]0, Map_Count - 1]
insertpos = ceil(insertpos) + 1; // {2, 3, 4, ..., Map_Count}
- dprint("SHUFFLE: insert pos = ", ftos(insertpos), "\n");
+ LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos), "\n");
// insert the current map there
newlist = "";
s = strcat(s, GetGametype(), "_", GetMapname(), ":", ftos(rint(time)));
if(to_console)
- print(s, "\n");
+ LOG_INFO(s, "\n");
if(to_eventlog)
GameLogEcho(s);
s = strcat(":labels:player:", GetPlayerScoreString(world, 0));
if(to_console)
- print(s, "\n");
+ LOG_INFO(s, "\n");
if(to_eventlog)
GameLogEcho(s);
if(to_file)
s = strcat(s, "spectator:");
if(to_console)
- print(s, other.netname, "\n");
+ LOG_INFO(s, other.netname, "\n");
if(to_eventlog)
GameLogEcho(strcat(s, ftos(other.playerid), ":", other.netname));
if(to_file)
{
s = strcat(":labels:teamscores:", GetTeamScoreString(0, 0));
if(to_console)
- print(s, "\n");
+ LOG_INFO(s, "\n");
if(to_eventlog)
GameLogEcho(s);
if(to_file)
s = strcat(":teamscores:see-labels:", GetTeamScoreString(i, 0));
s = strcat(s, ":", ftos(i));
if(to_console)
- print(s, "\n");
+ LOG_INFO(s, "\n");
if(to_eventlog)
GameLogEcho(s);
if(to_file)
}
if(to_console)
- print(":end\n");
+ LOG_INFO(":end\n");
if(to_eventlog)
GameLogEcho(":end");
if(to_file)
{
// SNAFU (maybe a draw game?)
ClearWinners();
- dprint("No players, ending game.\n");
+ LOG_TRACE("No players, ending game.\n");
return WINNING_YES;
}
}
FOR_EACH_REALCLIENT(self)
{
// TODO add timer
- print("Redirecting: sending connect command to ", self.netname, "\n");
+ LOG_INFO("Redirecting: sending connect command to ", self.netname, "\n");
if(redirection_target == "self")
stuffcmd(self, "\ndisconnect; defer ", ftos(autocvar_quit_and_redirect_timer), " reconnect\n");
else
++clients_found;
}
- print("Redirecting: ", ftos(clients_found), " clients left.\n");
+ LOG_INFO("Redirecting: ", ftos(clients_found), " clients left.\n");
if(time > redirection_timeout || clients_found == 0)
localcmd("\nwait; wait; wait; quit\n");
if(world_initialized > 0)
{
world_initialized = 0;
- print("Saving persistent data...\n");
+ LOG_INFO("Saving persistent data...\n");
Ban_SaveBans();
// playerstats with unfinished match
CheatShutdown(); // must be after cheatcount check
db_close(ServerProgsDB);
db_close(TemporaryDB);
- print("done!\n");
+ LOG_INFO("done!\n");
// tell the bot system the game is ending now
bot_endgame();
}
else if(world_initialized == 0)
{
- print("NOTE: crashed before even initializing the world, not saving persistent data\n");
+ LOG_INFO("NOTE: crashed before even initializing the world, not saving persistent data\n");
}
}