Skip to content

Commit

Permalink
Merge pull request #422 from proxict/feature/onclientcommand
Browse files Browse the repository at this point in the history
Added OnClientCommand plugin callback
  • Loading branch information
proxict authored Feb 5, 2024
2 parents 6b9a943 + 3bcb95c commit 8a70784
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/callback_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
PCL void OnClientSpawn(gentity_t* ent);
PCL void OnClientEnterWorld(client_t* client);
PCL void OnClientUserinfoChanged(client_t* client);
PCL void OnClientCommand(client_t* client, const char* command);
PCL void OnClientMoveCommand(client_t* client, usercmd_t* ucmd);
PCL void OnPlayerKilled(gentity_t* self, gentity_t* inflictor, gentity_t* attacker, int damage, int meansOfDeath, int iWeapon, hitLocation_t hitLocation);
PCL void OnPlayerWantReservedSlot(netadr_t* from, char* pbguid, char* userinfo, int authstate, qboolean *isallowed);
Expand Down
1 change: 1 addition & 0 deletions src/plugin_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum PluginEvents{
PLUGINS_ONPREGAMERESTART,
PLUGINS_ONPOSTGAMERESTART,
PLUGINS_ONCLIENTUSERINFOCHANGED,
PLUGINS_ONCLIENTCOMMAND,
PLUGINS_ONCLIENTMOVECOMMAND,
PLUGINS_ONPLAYERKILLED,
PLUGINS_ONPLAYERWANTRESERVEDSLOT,
Expand Down
1 change: 1 addition & 0 deletions src/plugin_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ char PHandler_Events[PLUGINS_ITEMCOUNT][32]={
"OnPreGameRestart",
"OnPostGameRestart",
"OnClientUserinfoChanged",
"OnClientCommand",
"OnClientMoveCommand",
"OnPlayerKilled",
"OnPlayerWantReservedSlot",
Expand Down
1 change: 1 addition & 0 deletions src/sv_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2584,6 +2584,7 @@ void SV_ExecuteClientCommand( client_t *cl, const char *s, qboolean clientOK, qb
if ( !strcmp( SV_Cmd_Argv( 0 ), u->name ) ) {

if(!inDl || u->indlcmd){
PHandler_Event(PLUGINS_ONCLIENTCOMMAND, cl, s);
u->func( cl );
}
SV_Cmd_EndTokenizedString( );
Expand Down

0 comments on commit 8a70784

Please sign in to comment.