2001-07-17 05:58:10 +00:00
|
|
|
/*
|
|
|
|
TeamFortress V2.1 22/12/96
|
|
|
|
|
|
|
|
TeamFortress Software
|
|
|
|
*/
|
2001-07-23 20:52:47 +00:00
|
|
|
|
|
|
|
#include "defs.qh"
|
|
|
|
|
2001-07-17 05:58:10 +00:00
|
|
|
float() CheckExistence;
|
|
|
|
entity(float gno) Findgoal;
|
|
|
|
|
|
|
|
//- OfN -
|
|
|
|
void (string msg) RPrint;
|
|
|
|
void(entity who) MakeMeDebug;
|
|
|
|
|
|
|
|
//==============================================================
|
|
|
|
// A remove function which makes sure the entity hasn't already
|
2001-11-02 17:00:52 +00:00
|
|
|
// been removed, and that it isn't the NIL object.
|
2001-07-17 05:58:10 +00:00
|
|
|
void(entity te) dremove =
|
|
|
|
{
|
2001-11-02 17:00:52 +00:00
|
|
|
if (!te)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
RPrint("***BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG***\n");
|
|
|
|
RPrint("WORLD has nearly been removed. Don't worry!\n");
|
|
|
|
RPrint("***BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG***\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (te.classname == "player") //- OfN -
|
|
|
|
{
|
|
|
|
RPrint("***BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG***\n");
|
|
|
|
RPrint("Player entity was going to be removed. Don't worry!\n");
|
|
|
|
RPrint("***BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG***\n");
|
|
|
|
return;
|
|
|
|
}
|
2001-10-17 03:28:37 +00:00
|
|
|
#if 0
|
2001-07-23 20:52:47 +00:00
|
|
|
if (te.is_removed == TRUE)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
|
|
|
RPrint("***BUG BUG BUG BUG BUG BUG BUG***\n");
|
|
|
|
RPrint(" Entity has been removed twice. \n");
|
|
|
|
RPrint("***BUG BUG BUG BUG BUG BUG BUG***\n");
|
|
|
|
return;
|
|
|
|
}
|
2001-10-17 03:28:37 +00:00
|
|
|
#endif
|
2001-07-17 05:58:10 +00:00
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
te.is_removed = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
remove(te);
|
|
|
|
};
|
|
|
|
|
|
|
|
//==============================================================
|
|
|
|
// A command which just dumps your current location to the screen
|
|
|
|
void() display_location =
|
|
|
|
{
|
|
|
|
local string st;
|
|
|
|
|
|
|
|
st = vtos(self.origin);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint (self, PRINT_HIGH, st);
|
|
|
|
sprint (self, PRINT_HIGH, "\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//- OfN
|
|
|
|
// any client can remotely debug the server after using impulse 195 if "allow_debug" is set to 1
|
|
|
|
// and its and admin
|
|
|
|
// then RPrints will be sprinted to him also
|
|
|
|
// i coded this cause i dont have access to console in prozac server and wanted to see the dprints
|
|
|
|
// all the dprints in the code were replaced with RPrints
|
|
|
|
void (string msg) RPrint =
|
|
|
|
{
|
|
|
|
dprint(msg);
|
|
|
|
|
2001-11-02 17:00:52 +00:00
|
|
|
if (!debug_target)
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(debug_target,PRINT_HIGH,msg);
|
2001-07-17 05:58:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
float(entity person) Is_Admin;
|
|
|
|
void(entity person) Check_Admin_Password;
|
|
|
|
|
|
|
|
//====================================================================//
|
|
|
|
// called when an impulse 195
|
|
|
|
void(entity who) MakeMeDebug =
|
|
|
|
{
|
|
|
|
if (debug_target==who)
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(debug_target,PRINT_HIGH,"You are already the remote debugger!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Is_Admin(who))
|
|
|
|
{
|
|
|
|
RPrint(who.netname);
|
|
|
|
RPrint(" requests remote debugging without having the admin password set.\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
RPrint("(OfteN debug): ");
|
|
|
|
RPrint(who.netname);
|
|
|
|
RPrint(" requests remote debugging. Debug (dprints) messages will be sent to him/her too.\n");
|
|
|
|
|
2001-11-02 17:00:52 +00:00
|
|
|
if (debug_target)
|
2001-07-17 05:58:10 +00:00
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(debug_target,PRINT_HIGH,"(OfteN debug): You are not the remote debugger anymore.\n");
|
|
|
|
sprint(debug_target,PRINT_HIGH," New remote debugger is: '");
|
2001-07-17 05:58:10 +00:00
|
|
|
sprint(debug_target,who.netname);
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(debug_target,PRINT_HIGH,"'\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
debug_target=who;
|
2001-07-23 20:52:47 +00:00
|
|
|
sprint(debug_target,PRINT_HIGH,"(OfteN debug): Server debug messages (dprints) will be sent to you...\n");
|
|
|
|
};
|
2001-10-12 06:10:59 +00:00
|
|
|
|
|
|
|
void (float oneline) printtrace =
|
|
|
|
{
|
|
|
|
local string sep = oneline ? " " : "\n";
|
|
|
|
dprint ("allsolid: " + ftos (trace_allsolid) + sep);
|
|
|
|
dprint ("startsolid: " + ftos (trace_startsolid) + sep);
|
|
|
|
dprint ("fraction: " + ftos (trace_fraction) + sep);
|
|
|
|
dprint ("endpos: " + vtos (trace_endpos) + sep);
|
|
|
|
dprint ("plane_normal: " + vtos (trace_plane_normal) + sep);
|
|
|
|
dprint ("plane_dist: " + ftos (trace_plane_dist) + sep);
|
|
|
|
dprint ("ent: " + (trace_ent ? "yes" : "no") + sep);
|
|
|
|
dprint ("inopen: " + ftos (trace_inopen) + sep);
|
|
|
|
dprint ("inwater: " + ftos (trace_inwater) + "\n");
|
|
|
|
};
|