Added request at29487

1) New hookable Engine func: GetInfoKeyBuffer
2) New GameDLL func that can be called via engfunc: GetInfoKeyBuffer
3) New native: copy_infokey_buffer that copies data out of the specified info key buffer
4) EngFunc_InfoKeyValue, EngFunc_SetKeyValue, and EngFunc_SetClientKeyValue have been reworked
    so that they expect pointers to an info key buffer in order to work properly o_O
This commit is contained in:
Scott Ehlert 2006-05-10 11:28:00 +00:00
parent b12025093b
commit c6e8a356ee
3 changed files with 22 additions and 17 deletions

View File

@ -9,14 +9,7 @@
#include <fakemeta_const> #include <fakemeta_const>
#if AMXX_VERSION_NUM >= 175 #pragma library fakemeta
#pragma reqlib fakemeta
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib fakemeta
#endif
#else
#pragma library fakemeta
#endif
/* Returns entvar data from an entity Use the pev_* enum to specify which form of data you want returned. */ /* Returns entvar data from an entity Use the pev_* enum to specify which form of data you want returned. */
native pev(_index,_value,{Float,Sql,Result,_}:...); native pev(_index,_value,{Float,Sql,Result,_}:...);
@ -124,3 +117,7 @@ native get_pdata_string(entity, offset, dest[], maxlength, byref=1, linux=-5);
//realloc = 1 - reallocate new string with free+malloc //realloc = 1 - reallocate new string with free+malloc
//realloc = 2 - reallocate new string with delete[]+new[] //realloc = 2 - reallocate new string with delete[]+new[]
native set_pdata_string(entity, offset, const source[], realloc=2, linux=-5); native set_pdata_string(entity, offset, const source[], realloc=2, linux=-5);
// Copies the given infoBuffer pointer into out[]
// An infoBuffer pointer is returned by EngFunc_GetInfoKeyBuffer
native copy_infokey_buffer(infoBuffer, out[], maxlen);

View File

@ -20,6 +20,9 @@
#define FMRES_IGNORED 1 #define FMRES_IGNORED 1
#define FMRES_OVERRIDE 3 #define FMRES_OVERRIDE 3
// Use this with GetInfoKeyBuffer if you want the server's localinfo buffer
#define FM_NULLENT -1
/* Used with engfunc() /* Used with engfunc()
*/ */
@ -105,7 +108,8 @@ enum {
EngFunc_InfoKeyValue, // char*) (char *infobuffer, char *key); EngFunc_InfoKeyValue, // char*) (char *infobuffer, char *key);
EngFunc_SetKeyValue, // void ) (char *infobuffer, char *key, char *value); EngFunc_SetKeyValue, // void ) (char *infobuffer, char *key, char *value);
EngFunc_SetClientKeyValue, // void ) (int clientIndex, char *infobuffer, char *key, char *value); EngFunc_SetClientKeyValue, // void ) (int clientIndex, char *infobuffer, char *key, char *value);
EngFunc_CreateInstBaseline // int ) (int classname, struct entity_state_s *baseline); EngFunc_CreateInstBaseline, // int ) (int classname, struct entity_state_s *baseline);
EngFunc_GetInfoKeyBuffer // char*) (edict_t *e);
}; };
/* Used with dllfunc() /* Used with dllfunc()
@ -513,14 +517,16 @@ enum {
FM_ShouldCollide, FM_ShouldCollide,
//LATE ADDITIONS (v1.71) //LATE ADDITIONS (v1.71)
FM_ClientUserInfoChanged, //passes id only FM_ClientUserInfoChanged,
// LATE ADDITIONS (v1.75)
FM_UpdateClientData, FM_UpdateClientData,
FM_AddToFullPack, FM_AddToFullPack,
FM_CmdStart, FM_CmdStart,
FM_CmdEnd, FM_CmdEnd,
FM_CreateInstBaseline, FM_CreateInstBaseline,
FM_CreateBaseline FM_CreateBaseline,
FM_GetInfoKeyBuffer
}; };
enum TraceResult enum TraceResult

View File

@ -175,16 +175,18 @@ stock EF_WriteCoord(Float:value)
return engfunc(EngFunc_WriteCoord, value) return engfunc(EngFunc_WriteCoord, value)
stock EF_WriteAngle(Float:value) stock EF_WriteAngle(Float:value)
return engfunc(EngFunc_WriteAngle, value) return engfunc(EngFunc_WriteAngle, value)
stock EF_InfoKeyValue(const CLIENT, const KEY[], returnValue[], maxLength) stock EF_InfoKeyValue(const INFOBUFFER, const KEY[], returnValue[], maxLength)
return engfunc(EngFunc_InfoKeyValue, CLIENT, KEY, returnValue, maxLength) return engfunc(EngFunc_InfoKeyValue, INFOBUFFER, KEY, returnValue, maxLength)
stock EF_SetKeyValue(const BUFFER[], const KEY[], const VALUE[]) stock EF_SetKeyValue(const INFOBUFFER, const KEY[], const VALUE[])
return engfunc(EngFunc_SetKeyValue, BUFFER, KEY, VALUE) return engfunc(EngFunc_SetKeyValue, INFOBUFFER, KEY, VALUE)
stock EF_SetClientKeyValue(const ID, const KEY[], const VALUE[]) stock EF_SetClientKeyValue(const ID, const INFOBUFFER, const KEY[], const VALUE[])
return engfunc(EngFunc_SetClientKeyValue, ID, KEY, VALUE) return engfunc(EngFunc_SetClientKeyValue, ID, INFOBUFFER, KEY, VALUE)
stock EF_CreateInstBaseline(CLASSNAME, baseline) stock EF_CreateInstBaseline(CLASSNAME, baseline)
return engfunc(EngFunc_CreateInstBaseline, CLASSNAME, baseline) return engfunc(EngFunc_CreateInstBaseline, CLASSNAME, baseline)
stock EF_GetInfoKeyBuffer(const ENTITY)
return engfunc(EngFunc_GetInfoKeyBuffer, ENTITY)
// DLLFuncs // DLLFuncs
stock DF_GameInit() stock DF_GameInit()