csqctest apparently depends on serverkey used serverside, lets give it.

This commit is contained in:
Shpoike 2023-07-20 15:10:45 +01:00
parent 157e5672bd
commit 506484cb4b
1 changed files with 23 additions and 2 deletions

View File

@ -5610,6 +5610,27 @@ static void PF_cl_serverkey_f(void)
PF_cl_serverkey_internal(keyname, true); PF_cl_serverkey_internal(keyname, true);
} }
void PF_sv_serverkey_internal(const char *key, qboolean retfloat)
{
char buf[1024];
const char *ret = Info_GetKey(svs.serverinfo, key, buf, sizeof(buf));
if (retfloat)
G_FLOAT(OFS_RETURN) = atof(ret);
else
G_INT(OFS_RETURN) = PR_SetEngineString(ret);
}
static void PF_sv_serverkey_s(void)
{
const char *keyname = G_STRING(OFS_PARM0);
PF_sv_serverkey_internal(keyname, false);
}
static void PF_sv_serverkey_f(void)
{
const char *keyname = G_STRING(OFS_PARM0);
PF_sv_serverkey_internal(keyname, true);
}
static void PF_sv_forceinfokey(void) static void PF_sv_forceinfokey(void)
{ {
int edict = G_EDICTNUM(OFS_PARM0); int edict = G_EDICTNUM(OFS_PARM0);
@ -7527,8 +7548,8 @@ static struct
// {"setup_reverb", PF_NoSSQC, PF_FullCSQCOnly, 0, PF_NoMenu, D("typedef struct {\n\tfloat flDensity;\n\tfloat flDiffusion;\n\tfloat flGain;\n\tfloat flGainHF;\n\tfloat flGainLF;\n\tfloat flDecayTime;\n\tfloat flDecayHFRatio;\n\tfloat flDecayLFRatio;\n\tfloat flReflectionsGain;\n\tfloat flReflectionsDelay;\n\tvector flReflectionsPan;\n\tfloat flLateReverbGain;\n\tfloat flLateReverbDelay;\n\tvector flLateReverbPan;\n\tfloat flEchoTime;\n\tfloat flEchoDepth;\n\tfloat flModulationTime;\n\tfloat flModulationDepth;\n\tfloat flAirAbsorptionGainHF;\n\tfloat flHFReference;\n\tfloat flLFReference;\n\tfloat flRoomRolloffFactor;\n\tint iDecayHFLimit;\n} reverbinfo_t;\nvoid(float reverbslot, reverbinfo_t *reverbinfo, int sizeofreverinfo_t)", "Reconfigures a reverb slot for weird effects. Slot 0 is reserved for no effects. Slot 1 is reserved for underwater effects. Reserved slots will be reinitialised on snd_restart, but can otherwise be changed. These reverb slots can be activated with SetListener. Note that reverb will currently only work when using OpenAL.")}, // {"setup_reverb", PF_NoSSQC, PF_FullCSQCOnly, 0, PF_NoMenu, D("typedef struct {\n\tfloat flDensity;\n\tfloat flDiffusion;\n\tfloat flGain;\n\tfloat flGainHF;\n\tfloat flGainLF;\n\tfloat flDecayTime;\n\tfloat flDecayHFRatio;\n\tfloat flDecayLFRatio;\n\tfloat flReflectionsGain;\n\tfloat flReflectionsDelay;\n\tvector flReflectionsPan;\n\tfloat flLateReverbGain;\n\tfloat flLateReverbDelay;\n\tvector flLateReverbPan;\n\tfloat flEchoTime;\n\tfloat flEchoDepth;\n\tfloat flModulationTime;\n\tfloat flModulationDepth;\n\tfloat flAirAbsorptionGainHF;\n\tfloat flHFReference;\n\tfloat flLFReference;\n\tfloat flRoomRolloffFactor;\n\tint iDecayHFLimit;\n} reverbinfo_t;\nvoid(float reverbslot, reverbinfo_t *reverbinfo, int sizeofreverinfo_t)", "Reconfigures a reverb slot for weird effects. Slot 0 is reserved for no effects. Slot 1 is reserved for underwater effects. Reserved slots will be reinitialised on snd_restart, but can otherwise be changed. These reverb slots can be activated with SetListener. Note that reverb will currently only work when using OpenAL.")},
{"registercommand", NULL, PF_cl_registercommand,352, PF_cl_registercommand,352, D("void(string cmdname)", "Register the given console command, for easy console use.\nConsole commands that are later used will invoke CSQC_ConsoleCommand.")},//(EXT_CSQC) {"registercommand", NULL, PF_cl_registercommand,352, PF_cl_registercommand,352, D("void(string cmdname)", "Register the given console command, for easy console use.\nConsole commands that are later used will invoke CSQC_ConsoleCommand.")},//(EXT_CSQC)
{"wasfreed", PF_WasFreed, PF_WasFreed, 353, PF_WasFreed,353, D("float(entity ent)", "Quickly check to see if the entity is currently free. This function is only valid during the two-second non-reuse window, after that it may give bad results. Try one second to make it more robust.")},//(EXT_CSQC) (should be availabe on server too) {"wasfreed", PF_WasFreed, PF_WasFreed, 353, PF_WasFreed,353, D("float(entity ent)", "Quickly check to see if the entity is currently free. This function is only valid during the two-second non-reuse window, after that it may give bad results. Try one second to make it more robust.")},//(EXT_CSQC) (should be availabe on server too)
{"serverkey", NULL, PF_cl_serverkey_s, 354, PF_NoMenu, D("string(string key)", "Look up a key in the server's public serverinfo string")},// {"serverkey", PF_sv_serverkey_s, PF_cl_serverkey_s, 354, PF_NoMenu, D("string(string key)", "Look up a key in the server's public serverinfo string")},//
{"serverkeyfloat", NULL, PF_cl_serverkey_f, 0, PF_NoMenu, D("float(string key, optional float assumevalue)", "Version of serverkey that returns the value as a float (which avoids tempstrings).")},// {"serverkeyfloat", PF_sv_serverkey_f, PF_cl_serverkey_f, 0, PF_NoMenu, D("float(string key, optional float assumevalue)", "Version of serverkey that returns the value as a float (which avoids tempstrings).")},//
{"getentitytoken", PF_NoSSQC, PF_cs_getentitytoken,355, PF_NoMenu, D("string(optional string resetstring)", "Grab the next token in the map's entity lump.\nIf resetstring is not specified, the next token will be returned with no other sideeffects.\nIf empty, will reset from the map before returning the first token, probably {.\nIf not empty, will tokenize from that string instead.\nAlways returns tempstrings.")},//; {"getentitytoken", PF_NoSSQC, PF_cs_getentitytoken,355, PF_NoMenu, D("string(optional string resetstring)", "Grab the next token in the map's entity lump.\nIf resetstring is not specified, the next token will be returned with no other sideeffects.\nIf empty, will reset from the map before returning the first token, probably {.\nIf not empty, will tokenize from that string instead.\nAlways returns tempstrings.")},//;
// {"findfont", PF_NoSSQC, PF_FullCSQCOnly, 356, PF_NoMenu, D("float(string s)", "Looks up a named font slot. Matches the actual font name as a last resort.")},//; // {"findfont", PF_NoSSQC, PF_FullCSQCOnly, 356, PF_NoMenu, D("float(string s)", "Looks up a named font slot. Matches the actual font name as a last resort.")},//;
// {"loadfont", PF_NoSSQC, PF_FullCSQCOnly, 357, PF_NoMenu, D("float(string fontname, string fontmaps, string sizes, float slot, optional float fix_scale, optional float fix_voffset)", "too convoluted for me to even try to explain correct usage. Try drawfont = loadfont(\"\", \"cour\", \"16\", -1, 0, 0); to switch to the courier font (optimised for 16 virtual pixels high), if you have the freetype2 library in windows..")}, // {"loadfont", PF_NoSSQC, PF_FullCSQCOnly, 357, PF_NoMenu, D("float(string fontname, string fontmaps, string sizes, float slot, optional float fix_scale, optional float fix_voffset)", "too convoluted for me to even try to explain correct usage. Try drawfont = loadfont(\"\", \"cour\", \"16\", -1, 0, 0); to switch to the courier font (optimised for 16 virtual pixels high), if you have the freetype2 library in windows..")},