Skip to content

Commit

Permalink
onscreenshot arrived plugin callback
Browse files Browse the repository at this point in the history
  • Loading branch information
D4edalus committed Sep 6, 2016
1 parent 9c59fb3 commit 8a0a312
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions plugins/callback_declarations.h
Expand Up @@ -50,6 +50,8 @@
PCL void OnClientMoveCommand(client_t* client, usercmd_t* ucmd);
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);

//Following function gets called when the player has basic authentication completed. Here we got a pbguid, the uid which is a short steamid, rejectmsg can be written a text to but never exceed 1023 characters, returnNow will keep the client idle when set to true, client_t*
PCL void OnPlayerGotAuthInfo(netadr_t* from, uint64_t* playerid, uint64_t *steamid, char *rejectmsg /*never exceed a limit of 1023 chars*/, qboolean *returnNow, client_t* cl); //an unverified playerid, SteamID "steamIdPending" and "clanIdPending" is not getting verified yet at all - you can get this info from client_t* structure
PCL void OnPlayerAddBan(baninfo_t* baninfo);
Expand Down
3 changes: 2 additions & 1 deletion plugins/dlang/cod4x/callback_declarations.d
Expand Up @@ -23,4 +23,5 @@ extern (C) void OnClientEnterWorld(client_t* client);
extern (C) void OnClientUserinfoChanged(client_t* client);
extern (C) void OnClientMoveCommand(client_t* client, usercmd_t* ucmd);
extern (C) void OnPlayerWantReservedSlot(netadr_t* from, char* pbguid, char* userinfo, int authstate, qboolean *isallowed);
extern (C) void OnModuleLoaded(client_t* client, char* fullpath, long checksum);
extern (C) void OnModuleLoaded(client_t* client, char* fullpath, long checksum);
extern (C) void OnScreenshotArrived(client_t* client, const char* path);
3 changes: 2 additions & 1 deletion src/plugin_events.h
Expand Up @@ -55,7 +55,8 @@ enum PluginEvents{
PLUGINS_ONPLAYERADDBAN,
PLUGINS_ONPLAYERGETBANSTATUS,
PLUGINS_ONPLAYERREMOVEBAN,
PLUGINS_ONMODULELOADED,
PLUGINS_ONMODULELOADED,
PLUGINS_ONSCREENSHOTARRIVED,
PLUGINS_ONTERMINATE,
PLUGINS_ITEMCOUNT

Expand Down
1 change: 1 addition & 0 deletions src/plugin_handler.c
Expand Up @@ -70,6 +70,7 @@ char PHandler_Events[PLUGINS_ITEMCOUNT][32]={
"OnPlayerAddBan",
"OnPlayerGetBanStatus",
"OnPlayerRemoveBan",
"OnScreenshotArrived"
"OnModuleLoaded",
"OnTerminate"
};
Expand Down
2 changes: 2 additions & 0 deletions src/sv_screenshot.c
Expand Up @@ -165,6 +165,8 @@ void SV_ScreenshotArrived( client_t* cl, const char* filename )
return;
}
Com_sprintf(cmdline, sizeof(cmdline), "\"%s/apps/%s\" \"%s/%s\"", fs_homepath->string, sv_screenshotArrivedCmd->string, fs_homepath->string, filename);

PHandler_Event(PLUGINS_ONSCREENSHOTARRIVED, cl, filename);
Sys_DoStartProcess(cmdline);
}

Expand Down
2 changes: 1 addition & 1 deletion src/version_build.h
@@ -1 +1 @@
#define BUILD_NUMBER 1454
#define BUILD_NUMBER 1455

0 comments on commit 8a0a312

Please sign in to comment.