e.bgmscriptline = e.bgmscriptline0 = i;
if(i >= bgmscriptbufsize)
{
- printf("ERROR: bgmscript does not define %s\n", e.bgmscript);
+ LOG_INFOF("ERROR: bgmscript does not define %s\n", e.bgmscript);
strunzone(e.bgmscript);
e.bgmscript = string_null;
}
blurtest_time1 = time + stof(argv(1));
blurtest_radius = stof(argv(2));
blurtest_power = stof(argv(3));
- print("Enabled blurtest\n");
+ LOG_INFO("Enabled blurtest\n");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd blurtest\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
#else
if(request)
{
- print("Blurtest is not enabled on this client.\n");
+ LOG_INFO("Blurtest is not enabled on this client.\n");
return;
}
#endif
}
default:
- print("Incorrect parameters for ^2boxparticles^7\n");
+ LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
- print(" 'effectname' is the name of a particle effect in effectinfo.txt\n");
- print(" 'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
- print(" 'org_from' is the starting origin of the box\n");
- print(" 'org_to' is the ending origin of the box\n");
- print(" 'dir_from' is the minimum velocity\n");
- print(" 'dir_to' is the maximum velocity\n");
- print(" 'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
- print(" 'flags' can contain:\n");
- print(" 1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
- print(" 2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
- print(" 4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
- print(" 128 to draw a trail, not a box\n");
+ LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
+ LOG_INFO(" 'effectname' is the name of a particle effect in effectinfo.txt\n");
+ LOG_INFO(" 'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
+ LOG_INFO(" 'org_from' is the starting origin of the box\n");
+ LOG_INFO(" 'org_to' is the ending origin of the box\n");
+ LOG_INFO(" 'dir_from' is the minimum velocity\n");
+ LOG_INFO(" 'dir_to' is the maximum velocity\n");
+ LOG_INFO(" 'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
+ LOG_INFO(" 'flags' can contain:\n");
+ LOG_INFO(" 1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
+ LOG_INFO(" 2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
+ LOG_INFO(" 4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
+ LOG_INFO(" 128 to draw a trail, not a box\n");
return;
}
}
fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
fputs(fh, "}\n");
- print("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+ LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
fclose(fh);
}
else
{
- print("^1Error: ^7Could not dump to file!\n");
+ LOG_INFO("^1Error: ^7Could not dump to file!\n");
}
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd create_scrshot_ent\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd debugmodel model\n");
- print(" Where 'model' is a string of the model name to use for the debug model.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
+ LOG_INFO(" Where 'model' is a string of the model name to use for the debug model.\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2handlevote^7\n");
+ LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd handlevote vote\n");
- print(" Where 'vote' is the selection for either the current poll or uid2name.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
+ LOG_INFO(" Where 'vote' is the selection for either the current poll or uid2name.\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2hud^7\n");
+ LOG_INFO("Incorrect parameters for ^2hud^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
- print(" Where 'action' is the command to complete,\n");
- print(" 'configname' is the name to save to for \"save\" action,\n");
- print(" 'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
- print(" and 'layout' is how to organize the scoreboard columns for the set action.\n");
- print(" Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+ LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
+ LOG_INFO(" Where 'action' is the command to complete,\n");
+ LOG_INFO(" 'configname' is the name to save to for \"save\" action,\n");
+ LOG_INFO(" 'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
+ LOG_INFO(" and 'layout' is how to organize the scoreboard columns for the set action.\n");
+ LOG_INFO(" Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2localprint^7\n");
+ LOG_INFO("Incorrect parameters for ^2localprint^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd localprint \"message\"\n");
- print(" 'message' is the centerprint message to send to yourself.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
+ LOG_INFO(" 'message' is the centerprint message to send to yourself.\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2mv_download^7\n");
+ LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd mv_download mapid\n");
- print(" Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
+ LOG_INFO(" Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
return;
}
}
entity client;
for(client = world; (client = find(client, classname, argv(1))); )
- print(etos(client), "\n");
+ LOG_INFO(etos(client), "\n");
return;
}
default:
- print("Incorrect parameters for ^2find^7\n");
+ LOG_INFO("Incorrect parameters for ^2find^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd find classname\n");
- print(" Where 'classname' is the classname to search for.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
+ LOG_INFO(" Where 'classname' is the classname to search for.\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2sendcvar^7\n");
+ LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
- print(" Where 'cvar' is the cvar plus arguments to send to the server.\n");
+ LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
+ LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server.\n");
return;
}
}
void LocalCommand_macro_help()
{
#define CLIENT_COMMAND(name,function,description) \
- { if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } }
+ { if(strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
CLIENT_COMMANDS(0, 0);
#undef CLIENT_COMMAND
{
if(argc == 1)
{
- print("\nClient console commands:\n");
+ LOG_INFO("\nClient console commands:\n");
LocalCommand_macro_help();
- print("\nGeneric commands shared by all programs:\n");
+ LOG_INFO("\nGeneric commands shared by all programs:\n");
GenericCommand_macro_help();
- print("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
- print("For help about a specific command, type cl_cmd help COMMAND\n");
+ LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
+ LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
return;
}
) return;
// nothing above caught the command, must be invalid
- print(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
+ LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
return;
}
self.forceplayermodels_isgoodmodel = fexists(self.forceplayermodels_savemodel);
self.forceplayermodels_isgoodmodel_mdl = self.forceplayermodels_savemodel;
if(!self.forceplayermodels_isgoodmodel)
- printf("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
+ LOG_INFOF("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
}
}
void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
}
- printf("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
+ LOG_INFOF("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
return f;
}
void CSQCPlayer_FallbackFrame_Apply(void)
// we need to prevent this from 'appening
self.tag_entity = world;
self.drawmask = 0;
- dprint("h_ model lacks weapon attachment, but v_ model is attached to it\n");
+ LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it\n");
}
}
else if(self.tag_entity.isplayermodel)
{
vote_yescount = 0;
vote_nocount = 0;
- print(_("^1You must answer before entering hud configure mode\n"));
+ LOG_INFO(_("^1You must answer before entering hud configure mode\n"));
cvar_set("_hud_configure", "0");
}
if(vote_called_vote)
}
}
if (warning)
- dprint("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
+ LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
cvar_set("_hud_panelorder", s);
if(hud_panelorder_prev)
}
HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
- printf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
+ LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
fclose(fh);
}
else
- printf(_("^1Couldn't write to %s\n"), filename);
+ LOG_INFOF(_("^1Couldn't write to %s\n"), filename);
}
void HUD_Configure_Exit_Force()
prvm_language = cvar_string("prvm_language");
#ifdef WATERMARK
- dprintf("^4CSQC Build information: ^1%s\n", WATERMARK);
+ LOG_TRACEF("^4CSQC Build information: ^1%s\n", WATERMARK);
#endif
int i;
default:
if(GetTeam(Team, false) == world)
{
- dprintf("trying to switch to unsupported team %d\n", Team);
+ LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
}
break;
default:
if(GetTeam(Team, false) == world)
{
- dprintf("trying to switch to unsupported team %d\n", Team);
+ LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
Team = NUM_SPECTATOR;
}
break;
if(!isNew && n != self.sv_entnum)
{
//print("A CSQC entity changed its owner!\n");
- printf("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
+ LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
isNew = true;
Ent_Remove();
self.enttype = ENT_CLIENT_SCORES;
t = ReadByte();
if(autocvar_developer_csqcentities)
- printf("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
+ LOG_INFOF("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
// set up the "time" global for received entities to be correct for interpolation purposes
savetime = time;
if(t != self.enttype || bIsNewEntity)
{
//print("A CSQC entity changed its type!\n");
- printf("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t);
+ LOG_INFOF("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t);
Ent_Remove();
clearentity(self);
bIsNewEntity = 1;
{
if(!bIsNewEntity)
{
- printf("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
+ LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
bIsNewEntity = 1;
}
}
void CSQC_Ent_Remove()
{
if(autocvar_developer_csqcentities)
- printf("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
+ LOG_INFOF("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
if(wasfreed(self))
{
- print("WARNING: CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
+ LOG_INFO("WARNING: CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
return;
}
if(self.enttype)
void CSQC_Parse_StuffCmd(string strMessage)
{
if(autocvar_developer_csqcentities)
- printf("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
+ LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
localcmd(strMessage);
}
void CSQC_Parse_Print(string strMessage)
{
if(autocvar_developer_csqcentities)
- printf("CSQC_Parse_Print(\"%s\")\n", strMessage);
+ LOG_INFOF("CSQC_Parse_Print(\"%s\")\n", strMessage);
- print(ColorTranslateRGB(strMessage));
+ LOG_INFO(ColorTranslateRGB(strMessage));
}
// CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.
void CSQC_Parse_CenterPrint(string strMessage)
{
if(autocvar_developer_csqcentities)
- printf("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
+ LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
centerprint_hud(strMessage);
}
int nTEID = ReadByte();
if (autocvar_developer_csqcentities)
- printf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
+ LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
switch (nTEID)
{
if(argc != 2 || !mv_pk3list)
{
- print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
+ LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
return;
}
break;
if(!pak || pak.sv_entnum != id) {
- print(_("^1Error:^7 Couldn't find pak index.\n"));
+ LOG_INFO(_("^1Error:^7 Couldn't find pak index.\n"));
return;
}
mv_preview[id] = true;
return;
} else {
- print(_("Requesting preview...\n"));
+ LOG_INFO(_("Requesting preview...\n"));
localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n"));
}
}
if(!tm)
{
- print(_("Trying to remove a team which is not in the teamlist!"));
+ LOG_INFO(_("Trying to remove a team which is not in the teamlist!"));
return;
}
parent.sort_next = Team.sort_next;
}
else
{
- printf("Received HTTP request data for an invalid id %d.\n", id);
+ LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
}
}
if(acc_levels > MAX_ACCURACY_LEVELS)
acc_levels = MAX_ACCURACY_LEVELS;
if(acc_levels < 2)
- print("Warning: accuracy_color_levels must contain at least 2 values\n");
+ LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values\n");
int i;
for(i = 0; i < acc_levels; ++i)
}
}
else
- dprint("No model parameters for ", e.model, "\n");
+ LOG_TRACE("No model parameters for ", e.model, "\n");
//dprint(e.model, " uses ", ftos(e.bone_upperbody), " ", ftos(e.fixbone), "\n");
get_model_parameters(string_null, 0);
e.skeleton_info_modelindex = e.modelindex;
void Cmd_HUD_Help()
{
- print(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
- print(_("^3|---------------------------------------------------------------|\n"));
- print(_("Usage:\n"));
- print(_("^2scoreboard_columns_set default\n"));
- print(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
- print(_("The following field names are recognized (case insensitive):\n"));
- print(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
-
- print(_("^3name^7 or ^3nick^7 Name of a player\n"));
- print(_("^3ping^7 Ping time\n"));
- print(_("^3pl^7 Packet loss\n"));
- print(_("^3kills^7 Number of kills\n"));
- print(_("^3deaths^7 Number of deaths\n"));
- print(_("^3suicides^7 Number of suicides\n"));
- print(_("^3frags^7 kills - suicides\n"));
- print(_("^3kd^7 The kill-death ratio\n"));
- print(_("^3sum^7 frags - deaths\n"));
- print(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured\n"));
- print(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
- print(_("^3captime^7 Time of fastest cap (CTF)\n"));
- print(_("^3fckills^7 Number of flag carrier kills\n"));
- print(_("^3returns^7 Number of flag returns\n"));
- print(_("^3drops^7 Number of flag drops\n"));
- print(_("^3lives^7 Number of lives (LMS)\n"));
- print(_("^3rank^7 Player rank\n"));
- print(_("^3pushes^7 Number of players pushed into void\n"));
- print(_("^3destroyed^7 Number of keys destroyed by pushing them into void\n"));
- print(_("^3kckills^7 Number of keys carrier kills\n"));
- print(_("^3losses^7 Number of times a key was lost\n"));
- print(_("^3laps^7 Number of laps finished (race/cts)\n"));
- print(_("^3time^7 Total time raced (race/cts)\n"));
- print(_("^3fastest^7 Time of fastest lap (race/cts)\n"));
- print(_("^3ticks^7 Number of ticks (DOM)\n"));
- print(_("^3takes^7 Number of domination points taken (DOM)\n"));
- print(_("^3bckills^7 Number of ball carrier kills\n"));
- print(_("^3bctime^7 Total amount of time holding the ball in Keepaway\n"));
- print(_("^3score^7 Total score\n\n"));
-
- print(_("Before a field you can put a + or - sign, then a comma separated list\n"
+ LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
+ LOG_INFO(_("^3|---------------------------------------------------------------|\n"));
+ LOG_INFO(_("Usage:\n"));
+ LOG_INFO(_("^2scoreboard_columns_set default\n"));
+ LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
+ LOG_INFO(_("The following field names are recognized (case insensitive):\n"));
+ LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
+
+ LOG_INFO(_("^3name^7 or ^3nick^7 Name of a player\n"));
+ LOG_INFO(_("^3ping^7 Ping time\n"));
+ LOG_INFO(_("^3pl^7 Packet loss\n"));
+ LOG_INFO(_("^3kills^7 Number of kills\n"));
+ LOG_INFO(_("^3deaths^7 Number of deaths\n"));
+ LOG_INFO(_("^3suicides^7 Number of suicides\n"));
+ LOG_INFO(_("^3frags^7 kills - suicides\n"));
+ LOG_INFO(_("^3kd^7 The kill-death ratio\n"));
+ LOG_INFO(_("^3sum^7 frags - deaths\n"));
+ LOG_INFO(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured\n"));
+ LOG_INFO(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
+ LOG_INFO(_("^3captime^7 Time of fastest cap (CTF)\n"));
+ LOG_INFO(_("^3fckills^7 Number of flag carrier kills\n"));
+ LOG_INFO(_("^3returns^7 Number of flag returns\n"));
+ LOG_INFO(_("^3drops^7 Number of flag drops\n"));
+ LOG_INFO(_("^3lives^7 Number of lives (LMS)\n"));
+ LOG_INFO(_("^3rank^7 Player rank\n"));
+ LOG_INFO(_("^3pushes^7 Number of players pushed into void\n"));
+ LOG_INFO(_("^3destroyed^7 Number of keys destroyed by pushing them into void\n"));
+ LOG_INFO(_("^3kckills^7 Number of keys carrier kills\n"));
+ LOG_INFO(_("^3losses^7 Number of times a key was lost\n"));
+ LOG_INFO(_("^3laps^7 Number of laps finished (race/cts)\n"));
+ LOG_INFO(_("^3time^7 Total time raced (race/cts)\n"));
+ LOG_INFO(_("^3fastest^7 Time of fastest lap (race/cts)\n"));
+ LOG_INFO(_("^3ticks^7 Number of ticks (DOM)\n"));
+ LOG_INFO(_("^3takes^7 Number of domination points taken (DOM)\n"));
+ LOG_INFO(_("^3bckills^7 Number of ball carrier kills\n"));
+ LOG_INFO(_("^3bctime^7 Total amount of time holding the ball in Keepaway\n"));
+ LOG_INFO(_("^3score^7 Total score\n\n"));
+
+ LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
"of game types, then a slash, to make the field show up only in these\n"
"or in all but these game types. You can also specify 'all' as a\n"
"field to show all fields available for the current game mode.\n\n"));
- print(_("The special game type names 'teams' and 'noteams' can be used to\n"
+ LOG_INFO(_("The special game type names 'teams' and 'noteams' can be used to\n"
"include/exclude ALL teams/noteams game modes.\n\n"));
- print(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
- print(_("will display name, ping and pl aligned to the left, and the fields\n"
+ LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
+ LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields\n"
"right of the vertical bar aligned to the right.\n"));
- print(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
+ LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
"other gamemodes except DM.\n"));
}
else
{
if (!nocomplain)
- printf("^1Error:^7 Unknown score field: '%s'\n", str);
+ LOG_INFOF("^1Error:^7 Unknown score field: '%s'\n", str);
continue;
}
:found
hud_title[0] = strzone(TranslateScoresLabel("name"));
hud_field[0] = SP_NAME;
++hud_num_fields;
- print("fixed missing field 'name'\n");
+ LOG_INFO("fixed missing field 'name'\n");
if(!have_separator)
{
hud_field[1] = SP_SEPARATOR;
hud_size[1] = stringwidth("|", false, hud_fontsize);
++hud_num_fields;
- print("fixed missing field '|'\n");
+ LOG_INFO("fixed missing field '|'\n");
}
}
else if(!have_separator)
hud_size[hud_num_fields] = stringwidth("|", false, hud_fontsize);
hud_field[hud_num_fields] = SP_SEPARATOR;
++hud_num_fields;
- print("fixed missing field '|'\n");
+ LOG_INFO("fixed missing field '|'\n");
}
if(!have_secondary)
{
hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
hud_field[hud_num_fields] = ps_secondary;
++hud_num_fields;
- printf("fixed missing field '%s'\n", scores_label[ps_secondary]);
+ LOG_INFOF("fixed missing field '%s'\n", scores_label[ps_secondary]);
}
if(!have_primary)
{
hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
hud_field[hud_num_fields] = ps_primary;
++hud_num_fields;
- printf("fixed missing field '%s'\n", scores_label[ps_primary]);
+ LOG_INFOF("fixed missing field '%s'\n", scores_label[ps_primary]);
}
}
Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
if (Tuba_PitchStep) {
if (!checkextension("DP_SND_SOUND7_WIP2") && !checkextension("DP_SND_SOUND7")) {
- print("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
+ LOG_INFO("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
Tuba_PitchStep = 0;
}
}
if (damage_dealt_time != damage_dealt_time_prev)
{
unaccounted_damage += unaccounted_damage_new;
- dprint("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
+ LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
}
damage_dealt_time_prev = damage_dealt_time;
pitch_shift = mirror_value + (mirror_value - pitch_shift);
}
- dprint("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
+ LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
// todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary
// todo: normalize sound pressure levels? seems unnecessary
setproperty(VF_ANGLES, '90 0 0');
#if 0
- printf("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
+ LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
vtos(ov_org),
vtos(getpropertyvec(VF_ANGLES)),
ov_distance,
string do_cvar = curl_uri_get_cvar[i];
if(status != 0)
{
- dprintf("error: status is %d\n", status);
+ LOG_TRACEF("error: status is %d\n", status);
if(do_cvar)
strunzone(do_cvar);
return;
}
if(!do_exec)
if (!do_cvar)
- print(data);
+ LOG_INFO(data);
}
}
default:
- print("Incorrect parameters for ^2addtolist^7\n");
+ LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
- print(" Where 'variable' is what to add 'value' to.\n");
- print("See also: ^2removefromlist^7\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
+ LOG_INFO(" Where 'variable' is what to add 'value' to.\n");
+ LOG_INFO("See also: ^2removefromlist^7\n");
return;
}
}
curl_uri_get_pos = (curl_uri_get_pos + 1) % (URI_GET_CURL_END - URI_GET_CURL + 1);
}
else
- print(_("error creating curl handle\n"));
+ LOG_INFO(_("error creating curl handle\n"));
buf_del(buf);
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
return;
}
}
CMD_Write("\ndump of generic commands:\n");
GenericCommand_macro_write_aliases(fh);
- print("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
+ LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
fclose(fh);
}
else
{
- print("^1Error: ^7Could not dump to file!\n");
+ LOG_INFO("^1Error: ^7Could not dump to file!\n");
}
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
- print(" No arguments required.\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
+ LOG_INFO(" No arguments required.\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- printf("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+ LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
return;
}
}
if(fh >= 0)
{
Dump_Notifications(fh, alsoprint);
- printf("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
+ LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
fclose(fh);
}
else
{
- printf("^1Error: ^7Could not open file '%s'!\n", filename);
+ LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
}
#else
- print(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+ LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
- print(" Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
- print(" if supplied with '-' output to console as well as default,\n");
- print(" if left blank, it will only write to default.\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+ LOG_INFO(" Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
+ LOG_INFO(" if supplied with '-' output to console as well as default,\n");
+ LOG_INFO(" if left blank, it will only write to default.\n");
return;
}
}
if(wep_config_file >= 0)
{
Dump_Weapon_Settings();
- print(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
+ LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
fclose(wep_config_file);
wep_config_file = -1;
wep_config_alsoprint = -1;
}
else
{
- print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+ LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
}
#else
- print(_("Weapons dump command only works with sv_cmd.\n"));
+ LOG_INFO(_("Weapons dump command only works with sv_cmd.\n"));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
- print(" Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
- print(" if supplied with '-' output to console as well as default,\n");
- print(" if left blank, it will only write to default.\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
+ LOG_INFO(" Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
+ LOG_INFO(" if supplied with '-' output to console as well as default,\n");
+ LOG_INFO(" if left blank, it will only write to default.\n");
return;
}
}
if(tur_config_file >= 0)
{
Dump_Turret_Settings();
- print(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
+ LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
fclose(tur_config_file);
tur_config_file = -1;
tur_config_alsoprint = -1;
}
else
{
- print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+ LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
}
#else
- print(_("Turrets dump command only works with sv_cmd.\n"));
+ LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
- print(" Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
- print(" if supplied with '-' output to console as well as default,\n");
- print(" if left blank, it will only write to default.\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
+ LOG_INFO(" Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
+ LOG_INFO(" if supplied with '-' output to console as well as default,\n");
+ LOG_INFO(" if left blank, it will only write to default.\n");
return;
}
}
{
if (!fexists(strcat("maps/", argv(2), ".bsp")))
{
- print("maplist: ERROR: ", argv(2), " does not exist!\n");
+ LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!\n");
break;
}
}
default:
- print("Incorrect parameters for ^2maplist^7\n");
+ LOG_INFO("Incorrect parameters for ^2maplist^7\n");
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
- print(" Where 'action' is the command to complete,\n");
- print(" and 'map' is what it acts upon (if required).\n");
- print(" Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
+ LOG_INFO(" Where 'action' is the command to complete,\n");
+ LOG_INFO(" and 'map' is what it acts upon (if required).\n");
+ LOG_INFO(" Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
- print(" Where command will be executed next frame of this VM\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
+ LOG_INFO(" Where command will be executed next frame of this VM\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2removefromlist^7\n");
+ LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
- print(" Where 'variable' is what cvar to remove 'value' from.\n");
- print("See also: ^2addtolist^7\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
+ LOG_INFO(" Where 'variable' is what cvar to remove 'value' from.\n");
+ LOG_INFO("See also: ^2addtolist^7\n");
return;
}
}
case CMD_REQUEST_COMMAND:
{
#ifndef MENUQC
- printf(
+ LOG_INFOF(
strcat(
"Restart_Notifications(): Restarting %d notifications... ",
"Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
Destroy_All_Notifications();
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
#else
- print(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
+ LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
#endif
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
- print(" No arguments required.\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
+ LOG_INFO(" No arguments required.\n");
return;
}
}
{
float f = cvar_settemp(argv(1), argv(2));
if(f == 1)
- dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
+ LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
else if(f == -1)
- dprint("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
+ LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
// else cvar_settemp itself errors out
return;
}
default:
- print("Incorrect parameters for ^2settemp^7\n");
+ LOG_INFO("Incorrect parameters for ^2settemp^7\n");
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
- print(" Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
- print("See also: ^2settemp_restore^7\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
+ LOG_INFO(" Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
+ LOG_INFO("See also: ^2settemp_restore^7\n");
return;
}
}
float i = cvar_settemp_restore();
if(i)
- dprint("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
+ LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
else
- dprint("Nothing to restore.\n");
+ LOG_TRACE("Nothing to restore.\n");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
- print(" No arguments required.\n");
- print("See also: ^2settemp^7\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2settemp^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
return;
}
}
void GenericCommand_macro_help()
{
#define GENERIC_COMMAND(name,function,description) \
- { print(" ^2", name, "^7: ", description, "\n"); }
+ { LOG_INFO(" ^2", name, "^7: ", description, "\n"); }
GENERIC_COMMANDS(0, 0, "");
#undef GENERIC_COMMAND
--rpn_sp;
return rpn_stack[rpn_sp];
} else {
- print("rpn: stack underflow\n");
+ LOG_INFO("rpn: stack underflow\n");
rpn_error = true;
return "";
}
rpn_stack[rpn_sp] = s;
++rpn_sp;
} else {
- print("rpn: stack overflow\n");
+ LOG_INFO("rpn: stack overflow\n");
rpn_error = true;
}
}
if(rpn_sp > 0) {
return rpn_stack[rpn_sp - 1];
} else {
- print("rpn: empty stack\n");
+ LOG_INFO("rpn: empty stack\n");
rpn_error = true;
return "";
}
if(rpn_sp > 0) {
rpn_stack[rpn_sp - 1] = s;
} else {
- print("rpn: empty stack\n");
+ LOG_INFO("rpn: empty stack\n");
rpn_error = true;
}
}
}
else
{
- print("rpn: empty cvar name for 'def'\n");
+ LOG_INFO("rpn: empty cvar name for 'def'\n");
rpn_error = true;
}
} else if(rpncmd == "defs" || rpncmd == "@") {
}
else
{
- print("rpn: empty cvar name for 'defs'\n");
+ LOG_INFO("rpn: empty cvar name for 'defs'\n");
rpn_error = true;
}
} else if(rpncmd == "load") {
db_put(rpn_db, "stack.pos", ftos(i-2));
} else {
rpn_error = 1;
- print("rpn: database underflow\n");
+ LOG_INFO("rpn: database underflow\n");
}
} else if(rpncmd == "dbget") {
rpn_push(db_get(rpn_db, strcat("stack.", ftos(i-1))));
} else {
rpn_error = 1;
- print("rpn: database empty\n");
+ LOG_INFO("rpn: database empty\n");
}
} else if(rpncmd == "dblen") {
rpn_push(db_get(rpn_db, "stack.pointer"));
if(!j)
{
rpn_error = true;
- print("rpn: empty database\n");
+ LOG_INFO("rpn: empty database\n");
} else {
--j;
rpn_push(db_get(rpn_db, strcat("stack.", ftos(i))));
rpn_push(db_get(rpn_db, strcat("stack.", s)));
} else {
rpn_error = 1;
- print("rpn: empty database\n");
+ LOG_INFO("rpn: empty database\n");
}
} else if(rpncmd == "dbat") {
rpn_push(db_get(rpn_db, "stack.pos"));
{
if(i < 0 || i >= j)
{
- print("rpn: database cursor out of bounds\n");
+ LOG_INFO("rpn: database cursor out of bounds\n");
rpn_error = true;
}
if(!rpn_error)
if(!j)
{
rpn_error = true;
- print("rpn: empty database, cannot move cursor\n");
+ LOG_INFO("rpn: empty database, cannot move cursor\n");
}
if(!rpn_error)
{
j = stof(db_get(rpn_db, "stack.pointer"));
if(i < 0 || i >= j)
{
- print("rpn: database cursor destination out of bounds\n");
+ LOG_INFO("rpn: database cursor destination out of bounds\n");
rpn_error = true;
}
if(!rpn_error)
{
if (!fexists(s))
{
- print("rpn: ERROR: ", s, " does not exist!\n");
+ LOG_INFO("rpn: ERROR: ", s, " does not exist!\n");
rpn_error = true;
}
}
while(rpn_sp > 0)
{
s = rpn_pop();
- print("rpn: still on stack: ", s, "\n");
+ LOG_INFO("rpn: still on stack: ", s, "\n");
}
}
default:
case CMD_REQUEST_USAGE:
{
- print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
- print(" Operator description (x: string, s: set, f: float):\n");
- print(" x pop -----------------------------> : removes the top\n");
- print(" x dup -----------------------------> x x : duplicates the top\n");
- print(" x x exch --------------------------> x x : swap the top two\n");
- print(" /cvarname load --------------------> x : loads a cvar\n");
- print(" /cvarname x def -------------------> : writes to a cvar\n");
- print(" f f add|sub|mul|div|mod|pow -------> f : adds/... two numbers\n");
- print(" f f and|or|xor|bitand|bitor|bitxor > f : logical and bitwise operations\n");
- print(" f f eq|ne|gt|ge|lt|le|max|min -----> f : compares two numbers\n");
- print(" f neg|abs|sgn|rand|floor|ceil------> f : negates/... a number\n");
- print(" f not|bitnot ----------------------> f : logical and bitwise negation\n");
- print(" f exp|log|sin|cos -----------------> f : exponential function & Co.\n");
- print(" f f f bound -----------------------> f : bounds the middle number\n");
- print(" f1 f2 b when ----------------------> f : f1 if b, f2 otherwise\n");
- print(" s s union|intersection|difference -> s : set operations\n");
- print(" s shuffle -------------------------> s : randomly arrange elements\n");
- print(" /key /value put -------------------> : set a database key\n");
- print(" /key get --------------------------> s : get a database value\n");
- print(" x dbpush --------------------------> : pushes the top onto the database\n");
- print(" dbpop|dbget -----------------------> x : removes/reads DB's top\n");
- print(" dblen|dbat ------------------------> f : gets the DB's size/cursor pos\n");
- print(" dbclr -----------------------------> : clear the DB\n");
- print(" s dbsave|dbload--------------------> : save/load the DB to/from a file\n");
- print(" x dbins ---------------------------> : moves the top into the DB\n");
- print(" dbext|dbread ----------------------> x : extract/get from the DB's cursor\n");
- print(" f dbmov|dbgoto --------------------> : move or set the DB's cursor\n");
- print(" s localtime -----------------------> s : formats the current local time\n");
- print(" s gmtime --------------------------> s : formats the current UTC time\n");
- print(" time ------------------------------> f : seconds since VM start\n");
- print(" s /MD4 digest ---------------------> s : MD4 digest\n");
- print(" s /SHA256 digest ------------------> s : SHA256 digest\n");
- print(" s /formatstring sprintf1s ---------> s : sprintf with 1 string (pad, cut)\n");
- print(" s eval ----------------------------> : does something eval\n");
- print(" Set operations operate on 'such''strings'.\n");
- print(" Unknown tokens insert their cvar value.\n");
+ LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
+ LOG_INFO(" Operator description (x: string, s: set, f: float):\n");
+ LOG_INFO(" x pop -----------------------------> : removes the top\n");
+ LOG_INFO(" x dup -----------------------------> x x : duplicates the top\n");
+ LOG_INFO(" x x exch --------------------------> x x : swap the top two\n");
+ LOG_INFO(" /cvarname load --------------------> x : loads a cvar\n");
+ LOG_INFO(" /cvarname x def -------------------> : writes to a cvar\n");
+ LOG_INFO(" f f add|sub|mul|div|mod|pow -------> f : adds/... two numbers\n");
+ LOG_INFO(" f f and|or|xor|bitand|bitor|bitxor > f : logical and bitwise operations\n");
+ LOG_INFO(" f f eq|ne|gt|ge|lt|le|max|min -----> f : compares two numbers\n");
+ LOG_INFO(" f neg|abs|sgn|rand|floor|ceil------> f : negates/... a number\n");
+ LOG_INFO(" f not|bitnot ----------------------> f : logical and bitwise negation\n");
+ LOG_INFO(" f exp|log|sin|cos -----------------> f : exponential function & Co.\n");
+ LOG_INFO(" f f f bound -----------------------> f : bounds the middle number\n");
+ LOG_INFO(" f1 f2 b when ----------------------> f : f1 if b, f2 otherwise\n");
+ LOG_INFO(" s s union|intersection|difference -> s : set operations\n");
+ LOG_INFO(" s shuffle -------------------------> s : randomly arrange elements\n");
+ LOG_INFO(" /key /value put -------------------> : set a database key\n");
+ LOG_INFO(" /key get --------------------------> s : get a database value\n");
+ LOG_INFO(" x dbpush --------------------------> : pushes the top onto the database\n");
+ LOG_INFO(" dbpop|dbget -----------------------> x : removes/reads DB's top\n");
+ LOG_INFO(" dblen|dbat ------------------------> f : gets the DB's size/cursor pos\n");
+ LOG_INFO(" dbclr -----------------------------> : clear the DB\n");
+ LOG_INFO(" s dbsave|dbload--------------------> : save/load the DB to/from a file\n");
+ LOG_INFO(" x dbins ---------------------------> : moves the top into the DB\n");
+ LOG_INFO(" dbext|dbread ----------------------> x : extract/get from the DB's cursor\n");
+ LOG_INFO(" f dbmov|dbgoto --------------------> : move or set the DB's cursor\n");
+ LOG_INFO(" s localtime -----------------------> s : formats the current local time\n");
+ LOG_INFO(" s gmtime --------------------------> s : formats the current UTC time\n");
+ LOG_INFO(" time ------------------------------> f : seconds since VM start\n");
+ LOG_INFO(" s /MD4 digest ---------------------> s : MD4 digest\n");
+ LOG_INFO(" s /SHA256 digest ------------------> s : SHA256 digest\n");
+ LOG_INFO(" s /formatstring sprintf1s ---------> s : sprintf with 1 string (pad, cut)\n");
+ LOG_INFO(" s eval ----------------------------> : does something eval\n");
+ LOG_INFO(" Set operations operate on 'such''strings'.\n");
+ LOG_INFO(" Unknown tokens insert their cvar value.\n");
return;
}
}
#define dedi ""
#endif
- dprintf("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
+ LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
#undef dedi
}
void RegisterEffects_Done()
{
- dprint("Effects initialization successful!\n");
+ LOG_TRACE("Effects initialization successful!\n");
}
// NOW we actually activate the declarations
.int fld = inv_items[i];
int prev = data.(fld);
int next = data.(fld) = ReadByte();
- dprintf("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
+ LOG_TRACEF("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
));
}
#endif
METHOD(GameItem, display, void(entity this, void(string name, string icon) returns)) {
returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
}
- METHOD(GameItem, show, void(entity this)) { print("A game item\n"); }
+ METHOD(GameItem, show, void(entity this)) { LOG_INFO("A game item\n"); }
void ITEM_HANDLE(Show, entity this) { this.show(this); }
ENDCLASS(GameItem)
bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
bool b = this.giveTo(this, item, player);
if (b) {
- dprintf("entity %i picked up %s\n", player, this.m_name);
+ LOG_TRACEF("entity %i picked up %s\n", player, this.m_name);
player.inventory.inv_items[this.m_id]++;
Inventory_update(player);
}
ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
ATTRIB(Pickup, m_name, string, string_null)
METHOD(Pickup, show, void(entity this));
- void Pickup_show(entity this) { printf("%s: %s\n", etos(this), this.m_name); }
+ void Pickup_show(entity this) { LOG_INFOF("%s: %s\n", etos(this), this.m_name); }
#ifdef SVQC
ATTRIB(Pickup, m_botvalue, int, 0)
ATTRIB(Pickup, m_itemflags, int, 0)
if(MapInfo_Get_ByName(_MapInfo_GlobItem(i), 1, 0) == 2) // if we generated one... BAIL OUT and let the caller continue in the next frame.
if(pAbortOnGenerate)
{
- dprint("Autogenerated a .mapinfo, doing the rest later.\n");
+ LOG_TRACE("Autogenerated a .mapinfo, doing the rest later.\n");
MapInfo_progress = i / _MapInfo_globcount;
return 0;
}
}
if(fh < 0)
return 0;
- print("Analyzing ", fn, " to generate initial mapinfo\n");
+ LOG_INFO("Analyzing ", fn, " to generate initial mapinfo\n");
inWorldspawn = 2;
MapInfo_Map_flags = 0;
}
if(inWorldspawn)
{
- print(fn, " ended still in worldspawn, BUG\n");
+ LOG_INFO(fn, " ended still in worldspawn, BUG\n");
return 0;
}
diameter = vlen(mapMaxs - mapMins);
MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS;
}
- dprint("-> diameter ", ftos(diameter));
- dprint("; spawnpoints ", ftos(spawnpoints));
- dprint("; modes ", ftos(MapInfo_Map_supportedGametypes), "\n");
+ LOG_TRACE("-> diameter ", ftos(diameter));
+ LOG_TRACE("; spawnpoints ", ftos(spawnpoints));
+ LOG_TRACE("; modes ", ftos(MapInfo_Map_supportedGametypes), "\n");
fclose(fh);
p = strstrofs(sa, "=", 0);
if(p < 0)
{
- print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+ LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
continue;
}
k = substring(sa, 0, p);
}
else
{
- print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+ LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
}
}
{
if(t == "nexball")
{
- print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
t = "nb";
- print("'. Should use '", t, "'.\n");
+ LOG_INFO("'. Should use '", t, "'.\n");
}
if(t == "freezetag")
{
- print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
t = "ft";
- print("'. Should use '", t, "'.\n");
+ LOG_INFO("'. Should use '", t, "'.\n");
}
if(t == "keepaway")
{
- print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
t = "ka";
- print("'. Should use '", t, "'.\n");
+ LOG_INFO("'. Should use '", t, "'.\n");
}
if(t == "invasion")
{
- print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
t = "inv";
- print("'. Should use '", t, "'.\n");
+ LOG_INFO("'. Should use '", t, "'.\n");
}
if(t == "assault")
{
- print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
t = "as";
- print("'. Should use '", t, "'.\n");
+ LOG_INFO("'. Should use '", t, "'.\n");
}
if(t == "race")
{
- print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+ LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
t = "rc";
- print("'. Should use '", t, "'.\n");
+ LOG_INFO("'. Should use '", t, "'.\n");
}
if(t == "all")
return MAPINFO_TYPE_ALL;
{
fh = fopen(s, FILE_READ);
if(fh < 0)
- print("Map ", pFilename, " references not existing config file ", s, "\n");
+ LOG_INFO("Map ", pFilename, " references not existing config file ", s, "\n");
else
{
for (;;)
}
}
else
- print("Map ", pFilename, " uses too many levels of inclusion\n");
+ LOG_INFO("Map ", pFilename, " uses too many levels of inclusion\n");
}
else if(t == "")
- print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if (!cvar_value_issafe(t))
- print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if (!cvar_value_issafe(s))
- print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
- print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
else if(matchacl(acl, t) <= 0)
- print("Map ", pFilename, " contains a denied setting, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a denied setting, ignored\n");
else
{
if(type == 0) // server set
{
- dprint("Applying temporary setting ", t, " := ", s, "\n");
+ LOG_TRACE("Applying temporary setting ", t, " := ", s, "\n");
if(cvar("g_campaign"))
cvar_set(t, s); // this is a wrapper and is always temporary anyway; no need to backup old values then
else
}
else
{
- dprint("Applying temporary client setting ", t, " := ", s, "\n");
+ LOG_TRACE("Applying temporary client setting ", t, " := ", s, "\n");
MapInfo_Map_clientstuff = strcat(
MapInfo_Map_clientstuff, "cl_cmd settemp \"", t, "\" \"", s, "\"\n"
);
if(strstrofs(pFilename, "/", 0) >= 0)
{
- print("Invalid character in map name, ignored\n");
+ LOG_INFO("Invalid character in map name, ignored\n");
return 0;
}
error("... but I just wrote it!");
}
- print("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
+ LOG_INFO("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
}
_MapInfo_Map_Reset();
else if(t == "monsters") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_MONSTERS;
else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
else
- dprint("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
+ LOG_TRACE("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
}
else if(t == "hidden")
{
{
t = car(s); s = cdr(s);
f = MapInfo_Type_FromString(t);
- dprint("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
+ LOG_TRACE("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
if(f)
_MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, true);
else
- dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+ LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
}
else if(t == "gametype")
{
if(f)
_MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
else
- dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+ LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
}
else if(t == "size")
{
t = car(s); s = cdr(s); d = stof(t);
t = car(s); s = cdr(s); e = stof(t);
if(s == "")
- print("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+ LOG_INFO("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
else
{
t = car(s); s = cdr(s); f = stof(t);
if(s != "")
- print("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+ LOG_INFO("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
else
{
if(a >= d || b >= e || c >= f)
- print("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
+ LOG_INFO("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
else
{
MapInfo_Map_mins.x = a;
}
else
{
- dprint("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
+ LOG_TRACE("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
}
}
else if(t == "clientsettemp_for_type")
}
else
{
- dprint("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
+ LOG_TRACE("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
}
}
else if(t == "fog")
{
if (!cvar_value_issafe(s))
- print("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
else
MapInfo_Map_fog = s;
}
if(pGametypeToSet)
{
if (!cvar_value_issafe(t))
- print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
+ LOG_INFO("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
else
MapInfo_Map_clientstuff = strcat(
MapInfo_Map_clientstuff, "cd loop \"", t, "\"\n"
}
}
else
- dprint("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
+ LOG_TRACE("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
}
fclose(fh);
MapInfo_Cache_Store();
if(MapInfo_Map_supportedGametypes != 0)
return r;
- dprint("Map ", pFilename, " supports no game types, ignored\n");
+ LOG_TRACE("Map ", pFilename, " supports no game types, ignored\n");
return 0;
}
float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, int pGametypeToSet)
{
if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break"))
{
- print("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
+ LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
_MapInfo_Map_ApplyGametypeEx("", t, t);
return; // do not call Get_ByName!
}
if(MapInfo_Map_supportedGametypes == 0)
{
- print("Mapinfo system is not functional at all. Assuming deathmatch.\n");
+ LOG_INFO("Mapinfo system is not functional at all. Assuming deathmatch.\n");
MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH;
MapInfo_LoadMapSettings_SaveGameType(MAPINFO_TYPE_DEATHMATCH);
_MapInfo_Map_ApplyGametypeEx("", MAPINFO_TYPE_DEATHMATCH, MAPINFO_TYPE_DEATHMATCH);
}
// t is now a supported mode!
- print("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
+ LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
MapInfo_LoadMapSettings_SaveGameType(t);
}
MapInfo_Get_ByName(s, 1, t);
void minigame_autoclean_entity(entity e)
{
- dprint("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+ LOG_TRACE("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
remove(e);
}
if ( !minigame.descriptor || minigame.classname != "minigame" )
{
- dprint("Trying to activate unregistered minigame ",minigame.netname," in client\n");
+ LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client\n");
return;
}
self.owner = find(self.owner,netname,owner_name);
while ( self.owner && self.owner.classname != "minigame" );
if ( !self.owner )
- dprint("Got a minigame entity without a minigame!\n");
+ LOG_TRACE("Got a minigame entity without a minigame!\n");
}
void ent_read_minigame()
{
self.entremove = minigame_entremove;
self.descriptor = minigame_get_descriptor(ReadString_Raw());
if ( !self.descriptor )
- dprint("Got a minigame without a client-side descriptor!\n");
+ LOG_TRACE("Got a minigame without a client-side descriptor!\n");
else
self.minigame_event = self.descriptor.minigame_event;
}
minigame_read_owner();
float ent = ReadLong();
self.minigame_playerslot = ent;
- dprint("Player: ",GetPlayerName(ent-1),"\n");
+ LOG_TRACE("Player: ",GetPlayerName(ent-1),"\n");
activate = (ent == player_localnum+1 && self.owner && self.owner != active_minigame);
if ( sf & MINIG_SF_CREATE )
{
- dprint("CL Reading entity: ",ftos(num_for_edict(self)),
+ LOG_TRACE("CL Reading entity: ",ftos(num_for_edict(self)),
" classname:",self.classname," enttype:",ftos(self.enttype) );
- dprint(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
+ LOG_TRACE(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
}
}
#undef ReadString
minigame.SendFlags |= MINIG_SF_UPDATE;
}
else
- dprint("Invalid move: ",...(2,string),"\n");
+ LOG_TRACE("Invalid move: ",...(2,string),"\n");
return 1;
}
}
f <<= 1;
}
- dprint(sprintf("TTT AI: selected %x from %x\n",
+ LOG_TRACE(sprintf("TTT AI: selected %x from %x\n",
RandomSelection_chosen_float, piecemask) );
return RandomSelection_chosen_float;
}
r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B3,TTT_AI_POSFLAG_C3);
r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A1,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C3);
r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C1);
- dprint(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
+ LOG_TRACE(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
r &= piecemask_free;
return ttt_ai_random(r);
}
{
int move = 0;
- dprint("TTT AI: checking winning move\n");
+ LOG_TRACE("TTT AI: checking winning move\n");
if (( move = ttt_ai_block3(piecemask_self,piecemask_free) ))
return ttt_ai_piece_flag2pos(move); // place winning move
- dprint("TTT AI: checking opponent's winning move\n");
+ LOG_TRACE("TTT AI: checking opponent's winning move\n");
if (( move = ttt_ai_block3(piecemask_opponent,piecemask_free) ))
return ttt_ai_piece_flag2pos(move); // block opponent
- dprint("TTT AI: random move\n");
+ LOG_TRACE("TTT AI: random move\n");
return ttt_ai_piece_flag2pos(ttt_ai_random(piecemask_free));
}
}
// TODO multiple AI difficulties
- dprint(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
+ LOG_TRACE(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
piecemask_self, piecemask_opponent, piecemask_free));
pos = ttt_ai_choose_simple(piecemask_self, piecemask_opponent, piecemask_free);
- dprint("TTT AI: chosen move: ",pos,"\n\n");
+ LOG_TRACE("TTT AI: chosen move: ",pos,"\n\n");
if ( !pos )
- dprint("Tic Tac Toe AI has derped!\n");
+ LOG_TRACE("Tic Tac Toe AI has derped!\n");
else
ttt_move(minigame,aiplayer,pos);
}
return false;
}
-#endif
\ No newline at end of file
+#endif
GameLogEcho(strcat(":minigame:start:",minig.netname));
if ( ! minigame_addplayer(minig,player) )
{
- dprint("Minigame ",minig.netname," rejected the first player join!\n");
+ LOG_TRACE("Minigame ",minig.netname," rejected the first player join!\n");
end_minigame(minig);
return world;
}
while( (e = findentity(e, owner, minigame_session)) )
if ( e.minigame_autoclean )
{
- dprint("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+ LOG_TRACE("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
remove(e);
}
sprint(self, " Leave the current minigame\n");
sprint(self, "Usage:^3 cmd minigame invite <player>\n");
sprint(self, " Invite the given player to join you in a minigame\n");
-}
\ No newline at end of file
+}
{
if(tokenize_console(s) != 3)
{
- dprint("Invalid sound info line: ", s, "\n");
+ LOG_TRACE("Invalid sound info line: ", s, "\n");
continue;
}
PrecacheGlobalSound(strcat(argv(1), " ", argv(2)));
fh = fopen(f, FILE_READ);
if(fh < 0)
{
- dprint("Monster sound file not found: ", f, "\n");
+ LOG_TRACE("Monster sound file not found: ", f, "\n");
return 0;
}
while((s = fgets(fh)))
if(!_Movetype_TestEntityPosition('0 0 -1' * i)) goto success;
if(!_Movetype_TestEntityPosition('0 0 1' * i)) goto success;
}
- dprintf("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n",
+ LOG_TRACEF("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n",
num_for_edict(self), self.classname, vtos(self.move_origin));
return false;
: success;
- dprintf("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n",
+ LOG_TRACEF("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n",
num_for_edict(self), self.classname, vtos(self.move_origin));
_Movetype_LinkEdict(true);
return true;
_Movetype_LinkEdict(true);
return;
default:
- dprintf("_Movetype_PushMove: entity %e, unrecognized solid type %d\n", self, self.solid);
+ LOG_TRACEF("_Movetype_PushMove: entity %e, unrecognized solid type %d\n", self, self.solid);
return;
}
#define MUTATOR_HOOK(cb, func, order) do { \
MUTATOR_ONADD { \
if (!CallbackChain_Add(HOOK_##cb, CALLBACK_##func, order)) { \
- print("HOOK FAILED: ", #cb, ":", #func, "\n"); \
+ LOG_INFO("HOOK FAILED: ", #cb, ":", #func, "\n"); \
return true; \
} \
} \
if (rgb == '0 0 0')
{
self.teamradar_color = '1 0 1';
- printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+ LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
}
if (time - floor(time) > 0.5)
// done to both MSG_INFO and MSG_CENTER
if(substring(input, (strlen(input) - 1), 1) == "\n")
{
- printf(
+ LOG_INFOF(
strcat(
"^1TRAILING NEW LINE AT END OF NOTIFICATION: ",
"^7net_type = %s, net_name = %s, string = %s.\n"
{
if(sel_num == NOTIF_MAX_ARGS)
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
"^7net_type = %s, net_name = %s, max args = %d.\n"
#undef ARG_CASE_ARG_CS_SV_HA
default:
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
"^7net_type = %s, net_name = %s, args arg = '%s'.\n"
{
if(sel_num == NOTIF_MAX_HUDARGS)
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
"^7net_type = %s, net_name = %s, max hudargs = %d.\n"
#undef ARG_CASE_ARG_CS_SV_HA
default:
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
"^7net_type = %s, net_name = %s, hudargs arg = '%s'.\n"
{
if(sel_num == NOTIF_MAX_DURCNT)
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
"^7net_type = %s, net_name = %s, max durcnt = %d.\n"
if(ftos(stof(selected)) != "") { ++sel_num; }
else
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
"^7net_type = %s, net_name = %s, durcnt arg = '%s'.\n"
}
else
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH NO SOUND: ",
"^7net_type = %s, net_name = %s.\n"
}
else if((hudargs == "") && (durcnt ==""))
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: ",
"^7net_type = %s, net_name = %s, strnum = %d, flnum = %d\n"
if(icon != "") { notif.nent_icon = strzone(icon); }
else
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS HUDARGS BUT NO ICON: ",
"^7net_type = %s, net_name = %s.\n"
}
else if(icon != "")
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS ICON BUT NO HUDARGS: ",
"^7net_type = %s, net_name = %s.\n"
if(cpid != NO_MSG) { notif.nent_cpid = cpid; }
else
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION HAS DURCNT BUT NO CPID: ",
"^7net_type = %s, net_name = %s.\n"
// Check to make sure a string was chosen
if(notif.nent_string == "")
{
- printf(
+ LOG_INFOF(
strcat(
"^1EMPTY NOTIFICATION: ",
"^7net_type = %s, net_name = %s.\n"
// Set MSG_MULTI string/float counts
if((anncename == NO_MSG) && (infoname == NO_MSG) && (centername == NO_MSG))
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH NO SUBCALLS: ",
"^7net_type = %s, net_name = %s.\n"
{
if((chtype == NO_MSG) || (optiona == NO_MSG) || (optionb == NO_MSG))
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION IS MISSING CHOICE PARAMS: ",
"^7net_type = %s, net_name = %s.\n"
default:
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH IMPROPER TYPE: ",
"^7net_type = %d, net_name = %s.\n"
default:
{
- printf(
+ LOG_INFOF(
strcat(
"^1NOTIFICATION WITH IMPROPER TYPE: ",
"^7net_type = %d, net_name = %s.\n"
{
#define NOTIF_WRITE(a) { \
fputs(fh, a); \
- if(alsoprint) { print(a); } }
+ if(alsoprint) { LOG_INFO(a); } }
#define NOTIF_WRITE_ENTITY(description) { \
notif_msg = \
sprintf( \
{
switch(autocvar_notification_debug)
{
- case 1: { dprint(input); break; }
- case 2: { print(input); break; }
+ case 1: { LOG_TRACE(input); break; }
+ case 2: { LOG_INFO(input); break; }
}
}
#endif
case MSG_INFO:
{
- print(
+ LOG_INFO(
Local_Notification_sprintf(
notif.nent_string,
notif.nent_args,
#define dedi ""
#endif
- printf("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME);
+ LOG_INFOF("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME);
#undef dedi
// maybe do another implementation of this with checksums? for now, we don't need versioning
if(autocvar_notification_errors_are_fatal)
error("Notification initialization failed! Read above and fix the errors!\n");
else
- print("Notification initialization failed! Read above and fix the errors!\n");
+ LOG_INFO("Notification initialization failed! Read above and fix the errors!\n");
}
- else { print("Notification initialization successful!\n"); }
+ else { LOG_INFO("Notification initialization successful!\n"); }
}
// NOW we actually activate the declarations
{
#ifdef SVQC
if(autocvar_speedmeter)
- dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
+ LOG_TRACE(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
#endif
if(self.lastground < time - 0.3)
{
}
#ifdef SVQC
if(self.jumppadcount > 1)
- dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
+ LOG_TRACE(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
self.jumppadcount = 0;
#endif
}
TetrisImpulse();
#else
if (!CheatImpulse(99))
- print("A hollow voice says \"Plugh\".\n");
+ LOG_INFO("A hollow voice says \"Plugh\".\n");
#endif
#endif
}
{
#ifdef SVQC
if (autocvar_speedmeter)
- dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
+ LOG_TRACE(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
#endif
if (self.lastground < time - 0.3)
self.velocity *= (1 - PHYS_FRICTION_ONLAND);
#ifdef SVQC
if (self.jumppadcount > 1)
- dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
+ LOG_TRACE(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
self.jumppadcount = 0;
#endif
}
{
// url_fclose is processing, we got a response for writing the data
// this must come from HTTP
- dprint("Got response from player stats server:\n");
- while((s = url_fgets(fh))) { dprint(" ", s, "\n"); }
- dprint("End of response.\n");
+ LOG_TRACE("Got response from player stats server:\n");
+ while((s = url_fgets(fh))) { LOG_TRACE(" ", s, "\n"); }
+ LOG_TRACE("End of response.\n");
url_fclose(fh);
break;
}
case URL_READY_CLOSED:
{
// url_fclose has finished
- dprint("Player stats written\n");
+ LOG_TRACE("Player stats written\n");
PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
case URL_READY_ERROR:
default:
{
- print("Player stats writing failed: ", ftos(status), "\n");
+ LOG_INFO("Player stats writing failed: ", ftos(status), "\n");
PlayerStats_GameReport_DelayMapVote = false;
if(PS_GR_OUT_DB >= 0)
{
// now request the information
uri = strcat(uri, "/player/", uri_escape(uri_escape(joiningplayer.crypto_idfp)), "/elo.txt");
- dprint("Retrieving playerstats from URL: ", uri, "\n");
+ LOG_TRACE("Retrieving playerstats from URL: ", uri, "\n");
url_single_fopen(
uri,
FILE_APPEND,
// determine whether we should retrieve playerbasic information again
#if 0
- printf("PlayerStats_PlayerBasic_CheckUpdate('%s'): %f\n",
+ LOG_INFOF("PlayerStats_PlayerBasic_CheckUpdate('%s'): %f\n",
joiningplayer.netname,
time
);
{
case URL_READY_CANWRITE:
{
- dprint("-- Sending data to player stats server\n");
+ LOG_TRACE("-- Sending data to player stats server\n");
/*url_fputs(fh, "V 1\n");
#ifdef WATERMARK
url_fputs(fh, sprintf("R %s\n", WATERMARK));
case URL_READY_CANREAD:
{
string s = "";
- dprint("-- Got response from player stats server:\n");
+ LOG_TRACE("-- Got response from player stats server:\n");
//string gametype = string_null;
while((s = url_fgets(fh)))
{
- dprint(" ", s, "\n");
+ LOG_TRACE(" ", s, "\n");
/*
string key = "", value = "", data = "";
continue;
*/
}
- dprint("-- End of response.\n");
+ LOG_TRACE("-- End of response.\n");
url_fclose(fh);
break;
}
case URL_READY_CLOSED:
{
// url_fclose has finished
- print("Player stats synchronized with server\n");
+ LOG_INFO("Player stats synchronized with server\n");
break;
}
case URL_READY_ERROR:
default:
{
- print("Receiving player stats failed: ", ftos(status), "\n");
+ LOG_INFO("Receiving player stats failed: ", ftos(status), "\n");
break;
}
}
float i = 0;
for(e = PS_D_IN_EVL; (en = db_get(PS_D_IN_DB, e)) != ""; e = en)
{
- print(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
+ LOG_INFO(sprintf("%d:%s:%s\n", i, e, db_get(PS_D_IN_DB, sprintf("#%s", e))));
++i;
}
#endif
// now actually set the event data
db_put(PS_D_IN_DB, sprintf("#%s", event), data);
- dprint("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB\n");
+ LOG_TRACE("Added item ", sprintf("#%s", event), "=", data, " to PS_D_IN_DB\n");
}
void PlayerStats_PlayerDetail(void)
PS_D_IN_DB = db_create();
//uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0)));
- dprint("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
+ LOG_TRACE("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
url_single_fopen(
autocvar_g_playerstats_playerdetail_uri,
FILE_APPEND,
float gamecount = cvar("cl_matchcount");
#if 0
- printf("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d\n",
+ LOG_INFOF("PlayerStats_PlayerDetail_CheckUpdate(): %f >= %f, %d > %d\n",
time,
PS_D_NEXTUPDATETIME,
PS_D_LASTGAMECOUNT,
{
case URL_READY_CANWRITE:
{
- dprint("PlayerStats_PlayerDetail_Handler(): Sending data to player stats server...\n");
+ LOG_TRACE("PlayerStats_PlayerDetail_Handler(): Sending data to player stats server...\n");
url_fputs(fh, "V 1\n");
#ifdef WATERMARK
url_fputs(fh, sprintf("R %s\n", WATERMARK));
default:
{
- printf(
+ LOG_INFOF(
"PlayerStats_PlayerDetail_Handler(): ERROR: "
"Key went unhandled? Is our version outdated?\n"
"PlayerStats_PlayerDetail_Handler(): "
}
#if 0
- print(sprintf(
+ LOG_INFO(sprintf(
"PlayerStats_PlayerDetail_Handler(): "
"Key '%s', Event '%s', Data '%s'\n",
key,
case URL_READY_CLOSED:
{
// url_fclose has finished
- print("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.\n");
+ LOG_INFO("PlayerStats_PlayerDetail_Handler(): Player stats synchronized with server.\n");
break;
}
case URL_READY_ERROR:
default:
{
- print("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status), "\n");
+ LOG_INFO("PlayerStats_PlayerDetail_Handler(): Receiving player stats failed: ", ftos(status), "\n");
PlayerStats_PlayerDetail_Status = PS_D_STATUS_ERROR;
if(PS_D_IN_DB >= 0)
{
FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, world);
// set owner, and make a loop of the chain
- dprint("LinkDoors: linking doors:");
+ LOG_TRACE("LinkDoors: linking doors:");
for(t = self; ; t = t.enemy)
{
- dprint(" ", etos(t));
+ LOG_TRACE(" ", etos(t));
t.owner = self;
if(t.enemy == world)
{
break;
}
}
- dprint("\n");
+ LOG_TRACE("\n");
// collect health, targetname, message, size
cmins = self.absmin;
sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
if(getsoundtime(e, CH_BGM_SINGLE) < 0)
{
- dprintf("Cannot initialize sound %s\n", e.noise);
+ LOG_TRACEF("Cannot initialize sound %s\n", e.noise);
strunzone(e.noise);
e.noise = string_null;
}
sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE);
if(getsoundtime(self, CH_BGM_SINGLE) < 0)
{
- dprintf("Cannot initialize sound %s\n", self.noise);
+ LOG_TRACEF("Cannot initialize sound %s\n", self.noise);
strunzone(self.noise);
self.noise = string_null;
}
data = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", key)));
if(data.y == 0) // undefined field, i.e., invalid type
{
- print("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
+ LOG_INFO("target_spawn: invalid/unknown entity key ", key, " specified, ignored!\n");
continue;
}
}
}
else
{
- print("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
+ LOG_INFO("target_spawn: invalid/unknown variable replacement ", value, " specified, ignored!\n");
continue;
}
{
if(value != "")
{
- print("target_spawn: try to get a field of a non-entity, ignored!\n");
+ LOG_INFO("target_spawn: try to get a field of a non-entity, ignored!\n");
continue;
}
data2 = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", valuefield)));
if(data2_y == 0) // undefined field, i.e., invalid type
{
- print("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
+ LOG_INFO("target_spawn: invalid/unknown entity key replacement ", valuefield, " specified, ignored!\n");
continue;
}
value = getentityfieldstring(data2_x, valueent);
value = vtos(stov(value) + stov(valueoffset));
break;
default:
- print("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
+ LOG_INFO("target_spawn: only string, float and vector fields can do calculations, calculation ignored!\n");
break;
}
}
value = vtos(stov(value) + random() * data2_x * '1 0 0' + random() * data2_y * '0 1 0' + random() * data2_z * '0 0 1');
break;
default:
- print("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
+ LOG_INFO("target_spawn: only float and vector fields can do random calculations, calculation ignored!\n");
break;
}
}
if(e.movetype == MOVETYPE_NONE)
waypoint_spawnforteleporter(self, e.origin, 0);
if(e.classname != "info_teleport_destination")
- print("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
+ LOG_INFO("^3MAPPER ERROR: teleporter does target an invalid teleport destination entity. Angles will not work.\n");
}
if(n == 0)
if(pl.owner == pl.realowner)
{
if(!(pl.flags & FL_PROJECTILE))
- print("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
+ LOG_INFO("A non-projectile got through a warpzone and its owner cleared. It's a ", pl.classname, ".\n");
pl.owner = world;
}
if(IS_PLAYER(pl))
}
if((!a) == (!b))
- print("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!\n");
+ LOG_INFO("Invalid use of trigger_disablerelay: ", ftos(a), " relays were on, ", ftos(b), " relays were off!\n");
}
void spawnfunc_trigger_disablerelay()
break;
}
- if(!self.enemy) { print("^1FAIL!\n"); remove(self); return; }
+ if(!self.enemy) { LOG_INFO("^1FAIL!\n"); remove(self); return; }
if(!self.goalentity)
self.goalentity = self.enemy; // make them match so CSQC knows what to do
void spawnfunc_trigger_viewlocation()
{
// we won't check target2 here yet, as it may not even need to exist
- if(self.target == "") { print("^1FAIL!\n"); remove(self); return; }
+ if(self.target == "") { LOG_INFO("^1FAIL!\n"); remove(self); return; }
EXACTTRIGGER_INIT;
InitializeEntity(self, viewloc_init, INITPRIO_FINDTARGET);
{
self.enemy = find(world, targetname, self.target);
if(self.enemy == world)
- dprint("A turret_checkpoint faild to find its target!\n");
+ LOG_TRACE("A turret_checkpoint faild to find its target!\n");
}
//self.think = turret_checkpoint_think;
//self.nextthink = time + tc_acum + 0.25;
if(rgb == '0 0 0')
{
self.teamradar_color = '1 0 1';
- printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
+ LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
}
txt = self.netname;
TUR_CONFIG_WRITETOFILE("// }}}\n")
// step 5: debug info
- print(sprintf("#%d: %s: %d settings...\n", i, TUR_NAME(i), TUR_CONFIG_COUNT));
+ LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, TUR_NAME(i), TUR_CONFIG_COUNT));
totalsettings += TUR_CONFIG_COUNT;
}
{ tur_config_queue[x] = string_null; }
// extra information
- print(sprintf("Totals: %d turrets, %d settings\n", (i - 1), totalsettings));
+ LOG_INFO(sprintf("Totals: %d turrets, %d settings\n", (i - 1), totalsettings));
}
#define TUR_CONFIG_WRITETOFILE(a) { \
fputs(tur_config_file, a); \
- if(tur_config_alsoprint) { print(a); } }
+ if(tur_config_alsoprint) { LOG_INFO(a); } }
#define TUR_CONFIG_WRITE_CVARS(turret,name) \
{ TUR_CONFIG_QUEUE( \
*/
#ifdef TURRET_DEBUG_TARGETSELECT
- dprint("Target:",e_target.netname," is a valid target for ",e_turret.netname,"\n");
+ LOG_TRACE("Target:",e_target.netname," is a valid target for ",e_turret.netname,"\n");
#endif
return 1;
*/
void turret_use()
{
- dprint("Turret ",self.netname, " used by ", activator.classname, "\n");
+ LOG_TRACE("Turret ",self.netname, " used by ", activator.classname, "\n");
self.team = activator.team;
if (self.tur_defend == world)
{
self.target = "";
- dprint("Turret has invalid defendpoint!\n");
+ LOG_TRACE("Turret has invalid defendpoint!\n");
}
}
e = find(world, targetname, self.target);
if (!e)
{
- dprint("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
+ LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
self.target = "";
}
if (e.classname != "turret_checkpoint")
- dprint("Warning: not a turrret path\n");
+ LOG_TRACE("Warning: not a turrret path\n");
else
{
self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
if(self.tur_head.frame < 0)
{
- dprint("ammo:",ftos(self.ammo),"\n");
- dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
+ LOG_TRACE("ammo:",ftos(self.ammo),"\n");
+ LOG_TRACE("shot_dmg:",ftos(self.shot_dmg),"\n");
}
return true;
e = find(world, targetname, self.target);
if (!e)
{
- dprint("Initital waypoint for walker does NOT exsist, fix your map!\n");
+ LOG_TRACE("Initital waypoint for walker does NOT exsist, fix your map!\n");
self.target = "";
}
if (e.classname != "turret_checkpoint")
- dprint("Warning: not a turrret path\n");
+ LOG_TRACE("Warning: not a turrret path\n");
else
{
#ifdef WALKER_FANCYPATHING
fh = fopen(pFilename, FILE_WRITE);
if(fh < 0)
{
- print(strcat("^1Can't write DB to ", pFilename));
+ LOG_INFO(strcat("^1Can't write DB to ", pFilename));
return;
}
n = buf_getsize(db);
void db_test()
{
float db, i;
- print("LOAD...\n");
+ LOG_INFO("LOAD...\n");
db = db_load("foo.db");
- print("LOADED. FILL...\n");
+ LOG_INFO("LOADED. FILL...\n");
for(i = 0; i < DB_BUCKETS; ++i)
db_put(db, ftos(random()), "X");
- print("FILLED. SAVE...\n");
+ LOG_INFO("FILLED. SAVE...\n");
db_save(db, "foo.db");
- print("SAVED. CLOSE...\n");
+ LOG_INFO("SAVED. CLOSE...\n");
db_close(db);
- print("CLOSED.\n");
+ LOG_INFO("CLOSED.\n");
}
// Multiline text file buffers
if(cvar("developer"))
{
- print("Verifying vector compression table...\n");
+ LOG_INFO("Verifying vector compression table...\n");
for(i = 0x0F00; i < 0xFFFF; ++i)
if(i != compressShortVector(decompressShortVector(i)))
{
- print("BROKEN vector compression: ", ftos(i));
- print(" -> ", vtos(decompressShortVector(i)));
- print(" -> ", ftos(compressShortVector(decompressShortVector(i))));
- print("\n");
+ LOG_INFO("BROKEN vector compression: ", ftos(i));
+ LOG_INFO(" -> ", vtos(decompressShortVector(i)));
+ LOG_INFO(" -> ", ftos(compressShortVector(decompressShortVector(i))));
+ LOG_INFO("\n");
error("b0rk");
}
- print("Done.\n");
+ LOG_INFO("Done.\n");
}
}
if (!(tmp_cvar || tmp_value))
{
- dprint("Error: Invalid usage of cvar_settemp(string, string); !\n");
+ LOG_TRACE("Error: Invalid usage of cvar_settemp(string, string); !\n");
return 0;
}
if(!cvar_type(tmp_cvar))
{
- printf("Error: cvar %s doesn't exist!\n", tmp_cvar);
+ LOG_INFOF("Error: cvar %s doesn't exist!\n", tmp_cvar);
return 0;
}
++i;
}
else
- printf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname);
+ LOG_INFOF("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname);
}
return i;
z = rint(v.z * 4) + 128;
if(x > 255 || x < 0)
{
- print("shot origin ", vtos(v), " x out of bounds\n");
+ LOG_INFO("shot origin ", vtos(v), " x out of bounds\n");
x = bound(0, x, 255);
}
if(y > 255 || y < 0)
{
- print("shot origin ", vtos(v), " y out of bounds\n");
+ LOG_INFO("shot origin ", vtos(v), " y out of bounds\n");
y = bound(0, y, 255);
}
if(z > 255 || z < 0)
{
- print("shot origin ", vtos(v), " z out of bounds\n");
+ LOG_INFO("shot origin ", vtos(v), " z out of bounds\n");
z = bound(0, z, 255);
}
return x * 0x10000 + y * 0x100 + z;
{
if(shutdown_running)
{
- print("Recursive shutdown detected! Only restoring cvars...\n");
+ LOG_INFO("Recursive shutdown detected! Only restoring cvars...\n");
}
else
{
#ifdef SVQC
void dedicated_print(string input) // print(), but only print if the server is not local
{
- if(server_is_dedicated) { print(input); }
+ if(server_is_dedicated) { LOG_INFO(input); }
}
#endif
void vehicle_use()
{
- dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
+ LOG_TRACE("vehicle ",self.netname, " used by ", activator.classname, "\n");
self.tur_head.team = activator.team;
if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO && !gameover)
{
- dprint("Respawning vehicle: ", self.netname, "\n");
+ LOG_TRACE("Respawning vehicle: ", self.netname, "\n");
if(self.effects & EF_NODRAW)
{
self.think = vehicles_spawn;
if(vehicles_exit_running)
{
- dprint("^1vehicles_exit allready running! this is not good..\n");
+ LOG_TRACE("^1vehicles_exit allready running! this is not good..\n");
return;
}
// initialization
void vehicles_spawn()
{
- dprint("Spawning vehicle: ", self.classname, "\n");
+ LOG_TRACE("Spawning vehicle: ", self.classname, "\n");
// disown & reset
self.vehicle_hudmodel.viewmodelforclient = self;
}
else if(!vehic.gunner1 && time >= vehic.gun1.phase) { gunner = vehic.gun1; vehic.gunner1 = player; }
else if(!vehic.gunner2 && time >= vehic.gun2.phase) { gunner = vehic.gun2; vehic.gunner2 = player; }
- else { dprint("Vehicle is full, fail\n"); return false; }
+ else { LOG_TRACE("Vehicle is full, fail\n"); return false; }
player.vehicle = gunner;
player.angles = vehic.angles;
}
#if 0
- dprint(vtos(camera_position), "\n");
- dprint(vtos(old_camera_angle), "\n");
- dprint(vtos(camera_angle), "\n");
+ LOG_TRACE(vtos(camera_position), "\n");
+ LOG_TRACE(vtos(old_camera_angle), "\n");
+ LOG_TRACE(vtos(camera_angle), "\n");
#endif
freeze_org = getpropertyvec(VF_ORIGIN);
v = explosion_calcpush(explosion_f * speedfactor, m, target_v, 1, 0);
// the factor we then get is:
// 1
- printf("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
+ LOG_INFOF("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
m,
target_v, target_v + v,
target_v * target_v, m * explosion_f * speedfactor * explosion_f * speedfactor, target_v * target_v + m * explosion_f * speedfactor * explosion_f * speedfactor,
WEP_CONFIG_WRITETOFILE("// }}}\n");
// step 5: debug info
- print(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
+ LOG_INFO(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
totalsettings += WEP_CONFIG_COUNT;
}
{ wep_config_queue[x] = string_null; }
// extra information
- print(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));
+ LOG_INFO(sprintf("Totals: %d weapons, %d settings\n", (i - 1), totalsettings));
}
#define WEP_CONFIG_WRITETOFILE(a) do { \
fputs(wep_config_file, a); \
- if(wep_config_alsoprint) { print(a); } \
+ if(wep_config_alsoprint) { LOG_INFO(a); } \
} while(0)
#define WEP_CONFIG_WRITE_CVARS_NONE(wepname,name) \
#if 0
if(self.rl_release == 0)
{
- printf("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo));
+ LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: TRUE\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo));
return true;
}
else
{
ammo_amount = self.WEP_AMMO(DEVASTATOR) >= WEP_CVAR(devastator, ammo);
ammo_amount += self.(weapon_load[WEP_DEVASTATOR.m_id]) >= WEP_CVAR(devastator, ammo);
- printf("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
+ LOG_INFOF("W_Devastator(WR_CHECKAMMO1): %d, %.2f, %d: %s\n", self.rl_release, self.WEP_AMMO(DEVASTATOR), WEP_CVAR(devastator, ammo), (ammo_amount ? "TRUE" : "FALSE"));
return ammo_amount;
}
#else
{
case WR_IMPACTEFFECT:
{
- print("Since when does Porto send DamageInfo?\n");
+ LOG_INFO("Since when does Porto send DamageInfo?\n");
return true;
}
case WR_INIT:
af = ATTACK_FINISHED(self);
self.switchweapon = self.weapon;
ATTACK_FINISHED(self) = time;
- print(ftos(self.WEP_AMMO(RIFLE)), "\n");
+ LOG_INFO(ftos(self.WEP_AMMO(RIFLE)), "\n");
r = weapon_prepareattack(self.rifle_bullethail_frame == WFRAME_FIRE2, self.rifle_bullethail_refire);
if(self.switchweapon == self.weapon)
self.switchweapon = sw;
{
self.rifle_bullethail_attackfunc();
weapon_thinkf(self.rifle_bullethail_frame, self.rifle_bullethail_animtime, W_Rifle_BulletHail_Continue);
- print("thinkf set\n");
+ LOG_INFO("thinkf set\n");
}
else
{
ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
- print("out of ammo... ", ftos(self.weaponentity.state), "\n");
+ LOG_INFO("out of ammo... ", ftos(self.weaponentity.state), "\n");
}
}
{ accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, swing_damage); }
#ifdef DEBUG_SHOCKWAVE
- print(sprintf(
+ LOG_INFO(sprintf(
"MELEE: %s hitting %s with %f damage (factor: %f) at %f time.\n",
self.realowner.netname,
target_victim.netname,
);
#ifdef DEBUG_SHOCKWAVE
- print(sprintf(
+ LOG_INFO(sprintf(
"SELF HIT: multiplier = %f, damage = %f, force = %f... "
"multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
multiplier,
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
#ifdef DEBUG_SHOCKWAVE
- print(sprintf(
+ LOG_INFO(sprintf(
"SPLASH HIT: multiplier = %f, damage = %f, force = %f... "
"multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
multiplier,
if(W_Shockwave_Attack_CheckHit(queue, head, final_force, final_damage)) { queue = min(queue + 1, MAX_SHOCKWAVE_HITS); }
#ifdef DEBUG_SHOCKWAVE
- print(sprintf(
+ LOG_INFO(sprintf(
"BLAST HIT: multiplier = %f, damage = %f, force = %f... "
"multiplier_from_accuracy = %f, multiplier_from_distance = %f.\n",
multiplier,
if(accuracy_isgooddamage(self.realowner, head))
{
- print("wtf\n");
+ LOG_INFO("wtf\n");
accuracy_add(self.realowner, WEP_SHOCKWAVE.m_id, 0, final_damage);
}
#ifdef DEBUG_SHOCKWAVE
- print(sprintf(
+ LOG_INFO(sprintf(
"SHOCKWAVE by %s: damage = %f, force = %f.\n",
self.netname,
final_damage,
{
csqcplayer_moveframe = clientcommandframe;
getinputstate(csqcplayer_moveframe-1);
- print("the Weird code path got hit\n");
+ LOG_INFO("the Weird code path got hit\n");
return;
}
#endif
prandom_seed = c;
#ifdef USE_PRANDOM_DEBUG
- dprint("RANDOM -> ", ftos(c), "\n");
+ LOG_TRACE("RANDOM -> ", ftos(c), "\n");
#endif
return c / 65536; // in [0..1[
{
prandom_seed = seed;
#ifdef USE_PRANDOM_DEBUG
- dprint("SRANDOM ", ftos(seed), "\n");
+ LOG_TRACE("SRANDOM ", ftos(seed), "\n");
#endif
}
#ifdef USE_PRANDOM_DEBUG
void prandom_debug()
{
- dprint("Current random seed = ", ftos(prandom_seed), "\n");
+ LOG_TRACE("Current random seed = ", ftos(prandom_seed), "\n");
}
#endif
#endif
void TEST_Fail(string cond)
{
- printf("Assertion failed: ", cond);
+ LOG_INFOF("Assertion failed: ", cond);
//backtrace();
++TEST_failed;
}
}
if(f)
{
- printf("%d tests failed\n", f);
+ LOG_INFOF("%d tests failed\n", f);
return 1;
}
else
{
- printf("All tests OK\n", f);
+ LOG_INFOF("All tests OK\n", f);
return 0;
}
}
float TEST_Run(string s)
{
- printf("%s: testing...\n", s);
+ LOG_INFOF("%s: testing...\n", s);
TEST_failed = TEST_ok = 0;
callfunction(strcat("_TEST_", s));
if(TEST_failed > 0)
{
- printf("%s: %d items failed.\n", s, TEST_failed);
+ LOG_INFOF("%s: %d items failed.\n", s, TEST_failed);
return 0;
}
else if(!TEST_ok)
{
- printf("%s: did not complete.\n", s);
+ LOG_INFOF("%s: did not complete.\n", s);
return 0;
}
return 1;
return 0;
if(e.url_rbuf >= 0 || e.url_wbuf >= 0)
{
- printf("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
+ LOG_INFOF("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
return 0;
}
e.url_rbuf = buf_create();
if(e.url_rbuf < 0)
{
- print("url_URI_Get_Callback: out of memory in buf_create\n");
+ LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
strunzone(e.url_url);
remove(e);
e.url_rbufpos = 0;
if(e.url_rbuf < 0)
{
- print("url_URI_Get_Callback: out of memory in buf_create\n");
+ LOG_INFO("url_URI_Get_Callback: out of memory in buf_create\n");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
strunzone(e.url_url);
remove(e);
e.url_wbuf = buf_create();
if(e.url_wbuf < 0)
{
- print("url_single_fopen: out of memory in buf_create\n");
+ LOG_INFO("url_single_fopen: out of memory in buf_create\n");
rdy(e, pass, URL_READY_ERROR);
strunzone(e.url_url);
remove(e);
break;
if(i >= autocvar__urllib_nextslot)
{
- print("url_single_fopen: too many concurrent requests\n");
+ LOG_INFO("url_single_fopen: too many concurrent requests\n");
rdy(NULL, pass, URL_READY_ERROR);
return;
}
// GET the data
if(!crypto_uri_postbuf(url, i + MIN_URL_ID, string_null, string_null, -1, 0))
{
- print("url_single_fopen: failure in crypto_uri_postbuf\n");
+ LOG_INFO("url_single_fopen: failure in crypto_uri_postbuf\n");
rdy(NULL, pass, URL_READY_ERROR);
return;
}
rdy(e, pass, URL_READY_CANWRITE);
break;
case FILE_READ:
- print("url_single_fopen: cannot open '-' for reading\n");
+ LOG_INFO("url_single_fopen: cannot open '-' for reading\n");
rdy(NULL, pass, URL_READY_ERROR);
break;
}
break;
if(i >= autocvar__urllib_nextslot)
{
- print("url_fclose: too many concurrent requests\n");
+ LOG_INFO("url_fclose: too many concurrent requests\n");
e.url_ready(e,e.url_ready_pass, URL_READY_ERROR);
buf_del(e.url_wbuf);
strunzone(e.url_url);
// POST the data
if(!crypto_uri_postbuf(e.url_url, i + MIN_URL_ID, "text/plain", "", e.url_wbuf, 0))
{
- print("url_fclose: failure in crypto_uri_postbuf\n");
+ LOG_INFO("url_fclose: failure in crypto_uri_postbuf\n");
e.url_ready(e, e.url_ready_pass, URL_READY_ERROR);
buf_del(e.url_wbuf);
strunzone(e.url_url);
else if(e.url_fh == URL_FH_STDOUT)
{
// stdout
- print(s);
+ LOG_INFO(s);
}
else
{
{
if(status == -422) // Unprocessable Entity
{
- print("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
+ LOG_INFO("uri_multi_ready: got HTTP error 422, data is in unusable format - not continuing\n");
me.url_ready(fh, me.url_ready_pass, status);
strunzone(me.url_url);
remove(me);
n = tokenize_console(url);
if(n <= 0)
{
- print("url_multi_fopen: need at least one URL\n");
+ LOG_INFO("url_multi_fopen: need at least one URL\n");
rdy(NULL, pass, URL_READY_ERROR);
return;
}
s = me.classname;
else
s = strcat(me.classname, ": ", s);
- print(_dumptree_space, etos(me), " (", s, ")");
+ LOG_INFO(_dumptree_space, etos(me), " (", s, ")");
if(me.firstChild)
{
- print(" {\n");
+ LOG_INFO(" {\n");
_dumptree_space = strcat(_dumptree_space, " ");
}
else
- print("\n");
+ LOG_INFO("\n");
}
void _dumptree_close(entity pass, entity me)
{
if(me.firstChild)
{
_dumptree_space = substring(_dumptree_space, 0, strlen(_dumptree_space) - 2);
- print(_dumptree_space, "}\n");
+ LOG_INFO(_dumptree_space, "}\n");
}
}
if(argv(0) == "help" || argc == 0)
{
- print(_("Usage: menu_cmd command..., where possible commands are:\n"));
- print(_(" sync - reloads all cvars on the current menu page\n"));
- print(_(" directmenu ITEM - select a menu item as main item\n"));
+ LOG_INFO(_("Usage: menu_cmd command..., where possible commands are:\n"));
+ LOG_INFO(_(" sync - reloads all cvars on the current menu page\n"));
+ LOG_INFO(_(" directmenu ITEM - select a menu item as main item\n"));
- print("\nGeneric commands shared by all programs:\n");
+ LOG_INFO("\nGeneric commands shared by all programs:\n");
GenericCommand_macro_help();
return;
if(argc == 1)
{
- print(_("Available options:\n"));
+ LOG_INFO(_("Available options:\n"));
float i;
entity e;
string s;
continue;
s = substring(s, strlen(filter), strlen(s) - strlen(filter));
}
- print(strcat(" ", s ,"\n"));
+ LOG_INFO(strcat(" ", s ,"\n"));
++i;
}
}
return;
}
- print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
+ LOG_INFO(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
}
void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
{
if(theSize.x <= 0 || theSize.y <= 0) {
- dprint("Drawing zero size text?\n");
+ LOG_TRACE("Drawing zero size text?\n");
return;
}
me.realOrigin_x = me.keepspaceLeft;
if(!me.overrideCondenseFactor)
me.condenseFactor = spaceAvail / spaceUsed;
- dprintf("NOTE: label text %s too wide for label, condensed by factor %f\n", t, me.condenseFactor);
+ LOG_TRACEF("NOTE: label text %s too wide for label, condensed by factor %f\n", t, me.condenseFactor);
}
if(!me.overrideRealOrigin_y)
cvar_set("_menu_prvm_language", prvm_language);
#ifdef WATERMARK
- dprintf("^4MQC Build information: ^1%s\n", WATERMARK);
+ LOG_TRACEF("^4MQC Build information: ^1%s\n", WATERMARK);
#endif
// list all game dirs (TEST)
s = getgamedirinfo(i, GETGAMEDIRINFO_NAME);
if (!s)
break;
- dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
+ LOG_TRACE(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
}
}
if(mouseButtonsPressed < 0)
{
mouseButtonsPressed = 0;
- dprint("Warning: released an already released button\n");
+ LOG_TRACE("Warning: released an already released button\n");
}
}
if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
if(mouseButtonsPressed > 10)
{
mouseButtonsPressed = 10;
- dprint("Warning: pressed an already pressed button\n");
+ LOG_TRACE("Warning: pressed an already pressed button\n");
}
}
if(key == K_ALT) menuShiftState |= S_ALT;
//#define SKINSTRING(name,def) case #name: break
#define SKINSTRING(name,def) case #name: SKIN##name = strzone(_value); break
// I know this leaks memory when skin is read multiple times. Screw it.
-#define SKINEND case "": break; case "//": break; default: dprint("Invalid key in skin file: ", key, "\n"); } }
+#define SKINEND case "": break; case "//": break; default: LOG_TRACE("Invalid key in skin file: ", key, "\n"); } }
#include "skin-customizables.inc"
#undef SKINEND
#undef SKINSTRING
m = MapInfo_BSPName_ByID(i);
if (!m)
{
- print(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
+ LOG_INFO(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
me.refilter(me);
return;
}
}
else
{
- print(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
+ LOG_INFO(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
me.refilter(me);
return;
}
} \
else \
{ \
- printf( \
+ LOG_INFOF( \
"RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
s, \
categories[i].cat_name \
case "cts":
case "xdf": { return CAT_DEFRAG; }
- default: { dprintf("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
+ default: { LOG_TRACEF("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
}
}
fh = fopen(language_filename(s), FILE_READ);
if(fh < 0)
{
- print("Warning: can't open skinvalues.txt file\n");
+ LOG_INFO("Warning: can't open skinvalues.txt file\n");
continue;
}
while((s = fgets(fh)))
float v = fromDecibelOfSquare(db, -40);
float dbv = toDecibelOfSquare(v, -40);
float d = dbv - db;
- printf("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
+ LOG_INFOF("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
TEST_Check(fabs(d) > 0.02);
}
TEST_OK();
minfactor = min(1, 640 / c.x); // can be > 1 only if c_x is <640
maxfactor = max(1, r.x / c.x, r.y / c.y); // can be < 1 only if r_x < c_x and r_y < c_y
- dprint("min factor: ", ftos(minfactor), "\n");
- dprint("max factor: ", ftos(maxfactor), "\n");
+ LOG_TRACE("min factor: ", ftos(minfactor), "\n");
+ LOG_TRACE("max factor: ", ftos(maxfactor), "\n");
if(sz < 0)
f = 1 - (maxfactor - 1) * sz;
r = getresolution(-1);
if(r.x != 0 || r.y != 0)
me.addResolution(me, r.x, r.y, r.z);
- dprint("Added system resolutions.\n");
+ LOG_TRACE("Added system resolutions.\n");
}
if(me.nValues == 0)
me.addResolution(me, 1280, 960, 1); // pc res
me.addResolution(me, 1280, 1024, 1); // pc res
me.addResolution(me, 1920, 1080, 1); // 1080p
- dprint("Added default resolutions.\n");
+ LOG_TRACE("Added default resolutions.\n");
}
- dprint("Total number of resolutions detected: ", ftos(me.nValues), "\n");
+ LOG_TRACE("Total number of resolutions detected: ", ftos(me.nValues), "\n");
me.vid_fullscreen = fullscreen;
void XonoticStatsList_getStats(entity me)
{
- dprint("XonoticStatsList_getStats() at time: ", ftos(time), "\n");
+ LOG_TRACE("XonoticStatsList_getStats() at time: ", ftos(time), "\n");
// delete the old buffer if it exists
if(me.listStats >= 0)
buf_del(me.listStats);
if(t != "" && t != "custom cvar")
return strzone(t);
}
- dprint("WARNING: no tooltip set for ", s, "\n");
+ LOG_TRACE("WARNING: no tooltip set for ", s, "\n");
return string_null;
}
}
else
{
- printf("Received HTTP request data for an invalid id %d.\n", id);
+ LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
}
}
if(_Nex_ExtResponseSystem_UpdateTo)
{
- dprint("error: UpdateNotification_URI_Get_Callback has been called before\n");
+ LOG_TRACE("error: UpdateNotification_URI_Get_Callback has been called before\n");
return;
}
if(status != 0)
{
- dprintf("error receiving update notification: status is %d\n", status);
+ LOG_TRACEF("error receiving update notification: status is %d\n", status);
return;
}
if(substring(data, 0, 1) == "<")
{
- dprint("error: received HTML instead of an update notification\n");
+ LOG_TRACE("error: received HTML instead of an update notification\n");
return;
}
if(strstrofs(data, "\r", 0) != -1)
{
- dprint("error: received carriage returns from update notification server\n");
+ LOG_TRACE("error: received carriage returns from update notification server\n");
return;
}
{
// update needed
_Nex_ExtResponseSystem_UpdateTo = strzone(un_version);
- if(un_download) { printf(_("Update can be downloaded at:\n%s\n"), un_download); }
+ if(un_download) { LOG_INFOF(_("Update can be downloaded at:\n%s\n"), un_download); }
if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); }
DisableServerBackwardsCompatibility();
}
cvar_set("gl_texturecompression", "1");
cvar_set("r_texture_dds_load", "1");
if(!can_dds)
- print(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
+ LOG_INFO(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
return 0;
}
else
{
if(me.sendCvars)
{
- printf("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring));
+ LOG_INFOF("Sending cvar: %s -> %s\n", cvarnamestring, cvar_string(cvarnamestring));
if(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))
{
cmd(sprintf("\nsendcvar %s\n", cvarnamestring));
-void dprint(string s, ...) = #25;
+void LOG_TRACE(string s, ...) = #25;
string ftos(float f) = #26;
string vtos(vector v) = #27;
void error(string e) = #10;
void spawnfunc_worldspawn()
{
float r;
- dprint("TESTCASE: START\n");
+ LOG_TRACE("TESTCASE: START\n");
r = test();
if(r == 1)
error("TESTCASE: PASS");
shotspeedupward *= W_WeaponSpeedFactor();
if (!shotspeed)
{
- dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
+ LOG_TRACE("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
shotspeed = 1000000;
}
if (!maxshottime)
{
- dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
+ LOG_TRACE("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
maxshottime = 1;
}
makevectors(self.v_angle);
if(file < 0)
{
- print(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
+ LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
readfile = "";
}
else
}
e = e.chain;
}
- dprint(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
+ LOG_TRACE(strcat("relink: ", ftos(currentbots), " bots seen.\n"));
bot_strategytoken = bot_list;
bot_strategytoken_taken = true;
}
bestbot = max(bestbot, head.totalfrags - head.totalfrags_lastcheck);
}
- dprint("autoskill: best player got ", ftos(bestplayer), ", ");
- dprint("best bot got ", ftos(bestbot), "; ");
+ LOG_TRACE("autoskill: best player got ", ftos(bestplayer), ", ");
+ LOG_TRACE("best bot got ", ftos(bestbot), "; ");
if(bestbot < 0 || bestplayer < 0)
{
- dprint("not doing anything\n");
+ LOG_TRACE("not doing anything\n");
// don't return, let it reset all counters below
}
else if(bestbot <= bestplayer * factor - 2)
{
if(autocvar_skill < 17)
{
- dprint("2 frags difference, increasing skill\n");
+ LOG_TRACE("2 frags difference, increasing skill\n");
cvar_set("skill", ftos(autocvar_skill + 1));
bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
}
{
if(autocvar_skill > 0)
{
- dprint("2 frags difference, decreasing skill\n");
+ LOG_TRACE("2 frags difference, decreasing skill\n");
cvar_set("skill", ftos(autocvar_skill - 1));
bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
}
}
else
{
- dprint("not doing anything\n");
+ LOG_TRACE("not doing anything\n");
return;
// don't reset counters, wait for them to accumulate
}
threshold = maxspeed * 0.2;
if(sxy < threshold)
{
- dprint("Warning: ", self.netname, " got stuck on a jumppad (velocity in xy is ", ftos(sxy), "), trying to get out of it now\n");
+ LOG_TRACE("Warning: ", self.netname, " got stuck on a jumppad (velocity in xy is ", ftos(sxy), "), trying to get out of it now\n");
self.aistatus |= AI_STATUS_OUT_JUMPPAD;
}
return;
if(tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos))
{
// Remove dangerous dynamic goals from stack
- dprint("bot ", self.netname, " avoided the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it led to a dangerous path; goal stack cleared\n");
+ LOG_TRACE("bot ", self.netname, " avoided the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it led to a dangerous path; goal stack cleared\n");
navigation_clearroute();
return;
}
// Step 4: Move to waypoint
if(self.havocbot_personal_waypoint==world)
{
- dprint("Error: ", self.netname, " trying to walk to a non existent personal waypoint\n");
+ LOG_TRACE("Error: ", self.netname, " trying to walk to a non existent personal waypoint\n");
self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_GOING;
return CMD_STATUS_ERROR;
}
bot_strategytoken_taken = true;
if(havocbot_moveto_refresh_route())
{
- dprint(self.netname, " walking to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts)\n");
+ LOG_TRACE(self.netname, " walking to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts)\n");
self.havocbot_personal_waypoint_searchtime = time + 10;
self.havocbot_personal_waypoint_failcounter = 0;
}
self.havocbot_personal_waypoint_searchtime = time + 2;
if(self.havocbot_personal_waypoint_failcounter >= 30)
{
- dprint("Warning: can't walk to the personal waypoint located at ", vtos(self.havocbot_personal_waypoint.origin),"\n");
+ LOG_TRACE("Warning: can't walk to the personal waypoint located at ", vtos(self.havocbot_personal_waypoint.origin),"\n");
self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_LINKING;
remove(self.havocbot_personal_waypoint);
return CMD_STATUS_ERROR;
}
else
- dprint(self.netname, " can't walk to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts), trying later\n");
+ LOG_TRACE(self.netname, " can't walk to its personal waypoint (after ", ftos(self.havocbot_personal_waypoint_failcounter), " failed attempts), trying later\n");
}
}
if(self.aistatus & AI_STATUS_WAYPOINT_PERSONAL_REACHED)
{
// Step 5: Waypoint reached
- dprint(self.netname, "'s personal waypoint reached\n");
+ LOG_TRACE(self.netname, "'s personal waypoint reached\n");
remove(self.havocbot_personal_waypoint);
self.aistatus &= ~AI_STATUS_WAYPOINT_PERSONAL_REACHED;
return CMD_STATUS_FINISHED;
// Wait until it is linked
if(!self.havocbot_personal_waypoint.wplinked)
{
- dprint(self.netname, " waiting for personal waypoint to be linked\n");
+ LOG_TRACE(self.netname, " waiting for personal waypoint to be linked\n");
return CMD_STATUS_EXECUTING;
}
self.aistatus |= AI_STATUS_WAYPOINT_PERSONAL_GOING;
// Step 3: Route to waypoint
- dprint(self.netname, " walking to its personal waypoint\n");
+ LOG_TRACE(self.netname, " walking to its personal waypoint\n");
return CMD_STATUS_EXECUTING;
}
wp = waypoint_spawnpersonal(pos);
if(wp==world)
{
- dprint("Error: Can't spawn personal waypoint at ",vtos(pos),"\n");
+ LOG_TRACE("Error: Can't spawn personal waypoint at ",vtos(pos),"\n");
return CMD_STATUS_ERROR;
}
if (!(self.kh_next))
{
- dprint("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer\n");
self.havocbot_role = havocbot_role_kh_freelancer;
self.havocbot_role_timeout = 0;
return;
if (self.kh_next)
{
- dprint("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier\n");
self.havocbot_role = havocbot_role_kh_carrier;
self.havocbot_role_timeout = 0;
return;
self.havocbot_role_timeout = time + random() * 10 + 20;
if (time > self.havocbot_role_timeout)
{
- dprint("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer\n");
self.havocbot_role = havocbot_role_kh_freelancer;
self.havocbot_role_timeout = 0;
return;
if (self.kh_next)
{
- dprint("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier\n");
self.havocbot_role = havocbot_role_kh_carrier;
self.havocbot_role_timeout = 0;
return;
self.havocbot_role_timeout = time + random() * 10 + 20;
if (time > self.havocbot_role_timeout)
{
- dprint("changing role to freelancer\n");
+ LOG_TRACE("changing role to freelancer\n");
self.havocbot_role = havocbot_role_kh_freelancer;
self.havocbot_role_timeout = 0;
return;
if (self.kh_next)
{
- dprint("changing role to carrier\n");
+ LOG_TRACE("changing role to carrier\n");
self.havocbot_role = havocbot_role_kh_carrier;
self.havocbot_role_timeout = 0;
return;
{
if (random() < 0.5)
{
- dprint("changing role to offense\n");
+ LOG_TRACE("changing role to offense\n");
self.havocbot_role = havocbot_role_kh_offense;
}
else
{
- dprint("changing role to defense\n");
+ LOG_TRACE("changing role to defense\n");
self.havocbot_role = havocbot_role_kh_defense;
}
self.havocbot_role_timeout = 0;
void havocbot_chooserole()
{
- dprint("choosing a role...\n");
+ LOG_TRACE("choosing a role...\n");
self.bot_strategytime = 0;
if (MUTATOR_CALLHOOK(HavocBot_ChooseRole, self))
return;
{
switch(autocvar_bot_debug)
{
- case 1: dprint(input); break;
- case 2: print(input); break;
+ case 1: LOG_TRACE(input); break;
+ case 2: LOG_INFO(input); break;
}
}
return;
buf_del(bot.bot_cmdqueuebuf);
bot.bot_cmdqueuebuf_allocated = false;
- dprint("bot ", bot.netname, " queue cleared\n");
+ LOG_TRACE("bot ", bot.netname, " queue cleared\n");
}
void bot_queuecommand(entity bot, string cmdstring)
}
e = find(world, targetname, s);
if(!e)
- print("invalid place ", s, "\n");
+ LOG_INFO("invalid place ", s, "\n");
if(i < MAX_BOT_PLACES)
{
self.(bot_placenames[i]) = strzone(placename);
{
e = find(world, targetname, placename);
if(!e)
- print("invalid place ", placename, "\n");
+ LOG_INFO("invalid place ", placename, "\n");
return e;
}
}
if(cmd_parm_type!=BOT_CMD_PARAMETER_NONE&&parm=="")
{
- print("ERROR: A parameter is required for this command\n");
+ LOG_INFO("ERROR: A parameter is required for this command\n");
return 0;
}
}
return 1;
}
- print("ERROR: No such command '", cmdstring, "'\n");
+ LOG_INFO("ERROR: No such command '", cmdstring, "'\n");
return 0;
}
break;
}
- print(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
+ LOG_INFO(strcat("Command: ",bot_cmd_string[i],"\nParameter: <",stype,"> \n"));
- print("Description: ");
+ LOG_INFO("Description: ");
switch(i)
{
case BOT_CMD_PAUSE:
- print("Stops the bot completely. Any command other than 'continue' will be ignored.");
+ LOG_INFO("Stops the bot completely. Any command other than 'continue' will be ignored.");
break;
case BOT_CMD_CONTINUE:
- print("Disable paused status");
+ LOG_INFO("Disable paused status");
break;
case BOT_CMD_WAIT:
- print("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
+ LOG_INFO("Pause command parsing and bot ai for N seconds. Pressed key will remain pressed");
break;
case BOT_CMD_WAIT_UNTIL:
- print("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
+ LOG_INFO("Pause command parsing and bot ai until time is N from the last barrier. Pressed key will remain pressed");
break;
case BOT_CMD_BARRIER:
- print("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
+ LOG_INFO("Waits till all bots that have a command queue reach this command. Pressed key will remain pressed");
break;
case BOT_CMD_TURN:
- print("Look to the right or left N degrees. For turning to the left use positive numbers.");
+ LOG_INFO("Look to the right or left N degrees. For turning to the left use positive numbers.");
break;
case BOT_CMD_MOVETO:
- print("Walk to an specific coordinate on the map. Usage: moveto \"x y z\"");
+ LOG_INFO("Walk to an specific coordinate on the map. Usage: moveto \"x y z\"");
break;
case BOT_CMD_MOVETOTARGET:
- print("Walk to the specific target on the map");
+ LOG_INFO("Walk to the specific target on the map");
break;
case BOT_CMD_RESETGOAL:
- print("Resets the goal stack");
+ LOG_INFO("Resets the goal stack");
break;
case BOT_CMD_CC:
- print("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
+ LOG_INFO("Execute client command. Examples: cc \"say something\"; cc god; cc \"name newnickname\"; cc kill;");
break;
case BOT_CMD_IF:
- print("Perform simple conditional execution.\n");
- print("Syntax: \n");
- print(" sv_cmd .. if \"condition\"\n");
- print(" sv_cmd .. <instruction if true>\n");
- print(" sv_cmd .. <instruction if true>\n");
- print(" sv_cmd .. else\n");
- print(" sv_cmd .. <instruction if false>\n");
- print(" sv_cmd .. <instruction if false>\n");
- print(" sv_cmd .. fi\n");
- print("Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n");
- print(" Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n");
- print("Fields: health, speed, flagcarrier\n");
- print("Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;");
+ LOG_INFO("Perform simple conditional execution.\n");
+ LOG_INFO("Syntax: \n");
+ LOG_INFO(" sv_cmd .. if \"condition\"\n");
+ LOG_INFO(" sv_cmd .. <instruction if true>\n");
+ LOG_INFO(" sv_cmd .. <instruction if true>\n");
+ LOG_INFO(" sv_cmd .. else\n");
+ LOG_INFO(" sv_cmd .. <instruction if false>\n");
+ LOG_INFO(" sv_cmd .. <instruction if false>\n");
+ LOG_INFO(" sv_cmd .. fi\n");
+ LOG_INFO("Conditions: a=b, a>b, a<b, a\t\t(spaces not allowed)\n");
+ LOG_INFO(" Values in conditions can be numbers, cvars in the form cvar.cvar_string or special fields\n");
+ LOG_INFO("Fields: health, speed, flagcarrier\n");
+ LOG_INFO("Examples: if health>50; if health>cvar.g_balance_laser_primary_damage; if flagcarrier;");
break;
case BOT_CMD_RESETAIM:
- print("Points the aim to the coordinates x,y 0,0");
+ LOG_INFO("Points the aim to the coordinates x,y 0,0");
break;
case BOT_CMD_AIM:
- print("Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n");
- print("There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n");
- print("Examples: aim \"90 0\" // Turn 90 degrees inmediately (positive numbers move to the left/up)\n");
- print(" aim \"0 90 2\" // Will gradually look to the sky in the next two seconds");
+ LOG_INFO("Move the aim x/y (horizontal/vertical) degrees relatives to the bot\n");
+ LOG_INFO("There is a 3rd optional parameter telling in how many seconds the aim has to reach the new position\n");
+ LOG_INFO("Examples: aim \"90 0\" // Turn 90 degrees inmediately (positive numbers move to the left/up)\n");
+ LOG_INFO(" aim \"0 90 2\" // Will gradually look to the sky in the next two seconds");
break;
case BOT_CMD_AIMTARGET:
- print("Points the aim to given target");
+ LOG_INFO("Points the aim to given target");
break;
case BOT_CMD_PRESSKEY:
- print("Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use\n");
- print("Multiple keys can be pressed at time (with many presskey calls) and it will remain pressed until the command \"releasekey\" is called");
- print("Note: The script will not return the control to the bot ai until all keys are released");
+ LOG_INFO("Press one of the following keys: forward, backward, left, right, jump, crouch, attack1, attack2, use\n");
+ LOG_INFO("Multiple keys can be pressed at time (with many presskey calls) and it will remain pressed until the command \"releasekey\" is called");
+ LOG_INFO("Note: The script will not return the control to the bot ai until all keys are released");
break;
case BOT_CMD_RELEASEKEY:
- print("Release previoulsy used keys. Use the parameter \"all\" to release all keys");
+ LOG_INFO("Release previoulsy used keys. Use the parameter \"all\" to release all keys");
break;
case BOT_CMD_SOUND:
- print("play sound file at bot location");
+ LOG_INFO("play sound file at bot location");
break;
case BOT_CMD_DEBUG_ASSERT_CANFIRE:
- print("verify the state of the weapon entity");
+ LOG_INFO("verify the state of the weapon entity");
break;
default:
- print("This command has no description yet.");
+ LOG_INFO("This command has no description yet.");
break;
}
- print("\n");
+ LOG_INFO("\n");
}
}
if(!bot_cmds_initialized)
bot_commands_init();
- print("List of all available commands:\n");
- print(" Command - Parameter Type\n");
+ LOG_INFO("List of all available commands:\n");
+ LOG_INFO(" Command - Parameter Type\n");
for(i=1;i<BOT_CMD_COUNTER;++i)
{
ptype = "none";
break;
}
- print(strcat(" ",bot_cmd_string[i]," - <",ptype,"> \n"));
+ LOG_INFO(strcat(" ",bot_cmd_string[i]," - <",ptype,"> \n"));
}
}
return ((self.flagcarried!=world));
}
- print(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n"));
+ LOG_INFO(strcat("ERROR: Unable to convert the expression '",expr,"' into a numeric value\n"));
return 0;
}
if(self.bot_cmd_condition_status != CMD_CONDITION_NONE)
{
// Only one "if" block is allowed at time
- print("ERROR: Only one conditional block can be processed at time");
+ LOG_INFO("ERROR: Only one conditional block can be processed at time");
bot_clearqueue(self);
return CMD_STATUS_ERROR;
}
if(f)
{
self.colormod = '0 8 8';
- print("Bot ", self.netname, " using ", self.weaponname, " wants to fire, inhibited by weaponentity state\n");
+ LOG_INFO("Bot ", self.netname, " using ", self.weaponname, " wants to fire, inhibited by weaponentity state\n");
}
}
else if(ATTACK_FINISHED(self) > time)
if(f)
{
self.colormod = '8 0 8';
- print("Bot ", self.netname, " using ", self.weaponname, " wants to fire, inhibited by ATTACK_FINISHED (", ftos(ATTACK_FINISHED(self) - time), " seconds left)\n");
+ LOG_INFO("Bot ", self.netname, " using ", self.weaponname, " wants to fire, inhibited by ATTACK_FINISHED (", ftos(ATTACK_FINISHED(self) - time), " seconds left)\n");
}
}
else if(self.tuba_note)
if(f)
{
self.colormod = '8 0 0';
- print("Bot ", self.netname, " using ", self.weaponname, " wants to fire, bot still has an active tuba note\n");
+ LOG_INFO("Bot ", self.netname, " using ", self.weaponname, " wants to fire, bot still has an active tuba note\n");
}
}
else
if(!f)
{
self.colormod = '8 8 0';
- print("Bot ", self.netname, " using ", self.weaponname, " thinks it has fired, but apparently did not; ATTACK_FINISHED says ", ftos(ATTACK_FINISHED(self) - time), " seconds left\n");
+ LOG_INFO("Bot ", self.netname, " using ", self.weaponname, " thinks it has fired, but apparently did not; ATTACK_FINISHED says ", ftos(ATTACK_FINISHED(self) - time), " seconds left\n");
}
}
if(bot_cmd.bot_cmd_type!=BOT_CMD_NULL)
{
bot_command_executed(true);
- print( "WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
+ LOG_INFO( "WARNING: Commands are ignored while the bot is paused. Use the command 'continue' instead.\n");
}
return 1;
}
status = bot_cmd_debug_assert_canfire();
break;
default:
- print(strcat("ERROR: Invalid command on queue with id '",ftos(bot_cmd.bot_cmd_type),"'\n"));
+ LOG_INFO(strcat("ERROR: Invalid command on queue with id '",ftos(bot_cmd.bot_cmd_type),"'\n"));
return 0;
}
if (status==CMD_STATUS_ERROR)
- print(strcat("ERROR: The command '",bot_cmd_string[bot_cmd.bot_cmd_type],"' returned an error status\n"));
+ LOG_INFO(strcat("ERROR: The command '",bot_cmd_string[bot_cmd.bot_cmd_type],"' returned an error status\n"));
// Move execution pointer
if(status==CMD_STATUS_EXECUTING)
{
if(!(f & WAYPOINTFLAG_GENERATED))
{
- dprint("Killed a waypoint that was stuck in solid at ", vtos(w.origin), "\n");
+ LOG_TRACE("Killed a waypoint that was stuck in solid at ", vtos(w.origin), "\n");
remove(w);
return world;
}
{
if(autocvar_developer)
{
- print("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
+ LOG_INFO("A generated waypoint is stuck in solid at ", vtos(w.origin), "\n");
backtrace("Waypoint stuck");
}
}
if (file < 0)
{
- dprint("waypoint links load from ");
- dprint(filename);
- dprint(" failed\n");
+ LOG_TRACE("waypoint links load from ");
+ LOG_TRACE(filename);
+ LOG_TRACE(" failed\n");
return false;
}
if(!found)
{
- dprint("waypoint_load_links: couldn't find 'from' waypoint at ", vtos(wp_from.origin),"\n");
+ LOG_TRACE("waypoint_load_links: couldn't find 'from' waypoint at ", vtos(wp_from.origin),"\n");
continue;
}
if(!found)
{
- dprint("waypoint_load_links: couldn't find 'to' waypoint at ", vtos(wp_to.origin),"\n");
+ LOG_TRACE("waypoint_load_links: couldn't find 'to' waypoint at ", vtos(wp_to.origin),"\n");
continue;
}
fclose(file);
- dprint("loaded ");
- dprint(ftos(c));
- dprint(" waypoint links from maps/");
- dprint(mapname);
- dprint(".waypoints.cache\n");
+ LOG_TRACE("loaded ");
+ LOG_TRACE(ftos(c));
+ LOG_TRACE(" waypoint links from maps/");
+ LOG_TRACE(mapname);
+ LOG_TRACE(".waypoints.cache\n");
botframe_cachedwaypointlinks = true;
return true;
if (file < 0)
{
- dprint("waypoint links load from ");
- dprint(filename);
- dprint(" failed\n");
+ LOG_TRACE("waypoint links load from ");
+ LOG_TRACE(filename);
+ LOG_TRACE(" failed\n");
return;
}
if(!found)
{
- print(strcat("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped\n"));
+ LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_from_pos), ". Path skipped\n"));
continue;
}
}
if(!found)
{
- print(strcat("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped\n"));
+ LOG_INFO(strcat("NOTICE: Can not find waypoint at ", vtos(wp_to_pos), ". Path skipped\n"));
continue;
}
fclose(file);
- dprint("loaded ");
- dprint(ftos(c));
- dprint(" waypoint links from maps/");
- dprint(mapname);
- dprint(".waypoints.hardwired\n");
+ LOG_TRACE("loaded ");
+ LOG_TRACE(ftos(c));
+ LOG_TRACE(" waypoint links from maps/");
+ LOG_TRACE(mapname);
+ LOG_TRACE(".waypoints.hardwired\n");
}
entity waypoint_get_link(entity w, float i)
file = fopen(filename, FILE_WRITE);
if (file < 0)
{
- print("waypoint links save to ");
- print(filename);
- print(" failed\n");
+ LOG_INFO("waypoint links save to ");
+ LOG_INFO(filename);
+ LOG_INFO(" failed\n");
}
c = 0;
w = findchain(classname, "waypoint");
fclose(file);
botframe_cachedwaypointlinks = true;
- print("saved ");
- print(ftos(c));
- print(" waypoints links to maps/");
- print(mapname);
- print(".waypoints.cache\n");
+ LOG_INFO("saved ");
+ LOG_INFO(ftos(c));
+ LOG_INFO(" waypoints links to maps/");
+ LOG_INFO(mapname);
+ LOG_INFO(".waypoints.cache\n");
}
// save waypoints to gamedir/data/maps/mapname.waypoints
cwb = cwb + 1;
}
fclose(file);
- dprint("loaded ");
- dprint(ftos(cwp));
- dprint(" waypoints and ");
- dprint(ftos(cwb));
- dprint(" wayboxes from maps/");
- dprint(mapname);
- dprint(".waypoints\n");
+ LOG_TRACE("loaded ");
+ LOG_TRACE(ftos(cwp));
+ LOG_TRACE(" waypoints and ");
+ LOG_TRACE(ftos(cwb));
+ LOG_TRACE(" wayboxes from maps/");
+ LOG_TRACE(mapname);
+ LOG_TRACE(".waypoints\n");
}
else
{
- dprint("waypoint load from ");
- dprint(filename);
- dprint(" failed\n");
+ LOG_TRACE("waypoint load from ");
+ LOG_TRACE(filename);
+ LOG_TRACE(" failed\n");
}
return cwp + cwb;
}
}
if(bestdist < maxdist)
{
- print("update chain to new nearest WP ", etos(p.(fld)), "\n");
+ LOG_INFO("update chain to new nearest WP ", etos(p.(fld)), "\n");
return 0;
}
tmax = t;
}
- print("spawning a waypoint for connecting to ", etos(wp), "\n");
+ LOG_INFO("spawning a waypoint for connecting to ", etos(wp), "\n");
botframe_autowaypoints_createwp(o, p, fld, 0);
return 1;
}
if(r != -1)
return;
- print("emergency: got no good nearby WP to build a link from, starting a new chain\n");
+ LOG_INFO("emergency: got no good nearby WP to build a link from, starting a new chain\n");
if(!botframe_autowaypoints_fixdown(p.origin))
return; // shouldn't happen, caught above
botframe_autowaypoints_createwp(trace_endpos, p, fld, WAYPOINTFLAG_PROTECTED);
{
if (!(w.wpflags & (WAYPOINTFLAG_USEFUL | WAYPOINTFLAG_DEAD_END)))
{
- printf("Removed a waypoint at %v. Try again for more!\n", w.origin);
+ LOG_INFOF("Removed a waypoint at %v. Try again for more!\n", w.origin);
te_explosion(w.origin);
waypoint_remove(w);
break;
cvar_string = cvar_string_normal;
cvar_set = cvar_set_normal;
cvar_set("g_campaign", "0");
- print("^4campaign initialization failed: ", s, "\n");
+ LOG_INFO("^4campaign initialization failed: ", s, "\n");
if(autocvar__campaign_testrun)
error("CAMPAIGN FAIL AHAHAHAHAHAHAHAHAH))");
return 1;
if(campaign_won && campaign_entries < 2)
{
// last map won!
- print("^2test run: campaign looks GOOD\n");
+ LOG_INFO("^2test run: campaign looks GOOD\n");
localcmd("togglemenu 1\n");
CampaignFile_Unload();
return;
RadiusDamage(e2, self, 1000, 0, 128, world, world, 500, DEATH_CHEAT, e);
remove(e2);
- print("404 Sportsmanship not found.\n");
+ LOG_INFO("404 Sportsmanship not found.\n");
DID_CHEAT();
break;
}
if(IS_CLIENT(self))
{
- print("Warning: ClientConnect, but already connected!\n");
+ LOG_INFO("Warning: ClientConnect, but already connected!\n");
return;
}
if(player_count<0)
{
- dprint("BUG player count is lower than zero, this cannot happen!\n");
+ LOG_TRACE("BUG player count is lower than zero, this cannot happen!\n");
player_count = 0;
}
if (!IS_CLIENT(self))
{
- print("Warning: ClientDisconnect without ClientConnect\n");
+ LOG_INFO("Warning: ClientDisconnect without ClientConnect\n");
return;
}
if(strstr(autocvar_g_xonoticversion, "git", 0) >= 0 || strstr(autocvar_g_xonoticversion, "autobuild", 0) >= 0)
{
// notify release users if connecting to git
- dprint("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+ LOG_TRACE("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, " (beta)^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, self.cvar_g_xonoticversion);
}
else
if(r < 0)
{
// give users new version
- dprint("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n");
+ LOG_TRACE("^1NOTE^7 to ", self.netname, "^7 - ^3Xonotic ", autocvar_g_xonoticversion, "^7 is out, and you still have ^3Xonotic ", self.cvar_g_xonoticversion, "^1 - get the update from ^4http://www.xonotic.org/^1!\n");
Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, self.cvar_g_xonoticversion);
}
else if(r > 0)
{
// notify users about old server version
- print("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
+ LOG_INFO("^1NOTE^7 to ", self.netname, "^7 - the server is running ^3Xonotic ", autocvar_g_xonoticversion, "^7, you have ^3Xonotic ", self.cvar_g_xonoticversion, "^1\n");
Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, self.cvar_g_xonoticversion);
}
}
{
if(e.wpcost >= 10000000)
{
- print("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
+ LOG_INFO("unreachable: ", etos(e), " ", vtos(e.origin), "\n");
e.colormod_z = 8;
e.effects |= EF_NODEPTHTEST | EF_BLUE;
++i;
}
}
if(i)
- print(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
+ LOG_INFO(ftos(i), " waypoints cannot be reached from here in any way (marked with blue light)\n");
navigation_markroutes_inverted(e2);
i = 0;
for(e = findchain(classname, "waypoint"); e; e = e.chain)
{
if(e.wpcost >= 10000000)
{
- print("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
+ LOG_INFO("cannot reach me: ", etos(e), " ", vtos(e.origin), "\n");
e.colormod_x = 8;
if(!(e.effects & EF_NODEPTHTEST)) // not already reported before
++m;
}
}
if(i)
- print(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
+ LOG_INFO(ftos(i), " waypoints cannot walk to here in any way (marked with red light)\n");
if(m)
- print(ftos(m), " waypoints have been marked total\n");
+ LOG_INFO(ftos(m), " waypoints have been marked total\n");
i = 0;
for(e = findchain(classname, "info_player_deathmatch"); e; e = e.chain)
{
else
{
setorigin(e, org);
- print("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+ LOG_INFO("spawn without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
e.effects |= EF_NODEPTHTEST;
setmodel(e, self.model);
e.frame = self.frame;
}
}
if(i)
- print(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
+ LOG_INFO(ftos(i), " spawnpoints have no nearest waypoint (marked by player model)\n");
i = 0;
entity start;
start = findchainflags(flags, FL_ITEM);
}
else
{
- print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+ LOG_INFO("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
e.effects |= EF_NODEPTHTEST | EF_RED;
e.colormod_x = 8;
++i;
}
}
if(i)
- print(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
+ LOG_INFO(ftos(i), " items have no nearest waypoint and cannot be walked away from (marked with red light)\n");
i = 0;
for(e = start; e; e = e.chain)
{
}
else
{
- print("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
+ LOG_INFO("item without waypoint: ", etos(e), " ", vtos(e.origin), "\n");
e.effects |= EF_NODEPTHTEST | EF_BLUE;
e.colormod_z = 8;
++i;
}
}
if(i)
- print(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");
+ LOG_INFO(ftos(i), " items have no nearest waypoint and cannot be walked to (marked with blue light)\n");
break;
}
}
}
if(flood)
- print("NOTE: ", playername(source), "^7 is flooding.\n");
+ LOG_INFO("NOTE: ", playername(source), "^7 is flooding.\n");
// build sourcemsgstr by cutting off a prefix and replacing it by the other one
if(privatesay)
{
if(tokenize_console(s) != 3)
{
- dprint("Invalid sound info line: ", s, "\n");
+ LOG_TRACE("Invalid sound info line: ", s, "\n");
continue;
}
PrecacheGlobalSound(strcat(argv(1), " ", argv(2)));
fh = fopen(f, FILE_READ);
if(fh < 0)
{
- dprint("Player sound file not found: ", f, "\n");
+ LOG_TRACE("Player sound file not found: ", f, "\n");
return 0;
}
while((s = fgets(fh)))
}
default:
- print("Incorrect parameters for ^2ban^7\n");
+ LOG_INFO("Incorrect parameters for ^2ban^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd ban address [bantime] [reason]\n");
- print(" 'address' is the IP address or range of the player to ban,\n");
- print(" 'bantime' is the amount of time that the ban is active (default if not provided),\n");
- print(" and 'reason' is the string to label the ban with as reason for banning.\n");
- print("See also: ^2banlist, kickban, unban^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd ban address [bantime] [reason]\n");
+ LOG_INFO(" 'address' is the IP address or range of the player to ban,\n");
+ LOG_INFO(" 'bantime' is the amount of time that the ban is active (default if not provided),\n");
+ LOG_INFO(" and 'reason' is the string to label the ban with as reason for banning.\n");
+ LOG_INFO("See also: ^2banlist, kickban, unban^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd banlist\n");
- print(" No arguments required.\n");
- print("See also: ^2ban, kickban, unban^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd banlist\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2ban, kickban, unban^7\n");
return;
}
}
}
else
{
- print("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("kickban: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
}
default:
- print("Incorrect parameters for ^2kickban^7\n");
+ LOG_INFO("Incorrect parameters for ^2kickban^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd kickban client [bantime] [masksize] [reason]\n");
- print(" 'client' is the entity number or name of the player to ban,\n");
- print(" 'bantime' is the amount of time that the ban is active (default if not provided),\n");
- print(" 'masksize' is the range of the IP address (1-thru-4, default if not provided),\n");
- print(" and 'reason' is the string to label the ban with as reason for banning.\n");
- print("See also: ^2ban, banlist, unban^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd kickban client [bantime] [masksize] [reason]\n");
+ LOG_INFO(" 'client' is the entity number or name of the player to ban,\n");
+ LOG_INFO(" 'bantime' is the amount of time that the ban is active (default if not provided),\n");
+ LOG_INFO(" 'masksize' is the range of the IP address (1-thru-4, default if not provided),\n");
+ LOG_INFO(" and 'reason' is the string to label the ban with as reason for banning.\n");
+ LOG_INFO("See also: ^2ban, banlist, unban^7\n");
return;
}
}
}
else
{
- print("mute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("mute: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
}
default:
- print("Incorrect parameters for ^2mute^7\n");
+ LOG_INFO("Incorrect parameters for ^2mute^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd mute client\n");
- print(" 'client' is the entity number or name of the player to mute.\n");
- print("See also: ^2unmute^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd mute client\n");
+ LOG_INFO(" 'client' is the entity number or name of the player to mute.\n");
+ LOG_INFO("See also: ^2unmute^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd unban banid\n");
- print(" Where 'banid' is the ID of the ban of which to remove.\n");
- print("See also: ^2ban, banlist, kickban^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd unban banid\n");
+ LOG_INFO(" Where 'banid' is the ID of the ban of which to remove.\n");
+ LOG_INFO("See also: ^2ban, banlist, kickban^7\n");
return;
}
}
}
else
{
- print("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("unmute: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
}
default:
- print("Incorrect parameters for ^2mute^7\n");
+ LOG_INFO("Incorrect parameters for ^2mute^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd unmute client\n");
- print(" 'client' is the entity number or name of the player to unmute.\n");
- print("See also: ^2mute^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd unmute client\n");
+ LOG_INFO(" 'client' is the entity number or name of the player to unmute.\n");
+ LOG_INFO("See also: ^2mute^7\n");
return;
}
}
void BanCommand_macro_help()
{
#define BAN_COMMAND(name,function,description) \
- { if(strtolower(description) != "") { print(" ^2", name, "^7: ", description, "\n"); } }
+ { if(strtolower(description) != "") { LOG_INFO(" ^2", name, "^7: ", description, "\n"); } }
BAN_COMMANDS(0, 0, "");
#undef BAN_COMMAND
{
case CMD_REQUEST_COMMAND:
{
- printf("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
+ LOG_INFOF("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
self.checkfail = 1;
return; // never fall through to usage
}
if(to)
sprint(to, strcat(input, "\n"));
else
- print(input, "\n");
+ LOG_INFO(input, "\n");
}
// ==========================================
return;
}
- default: dprint("timeout status was inactive, but this code was executed anyway?"); return;
+ default: LOG_TRACE("timeout status was inactive, but this code was executed anyway?"); return;
}
}
}
}
if(n > 200)
- dprint("HOLY SHIT! FullTraceFraction: ", ftos(n), " total traces, ", ftos(m), " iterations\n");
+ LOG_TRACE("HOLY SHIT! FullTraceFraction: ", ftos(n), " total traces, ", ftos(m), " iterations\n");
return white / (black + white);
}
self.maxs_x = (mi_picmax.x - mi_picmin.x) / self.size.x;
self.maxs_y = (mi_picmax.y - mi_picmin.y) / self.size.y;
self.maxs_z = mi_max.z - mi_min.z;
- print("Picture mins/maxs: ", ftos(self.maxs.x), " and ", ftos(self.maxs.y), " should match\n");
+ LOG_INFO("Picture mins/maxs: ", ftos(self.maxs.x), " and ", ftos(self.maxs.y), " should match\n");
self.netname = strzone(strcat("gfx/", mi_shortname, "_radar.xpm"));
if(!(self.count & 1))
{
{
fclose(self.cnt);
- print(self.netname, " already exists, aborting (you may want to specify --force)\n");
+ LOG_INFO(self.netname, " already exists, aborting (you may want to specify --force)\n");
RadarMap_Next();
return;
}
self.cnt = fopen(self.netname, FILE_WRITE);
if(self.cnt < 0)
{
- print("Error writing ", self.netname, "\n");
+ LOG_INFO("Error writing ", self.netname, "\n");
remove(self);
radarmapper = world;
return;
}
- print("Writing to ", self.netname, "...\n");
+ LOG_INFO("Writing to ", self.netname, "...\n");
fputs(self.cnt, "/* XPM */\n");
fputs(self.cnt, "static char *RadarMap[] = {\n");
fputs(self.cnt, "/* columns rows colors chars-per-pixel */\n");
else
{
fputs(self.cnt, "\",\n");
- print(ftos(self.size.y - self.frame), " lines left\n");
+ LOG_INFO(ftos(self.size.y - self.frame), " lines left\n");
}
}
else
{
fputs(self.cnt, "\",\n");
- print(ftos(self.size.y - self.frame), " lines left\n");
+ LOG_INFO(ftos(self.size.y - self.frame), " lines left\n");
}
}
// close the file
fputs(self.cnt, "};\n");
fclose(self.cnt);
- print("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
+ LOG_INFO("Finished. Please edit data/", self.netname, " with an image editing application and place it in the TGA format in the gfx folder.\n");
RadarMap_Next();
}
}
if(radarmapper) // after doing the arguments, see if we successfully went forward.
{
- print("Radarmap entity spawned.\n");
+ LOG_INFO("Radarmap entity spawned.\n");
return true; // if so, don't print usage.
}
}
{
if(MapInfo_FilterGametype(MAPINFO_TYPE_ALL, 0, 0, 0, 1))
{
- print("Done rebuiling mapinfos.\n");
+ LOG_INFO("Done rebuiling mapinfos.\n");
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
remove(self);
}
if(accepted <= 0)
{
- print("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ LOG_INFO("adminmsg: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
continue;
}
}
successful = strcat(successful, (successful ? ", " : ""), client.netname);
- dprint("Message sent to ", client.netname, "\n");
+ LOG_TRACE("Message sent to ", client.netname, "\n");
continue;
}
if(successful)
bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
else
- print("No players given (", original_targets, ") could receive the message.\n");
+ LOG_INFO("No players given (", original_targets, ") could receive the message.\n");
return;
}
}
default:
- print("Incorrect parameters for ^2adminmsg^7\n");
+ LOG_INFO("Incorrect parameters for ^2adminmsg^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd adminmsg clients \"message\" [infobartime]\n");
- print(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
- print(" If infobartime is provided, the message will be sent to infobar.\n");
- print(" Otherwise, it will just be sent as a centerprint message.\n");
- print("Examples: adminmsg 2,4 \"this infomessage will last for ten seconds\" 10\n");
- print(" adminmsg 2,5 \"this message will be a centerprint\"\n");
+ LOG_INFO("\nUsage:^3 sv_cmd adminmsg clients \"message\" [infobartime]\n");
+ LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
+ LOG_INFO(" If infobartime is provided, the message will be sent to infobar.\n");
+ LOG_INFO(" Otherwise, it will just be sent as a centerprint message.\n");
+ LOG_INFO("Examples: adminmsg 2,4 \"this infomessage will last for ten seconds\" 10\n");
+ LOG_INFO(" adminmsg 2,5 \"this message will be a centerprint\"\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- if(autocvar_g_campaign) { print("This command doesn't work in campaign mode.\n"); return; }
- if(g_invasion) { print("This command doesn't work during an invasion.\n"); return; }
+ if(autocvar_g_campaign) { LOG_INFO("This command doesn't work in campaign mode.\n"); return; }
+ if(g_invasion) { LOG_INFO("This command doesn't work during an invasion.\n"); return; }
float removed_count = 0;
entity head;
totalspawned = 0;
if(removed_count <= 0)
- print("No monsters to kill\n");
+ LOG_INFO("No monsters to kill\n");
else
- printf("Killed %d monster%s\n", removed_count, ((removed_count == 1) ? "" : "s"));
+ LOG_INFOF("Killed %d monster%s\n", removed_count, ((removed_count == 1) ? "" : "s"));
return; // never fall through to usage
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd mobbutcher\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd mobbutcher\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd allready\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd allready\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
++i;
}
if(i) { bprint(strcat("Successfully forced all (", ftos(i), ") players to spectate", (reason ? strcat(" for reason: '", reason, "'") : ""), ".\n")); }
- else { print("No players found to spectate.\n"); }
+ else { LOG_INFO("No players found to spectate.\n"); }
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd allspec [reason]\n");
- print(" Where 'reason' is an optional argument for explanation of allspec command.\n");
- print("See also: ^2moveplayer, shuffleteams^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd allspec [reason]\n");
+ LOG_INFO(" Where 'reason' is an optional argument for explanation of allspec command.\n");
+ LOG_INFO("See also: ^2moveplayer, shuffleteams^7\n");
return;
}
}
}
else
{
- print("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("anticheat: ", GetClientErrorString(accepted, argv(1)), ".\n");
}
}
default:
- print("Incorrect parameters for ^2anticheat^7\n");
+ LOG_INFO("Incorrect parameters for ^2anticheat^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd anticheat client\n");
- print(" 'client' is the entity number or name of the player.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd anticheat client\n");
+ LOG_INFO(" 'client' is the entity number or name of the player.\n");
return;
}
}
{
case CMD_REQUEST_COMMAND:
{
- print("Original size: ", ftos(world.absmin.x), " ", ftos(world.absmin.y), " ", ftos(world.absmin.z));
- print(" ", ftos(world.absmax.x), " ", ftos(world.absmax.y), " ", ftos(world.absmax.z), "\n");
- print("Currently set size: ", ftos(world.mins.x), " ", ftos(world.mins.y), " ", ftos(world.mins.z));
- print(" ", ftos(world.maxs.x), " ", ftos(world.maxs.y), " ", ftos(world.maxs.z), "\n");
- print("Solid bounding box size:");
+ LOG_INFO("Original size: ", ftos(world.absmin.x), " ", ftos(world.absmin.y), " ", ftos(world.absmin.z));
+ LOG_INFO(" ", ftos(world.absmax.x), " ", ftos(world.absmax.y), " ", ftos(world.absmax.z), "\n");
+ LOG_INFO("Currently set size: ", ftos(world.mins.x), " ", ftos(world.mins.y), " ", ftos(world.mins.z));
+ LOG_INFO(" ", ftos(world.maxs.x), " ", ftos(world.maxs.y), " ", ftos(world.maxs.z), "\n");
+ LOG_INFO("Solid bounding box size:");
tracebox('1 0 0' * world.absmin.x,
'0 1 0' * world.absmin.y + '0 0 1' * world.absmin.z,
MOVE_WORLDONLY,
world);
if(trace_startsolid)
- print(" ", ftos(world.absmin.x));
+ LOG_INFO(" ", ftos(world.absmin.x));
else
- print(" ", ftos(trace_endpos.x));
+ LOG_INFO(" ", ftos(trace_endpos.x));
tracebox('0 1 0' * world.absmin.y,
'1 0 0' * world.absmin.x + '0 0 1' * world.absmin.z,
MOVE_WORLDONLY,
world);
if(trace_startsolid)
- print(" ", ftos(world.absmin.y));
+ LOG_INFO(" ", ftos(world.absmin.y));
else
- print(" ", ftos(trace_endpos.y));
+ LOG_INFO(" ", ftos(trace_endpos.y));
tracebox('0 0 1' * world.absmin.z,
'1 0 0' * world.absmin.x + '0 1 0' * world.absmin.y,
MOVE_WORLDONLY,
world);
if(trace_startsolid)
- print(" ", ftos(world.absmin.z));
+ LOG_INFO(" ", ftos(world.absmin.z));
else
- print(" ", ftos(trace_endpos.z));
+ LOG_INFO(" ", ftos(trace_endpos.z));
tracebox('1 0 0' * world.absmax.x,
'0 1 0' * world.absmin.y + '0 0 1' * world.absmin.z,
MOVE_WORLDONLY,
world);
if(trace_startsolid)
- print(" ", ftos(world.absmax.x));
+ LOG_INFO(" ", ftos(world.absmax.x));
else
- print(" ", ftos(trace_endpos.x));
+ LOG_INFO(" ", ftos(trace_endpos.x));
tracebox('0 1 0' * world.absmax.y,
'1 0 0' * world.absmin.x + '0 0 1' * world.absmin.z,
MOVE_WORLDONLY,
world);
if(trace_startsolid)
- print(" ", ftos(world.absmax.y));
+ LOG_INFO(" ", ftos(world.absmax.y));
else
- print(" ", ftos(trace_endpos.y));
+ LOG_INFO(" ", ftos(trace_endpos.y));
tracebox('0 0 1' * world.absmax.z,
'1 0 0' * world.absmin.x + '0 1 0' * world.absmin.y,
MOVE_WORLDONLY,
world);
if(trace_startsolid)
- print(" ", ftos(world.absmax.z));
+ LOG_INFO(" ", ftos(world.absmax.z));
else
- print(" ", ftos(trace_endpos.z));
+ LOG_INFO(" ", ftos(trace_endpos.z));
- print("\n");
+ LOG_INFO("\n");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd bbox\n");
- print(" No arguments required.\n");
- print("See also: ^2gettaginfo, trace^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd bbox\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2gettaginfo, trace^7\n");
return;
}
}
bot_fixcount();
cvar_settemp("bot_number", argv(2));
if(!bot_fixcount())
- print("Sorry, could not set requested bot count\n");
+ LOG_INFO("Sorry, could not set requested bot count\n");
return;
}
else if(argv(1) == "load" && argc == 3)
fh = fopen(argv(2), FILE_READ);
if(fh < 0)
{
- print("cannot open the file\n");
+ LOG_INFO("cannot open the file\n");
return;
}
bot_fixcount();
cvar_settemp("bot_number", argv(3));
if(!bot_fixcount())
- print("Sorry, could not set requested bot count\n");
+ LOG_INFO("Sorry, could not set requested bot count\n");
}
else
{
++i;
}
- print(ftos(i), " commands read\n");
+ LOG_INFO(ftos(i), " commands read\n");
fclose(fh);
return;
}
bot = find_bot_by_name(argv(1));
if(bot)
{
- print(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
+ LOG_INFO(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n"));
bot_queuecommand(bot, substring(command, argv_start_index(2), -1));
return;
}
else
- print(strcat("Error: Can't find bot with the name or id '", argv(1),"' - Did you mistype the command?\n")); // don't return so that usage is shown
+ LOG_INFO(strcat("Error: Can't find bot with the name or id '", argv(1),"' - Did you mistype the command?\n")); // don't return so that usage is shown
}
}
default:
- print("Incorrect parameters for ^2bot_cmd^7\n");
+ LOG_INFO("Incorrect parameters for ^2bot_cmd^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd bot_cmd client command [argument]\n");
- print(" 'client' can be either the name or entity id of the bot\n");
- print(" For full list of commands, see bot_cmd help [command].\n");
- print("Examples: sv_cmd bot_cmd client cc \"say something\"\n");
- print(" sv_cmd bot_cmd client presskey jump\n");
+ LOG_INFO("\nUsage:^3 sv_cmd bot_cmd client command [argument]\n");
+ LOG_INFO(" 'client' can be either the name or entity id of the bot\n");
+ LOG_INFO(" For full list of commands, see bot_cmd help [command].\n");
+ LOG_INFO("Examples: sv_cmd bot_cmd client cc \"say something\"\n");
+ LOG_INFO(" sv_cmd bot_cmd client presskey jump\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd cointoss [result1 result2]\n");
- print(" Where 'result1' and 'result2' are user created options.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd cointoss [result1 result2]\n");
+ LOG_INFO(" Where 'result1' and 'result2' are user created options.\n");
return;
}
}
if(argv(1) == "save")
{
db_save(ServerProgsDB, argv(2));
- print(strcat("Copied serverprogs database to '", argv(2), "' in the data directory.\n"));
+ LOG_INFO(strcat("Copied serverprogs database to '", argv(2), "' in the data directory.\n"));
return;
}
else if(argv(1) == "dump")
{
db_dump(ServerProgsDB, argv(2));
- print("DB dumped.\n"); // wtf does this do?
+ LOG_INFO("DB dumped.\n"); // wtf does this do?
return;
}
else if(argv(1) == "load")
{
db_close(ServerProgsDB);
ServerProgsDB = db_load(argv(2));
- print(strcat("Loaded '", argv(2), "' as new serverprogs database.\n"));
+ LOG_INFO(strcat("Loaded '", argv(2), "' as new serverprogs database.\n"));
return;
}
}
}
default:
- print("Incorrect parameters for ^2database^7\n");
+ LOG_INFO("Incorrect parameters for ^2database^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd database action filename\n");
- print(" Where 'action' is the command to complete,\n");
- print(" and 'filename' is what it acts upon.\n");
- print(" Full list of commands here: \"save, dump, load.\"\n");
+ LOG_INFO("\nUsage:^3 sv_cmd database action filename\n");
+ LOG_INFO(" Where 'action' is the command to complete,\n");
+ LOG_INFO(" and 'filename' is what it acts upon.\n");
+ LOG_INFO(" Full list of commands here: \"save, dump, load.\"\n");
return;
}
}
if(accepted > 0)
{
stuffcmd(client, "defer clear\n");
- print("defer clear stuffed to ", client.netname, "\n");
+ LOG_INFO("defer clear stuffed to ", client.netname, "\n");
}
- else { print("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
+ else { LOG_INFO("defer_clear: ", GetClientErrorString(accepted, argv(1)), ".\n"); }
return;
}
}
default:
- print("Incorrect parameters for ^2defer_clear^7\n");
+ LOG_INFO("Incorrect parameters for ^2defer_clear^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd defer_clear client\n");
- print(" 'client' is the entity number or name of the player.\n");
- print("See also: ^2defer_clear_all^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd defer_clear client\n");
+ LOG_INFO(" 'client' is the entity number or name of the player.\n");
+ LOG_INFO("See also: ^2defer_clear_all^7\n");
return;
}
}
GameCommand_defer_clear(CMD_REQUEST_COMMAND, argc);
++i;
}
- if(i) { print(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found?
+ if(i) { LOG_INFO(strcat("Successfully stuffed defer clear to all clients (", ftos(i), ")\n")); } // should a message be added if no players were found?
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd defer_clear_all\n");
- print(" No arguments required.\n");
- print("See also: ^2defer_clear^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd defer_clear_all\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2defer_clear^7\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2delrec^7\n");
+ LOG_INFO("Incorrect parameters for ^2delrec^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd delrec ranking [map]\n");
- print(" 'ranking' is which ranking level to clear up to, \n");
- print(" it will clear all records up to nth place.\n");
- print(" if 'map' is not provided it will use current map.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd delrec ranking [map]\n");
+ LOG_INFO(" 'ranking' is which ranking level to clear up to, \n");
+ LOG_INFO(" it will clear all records up to nth place.\n");
+ LOG_INFO(" if 'map' is not provided it will use current map.\n");
return;
}
}
string s;
d = db_create();
- print("begin of effects list\n");
- db_put(d, "TE_GUNSHOT", "1"); print("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
- db_put(d, "TE_GUNSHOTQUAD", "1"); print("effect TE_GUNSHOTQUAD is ", ftos(particleeffectnum("TE_GUNSHOTQUAD")), "\n");
- db_put(d, "TE_SPIKE", "1"); print("effect TE_SPIKE is ", ftos(particleeffectnum("TE_SPIKE")), "\n");
- db_put(d, "TE_SPIKEQUAD", "1"); print("effect TE_SPIKEQUAD is ", ftos(particleeffectnum("TE_SPIKEQUAD")), "\n");
- db_put(d, "TE_SUPERSPIKE", "1"); print("effect TE_SUPERSPIKE is ", ftos(particleeffectnum("TE_SUPERSPIKE")), "\n");
- db_put(d, "TE_SUPERSPIKEQUAD", "1"); print("effect TE_SUPERSPIKEQUAD is ", ftos(particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
- db_put(d, "TE_WIZSPIKE", "1"); print("effect TE_WIZSPIKE is ", ftos(particleeffectnum("TE_WIZSPIKE")), "\n");
- db_put(d, "TE_KNIGHTSPIKE", "1"); print("effect TE_KNIGHTSPIKE is ", ftos(particleeffectnum("TE_KNIGHTSPIKE")), "\n");
- db_put(d, "TE_EXPLOSION", "1"); print("effect TE_EXPLOSION is ", ftos(particleeffectnum("TE_EXPLOSION")), "\n");
- db_put(d, "TE_EXPLOSIONQUAD", "1"); print("effect TE_EXPLOSIONQUAD is ", ftos(particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
- db_put(d, "TE_TAREXPLOSION", "1"); print("effect TE_TAREXPLOSION is ", ftos(particleeffectnum("TE_TAREXPLOSION")), "\n");
- db_put(d, "TE_TELEPORT", "1"); print("effect TE_TELEPORT is ", ftos(particleeffectnum("TE_TELEPORT")), "\n");
- db_put(d, "TE_LAVASPLASH", "1"); print("effect TE_LAVASPLASH is ", ftos(particleeffectnum("TE_LAVASPLASH")), "\n");
- db_put(d, "TE_SMALLFLASH", "1"); print("effect TE_SMALLFLASH is ", ftos(particleeffectnum("TE_SMALLFLASH")), "\n");
- db_put(d, "TE_FLAMEJET", "1"); print("effect TE_FLAMEJET is ", ftos(particleeffectnum("TE_FLAMEJET")), "\n");
- db_put(d, "EF_FLAME", "1"); print("effect EF_FLAME is ", ftos(particleeffectnum("EF_FLAME")), "\n");
- db_put(d, "TE_BLOOD", "1"); print("effect TE_BLOOD is ", ftos(particleeffectnum("TE_BLOOD")), "\n");
- db_put(d, "TE_SPARK", "1"); print("effect TE_SPARK is ", ftos(particleeffectnum("TE_SPARK")), "\n");
- db_put(d, "TE_PLASMABURN", "1"); print("effect TE_PLASMABURN is ", ftos(particleeffectnum("TE_PLASMABURN")), "\n");
- db_put(d, "TE_TEI_G3", "1"); print("effect TE_TEI_G3 is ", ftos(particleeffectnum("TE_TEI_G3")), "\n");
- db_put(d, "TE_TEI_SMOKE", "1"); print("effect TE_TEI_SMOKE is ", ftos(particleeffectnum("TE_TEI_SMOKE")), "\n");
- db_put(d, "TE_TEI_BIGEXPLOSION", "1"); print("effect TE_TEI_BIGEXPLOSION is ", ftos(particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
- db_put(d, "TE_TEI_PLASMAHIT", "1"); print("effect TE_TEI_PLASMAHIT is ", ftos(particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
- db_put(d, "EF_STARDUST", "1"); print("effect EF_STARDUST is ", ftos(particleeffectnum("EF_STARDUST")), "\n");
- db_put(d, "TR_ROCKET", "1"); print("effect TR_ROCKET is ", ftos(particleeffectnum("TR_ROCKET")), "\n");
- db_put(d, "TR_GRENADE", "1"); print("effect TR_GRENADE is ", ftos(particleeffectnum("TR_GRENADE")), "\n");
- db_put(d, "TR_BLOOD", "1"); print("effect TR_BLOOD is ", ftos(particleeffectnum("TR_BLOOD")), "\n");
- db_put(d, "TR_WIZSPIKE", "1"); print("effect TR_WIZSPIKE is ", ftos(particleeffectnum("TR_WIZSPIKE")), "\n");
- db_put(d, "TR_SLIGHTBLOOD", "1"); print("effect TR_SLIGHTBLOOD is ", ftos(particleeffectnum("TR_SLIGHTBLOOD")), "\n");
- db_put(d, "TR_KNIGHTSPIKE", "1"); print("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n");
- db_put(d, "TR_VORESPIKE", "1"); print("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n");
- db_put(d, "TR_NEHAHRASMOKE", "1"); print("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n");
- db_put(d, "TR_NEXUIZPLASMA", "1"); print("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n");
- db_put(d, "TR_GLOWTRAIL", "1"); print("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n");
- db_put(d, "TR_SEEKER", "1"); print("effect TR_SEEKER is ", ftos(particleeffectnum("TR_SEEKER")), "\n");
- db_put(d, "SVC_PARTICLE", "1"); print("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n");
+ LOG_INFO("begin of effects list\n");
+ db_put(d, "TE_GUNSHOT", "1"); LOG_INFO("effect TE_GUNSHOT is ", ftos(particleeffectnum("TE_GUNSHOT")), "\n");
+ db_put(d, "TE_GUNSHOTQUAD", "1"); LOG_INFO("effect TE_GUNSHOTQUAD is ", ftos(particleeffectnum("TE_GUNSHOTQUAD")), "\n");
+ db_put(d, "TE_SPIKE", "1"); LOG_INFO("effect TE_SPIKE is ", ftos(particleeffectnum("TE_SPIKE")), "\n");
+ db_put(d, "TE_SPIKEQUAD", "1"); LOG_INFO("effect TE_SPIKEQUAD is ", ftos(particleeffectnum("TE_SPIKEQUAD")), "\n");
+ db_put(d, "TE_SUPERSPIKE", "1"); LOG_INFO("effect TE_SUPERSPIKE is ", ftos(particleeffectnum("TE_SUPERSPIKE")), "\n");
+ db_put(d, "TE_SUPERSPIKEQUAD", "1"); LOG_INFO("effect TE_SUPERSPIKEQUAD is ", ftos(particleeffectnum("TE_SUPERSPIKEQUAD")), "\n");
+ db_put(d, "TE_WIZSPIKE", "1"); LOG_INFO("effect TE_WIZSPIKE is ", ftos(particleeffectnum("TE_WIZSPIKE")), "\n");
+ db_put(d, "TE_KNIGHTSPIKE", "1"); LOG_INFO("effect TE_KNIGHTSPIKE is ", ftos(particleeffectnum("TE_KNIGHTSPIKE")), "\n");
+ db_put(d, "TE_EXPLOSION", "1"); LOG_INFO("effect TE_EXPLOSION is ", ftos(particleeffectnum("TE_EXPLOSION")), "\n");
+ db_put(d, "TE_EXPLOSIONQUAD", "1"); LOG_INFO("effect TE_EXPLOSIONQUAD is ", ftos(particleeffectnum("TE_EXPLOSIONQUAD")), "\n");
+ db_put(d, "TE_TAREXPLOSION", "1"); LOG_INFO("effect TE_TAREXPLOSION is ", ftos(particleeffectnum("TE_TAREXPLOSION")), "\n");
+ db_put(d, "TE_TELEPORT", "1"); LOG_INFO("effect TE_TELEPORT is ", ftos(particleeffectnum("TE_TELEPORT")), "\n");
+ db_put(d, "TE_LAVASPLASH", "1"); LOG_INFO("effect TE_LAVASPLASH is ", ftos(particleeffectnum("TE_LAVASPLASH")), "\n");
+ db_put(d, "TE_SMALLFLASH", "1"); LOG_INFO("effect TE_SMALLFLASH is ", ftos(particleeffectnum("TE_SMALLFLASH")), "\n");
+ db_put(d, "TE_FLAMEJET", "1"); LOG_INFO("effect TE_FLAMEJET is ", ftos(particleeffectnum("TE_FLAMEJET")), "\n");
+ db_put(d, "EF_FLAME", "1"); LOG_INFO("effect EF_FLAME is ", ftos(particleeffectnum("EF_FLAME")), "\n");
+ db_put(d, "TE_BLOOD", "1"); LOG_INFO("effect TE_BLOOD is ", ftos(particleeffectnum("TE_BLOOD")), "\n");
+ db_put(d, "TE_SPARK", "1"); LOG_INFO("effect TE_SPARK is ", ftos(particleeffectnum("TE_SPARK")), "\n");
+ db_put(d, "TE_PLASMABURN", "1"); LOG_INFO("effect TE_PLASMABURN is ", ftos(particleeffectnum("TE_PLASMABURN")), "\n");
+ db_put(d, "TE_TEI_G3", "1"); LOG_INFO("effect TE_TEI_G3 is ", ftos(particleeffectnum("TE_TEI_G3")), "\n");
+ db_put(d, "TE_TEI_SMOKE", "1"); LOG_INFO("effect TE_TEI_SMOKE is ", ftos(particleeffectnum("TE_TEI_SMOKE")), "\n");
+ db_put(d, "TE_TEI_BIGEXPLOSION", "1"); LOG_INFO("effect TE_TEI_BIGEXPLOSION is ", ftos(particleeffectnum("TE_TEI_BIGEXPLOSION")), "\n");
+ db_put(d, "TE_TEI_PLASMAHIT", "1"); LOG_INFO("effect TE_TEI_PLASMAHIT is ", ftos(particleeffectnum("TE_TEI_PLASMAHIT")), "\n");
+ db_put(d, "EF_STARDUST", "1"); LOG_INFO("effect EF_STARDUST is ", ftos(particleeffectnum("EF_STARDUST")), "\n");
+ db_put(d, "TR_ROCKET", "1"); LOG_INFO("effect TR_ROCKET is ", ftos(particleeffectnum("TR_ROCKET")), "\n");
+ db_put(d, "TR_GRENADE", "1"); LOG_INFO("effect TR_GRENADE is ", ftos(particleeffectnum("TR_GRENADE")), "\n");
+ db_put(d, "TR_BLOOD", "1"); LOG_INFO("effect TR_BLOOD is ", ftos(particleeffectnum("TR_BLOOD")), "\n");
+ db_put(d, "TR_WIZSPIKE", "1"); LOG_INFO("effect TR_WIZSPIKE is ", ftos(particleeffectnum("TR_WIZSPIKE")), "\n");
+ db_put(d, "TR_SLIGHTBLOOD", "1"); LOG_INFO("effect TR_SLIGHTBLOOD is ", ftos(particleeffectnum("TR_SLIGHTBLOOD")), "\n");
+ db_put(d, "TR_KNIGHTSPIKE", "1"); LOG_INFO("effect TR_KNIGHTSPIKE is ", ftos(particleeffectnum("TR_KNIGHTSPIKE")), "\n");
+ db_put(d, "TR_VORESPIKE", "1"); LOG_INFO("effect TR_VORESPIKE is ", ftos(particleeffectnum("TR_VORESPIKE")), "\n");
+ db_put(d, "TR_NEHAHRASMOKE", "1"); LOG_INFO("effect TR_NEHAHRASMOKE is ", ftos(particleeffectnum("TR_NEHAHRASMOKE")), "\n");
+ db_put(d, "TR_NEXUIZPLASMA", "1"); LOG_INFO("effect TR_NEXUIZPLASMA is ", ftos(particleeffectnum("TR_NEXUIZPLASMA")), "\n");
+ db_put(d, "TR_GLOWTRAIL", "1"); LOG_INFO("effect TR_GLOWTRAIL is ", ftos(particleeffectnum("TR_GLOWTRAIL")), "\n");
+ db_put(d, "TR_SEEKER", "1"); LOG_INFO("effect TR_SEEKER is ", ftos(particleeffectnum("TR_SEEKER")), "\n");
+ db_put(d, "SVC_PARTICLE", "1"); LOG_INFO("effect SVC_PARTICLE is ", ftos(particleeffectnum("SVC_PARTICLE")), "\n");
fh = fopen("effectinfo.txt", FILE_READ);
while((s = fgets(fh)))
if(db_get(d, argv(1)) != "1")
{
if(particleeffectnum(argv(1)) >= 0)
- print("effect ", argv(1), " is ", ftos(particleeffectnum(argv(1))), "\n");
+ LOG_INFO("effect ", argv(1), " is ", ftos(particleeffectnum(argv(1))), "\n");
db_put(d, argv(1), "1");
}
}
}
- print("end of effects list\n");
+ LOG_INFO("end of effects list\n");
db_close(d);
return;
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd effectindexdump\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd effectindexdump\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd extendmatchtime\n");
- print(" No arguments required.\n");
- print("See also: ^2reducematchtime^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd extendmatchtime\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2reducematchtime^7\n");
return;
}
}
entity client;
for(client = world; (client = find(client, classname, argv(1))); )
- print(etos(client), "\n");
+ LOG_INFO(etos(client), "\n");
return;
}
default:
- print("Incorrect parameters for ^2find^7\n");
+ LOG_INFO("Incorrect parameters for ^2find^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd find classname\n");
- print(" Where 'classname' is the classname to search for.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd find classname\n");
+ LOG_INFO(" Where 'classname' is the classname to search for.\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2gametype^7\n");
+ LOG_INFO("Incorrect parameters for ^2gametype^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd gametype mode\n");
- print(" Where 'mode' is the gametype mode to switch to.\n");
- print("See also: ^2gotomap^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd gametype mode\n");
+ LOG_INFO(" Where 'mode' is the gametype mode to switch to.\n");
+ LOG_INFO("See also: ^2gotomap^7\n");
return;
}
}
if(i)
{
v = gettaginfo(tmp_entity, i);
- print("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
- print(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
- print(" vector = ", ftos(v.x), " ", ftos(v.y), " ", ftos(v.z), "\n");
- print(" offset = ", ftos(gettaginfo_offset.x), " ", ftos(gettaginfo_offset.y), " ", ftos(gettaginfo_offset.z), "\n");
- print(" forward = ", ftos(gettaginfo_forward.x), " ", ftos(gettaginfo_forward.y), " ", ftos(gettaginfo_forward.z), "\n");
- print(" right = ", ftos(gettaginfo_right.x), " ", ftos(gettaginfo_right.y), " ", ftos(gettaginfo_right.z), "\n");
- print(" up = ", ftos(gettaginfo_up.x), " ", ftos(gettaginfo_up.y), " ", ftos(gettaginfo_up.z), "\n");
+ LOG_INFO("model ", tmp_entity.model, " frame ", ftos(tmp_entity.frame), " tag ", gettaginfo_name);
+ LOG_INFO(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n");
+ LOG_INFO(" vector = ", ftos(v.x), " ", ftos(v.y), " ", ftos(v.z), "\n");
+ LOG_INFO(" offset = ", ftos(gettaginfo_offset.x), " ", ftos(gettaginfo_offset.y), " ", ftos(gettaginfo_offset.z), "\n");
+ LOG_INFO(" forward = ", ftos(gettaginfo_forward.x), " ", ftos(gettaginfo_forward.y), " ", ftos(gettaginfo_forward.z), "\n");
+ LOG_INFO(" right = ", ftos(gettaginfo_right.x), " ", ftos(gettaginfo_right.y), " ", ftos(gettaginfo_right.z), "\n");
+ LOG_INFO(" up = ", ftos(gettaginfo_up.x), " ", ftos(gettaginfo_up.y), " ", ftos(gettaginfo_up.z), "\n");
if(argc >= 6)
{
v.y = -v.y;
}
}
else
- print("bone not found\n");
+ LOG_INFO("bone not found\n");
remove(tmp_entity);
return;
}
default:
- print("Incorrect parameters for ^2gettaginfo^7\n");
+ LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
- print("See also: ^2bbox, trace^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
+ LOG_INFO("See also: ^2bbox, trace^7\n");
return;
}
}
t2 += gettime(GETTIME_HIRES) - t0;
n += 1;
}
- print("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s\n");
- print("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s\n");
+ LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f1), " animtime ", ftos(n / t1), "/s\n");
+ LOG_INFO("model ", tmp_entity.model, " frame ", ftos(f2), " animtime ", ftos(n / t2), "/s\n");
remove(tmp_entity);
return;
}
default:
- print("Incorrect parameters for ^2gettaginfo^7\n");
+ LOG_INFO("Incorrect parameters for ^2gettaginfo^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
- print("See also: ^2bbox, trace^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd gettaginfo model frame index [command one] [command two]\n");
+ LOG_INFO("See also: ^2bbox, trace^7\n");
return;
}
}
{
if(argv(1))
{
- print(GotoMap(argv(1)), "\n");
+ LOG_INFO(GotoMap(argv(1)), "\n");
return;
}
}
default:
- print("Incorrect parameters for ^2gotomap^7\n");
+ LOG_INFO("Incorrect parameters for ^2gotomap^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd gotomap map\n");
- print(" Where 'map' is the *.bsp file to change to.\n");
- print("See also: ^2gametype^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd gotomap map\n");
+ LOG_INFO(" Where 'map' is the *.bsp file to change to.\n");
+ LOG_INFO("See also: ^2gametype^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd lockteams\n");
- print(" No arguments required.\n");
- print("See also: ^2unlockteams^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd lockteams\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2unlockteams^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd make_mapinfo\n");
- print(" No arguments required.\n");
- print("See also: ^2radarmap^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd make_mapinfo\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2radarmap^7\n");
return;
}
}
if(accepted <= 0)
{
- print("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
+ LOG_INFO("moveplayer: ", GetClientErrorString(accepted, t), (targets ? ", skipping to next player.\n" : ".\n"));
continue;
}
}
else
{
- print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already spectating.\n");
+ LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already spectating.\n");
}
continue;
}
if(team_id == client.team) // already on the destination team
{
// keep the forcing undone
- print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
+ LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") is already on the ", Team_ColoredFullName(client.team), (targets ? "^7, skipping to next player.\n" : "^7.\n"));
continue;
}
else if(team_id == 0) // auto team
// Check to see if the destination team is even available
switch(team_id)
{
- case NUM_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
- case NUM_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
- case NUM_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
- case NUM_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
+ case NUM_TEAM_1: if(c1 == -1) { LOG_INFO("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
+ case NUM_TEAM_2: if(c2 == -1) { LOG_INFO("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
+ case NUM_TEAM_3: if(c3 == -1) { LOG_INFO("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
+ case NUM_TEAM_4: if(c4 == -1) { LOG_INFO("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
- default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
+ default: LOG_INFO("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
}
// If so, lets continue and finally move the player
client.team_forced = 0;
MoveToTeam(client, team_id, 6);
successful = strcat(successful, (successful ? ", " : ""), client.netname);
- print("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
+ LOG_INFO("Player ", ftos(GetFilteredNumber(t)), " (", client.netname, ") has been moved to the ", Team_ColoredFullName(team_id), "^7.\n");
continue;
}
else
{
- print("Can't change teams when currently not playing a team game.\n");
+ LOG_INFO("Can't change teams when currently not playing a team game.\n");
return;
}
}
else
{
- print("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P
+ LOG_INFO("Can't change teams if the player isn't in the game.\n"); // well technically we could, but should we allow that? :P
return;
}
}
if(successful)
bprint("Successfully moved players ", successful, " to destination ", destination, ".\n");
else
- print("No players given (", original_targets, ") are able to move.\n");
+ LOG_INFO("No players given (", original_targets, ") are able to move.\n");
return; // still correct parameters so return to avoid usage print
}
}
default:
- print("Incorrect parameters for ^2moveplayer^7\n");
+ LOG_INFO("Incorrect parameters for ^2moveplayer^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd moveplayer clients destination\n");
- print(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
- print(" 'destination' is what to send the player to, be it team or spectating\n");
- print(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
- print("Examples: sv_cmd moveplayer 1,3,5 red 3\n");
- print(" sv_cmd moveplayer 2 spec \n");
- print("See also: ^2allspec, shuffleteams^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd moveplayer clients destination\n");
+ LOG_INFO(" 'clients' is a list (separated by commas) of player entity ID's or nicknames\n");
+ LOG_INFO(" 'destination' is what to send the player to, be it team or spectating\n");
+ LOG_INFO(" Full list of destinations here: \"spec, spectator, red, blue, yellow, pink, auto.\"\n");
+ LOG_INFO("Examples: sv_cmd moveplayer 1,3,5 red 3\n");
+ LOG_INFO(" sv_cmd moveplayer 2 spec \n");
+ LOG_INFO("See also: ^2allspec, shuffleteams^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd nospectators\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd nospectators\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
if(accepted <= 0)
{
- print("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ LOG_INFO("playerdemo: read: ", GetClientErrorString(accepted, argv(2)), ".\n");
return;
}
if(accepted <= 0)
{
- print("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
+ LOG_INFO("playerdemo: write: ", GetClientErrorString(accepted, argv(2)), ".\n");
return;
}
}
default:
- print("Incorrect parameters for ^2playerdemo^7\n");
+ LOG_INFO("Incorrect parameters for ^2playerdemo^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)\n");
- print(" Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"\n");
+ LOG_INFO("\nUsage:^3 sv_cmd playerdemo command (entitynumber filename | entitynumber botnumber)\n");
+ LOG_INFO(" Full list of commands here: \"read, write, auto_read_and_write, auto_read.\"\n");
return;
}
}
case CMD_REQUEST_COMMAND:
{
DumpStats(false);
- print("stats dumped.\n");
+ LOG_INFO("stats dumped.\n");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd printstats\n");
- print(" No arguments required.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd printstats\n");
+ LOG_INFO(" No arguments required.\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2radarmap^7\n");
+ LOG_INFO("Incorrect parameters for ^2radarmap^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]\n");
- print(" The quality factor Q is roughly proportional to the time taken.\n");
- print(" trace supports no quality factor; its result should look like --block with infinite quality factor.\n");
- print("See also: ^2make_mapinfo^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd radarmap [--force] [--loop] [--quit] [--block | --trace | --sample | --lineblock] [--sharpen N] [--res W H] [--qual Q]\n");
+ LOG_INFO(" The quality factor Q is roughly proportional to the time taken.\n");
+ LOG_INFO(" trace supports no quality factor; its result should look like --block with infinite quality factor.\n");
+ LOG_INFO("See also: ^2make_mapinfo^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd reducematchtime\n");
- print(" No arguments required.\n");
- print("See also: ^2extendmatchtime^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd reducematchtime\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2extendmatchtime^7\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2setbots^7\n");
+ LOG_INFO("Incorrect parameters for ^2setbots^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd setbots botnumber\n");
- print(" Where 'botnumber' is the amount of bots to set bot_number cvar to.\n");
- print("See also: ^2bot_cmd^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd setbots botnumber\n");
+ LOG_INFO(" Where 'botnumber' is the amount of bots to set bot_number cvar to.\n");
+ LOG_INFO("See also: ^2bot_cmd^7\n");
return;
}
}
}
else
{
- print("Can't shuffle teams when currently not playing a team game.\n");
+ LOG_INFO("Can't shuffle teams when currently not playing a team game.\n");
}
return;
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd shuffleteams\n");
- print(" No arguments required.\n");
- print("See also: ^2moveplayer, allspec^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd shuffleteams\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2moveplayer, allspec^7\n");
return;
}
}
if(accepted > 0)
{
stuffcmd(client, strcat("\n", argv(next_token), "\n"));
- print(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1) ,").\n"));
+ LOG_INFO(strcat("Command: \"", argv(next_token), "\" sent to ", GetCallerName(client), " (", argv(1) ,").\n"));
}
else
- print("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
+ LOG_INFO("stuffto: ", GetClientErrorString(accepted, argv(1)), ".\n");
return;
}
}
default:
- print("Incorrect parameters for ^2stuffto^7\n");
+ LOG_INFO("Incorrect parameters for ^2stuffto^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd stuffto client \"command\"\n");
- print(" 'client' is the entity number or name of the player,\n");
- print(" and 'command' is the command to be sent to that player.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd stuffto client \"command\"\n");
+ LOG_INFO(" 'client' is the entity number or name of the player,\n");
+ LOG_INFO(" and 'command' is the command to be sent to that player.\n");
return;
}
}
#else
if(request)
{
- print("stuffto command is not enabled on this server.\n");
+ LOG_INFO("stuffto command is not enabled on this server.\n");
return;
}
#endif
case "debug":
{
float hitcount = 0;
- print("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
+ LOG_INFO("TEST CASE. If this returns the runaway loop counter error, possibly everything is oaky.\n");
float worst_endpos_bug = 0;
for (;;)
{
}
}
- print("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
- print("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
+ LOG_INFO("safe distance to back off: ", ftos(safe * vlen(p - start)), "qu\n");
+ LOG_INFO("unsafe distance to back off: ", ftos(unsafe * vlen(p - start)), "qu\n");
tracebox(p, PL_MIN + '0.1 0.1 0.1', PL_MAX - '0.1 0.1 0.1', p, MOVE_NOMONSTERS, world);
if(trace_startsolid)
- print("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ LOG_INFO("trace_endpos much in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
else
- print("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ LOG_INFO("trace_endpos just in solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
if (++hitcount >= 10)
break;
}
if(dq > worst_endpos_bug)
{
worst_endpos_bug = dq;
- print("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
- print("could go ", ftos(dq), " units further to ", vtos(q), "\n");
+ LOG_INFO("trace_endpos still before solid when tracing from ", vtos(start), " to ", vtos(end), " endpos ", vtos(p), "\n");
+ LOG_INFO("could go ", ftos(dq), " units further to ", vtos(q), "\n");
if (++hitcount >= 10)
break;
}
vv = trace_endpos;
if(trace_fraction == 1)
{
- print("not above ground, aborting\n");
+ LOG_INFO("not above ground, aborting\n");
return;
}
f = 0;
dv = -1 * dv;
tracebox(vv, e.mins, e.maxs, vv + dv, MOVE_NORMAL, e);
if(trace_startsolid)
- print("bug 1\n");
+ LOG_INFO("bug 1\n");
if(trace_fraction == 1)
if(dv.z < f)
{
- print("bug 2: ", ftos(dv.x), " ", ftos(dv.y), " ", ftos(dv.z));
- print(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)\n");
+ LOG_INFO("bug 2: ", ftos(dv.x), " ", ftos(dv.y), " ", ftos(dv.z));
+ LOG_INFO(" (", ftos(asin(dv.z / vlen(dv)) * 180 / M_PI), " degrees)\n");
f = dv.z;
}
}
- print("highest possible dist: ", ftos(f), "\n");
+ LOG_INFO("highest possible dist: ", ftos(f), "\n");
return;
}
{
e = nextent(world);
if(tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL))
- print("can walk\n");
+ LOG_INFO("can walk\n");
else
- print("cannot walk\n");
+ LOG_INFO("cannot walk\n");
return;
}
}
}
default:
- print("Incorrect parameters for ^2trace^7\n");
+ LOG_INFO("Incorrect parameters for ^2trace^7\n");
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd trace command (startpos endpos)\n");
- print(" Full list of commands here: \"debug, debug2, walk, showline.\"\n");
- print("See also: ^2bbox, gettaginfo^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd trace command (startpos endpos)\n");
+ LOG_INFO(" Full list of commands here: \"debug, debug2, walk, showline.\"\n");
+ LOG_INFO("See also: ^2bbox, gettaginfo^7\n");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd unlockteams\n");
- print(" No arguments required.\n");
- print("See also: ^2lockteams^7\n");
+ LOG_INFO("\nUsage:^3 sv_cmd unlockteams\n");
+ LOG_INFO(" No arguments required.\n");
+ LOG_INFO("See also: ^2lockteams^7\n");
return;
}
}
if(argc >= 2)
{
CampaignLevelWarp(stof(argv(1)));
- print("Successfully warped to campaign level ", stof(argv(1)), ".\n");
+ LOG_INFO("Successfully warped to campaign level ", stof(argv(1)), ".\n");
}
else
{
CampaignLevelWarp(-1);
- print("Successfully warped to next campaign level.\n");
+ LOG_INFO("Successfully warped to next campaign level.\n");
}
}
else
- print("Not in campaign, can't level warp\n");
+ LOG_INFO("Not in campaign, can't level warp\n");
return;
}
default:
case CMD_REQUEST_USAGE:
{
- print("\nUsage:^3 sv_cmd warp [level]\n");
- print(" 'level' is the level to change campaign mode to.\n");
- print(" if 'level' is not provided it will change to the next level.\n");
+ LOG_INFO("\nUsage:^3 sv_cmd warp [level]\n");
+ LOG_INFO(" 'level' is the level to change campaign mode to.\n");
+ LOG_INFO(" if 'level' is not provided it will change to the next level.\n");
return;
}
}
void GameCommand_macro_help()
{
#define SERVER_COMMAND(name,function,description) \
- { print(" ^2", name, "^7: ", description, "\n"); }
+ { LOG_INFO(" ^2", name, "^7: ", description, "\n"); }
SERVER_COMMANDS(0, 0, "");
#undef SERVER_COMMAND
{
if(argc == 1)
{
- print("\nServer console commands:\n");
+ LOG_INFO("\nServer console commands:\n");
GameCommand_macro_help();
- print("\nBanning commands:\n");
+ LOG_INFO("\nBanning commands:\n");
BanCommand_macro_help();
- print("\nCommon networked commands:\n");
+ LOG_INFO("\nCommon networked commands:\n");
CommonCommand_macro_help(world);
- print("\nGeneric commands shared by all programs:\n");
+ LOG_INFO("\nGeneric commands shared by all programs:\n");
GenericCommand_macro_help();
- print("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
- print("For help about a specific command, type sv_cmd help COMMAND\n");
+ LOG_INFO("\nUsage:^3 sv_cmd COMMAND...^7, where possible commands are listed above.\n");
+ LOG_INFO("For help about a specific command, type sv_cmd help COMMAND\n");
return;
}
}
// nothing above caught the command, must be invalid
- print(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
+ LOG_INFO(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
return;
}
void entcs_init()
{
- print("Initializing ClientSide information entities\n");
+ LOG_INFO("Initializing ClientSide information entities\n");
}
float entcs_customize()
}
else
{
- dprintf(
+ LOG_TRACEF(
"Obituary_WeaponDeath(): ^1Deathtype ^7(%d)^1 has no notification for weapon %d!\n",
deathtype,
death_weapon
mininv_f = (vlen(force) * (1-tfloorforce)) / autocvar_g_throughfloor_force_max_stddev;
if(autocvar_g_throughfloor_debug)
- printf("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f);
+ LOG_INFOF("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f);
total = 0.25 * pow(max(mininv_f, mininv_d), 2);
if(autocvar_g_throughfloor_debug)
- printf(" steps=%f", total);
+ LOG_INFOF(" steps=%f", total);
if (IS_PLAYER(targ))
total = ceil(bound(autocvar_g_throughfloor_min_steps_other, total, autocvar_g_throughfloor_max_steps_other));
if(autocvar_g_throughfloor_debug)
- printf(" steps=%f dD=%f dF=%f", total, finaldmg * (1-tfloordmg) / (2 * sqrt(total)), vlen(force) * (1-tfloorforce) / (2 * sqrt(total)));
+ LOG_INFOF(" steps=%f dD=%f dF=%f", total, finaldmg * (1-tfloordmg) / (2 * sqrt(total)), vlen(force) * (1-tfloorforce) / (2 * sqrt(total)));
for(c = 0; c < total; ++c)
{
force = force * a;
if(autocvar_g_throughfloor_debug)
- printf(" D=%f F=%f\n", finaldmg, vlen(force));
+ LOG_INFOF(" D=%f F=%f\n", finaldmg, vlen(force));
}
//if (targ == attacker)
if(c == 50)
{
- dprint("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2), "\n");
- dprint(" Nudging gets us nowhere at ", vtos(pos), "\n");
- dprint(" trace_endpos is ", vtos(trace_endpos), "\n");
- dprint(" trace distance is ", ftos(vlen(pos - trace_endpos)), "\n");
+ LOG_TRACE("HOLY SHIT! When tracing from ", vtos(v1), " to ", vtos(v2), "\n");
+ LOG_TRACE(" Nudging gets us nowhere at ", vtos(pos), "\n");
+ LOG_TRACE(" trace_endpos is ", vtos(trace_endpos), "\n");
+ LOG_TRACE(" trace distance is ", ftos(vlen(pos - trace_endpos)), "\n");
}
stopentity = trace_ent;
// TODO OPTIMIZE
}
#ifdef VERIFY
- print(vtos(tet_piecemins), "-");
- print(vtos(tet_piecemaxs), "\n");
+ LOG_INFO(vtos(tet_piecemins), "-");
+ LOG_INFO(vtos(tet_piecemaxs), "\n");
if(tet_piecemins.x > tet_piecemaxs.x)
error("inconsistent mins/maxs");
if(tet_piecemins.y > tet_piecemaxs.y)
for(r = 1; r <= TET_LINES; ++r)
{
l = GetLine(r);
- print(">");
+ LOG_INFO(">");
for(c = 1; c <= TET_WIDTH; ++c)
{
- print(ftos(GetXBlock(c, l)));
+ LOG_INFO(ftos(GetXBlock(c, l)));
}
- print("\n");
+ LOG_INFO("\n");
}
}
b = buf_create(); bastet_piece[6] = 7; bastet_score[6] = BastetSearch(b, 7, TET_START_PIECE_POS_x, 1+TET_START_PIECE_POS_y, TET_START_PIECE_POS_y, TET_WIDTH) + 100 * random() + bastet_piecetime[6]; buf_del(b);
float t2 = gettime(GETTIME_HIRES);
- dprintf("Time taken: %.6f seconds (of this, ev = %.2f%%, cm = %.2f%%)\n", t2 - t1, 100 * bastet_profile_evaluate_time / (t2 - t1), 100 * bastet_profile_checkmetrics_time / (t2 - t1));
+ LOG_TRACEF("Time taken: %.6f seconds (of this, ev = %.2f%%, cm = %.2f%%)\n", t2 - t1, 100 * bastet_profile_evaluate_time / (t2 - t1), 100 * bastet_profile_checkmetrics_time / (t2 - t1));
// sort
float i, j, k, p, s;
if (autocvar_g_bastet)
{
cvar_set("g_bastet", "0");
- print("The useless cvar has been toggled.\n");
+ LOG_INFO("The useless cvar has been toggled.\n");
}
return 0;
}
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");
}
}
if(id >= MAX_IPBAN_URIS)
{
- print("Received ban list for invalid ID\n");
+ LOG_INFO("Received ban list for invalid ID\n");
return;
}
tokenize_console(autocvar_g_ban_sync_uri);
uri = argv(id);
- print("Received ban list from ", uri, ": ");
+ LOG_INFO("Received ban list from ", uri, ": ");
if(OnlineBanList_RequestWaiting[id] == 0)
{
- print("rejected (unexpected)\n");
+ LOG_INFO("rejected (unexpected)\n");
return;
}
if(time > OnlineBanList_Timeout)
{
- print("rejected (too late)\n");
+ LOG_INFO("rejected (too late)\n");
return;
}
syncinterval = autocvar_g_ban_sync_interval;
if(syncinterval == 0)
{
- print("rejected (syncing disabled)\n");
+ LOG_INFO("rejected (syncing disabled)\n");
return;
}
if(syncinterval > 0)
if(status != 0)
{
- print("error: status is ", ftos(status), "\n");
+ LOG_INFO("error: status is ", ftos(status), "\n");
return;
}
if(substring(data, 0, 1) == "<")
{
- print("error: received HTML instead of a ban list\n");
+ LOG_INFO("error: received HTML instead of a ban list\n");
return;
}
if(strstrofs(data, "\r", 0) != -1)
{
- print("error: received carriage returns\n");
+ LOG_INFO("error: received carriage returns\n");
return;
}
if((n % 4) != 0)
{
- print("error: received invalid item count: ", ftos(n), "\n");
+ LOG_INFO("error: received invalid item count: ", ftos(n), "\n");
return;
}
- print("OK, ", ftos(n / 4), " items\n");
+ LOG_INFO("OK, ", ftos(n / 4), " items\n");
for(i = 0; i < n; i += 4)
{
reason = argv(i + 2);
serverip = argv(i + 3);
- dprint("received ban list item ", ftos(i / 4), ": ip=", ip);
- dprint(" timeleft=", ftos(timeleft), " reason=", reason);
- dprint(" serverip=", serverip, "\n");
+ LOG_TRACE("received ban list item ", ftos(i / 4), ": ip=", ip);
+ LOG_TRACE(" timeleft=", ftos(timeleft), " reason=", reason);
+ LOG_TRACE(" serverip=", serverip, "\n");
timeleft -= 1.5 * autocvar_g_ban_sync_timeout;
if(timeleft < 0)
for(j = 0; j < l; ++j)
if(strstrofs("0123456789.", substring(ip, j, 1), 0) == -1)
{
- print("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.\n");
+ LOG_INFO("Invalid character ", substring(ip, j, 1), " in IP address ", ip, ". Skipping this ban.\n");
goto skip;
}
}
// the ban will be prolonged on the next sync
// or expire 5 seconds after the next timeout
Ban_Insert(ip, timeleft, strcat("ban synced from ", serverip, " at ", uri), 0);
- print("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ");
- print(reason, "\n");
+ LOG_INFO("Ban list syncing: accepted ban of ", ip, " by ", serverip, " at ", uri, ": ");
+ LOG_INFO(reason, "\n");
:skip
}
float i, n;
string msg;
- print("^2Listing all existing active bans:\n");
+ LOG_INFO("^2Listing all existing active bans:\n");
n = 0;
for(i = 0; i < ban_count; ++i)
msg = strcat(msg, ban_ip[i], " is still banned for ");
msg = strcat(msg, ftos(ban_expire[i] - time), " seconds");
- print(" ", msg, "\n");
+ LOG_INFO(" ", msg, "\n");
}
- print("^2Done listing all active (", ftos(n), ") bans.\n");
+ LOG_INFO("^2Done listing all active (", ftos(n), ") bans.\n");
}
float Ban_GetClientIP(entity client)
if(time + bantime > ban_expire[i])
{
ban_expire[i] = time + bantime;
- dprint(ip, "'s ban has been prolonged to ", ftos(bantime), " seconds from now\n");
+ LOG_TRACE(ip, "'s ban has been prolonged to ", ftos(bantime), " seconds from now\n");
}
else
- dprint(ip, "'s ban is still active until ", ftos(ban_expire[i] - time), " seconds from now\n");
+ LOG_TRACE(ip, "'s ban is still active until ", ftos(ban_expire[i] - time), " seconds from now\n");
// and enforce
reason = Ban_Enforce(i, reason);
if(i < ban_count)
if(ban_expire[i] > time + bantime)
{
- print(ip, " could not get banned due to no free ban slot\n");
+ LOG_INFO(ip, " could not get banned due to no free ban slot\n");
return false;
}
// okay, insert our new victim as i
Ban_Delete(i);
- dprint(ip, " has been banned for ", ftos(bantime), " seconds\n");
+ LOG_TRACE(ip, " has been banned for ", ftos(bantime), " seconds\n");
ban_expire[i] = time + bantime;
ban_ip[i] = strzone(ip);
ban_count = max(ban_count, i + 1);
if ( !GameTypeVote_SetGametype(GameTypeVote_Type_FromString(mapvote_maps[pos])) )
{
- dprint("Selected gametype is not supported by any map");
+ LOG_TRACE("Selected gametype is not supported by any map");
}
localcmd("sv_vote_gametype_hook_all\n");
{
if (DistributeEvenly_amount)
{
- dprint("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
- dprint(ftos(DistributeEvenly_totalweight), " left!)\n");
+ LOG_TRACE("DistributeEvenly_Init: UNFINISHED DISTRIBUTION (", ftos(DistributeEvenly_amount), " for ");
+ LOG_TRACE(ftos(DistributeEvenly_totalweight), " left!)\n");
}
if (totalweight == 0)
DistributeEvenly_amount = 0;
}
if (autocvar_sv_eventlog_console)
{
- print(s, "\n");
+ LOG_INFO(s, "\n");
}
}
{
if (i != 0)
{
- dprint("Nearest point (");
- dprint(nearest_entity[0].netname);
- dprint(") is not visible, using a visible one.\n");
+ LOG_TRACE("Nearest point (");
+ LOG_TRACE(nearest_entity[0].netname);
+ LOG_TRACE(") is not visible, using a visible one.\n");
}
return nearest_entity[i];
}
if (num_nearest == 0)
return world;
- dprint("Not seeing any location point, using nearest as fallback.\n");
+ LOG_TRACE("Not seeing any location point, using nearest as fallback.\n");
/* DEBUGGING CODE:
dprint("Candidates were: ");
for(j = 0; j < num_nearest; ++j)
}
if (j > WEP_LAST)
{
- print("The weapon mutator list contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon mutator list contains an unknown weapon ", s, ". Skipped.\n");
}
}
g_weaponarena_list = strzone(substring(g_weaponarena_list, 0, strlen(g_weaponarena_list) - 3));
if(trace_dphitcontents == 0)
{
//dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
- dprintf("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
+ LOG_TRACEF("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
checkclient();
}
if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
traceline(self.origin - tic, self.origin + tic, MOVE_NORMAL, self);
if (trace_fraction >= 1)
{
- dprint("Odd... did not hit...?\n");
+ LOG_TRACE("Odd... did not hit...?\n");
}
else if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
- dprint("Detected and prevented the sky-grapple bug.\n");
+ LOG_TRACE("Detected and prevented the sky-grapple bug.\n");
return 1;
}
}
}
else
{
- print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
+ LOG_INFO("Received HTTP request data for an invalid id ", ftos(id), ".\n");
}
}
{
setorigin(e, start);
e.angles = vectoangles(end - start);
- dprint("Needed ", ftos(i + 1), " attempts\n");
+ LOG_TRACE("Needed ", ftos(i + 1), " attempts\n");
return true;
}
else
{
while(iter > 0)
{
- print(ftos(randombit(bits)), "\n");
+ LOG_INFO(ftos(randombit(bits)), "\n");
--iter;
}
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
{
pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
pickup_dropped_score = floor((autocvar_g_ctf_score_pickup_dropped_late * (1 - pickup_dropped_score) + autocvar_g_ctf_score_pickup_dropped_early * pickup_dropped_score) + 0.5);
- dprint("pickup_dropped_score is ", ftos(pickup_dropped_score), "\n");
+ LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score), "\n");
PlayerTeamScore_AddScore(player, pickup_dropped_score);
ctf_EventLog("pickup", flag.team, player);
break;
// sanity checks
if(self.mins != FLAG_MIN || self.maxs != FLAG_MAX) { // reset the flag boundaries in case it got squished
- dprint("wtf the flag got squashed?\n");
+ LOG_TRACE("wtf the flag got squashed?\n");
tracebox(self.origin, FLAG_MIN, FLAG_MAX, self.origin, MOVE_NOMONSTERS, self);
if(!trace_startsolid || self.noalign) // can we resize it without getting stuck?
setsize(self, FLAG_MIN, FLAG_MAX); }
default: // this should never happen
{
- dprint("ctf_FlagThink(): Flag exists with no status?\n");
+ LOG_TRACE("ctf_FlagThink(): Flag exists with no status?\n");
return;
}
}
case FLAG_CARRY:
{
- dprint("Someone touched a flag even though it was being carried?\n");
+ LOG_TRACE("Someone touched a flag even though it was being carried?\n");
break;
}
void havocbot_role_ctf_setrole(entity bot, int role)
{
- dprint(strcat(bot.netname," switched to "));
+ LOG_TRACE(strcat(bot.netname," switched to "));
switch(role)
{
case HAVOCBOT_CTF_ROLE_CARRIER:
- dprint("carrier");
+ LOG_TRACE("carrier");
bot.havocbot_role = havocbot_role_ctf_carrier;
bot.havocbot_role_timeout = 0;
bot.havocbot_cantfindflag = time + 10;
bot.bot_strategytime = 0;
break;
case HAVOCBOT_CTF_ROLE_DEFENSE:
- dprint("defense");
+ LOG_TRACE("defense");
bot.havocbot_role = havocbot_role_ctf_defense;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_CTF_ROLE_MIDDLE:
- dprint("middle");
+ LOG_TRACE("middle");
bot.havocbot_role = havocbot_role_ctf_middle;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_CTF_ROLE_OFFENSE:
- dprint("offense");
+ LOG_TRACE("offense");
bot.havocbot_role = havocbot_role_ctf_offense;
bot.havocbot_role_timeout = 0;
break;
case HAVOCBOT_CTF_ROLE_RETRIEVER:
- dprint("retriever");
+ LOG_TRACE("retriever");
bot.havocbot_previous_role = bot.havocbot_role;
bot.havocbot_role = havocbot_role_ctf_retriever;
bot.havocbot_role_timeout = time + 10;
bot.bot_strategytime = 0;
break;
case HAVOCBOT_CTF_ROLE_ESCORT:
- dprint("escort");
+ LOG_TRACE("escort");
bot.havocbot_previous_role = bot.havocbot_role;
bot.havocbot_role = havocbot_role_ctf_escort;
bot.havocbot_role_timeout = time + 30;
bot.bot_strategytime = 0;
break;
}
- dprint("\n");
+ LOG_TRACE("\n");
}
// if no teams are found, spawn defaults
if(find(world, classname, "ctf_team") == world)
{
- print("No ""ctf_team"" entities found on this map, creating them anyway.\n");
+ LOG_INFO("No ""ctf_team"" entities found on this map, creating them anyway.\n");
ctf_SpawnTeam("Red", NUM_TEAM_1 - 1);
ctf_SpawnTeam("Blue", NUM_TEAM_2 - 1);
if(ctf_teams >= 3)
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
// if no teams are found, spawn defaults
if(find(world, classname, "dom_team") == world || autocvar_g_domination_teams_override >= 2)
{
- print("No ""dom_team"" entities found on this map, creating them anyway.\n");
+ LOG_INFO("No ""dom_team"" entities found on this map, creating them anyway.\n");
domination_teams = bound(2, ((autocvar_g_domination_teams_override < 2) ? autocvar_g_domination_default_teams : autocvar_g_domination_teams_override), 4);
dom_spawnteams(domination_teams);
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
// If only one left on team or if role has timed out then start trying to free players.
if (((unfrozen == 0) && (!self.frozen)) || (time > self.havocbot_role_timeout))
{
- dprint("changing role to freeing\n");
+ LOG_TRACE("changing role to freeing\n");
self.havocbot_role = havocbot_role_ft_freeing;
self.havocbot_role_timeout = 0;
return;
if (time > self.havocbot_role_timeout)
{
- dprint("changing role to offense\n");
+ LOG_TRACE("changing role to offense\n");
self.havocbot_role = havocbot_role_ft_offense;
self.havocbot_role_timeout = 0;
return;
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
if(spawn_point == world)
{
- dprint("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n");
+ LOG_TRACE("Warning: couldn't find any invasion_spawnpoint spawnpoints, attempting to spawn monsters in random locations\n");
entity e = spawn();
setsize(e, (get_monsterinfo(mon)).mins, (get_monsterinfo(mon)).maxs);
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
o = self.origin;
if(!move_out_of_solid(self))
objerror("could not get out of solid at all!");
- print("^1NOTE: this map needs FIXING. ", self.classname, " at ", vtos(o - '0 0 1'));
- print(" needs to be moved out of solid, e.g. by '", ftos(self.origin.x - o.x));
- print(" ", ftos(self.origin.y - o.y));
- print(" ", ftos(self.origin.z - o.z), "'\n");
+ LOG_INFO("^1NOTE: this map needs FIXING. ", self.classname, " at ", vtos(o - '0 0 1'));
+ LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(self.origin.x - o.x));
+ LOG_INFO(" ", ftos(self.origin.y - o.y));
+ LOG_INFO(" ", ftos(self.origin.z - o.z), "'\n");
self.origin = o;
}
}
{
// dprint("Step 4: time: ", ftos(time), "\n");
if(vlen(self.origin - self.spawnorigin) > 10) // should not happen anymore
- dprint("The ball moved too far away from its spawn origin.\nOffset: ",
+ LOG_TRACE("The ball moved too far away from its spawn origin.\nOffset: ",
vtos(self.origin - self.spawnorigin), " Velocity: ", vtos(self.velocity), "\n");
self.velocity = '0 0 0';
setorigin(self, self.spawnorigin); // make sure it's positioned correctly anyway
void nb_spawnteam(string teamname, float teamcolor)
{
- dprint("^2spawned team ", teamname, "\n");
+ LOG_TRACE("^2spawned team ", teamname, "\n");
entity e;
e = spawn();
e.classname = "nexball_team";
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
{
switch(autocvar_g_onslaught_debug)
{
- case 1: dprint(input); break;
- case 2: print(input); break;
+ case 1: LOG_TRACE(input); break;
+ case 2: LOG_INFO(input); break;
}
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
// if no teams are found, spawn defaults
if(find(world, classname, "tdm_team") == world)
{
- print("No ""tdm_team"" entities found on this map, creating them anyway.\n");
+ LOG_INFO("No ""tdm_team"" entities found on this map, creating them anyway.\n");
float numteams = min(4, autocvar_g_tdm_teams_override);
MUTATOR_ONREMOVE
{
- print("This is a game type and it cannot be removed at runtime.");
+ LOG_INFO("This is a game type and it cannot be removed at runtime.");
return -1;
}
MUTATOR_ONREMOVE
{
- print("This cannot be removed at runtime\n");
+ LOG_INFO("This cannot be removed at runtime\n");
return -1;
}
{
if (!(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")))
{
- dprint("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
+ LOG_TRACE("Warning: Physical items are enabled but no physics engine can be used. Reverting to old items.\n");
return -1;
}
}
MUTATOR_ONREMOVE
{
- print("This cannot be removed at runtime\n");
+ LOG_INFO("This cannot be removed at runtime\n");
return -1;
}
gravity_delay = time + autocvar_g_random_gravity_delay;
- dprint("Gravity is now: ", ftos(autocvar_sv_gravity), "\n");
+ LOG_TRACE("Gravity is now: ", ftos(autocvar_sv_gravity), "\n");
return false;
}
fh = fopen(fn, FILE_WRITE);
if(fh < 0)
{
- dprint("^1ERROR: ^7 superspec can not open ", fn, " for writing.\n");
+ LOG_TRACE("^1ERROR: ^7 superspec can not open ", fn, " for writing.\n");
}
else
{
fh = fopen(fn, FILE_READ);
if(fh < 0)
{
- dprint("^1ERROR: ^7 superspec can not open ", fn, " for reading.\n");
+ LOG_TRACE("^1ERROR: ^7 superspec can not open ", fn, " for reading.\n");
}
else
{
string _magic = fgets(fh);
if(_magic != _SSMAGIX)
{
- dprint("^1ERROR^7 While reading superspec options file: unknown magic\n");
+ LOG_TRACE("^1ERROR^7 While reading superspec options file: unknown magic\n");
}
else
{
if(file_get < 0)
{
if(autocvar_g_sandbox_info > 0)
- print(strcat("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7could not find storage file ^3", file_name, "^7, no objects were loaded\n"));
}
else
{
}
}
if(autocvar_g_sandbox_info > 0)
- print(strcat("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name, "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7successfully loaded storage file ^3", file_name, "\n"));
}
fclose(file_get);
}
setmodel(e, argv(2));
if(autocvar_g_sandbox_info > 0)
- print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", self.netname, " spawned an object at origin ^3", vtos(e.origin), "\n"));
return true;
// ---------------- COMMAND: OBJECT, REMOVE ----------------
if(e != world)
{
if(autocvar_g_sandbox_info > 0)
- print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", self.netname, " removed an object at origin ^3", vtos(e.origin), "\n"));
sandbox_ObjectRemove(e);
return true;
}
print_to(self, "^2SANDBOX - INFO: ^7Object pasted successfully");
if(autocvar_g_sandbox_info > 0)
- print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", self.netname, " pasted an object at origin ^3", vtos(e.origin), "\n"));
return true;
}
return true;
self.object_attach = world; // object was attached, no longer keep it scheduled for attachment
print_to(self, "^2SANDBOX - INFO: ^7Object attached successfully");
if(autocvar_g_sandbox_info > 1)
- print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", self.netname, " attached objects at origin ^3", vtos(e.origin), "\n"));
return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Object could not be attached to the parent. Make sure you are facing an object that you have edit rights over");
sandbox_ObjectAttach_Remove(e);
print_to(self, "^2SANDBOX - INFO: ^7Child objects detached successfully");
if(autocvar_g_sandbox_info > 1)
- print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " detached objects at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", self.netname, " detached objects at origin ^3", vtos(e.origin), "\n"));
return true;
}
print_to(self, "^1SANDBOX - WARNING: ^7Child objects could not be detached. Make sure you are facing an object that you have edit rights over");
e.message2 = strzone(strftime(true, "%d-%m-%Y %H:%M:%S"));
if(autocvar_g_sandbox_info > 1)
- print(strcat("^3SANDBOX - SERVER: ^7", self.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
+ LOG_INFO(strcat("^3SANDBOX - SERVER: ^7", self.netname, " edited property ^3", argv(2), " ^7of an object at origin ^3", vtos(e.origin), "\n"));
return true;
}
if(node.owner == closedlist)
{
- dprint("Pathlib: Tried to close a closed node!\n");
+ LOG_TRACE("Pathlib: Tried to close a closed node!\n");
return;
}
to.x = fsnap(to.x,pathlib_gridsize);
to.y = fsnap(to.y,pathlib_gridsize);
- dprint("AStar init. ", ftos(pathlib_scraplist_cnt), " nodes on scrap\n");
+ LOG_TRACE("AStar init. ", ftos(pathlib_scraplist_cnt), " nodes on scrap\n");
path = pathlib_mknode(from,world);
pathlib_close_node(path,to);
if(pathlib_foundgoal)
{
- dprint("AStar: Goal found on first node!\n");
+ LOG_TRACE("AStar: Goal found on first node!\n");
open = spawn();
open.owner = open;
if(pathlib_expandnode(path,from,to) <= 0)
{
- dprint("AStar path fail.\n");
+ LOG_TRACE("AStar path fail.\n");
pathlib_cleanup();
return world;
if(pathlib_foundgoal)
{
- dprint("Target found. Rebuilding and filtering path...\n");
+ LOG_TRACE("Target found. Rebuilding and filtering path...\n");
ftime = gettime(GETTIME_REALTIME);
ptime = ftime - ptime;
#ifdef DEBUGPATHING
pathlib_showpath2(start);
- dprint("Time used - pathfinding: ", ftos(ptime),"\n");
- dprint("Time used - rebuild & filter: ", ftos(ftime),"\n");
- dprint("Time used - cleanup: ", ftos(ctime),"\n");
- dprint("Time used - total: ", ftos(ptime + ftime + ctime),"\n");
- dprint("Time used - # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
- dprint("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
- dprint("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
- dprint("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
- dprint("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
- dprint("Nodes - searched: ", ftos(pathlib_searched_cnt),"\n");
+ LOG_TRACE("Time used - pathfinding: ", ftos(ptime),"\n");
+ LOG_TRACE("Time used - rebuild & filter: ", ftos(ftime),"\n");
+ LOG_TRACE("Time used - cleanup: ", ftos(ctime),"\n");
+ LOG_TRACE("Time used - total: ", ftos(ptime + ftime + ctime),"\n");
+ LOG_TRACE("Time used - # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
+ LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
+ LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
+ LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
+ LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
+ LOG_TRACE("Nodes - searched: ", ftos(pathlib_searched_cnt),"\n");
if(pathlib_recycle_cnt)
- dprint("Nodes - make/reuse: ", ftos(pathlib_made_cnt / pathlib_recycle_cnt),"\n");
+ LOG_TRACE("Nodes - make/reuse: ", ftos(pathlib_made_cnt / pathlib_recycle_cnt),"\n");
if(pathlib_recycle_cnt)
- dprint("Nodes - reused: ", ftos(pathlib_recycle_cnt),"\n");
+ LOG_TRACE("Nodes - reused: ", ftos(pathlib_recycle_cnt),"\n");
- dprint("Nodes bestopen searched: ", ftos(pathlib_bestopen_seached),"\n");
- dprint("Nodes bestcash - hits: ", ftos(pathlib_bestcash_hits),"\n");
- dprint("Nodes bestcash - save: ", ftos(pathlib_bestcash_saved),"\n");
- dprint("AStar done. ", ftos(pathlib_scraplist_cnt), " nodes on scrap\n\n");
+ LOG_TRACE("Nodes bestopen searched: ", ftos(pathlib_bestopen_seached),"\n");
+ LOG_TRACE("Nodes bestcash - hits: ", ftos(pathlib_bestcash_hits),"\n");
+ LOG_TRACE("Nodes bestcash - save: ", ftos(pathlib_bestcash_saved),"\n");
+ LOG_TRACE("AStar done. ", ftos(pathlib_scraplist_cnt), " nodes on scrap\n\n");
#endif
return start;
}
}
- dprint("A* Faild to find a path! Try a smaller gridsize.\n");
+ LOG_TRACE("A* Faild to find a path! Try a smaller gridsize.\n");
pathlib_cleanup();
if(node.pathlib_node_edgeflags == pathlib_node_edgeflag_none)
{
- dprint("Node at ", vtos(node.origin), " not expanable");
+ LOG_TRACE("Node at ", vtos(node.origin), " not expanable");
return pathlib_open_cnt;
}
if(inwater(parent.origin))
{
- dprint("FromWater\n");
+ LOG_TRACE("FromWater\n");
pathlib_expandnode = pathlib_expandnode_box;
pathlib_movenode = pathlib_swimnode;
}
{
if(inwater(to))
{
- dprint("ToWater\n");
+ LOG_TRACE("ToWater\n");
pathlib_expandnode = pathlib_expandnode_box;
pathlib_movenode = pathlib_walknode;
}
else
{
- dprint("LandToLoand\n");
+ LOG_TRACE("LandToLoand\n");
//if(edge_check(parent.origin))
// return 0;
node = pathlib_nodeatpoint(to);
if(node)
{
- dprint("NodeAtPoint\n");
+ LOG_TRACE("NodeAtPoint\n");
++pathlib_merge_cnt;
if(node.owner == openlist)
{
//pathlib_showsquare(where, 0 ,30);
//pathlib_showsquare(parent.origin, 1 ,30);
- dprint("pathlib_movenode_goodnode = 0\n");
+ LOG_TRACE("pathlib_movenode_goodnode = 0\n");
return 0;
}
if(pathlib_nodeatpoint(where))
{
- dprint("NAP WHERE :",vtos(where),"\n");
- dprint("not NAP TO:",vtos(to),"\n");
- dprint("NAP-NNAP:",ftos(vlen(to-where)),"\n\n");
+ LOG_TRACE("NAP WHERE :",vtos(where),"\n");
+ LOG_TRACE("not NAP TO:",vtos(to),"\n");
+ LOG_TRACE("NAP-NNAP:",ftos(vlen(to-where)),"\n\n");
return 0;
}
if(doedge)
if (!tile_check(where))
{
- dprint("tile_check fail\n");
+ LOG_TRACE("tile_check fail\n");
pathlib_showsquare(where, 0 ,30);
return 0;
}
if(node.owner == closedlist)
{
- dprint("Pathlib: Tried to close a closed node!\n");
+ LOG_TRACE("Pathlib: Tried to close a closed node!\n");
return;
}
to.y = fsnap(to.y, pathlib_gridsize);
//to_z += 32;
- dprint("AStar init\n");
+ LOG_TRACE("AStar init\n");
path = pathlib_mknode(from, world);
pathlib_close_node(path, to);
if(pathlib_foundgoal)
{
- dprint("AStar: Goal found on first node!\n");
+ LOG_TRACE("AStar: Goal found on first node!\n");
open = spawn();
open.owner = open;
if(pathlib_expandnode(path, from, to) <= 0)
{
- dprint("AStar path fail.\n");
+ LOG_TRACE("AStar path fail.\n");
pathlib_cleanup();
return world;
{
if((gettime(GETTIME_REALTIME) - pathlib_starttime) > pathlib_maxtime)
{
- dprint("Path took to long to compute!\n");
- dprint("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
- dprint("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
- dprint("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
- dprint("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
+ LOG_TRACE("Path took to long to compute!\n");
+ LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
+ LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
+ LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
+ LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
pathlib_cleanup();
return world;
if(pathlib_foundgoal)
{
- dprint("Target found. Rebuilding and filtering path...\n");
+ LOG_TRACE("Target found. Rebuilding and filtering path...\n");
ftime = gettime(GETTIME_REALTIME);
ptime = ftime - ptime;
#ifdef DEBUGPATHING
pathlib_showpath2(start);
- dprint("Time used - pathfinding: ", ftos(ptime),"\n");
- dprint("Time used - rebuild & filter: ", ftos(ftime),"\n");
- dprint("Time used - cleanup: ", ftos(ctime),"\n");
- dprint("Time used - total: ", ftos(ptime + ftime + ctime),"\n");
- dprint("Time used - # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
- dprint("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
- dprint("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
- dprint("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
- dprint("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
- dprint("Nodes - searched: ", ftos(pathlib_searched_cnt),"\n");
- dprint("Nodes bestopen searched: ", ftos(pathlib_bestopen_seached),"\n");
- dprint("Nodes bestcash - hits: ", ftos(pathlib_bestcash_hits),"\n");
- dprint("Nodes bestcash - save: ", ftos(pathlib_bestcash_saved),"\n");
- dprint("AStar done.\n");
+ LOG_TRACE("Time used - pathfinding: ", ftos(ptime),"\n");
+ LOG_TRACE("Time used - rebuild & filter: ", ftos(ftime),"\n");
+ LOG_TRACE("Time used - cleanup: ", ftos(ctime),"\n");
+ LOG_TRACE("Time used - total: ", ftos(ptime + ftime + ctime),"\n");
+ LOG_TRACE("Time used - # frames: ", ftos(ceil((ptime + ftime + ctime) / sys_frametime)),"\n\n");
+ LOG_TRACE("Nodes - created: ", ftos(pathlib_made_cnt),"\n");
+ LOG_TRACE("Nodes - open: ", ftos(pathlib_open_cnt),"\n");
+ LOG_TRACE("Nodes - merged: ", ftos(pathlib_merge_cnt),"\n");
+ LOG_TRACE("Nodes - closed: ", ftos(pathlib_closed_cnt),"\n");
+ LOG_TRACE("Nodes - searched: ", ftos(pathlib_searched_cnt),"\n");
+ LOG_TRACE("Nodes bestopen searched: ", ftos(pathlib_bestopen_seached),"\n");
+ LOG_TRACE("Nodes bestcash - hits: ", ftos(pathlib_bestcash_hits),"\n");
+ LOG_TRACE("Nodes bestcash - save: ", ftos(pathlib_bestcash_saved),"\n");
+ LOG_TRACE("AStar done.\n");
#endif
return start;
}
}
- dprint("A* Faild to find a path! Try a smaller gridsize.\n");
+ LOG_TRACE("A* Faild to find a path! Try a smaller gridsize.\n");
pathlib_cleanup();
vector direction,point,last_point,s,e;
float steps, distance, i;
- dprint("Walking node from ", vtos(start), " to ", vtos(end), "\n");
+ LOG_TRACE("Walking node from ", vtos(start), " to ", vtos(end), "\n");
pathlib_movenode_goodnode = 0;
//start - movenode_maxdrop
a.cnt = time + 10;
- dprint("I cant walk on air!\n");
+ LOG_TRACE("I cant walk on air!\n");
return trace_endpos;
}
pathlib_searched_cnt = 0;
pathlib_foundgoal = false;
- dprint("pathlib_waypointpath init\n");
+ LOG_TRACE("pathlib_waypointpath init\n");
// Initialize waypoint grid
// FIXME! presisted chain for better preformance
start_node = wp_from;
start_node.pathlib_list = closedlist;
- dprint("Expanding ",ftos(pathlib_wpp_expand(start_node))," links\n");
+ LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(start_node))," links\n");
if(pathlib_open_cnt <= 0)
{
- dprint("pathlib_waypointpath: Start waypoint not linked! aborting.\n");
+ LOG_TRACE("pathlib_waypointpath: Start waypoint not linked! aborting.\n");
return world;
}
n = pathlib_wpp_bestopen();
if(!n)
{
- dprint("Cannot find best open node, abort.\n");
+ LOG_TRACE("Cannot find best open node, abort.\n");
return world;
}
pathlib_wpp_close(n);
- dprint("Expanding ",ftos(pathlib_wpp_expand(n))," links\n");
+ LOG_TRACE("Expanding ",ftos(pathlib_wpp_expand(n))," links\n");
if(pathlib_foundgoal)
{
entity start, end, open, ln;
- dprint("Target found. Rebuilding and filtering path...\n");
+ LOG_TRACE("Target found. Rebuilding and filtering path...\n");
buildpath_nodefilter = buildpath_nodefilter_none;
start = path_build(world, start_node.origin, world, world);
{
if(self.playerdemo_mode != PLAYERDEMO_MODE_OFF)
{
- print("playerdemo: ", self.netname, " closed\n");
+ LOG_INFO("playerdemo: ", self.netname, " closed\n");
fclose(self.playerdemo_fh);
}
self.playerdemo_mode = 0;
self.playerdemo_time = stof(fgets(self.playerdemo_fh));
self.playerdemo_time += self.playerdemo_starttime;
self.movetype = MOVETYPE_NONE;
- print("playerdemo: ", self.netname, " reading from ", f, "\n");
+ LOG_INFO("playerdemo: ", self.netname, " reading from ", f, "\n");
}
void playerdemo_open_write(string f)
{
self.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
self.playerdemo_fh = fopen(f, FILE_WRITE);
self.playerdemo_starttime = time - 1;
- print("playerdemo: ", self.netname, " writing to ", f, "\n");
- print("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!\n");
+ LOG_INFO("playerdemo: ", self.netname, " writing to ", f, "\n");
+ LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!\n");
}
#define PLAYERDEMO_FIELD(func,t,f) func##t(f,#f);
#define PLAYERDEMO_FIELDS(func) \
tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, step, MOVE_NOMONSTERS, player);
if(trace_startsolid)
{
- print("'safe' teleport location is not safe!\n");
+ LOG_INFO("'safe' teleport location is not safe!\n");
// FAIL TODO why does this happen?
return 0;
}
tracebox(safe, player.mins - SAFENUDGE, player.maxs + SAFENUDGE, to, MOVE_NOMONSTERS, player);
if(trace_startsolid)
{
- print("trace_endpos in solid, this can't be!\n");
+ LOG_INFO("trace_endpos in solid, this can't be!\n");
// FAIL TODO why does this happen? (reported by MrBougo)
return 0;
}
if(!move_out_of_solid(portal))
{
#ifdef DEBUG
- print("NO SAFE ORIGIN\n");
+ LOG_INFO("NO SAFE ORIGIN\n");
#endif
return 0;
}
{
float n, si, ni;
vector norm, vec;
- print("Surfaces of ", etos(e), ":\n");
+ LOG_INFO("Surfaces of ", etos(e), ":\n");
- print("TEST = ", ftos(getsurfacenearpoint(e, '0 0 0')), "\n");
+ LOG_INFO("TEST = ", ftos(getsurfacenearpoint(e, '0 0 0')), "\n");
for(si = 0; ; ++si)
{
n = getsurfacenumpoints(e, si);
if(n <= 0)
break;
- print(" Surface ", ftos(si), ":\n");
+ LOG_INFO(" Surface ", ftos(si), ":\n");
norm = getsurfacenormal(e, si);
- print(" Normal = ", vtos(norm), "\n");
+ LOG_INFO(" Normal = ", vtos(norm), "\n");
for(ni = 0; ni < n; ++ni)
{
vec = getsurfacepoint(e, si, ni);
- print(" Point ", ftos(ni), " = ", vtos(vec), " (", ftos(norm * vec), ")\n");
+ LOG_INFO(" Point ", ftos(ni), " = ", vtos(vec), " (", ftos(norm * vec), ")\n");
}
}
}
self.team = activator.team;
some_spawn_has_been_used = 1;
}
- print("spawnpoint was used!\n");
+ LOG_INFO("spawnpoint was used!\n");
}
void relocate_spawnpoint()
self.maxs = PL_MAX_CONST;
if (!move_out_of_solid(self))
objerror("could not get out of solid at all!");
- print("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));
- print(" needs to be moved out of solid, e.g. by '", ftos(self.origin.x - o.x));
- print(" ", ftos(self.origin.y - o.y));
- print(" ", ftos(self.origin.z - o.z), "'\n");
+ LOG_INFO("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));
+ LOG_INFO(" needs to be moved out of solid, e.g. by '", ftos(self.origin.x - o.x));
+ LOG_INFO(" ", ftos(self.origin.y - o.y));
+ LOG_INFO(" ", ftos(self.origin.z - o.z), "'\n");
if (autocvar_g_spawnpoints_auto_move_out_of_solid)
{
if (!spawnpoint_nag)
- print("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
+ LOG_INFO("\{1}^1NOTE: this map needs FIXING (it contains spawnpoints in solid, see server log)\n");
spawnpoint_nag = 1;
}
else
if(!found)
{
- dprint("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target, "\n");
+ LOG_TRACE("WARNING: spawnpoint at ", vtos(spot.origin), " could not find its target ", spot.target, "\n");
return '-1 0 0';
}
}
float t, pp, c_seeing, c_seen;
entity cl;
t = client_cefc_accumulator / (time - client_cefc_accumulatortime);
- print("CEFC time: ", ftos(t * 1000), "ms; ");
+ LOG_INFO("CEFC time: ", ftos(t * 1000), "ms; ");
c_seeing = 0;
c_seen = 0;
FOR_EACH_CLIENT(cl)
if(IS_PLAYER(cl))
++c_seen;
}
- print("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
- print("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
+ LOG_INFO("CEFC calls per second: ", ftos(c_seeing * (c_seen - 1) / t), "; ");
+ LOG_INFO("CEFC 100% load at: ", ftos(solve_quadratic(t, -t, -1) * '0 1 0'), "\n");
client_cefc_accumulatortime = time;
client_cefc_accumulator = 0;
else
{
self.draw = ItemDraw;
- dprint("Simple item requested for ", _fn, " but no model exists for it\n");
+ LOG_TRACE("Simple item requested for ", _fn, " but no model exists for it\n");
}
}
if(self.mdl == "")
- dprint("^1WARNING!^7 self.mdl is unset for item ", self.classname, " tell tZork aboute this!\n");
+ LOG_TRACE("^1WARNING!^7 self.mdl is unset for item ", self.classname, " tell tZork aboute this!\n");
precache_model(self.mdl);
setmodel(self, self.mdl);
{
if(self.mdl == "")
- dprint("^1WARNING!^7 self.mdl is unset for item ", self.classname, "exspect a crash just aboute now\n");
+ LOG_TRACE("^1WARNING!^7 self.mdl is unset for item ", self.classname, "exspect a crash just aboute now\n");
WriteString(MSG_ENTITY, self.mdl);
}
if(self.effects & EF_NODRAW)
{
// marker for item team search
- dprint("Initializing item team ", ftos(self.team), "\n");
+ LOG_TRACE("Initializing item team ", ftos(self.team), "\n");
RandomSelection_Init();
for(head = world; (head = findfloat(head, team, self.team)); ) if(head.flags & FL_ITEM)
RandomSelection_Add(head, 0, string_null, head.cnt, 0);
// why not flags & fl_item?
if(otheritem.is_item)
{
- dprint("XXX Found duplicated item: ", itemname, vtos(self.origin));
- dprint(" vs ", otheritem.netname, vtos(otheritem.origin), "\n");
+ LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(self.origin));
+ LOG_TRACE(" vs ", otheritem.netname, vtos(otheritem.origin), "\n");
error("Mapper sucks.");
}
}
}
}
if(j > WEP_LAST)
- print("target_items: invalid item ", argv(i), "\n");
+ LOG_INFO("target_items: invalid item ", argv(i), "\n");
}
}
}
}
if(j > WEP_LAST)
- print("give: invalid item ", cmd, "\n");
+ LOG_INFO("give: invalid item ", cmd, "\n");
break;
}
val = 999;
FindConnectedComponent(self, enemy, LinkDoors_nextent, LinkDoors_isconnected, world);
// set owner, and make a loop of the chain
- dprint("LinkDoors: linking doors:");
+ LOG_TRACE("LinkDoors: linking doors:");
for(t = self; ; t = t.enemy)
{
- dprint(" ", etos(t));
+ LOG_TRACE(" ", etos(t));
t.owner = self;
if(t.enemy == world)
{
break;
}
}
- dprint("\n");
+ LOG_TRACE("\n");
// collect health, targetname, message, size
cmins = self.absmin;
if (!cvar_value_issafe(world.fog))
{
- print("The current map contains a potentially harmful fog setting, ignored\n");
+ LOG_INFO("The current map contains a potentially harmful fog setting, ignored\n");
world.fog = string_null;
}
if(MapInfo_Map_fog != "")
}
if(j > WEP_LAST)
{
- print("The weapon replace list for ", oldself.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon replace list for ", oldself.classname, " contains an unknown weapon ", s, ". Skipped.\n");
}
}
self = oldself;
}
if(j > WEP_LAST)
{
- print("The weapon replace list for ", self.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon replace list for ", self.classname, " contains an unknown weapon ", s, ". Skipped.\n");
}
}
if(wpn == 0)
if (trace_ent == ent.cursor_trace_ent)
w_shotdir = normalize(ent.cursor_trace_ent.origin - w_shotorg);
else
- print("antilag fail\n");
+ LOG_INFO("antilag fail\n");
}
}
}
#if 0
mspercallsum += gettime(GETTIME_HIRES);
mspercallcount += 1;
- print("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
+ LOG_INFO("avg: ", ftos(mspercallcount / mspercallsum), " per sec\n");
#endif
proj.velocity = W_CalculateProjectileVelocity(proj.owner.velocity, pSpeed * dir, forceAbsolute);
case URL_READY_CANREAD:
// url_fclose is processing, we got a response for writing the data
// this must come from HTTP
- print("Got response from weapon stats server:\n");
+ LOG_INFO("Got response from weapon stats server:\n");
while((s = url_fgets(fh)))
- print(" ", s, "\n");
- print("End of response.\n");
+ LOG_INFO(" ", s, "\n");
+ LOG_INFO("End of response.\n");
url_fclose(fh);
break;
case URL_READY_CLOSED:
// url_fclose has finished
- print("Weapon stats written\n");
+ LOG_INFO("Weapon stats written\n");
buf_del(weaponstats_buffer);
weaponstats_buffer = -1;
break;
case URL_READY_ERROR:
default:
- print("Weapon stats writing failed: ", ftos(status), "\n");
+ LOG_INFO("Weapon stats writing failed: ", ftos(status), "\n");
buf_del(weaponstats_buffer);
weaponstats_buffer = -1;
break;
self.movedir = gettaginfo(self, idx);
else
{
- print("WARNING: weapon model ", self.model, " does not support the 'shot' tag, will display shots TOTALLY wrong\n");
+ LOG_INFO("WARNING: weapon model ", self.model, " does not support the 'shot' tag, will display shots TOTALLY wrong\n");
self.movedir = '0 0 0';
}
}
self.spawnorigin = gettaginfo(self, idx);
else
{
- print("WARNING: weapon model ", self.model, " does not support the 'shell' tag, will display casings wrong\n");
+ LOG_INFO("WARNING: weapon model ", self.model, " does not support the 'shell' tag, will display casings wrong\n");
self.spawnorigin = self.movedir;
}
}
}
else
{
- print("WARNING: weapon model ", self.model, " does not support the 'handle' tag and neither does the v_ model support the 'shot' tag, will display muzzle flashes TOTALLY wrong\n");
+ LOG_INFO("WARNING: weapon model ", self.model, " does not support the 'handle' tag and neither does the v_ model support the 'shot' tag, will display muzzle flashes TOTALLY wrong\n");
self.oldorigin = '0 0 0'; // there is no way to recover from this
}
}
// don't reload weapons that don't have the RELOADABLE flag
if (!(e.spawnflags & WEP_FLAG_RELOADABLE))
{
- dprint("Warning: Attempted to reload a weapon that does not have the WEP_FLAG_RELOADABLE flag. Fix your code!\n");
+ LOG_TRACE("Warning: Attempted to reload a weapon that does not have the WEP_FLAG_RELOADABLE flag. Fix your code!\n");
return;
}
#ifdef CSQC
if (trace_networkentity)
{
- dprint("hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush\n");
+ LOG_TRACE("hit a network ent, cannot continue WarpZoneLib_BoxTouchesBrush\n");
// we cannot continue, as a player blocks us...
// so, abort
return 0;
{
if(--i < 1)
{
- dprint("Too many warpzones in sequence, aborting trace.\n");
+ LOG_TRACE("Too many warpzones in sequence, aborting trace.\n");
trace_ent = world;
break;
}
if(trace_ent == wz)
{
// FIXME can this check be removed? Do we really need it?
- dprint("I transformed into the same zone again, wtf, aborting the trace\n");
+ LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n");
trace_ent = world;
break;
}
{
if(--i < 1)
{
- dprint("Too many warpzones in sequence, aborting trace.\n");
+ LOG_TRACE("Too many warpzones in sequence, aborting trace.\n");
trace_ent = world;
break;
}
if(trace_ent == wz)
{
// FIXME can this check be removed? Do we really need it?
- dprint("I transformed into the same zone again, wtf, aborting the trace\n");
+ LOG_TRACE("I transformed into the same zone again, wtf, aborting the trace\n");
trace_ent = world;
break;
}
}
else
{
- print("would have to put player in solid, won't do that\n");
+ LOG_INFO("would have to put player in solid, won't do that\n");
setorigin(player, o0 - player.view_ofs);
return 0;
}
}
else
{
- dprint("WARPZONE FAIL AHAHAHAHAH))\n");
+ LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))\n");
}
}
return 0;
#ifdef WARPZONELIB_REMOVEHACK
- print("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now\n");
+ LOG_INFO("impactfilter found something - and it no longer gets handled correctly - please tell divVerent whether anything behaves broken now\n");
#else
- print("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
+ LOG_INFO("impactfilter found something - and it even gets handled correctly - please tell divVerent that this code apparently gets triggered again\n");
#endif
- print("Entity type: ", player.classname, "\n");
- print("Origin: ", vtos(player.origin), "\n");
- print("Velocity: ", vtos(player.velocity), "\n");
+ LOG_INFO("Entity type: ", player.classname, "\n");
+ LOG_INFO("Origin: ", vtos(player.origin), "\n");
+ LOG_INFO("Velocity: ", vtos(player.velocity), "\n");
#ifdef WARPZONELIB_REMOVEHACK
return 0;
point = point * (1 / (3 * area));
if(vlen(norm) < 0.99)
{
- print("trigger_warpzone near ", vtos(self.aiment.origin), " is nonplanar. BEWARE.\n");
+ LOG_INFO("trigger_warpzone near ", vtos(self.aiment.origin), " is nonplanar. BEWARE.\n");
area = 0; // no autofixing in this case
}
norm = normalize(norm);
makevectors(ang);
if(norm * v_forward < 0)
{
- print("Position target of trigger_warpzone near ", vtos(self.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
+ LOG_INFO("Position target of trigger_warpzone near ", vtos(self.aiment.origin), " points into trigger_warpzone. BEWARE.\n");
norm = -1 * norm;
}
ang = vectoangles2(norm, v_up); // keep rotation, but turn exactly against plane
ang.x = -ang.x;
if(norm * v_forward < 0.99)
- print("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
+ LOG_INFO("trigger_warpzone near ", vtos(self.aiment.origin), " has been turned to match plane orientation (", vtos(self.aiment.angles), " -> ", vtos(ang), "\n");
if(vlen(org - self.aiment.origin) > 0.5)
- print("trigger_warpzone near ", vtos(self.aiment.origin), " has been moved to match the plane (", vtos(self.aiment.origin), " -> ", vtos(org), ").\n");
+ LOG_INFO("trigger_warpzone near ", vtos(self.aiment.origin), " has been moved to match the plane (", vtos(self.aiment.origin), " -> ", vtos(org), ").\n");
}
}
else if(area > 0)