Hook GC/GS immediately if available on extension load.

This commit is contained in:
Kyle Sanderson
2017-08-23 20:44:01 -07:00
parent 1f096ac7ac
commit 6c36535c98
2 changed files with 18 additions and 2 deletions
+8
View File
@@ -41,8 +41,16 @@ SteamWorksGCHooks::SteamWorksGCHooks()
this->pGCMsgAvail = forwards->CreateForward("SteamWorks_GCMsgAvailable", ET_Ignore, 1, NULL, Param_Cell); this->pGCMsgAvail = forwards->CreateForward("SteamWorks_GCMsgAvailable", ET_Ignore, 1, NULL, Param_Cell);
this->pGCRetMsg = forwards->CreateForward("SteamWorks_GCRetrieveMessage", ET_Event, 5, NULL, Param_Cell, Param_Cell, Param_String, Param_Cell, Param_Cell); this->pGCRetMsg = forwards->CreateForward("SteamWorks_GCRetrieveMessage", ET_Event, 5, NULL, Param_Cell, Param_Cell, Param_String, Param_Cell, Param_Cell);
ISteamGameCoordinator *pGC = GetSteamGCPointer();
if (pGC)
{
this->AddHooks(pGC);
}
else
{
smutils->AddGameFrameHook(OurGCGameFrameHook); smutils->AddGameFrameHook(OurGCGameFrameHook);
} }
}
SteamWorksGCHooks::~SteamWorksGCHooks() SteamWorksGCHooks::~SteamWorksGCHooks()
{ {
+8
View File
@@ -42,8 +42,16 @@ SteamWorksGSHooks::SteamWorksGSHooks()
this->pFOTR = forwards->CreateForward("SteamWorks_TokenRequested", ET_Ignore, 2, NULL, Param_String, Param_Cell); this->pFOTR = forwards->CreateForward("SteamWorks_TokenRequested", ET_Ignore, 2, NULL, Param_String, Param_Cell);
this->pOBAS = forwards->CreateForward("SteamWorks_BeginAuthSession", ET_Ignore, 3, NULL, Param_Array, Param_Cell, Param_Cell); this->pOBAS = forwards->CreateForward("SteamWorks_BeginAuthSession", ET_Ignore, 3, NULL, Param_Array, Param_Cell, Param_Cell);
ISteamGameServer *pGameServer = GetGameServerPointer();
if (pGameServer)
{
this->AddHooks(pGameServer);
}
else
{
smutils->AddGameFrameHook(OurGameFrameHook); smutils->AddGameFrameHook(OurGameFrameHook);
} }
}
SteamWorksGSHooks::~SteamWorksGSHooks() SteamWorksGSHooks::~SteamWorksGSHooks()
{ {