Skip to content

Commit

Permalink
Merge pull request #316 from k4r3l01/master
Browse files Browse the repository at this point in the history
Plugin Event OnDemoArrived
  • Loading branch information
proxict authored Sep 24, 2023
2 parents 2226b62 + a1f819d commit 4f07800
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/callback_declarations.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
PCL void OnPlayerWantReservedSlot(netadr_t* from, char* pbguid, char* userinfo, int authstate, qboolean *isallowed);
PCL void OnModuleLoaded(client_t* client, char* fullpath, long checksum);
PCL void OnScreenshotArrived(client_t* client, const char* path);
PCL void OnDemoArrived(client_t* client, const char *demoname);
PCL void OnScrUsercallFunction(const char* function_name);
PCL void OnScrUsercallMethod(const char* method_name, int clientnum);

Expand Down
1 change: 1 addition & 0 deletions src/plugin_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ enum PluginEvents{
PLUGINS_ONSCRUSERCALLFUNCTION,
PLUGINS_ONSCRUSERCALLMETHOD,
PLUGINS_ONSCREENSHOTARRIVED,
PLUGINS_ONDEMOARRIVED,
PLUGINS_ONTERMINATE,
PLUGINS_ITEMCOUNT

Expand Down
1 change: 1 addition & 0 deletions src/plugin_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ char PHandler_Events[PLUGINS_ITEMCOUNT][32]={
"OnScrUsercallFunction",
"OnScrUsercallMethod",
"OnScreenshotArrived",
"OnDemoArrived",
"OnTerminate"
};

Expand Down
4 changes: 2 additions & 2 deletions src/sv_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "q_platform.h"
#include "sys_main.h"
#include "net_game_conf.h"

#include "plugin_handler.h"
#include <stdint.h>
#include <string.h>

Expand Down Expand Up @@ -142,7 +142,7 @@ void SV_StopRecord( client_t *cl ) {
FS_FCloseDemoFile( &cl->demofile );
cl->demorecording = qfalse;
Com_Printf(CON_CHANNEL_SERVERDEMO, "Stopped demo for: %s\n", cl->name);

PHandler_Event(PLUGINS_ONDEMOARRIVED,cl,cl->demoName);
if(!*sv_demoCompletedCmd->string)
return;

Expand Down

0 comments on commit 4f07800

Please sign in to comment.