29 Net_Accept(net_debug);
32 this.
origin = ReadVector();
46 WriteHeader(channel, net_debug);
54 WriteVector(channel, o);
73 bool autocvar_debugdraw;
77 string autocvar_debugdraw_filter, autocvar_debugdraw_filterout;
82 if (!autocvar_debugdraw)
return;
83 static int debugdraw_frame;
87 if (it.debugdraw_last == debugdraw_frame)
continue;
89 FOREACH_ENTITY_RADIUS(it.origin, 100, it.debugdraw_last != debugdraw_frame, {
90 it.debugdraw_last = debugdraw_frame;
91 vector rgb = (it.debug) ?
'0 0 1' :
'1 0 0';
92 if (autocvar_debugdraw_filterout !=
"" && strhasword(autocvar_debugdraw_filterout, it.classname)) continue;
93 if (autocvar_debugdraw_filter !=
"" && !strhasword(autocvar_debugdraw_filter, it.classname)) continue;
94 if (autocvar_debugdraw == 3)
96 if (!it.entnum) continue;
98 if (autocvar_debugdraw == 4)
100 if (it.origin)
continue;
102 if (autocvar_debugdraw == 5)
104 if (!it.debug)
continue;
106 else if (autocvar_debugdraw > 5)
148 if (autocvar_debugdraw < 2)
continue;
153 o += it.tag_entity.origin;
155 if (pos.z < 0)
continue;
158 drawcolorcodedstring2_builtin(pos,
159 sprintf(
"%d: '%s'@%s", (it.debug ? it.sv_entnum :
etof(it)),
160 it.classname, it.sourceLoc),
175 if (!autocvar_debugdraw)
return;
180 if (autocvar_debugdraw < 2 &&
is_pure(e))
continue;
181 debug_send(e, caller, 0);
185 LOG_INFOF(
"%d server entities sent", n - rem);
192 LOG_HELP(
"Usage:^3 ", GetProgramCommandPrefix(),
" debugdraw_sv");
198 #endif // ENABLE_DEBUGDRAW 209 LOG_INFO(bufstr_get(bufhandle, string_index));
216 LOG_HELP(
"Usage:^3 ", GetProgramCommandPrefix(),
" bufstr_get <bufhandle> <string_index>");
229 LOG_INFO(PROGNAME,
" version: ", WATERMARK);
235 LOG_HELP(
"Usage:^3 ", GetProgramCommandPrefix(),
" version");
243 void(
float bufhandle,
string pattern,
string antipattern) buf_cvarlist = #517;
254 buf_cvarlist(h,
"",
"_");
255 int n = buf_getsize(h);
256 for (
int i = 0; i < n; ++i) {
257 string k = bufstr_get(h, i);
262 s =
strcat(s, k,
" \"", v,
"\" // \"", d,
"\"\n");
271 LOG_HELP(
"Usage:^3 ", GetProgramCommandPrefix(),
" cvar_localchanges");
278 #if ENABLE_DEBUGTRACE 282 bool autocvar_debugtrace;
286 .bool debug_trace_button;
293 if (btn == it.debug_trace_button) skip =
true;
294 it.debug_trace_button = btn;
295 if (!btn || skip)
continue;
297 it.solid_prev = it.solid;
301 MAKE_VECTORS(it.v_angle, forward, right, up);
302 vector pos = it.origin + it.view_ofs;
303 traceline(pos, pos + forward * max_shot_distance,
MOVE_NORMAL, it);
305 it.solid = it.solid_prev;
310 STAT(TRACE_ENT, it) = i;
313 stuffcmd(it, sprintf(
"prvm_edict server %d\n", i));
320 void Trace_draw2d(
entity this)
322 int e = STAT(TRACE_ENT);
332 e.draw2d = Trace_draw2d;
361 LOG_HELP(
"Usage:^3 " GetProgramCommandPrefix()
" find <classname>");
362 LOG_HELP(
" Where <classname> is the classname to search for.");
382 if (!
vdist(it.origin - org, <, dist))
385 else if (it.origin != org)
399 LOG_HELP(
"Usage:^3 " GetProgramCommandPrefix()
" findat <position> [<dist>]");
400 LOG_HELP(
" Where <position> is a vector \"x y z\"");
420 ATTRIB(DebugText3d, hit_time,
float);
429 this.hit_time =
time;
439 void DebugText3d_draw2d(DebugText3d
this) {
440 float since_created =
time - this.hit_time;
441 float alpha_ = 1 - since_created * this.
fade_rate;
450 if (screen_pos.z < 0)
return;
458 for(
int k = 0; k < n; ++k)
461 msg_pos = screen_pos + k * 1.25 * size *
eY;
463 msg_pos.x -=
stringwidth(msg,
true, size *
'1 1 0') *
min(1, align);
465 drawcolorcodedstring_builtin(msg_pos, msg, size *
'1 1 0', alpha_,
DRAWFLAG_NORMAL);
468 ATTRIB(DebugText3d, draw2d,
void(DebugText3d), DebugText3d_draw2d);
472 vector pos = ReadVector();
474 float align = ReadFloat();
475 float duration = ReadFloat();
476 vector vel = ReadVector();
477 make_impure(
NEW(DebugText3d, pos, msg, align, 1 / duration, vel));
486 #define debug_text_3d(...) EVAL(OVERLOAD(debug_text_3d, __VA_ARGS__)) 487 #define debug_text_3d_2(pos, msg) debug_text_3d_3(pos, msg, cvar("debug_text_3d_default_align")) 488 #define debug_text_3d_3(pos, msg, align) debug_text_3d_4(pos, msg, align, cvar("debug_text_3d_default_duration")) 489 #define debug_text_3d_4(pos, msg, align, dur) debug_text_3d_5(pos, msg, align, dur, stov(cvar_string("debug_text_3d_default_velocity"))) 490 #define debug_text_3d_5(pos, msg, align, dur, vel) debug_text_3d_fn(pos, msg, align, dur, vel) 493 void debug_text_3d_fn(
vector pos,
string msg,
float align,
float duration,
vector vel) {
#define DESTRUCTOR(cname)
vector project_3d_to_2d(vector vec)
#define REGISTER_MUTATOR(id, dependence)
#define PHYS_INPUT_BUTTON_HOOK(s)
const int CMD_REQUEST_USAGE
#define FOREACH_CLIENT(cond, body)
GENERIC_COMMAND(bufstr_get, "Examine a string buffer object", false)
string sourceLoc
Location entity was spawned from in source.
#define NET_HANDLE(id, param)
#define STATIC_INIT(func)
during worldspawn
#define CONSTRUCT(cname,...)
#define FOREACH_ENTITY_ORDERED(cond, body)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
#define FOREACH_ENTITY(cond, body)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
const int CMD_REQUEST_COMMAND
const float DRAWFLAG_NORMAL
#define FOREACH_ENTITY_CLASS_ORDERED(class, cond, body)
#define COMMON_COMMAND(id, description)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
REGISTER_STAT(MOVEFLAGS, int, MOVEFLAG_VALID|(autocvar_sv_gameplayfix_q2airaccelerate ? MOVEFLAG_Q2AIRACCELERATE :0)|(autocvar_sv_gameplayfix_nogravityonground ? MOVEFLAG_NOGRAVITYONGROUND :0)|(autocvar_sv_gameplayfix_gravityunaffectedbyticrate ? MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE :0)) .float gravity
cvar loopback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
#define tokenizebyseparator
#define new_pure(class)
purely logical entities (.origin doesn't work)
#define REGISTER_NET_TEMP(id)
#define MUTATOR_HOOKFUNCTION(...)
Header file that describes the resource system.
#define CONSTRUCTOR(cname,...)
IntrusiveList g_drawables_2d