X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fdebug.qh;h=c5345b32a33b4112a5aae9a49a37600290c69d4a;hb=91d607d78b9933c0823ba763f90e679db253d1cf;hp=25dc11d1c391f2e2e1907cb0a868dd47f1169371;hpb=16d6ec38d2ddf13a0880b9cd50a3968c48da8f8a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/debug.qh b/qcsrc/common/debug.qh index 25dc11d1c..c5345b32a 100644 --- a/qcsrc/common/debug.qh +++ b/qcsrc/common/debug.qh @@ -81,7 +81,7 @@ bool autocvar_debugdraw; #endif #ifdef SVQC - GENERIC_COMMAND(debugdraw_sv, "Dump all server entities") + COMMON_COMMAND(debugdraw_sv, "Dump all server entities") { switch (request) { @@ -111,4 +111,26 @@ bool autocvar_debugdraw; } #endif +GENERIC_COMMAND(bufstr_get, "Examine a string buffer object") +{ + switch (request) + { + case CMD_REQUEST_COMMAND: + { + int bufhandle = stof(argv(1)); + int string_index = stof(argv(2)); + string s = bufstr_get(bufhandle, string_index); + LOG_INFOF("%s\n", s); + return; + } + + default: + case CMD_REQUEST_USAGE: + { + LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index")); + return; + } + } +} + #endif