2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-03 18:45:46 +03:00

Merge pull request #165 from theAsmodai/api_extension

Added Steam connect/disconnect to api.
This commit is contained in:
theAsmodai 2016-02-07 00:22:14 +03:00
commit 4453169240
4 changed files with 13 additions and 7 deletions

View File

@ -731,20 +731,20 @@ qboolean Steam_NotifyBotConnect_internal(client_t *cl)
void EXT_FUNC Steam_NotifyClientDisconnect_api(IGameClient* cl)
{
Steam_NotifyClientDisconnect_internal(cl->GetClient());
g_RehldsHookchains.m_Steam_NotifyClientDisconnect.callChain(Steam_NotifyClientDisconnect_internal, cl);
}
void Steam_NotifyClientDisconnect(client_t *cl)
{
g_RehldsHookchains.m_Steam_NotifyClientDisconnect.callChain(Steam_NotifyClientDisconnect_api, GetRehldsApiClient(cl));
Steam_NotifyClientDisconnect_api(GetRehldsApiClient(cl));
}
/* <f191f> ../engine/sv_steam3.cpp:934 */
void Steam_NotifyClientDisconnect_internal(client_t *cl)
void Steam_NotifyClientDisconnect_internal(IGameClient* cl)
{
if (Steam3Server())
{
Steam3Server()->NotifyClientDisconnect(cl);
Steam3Server()->NotifyClientDisconnect(cl->GetClient());
}
}

View File

@ -203,11 +203,13 @@ bool ISteamApps_BIsSubscribedApp(uint32 appid);
const char *Steam_GetCommunityName(void);
qboolean Steam_NotifyClientConnect(client_t *cl, const void *pvSteam2Key, unsigned int ucbSteam2Key);
qboolean Steam_NotifyClientConnect_internal(client_t *cl, const void *pvSteam2Key, unsigned int ucbSteam2Key);
qboolean Steam_NotifyClientConnect_api(IGameClient *cl, const void *pvSteam2Key, unsigned int ucbSteam2Key);
qboolean Steam_NotifyBotConnect(client_t *cl);
qboolean Steam_NotifyBotConnect_internal(client_t *cl);
qboolean Steam_NotifyBotConnect_api(IGameClient* cl);
void Steam_NotifyClientDisconnect(client_t *cl);
void Steam_NotifyClientDisconnect_internal(client_t *cl);
void Steam_NotifyClientDisconnect_internal(IGameClient *cl);
void Steam_NotifyClientDisconnect_api(IGameClient* cl);
void Steam_NotifyOfLevelChange(void);
void Steam_Shutdown(void);
void Steam_Activate(void);

View File

@ -35,7 +35,7 @@
#include "model.h"
#define REHLDS_API_VERSION_MAJOR 2
#define REHLDS_API_VERSION_MINOR 7
#define REHLDS_API_VERSION_MINOR 8
//Steam_NotifyClientConnect hook
typedef IHookChain<qboolean, IGameClient*, const void*, unsigned int> IRehldsHook_Steam_NotifyClientConnect;
@ -251,6 +251,8 @@ struct RehldsFuncs_t {
void*(*GetPluginApi)(const char *name);
void(*RegisterPluginApi)(const char *name, void *impl);
qboolean(*SV_FileInConsistencyList)(const char *filename, struct consistency_s **ppconsist);
qboolean(*Steam_NotifyClientConnect_api)(IGameClient *cl, const void *pvSteam2Key, unsigned int ucbSteam2Key);
void(*Steam_NotifyClientDisconnect)(IGameClient* cl);
};
class IRehldsApi {

View File

@ -192,7 +192,9 @@ RehldsFuncs_t g_RehldsApiFuncs =
&MSG_WriteString_api,
&Rehlds_GetPluginApi,
&Rehlds_RegisterPluginApi,
&SV_FileInConsistencyList
&SV_FileInConsistencyList,
&Steam_NotifyClientConnect_api,
&Steam_NotifyClientDisconnect_api
};
sizebuf_t* EXT_FUNC GetNetMessage_api()