better command output redirection handling: maplist over rcon should show

all (or most, there are limits still) of the maps on a server with many
maps.

move the optional progs funcs into sv_funcs_t and add UserInfoChanged,
ChatMessage and LocalinfoChanged callback support.

clean up PF_setinfo (and SV_SetInfo_f and SV_Localinfo_f) using shared code
where possible und to use the UserInfoChanged and LocalinfoChanged
callbacks.

add chat message callback to SV_Say. if it returns zero, normal chat
handling is done, otherwise it's assumed to have been handled by the progs.

provide a hook for unkown user commands. non-zero return means it's been
handled.
This commit is contained in:
Bill Currie 2003-11-21 06:09:21 +00:00
parent 886b766295
commit ce745c8078
11 changed files with 218 additions and 127 deletions

View file

@ -79,6 +79,15 @@ typedef struct {
func_t ClientDisconnect;
func_t SetNewParms;
func_t SetChangeParms;
func_t EndFrame;
func_t SpectatorConnect;
func_t SpectatorThink;
func_t SpectatorDisconnect;
func_t UserInfoCallback;
func_t UserInfoChanged;
func_t ChatMessage;
func_t LocalinfoChanged;
} sv_funcs_t;
extern sv_funcs_t sv_funcs;
@ -159,10 +168,14 @@ typedef struct
int gravity;
int maxspeed;
int team_str; //string
} sv_fields_t;
extern sv_fields_t sv_fields;
extern struct progs_s sv_pr_state;
#if TYPECHECK_PROGS
#define SVFIELD(e,f,t) E_var (e, PR_AccessField (&sv_pr_state, #f, ev_##t, __FILE__, __LINE__), t)
#else
@ -178,12 +191,6 @@ extern sv_fields_t sv_fields;
#define PROGHEADER_CRC 54730
extern func_t EndFrame;
extern func_t SpectatorConnect;
extern func_t SpectatorThink;
extern func_t SpectatorDisconnect;
extern func_t UserInfoCallback;
static inline void
sv_pr_touch (edict_t *self, edict_t *other)
{