|
楼主 |
发表于 2008-7-8 21:04:54
|
显示全部楼层
来自 中国–广东–深圳
回复: 有关query_client_cvar
[php]
RE: [hlds_apps] Updated Half-Life 1 client cvar query interface
Manip
Wed, 23 Nov 2005 04:51:03 -0800
Very nice; shame the latest update causes all the Linux servers to crash
when the first person connects. :-/
You guys should talk to Microsoft about testing strategies; or perhaps fire
some managers and hire some people that have taken Software Engineering 101.
... No offence...
-----Original Message-----
From: [EMAIL PROTECTED]
[EMAIL PROTECTED] On Behalf Of Alfred Reynolds
Sent: 22 November 2005 19:46
To: hlcoders@list.valvesoftware.com; hlds_apps@list.valvesoftware.com
Subject: [hlds_apps] Updated Half-Life 1 client cvar query interface
We have updated the client CVAR query interface in Half-Life 1 with two
new functions that will help you better track queries and responses.
The enginefuncs_t structure has had this function added to the end:
void (*pfnQueryClientCvarValue2)( const edict_t *player, const
char *cvarName, int requestID );
It will query a cvar value from a player and return to you the supplied
requestID on success (or failure).
The response is sent to a pfnCvarValue2 callback in the
NEW_DLL_FUNCTIONS structure, its full definition is:
typedef struct
{
// Called right before the object's memory is freed.
// Calls its destructor.
void (*pfnOnFreeEntPrivateData)(edict_t *pEnt);
void (*pfnGameShutdown)(void);
int (*pfnShouldCollide)( edict_t *pentTouched, edict_t *pentOther );
void (*pfnCvarValue)( const edict_t *pEnt,const char *value );
void (*pfnCvarValue2)( const edict_t *pEnt,int requestID, const char *cvarName, const char *value );
} NEW_DLL_FUNCTIONS;
When the pfnQueryClientCvarValue2() completes it will call
pfnCvarValue2() with the request ID you supplied earlier, the name of
the cvar you requested and the value of that cvar. On failure (i.e that
user is not connected or the cvar does not exist) the value of the
returned cvar will be "Bad CVAR request". If you specify an invalid
player edict you will get "Bad Player" as the value response.
[/php] |
|