I need to call this function:
void CBaseServer::SetReservationCookie( uint64 uiCookie, char const *pchReasonFormat, ... )
I have this working detour:
PHP Code:
DETOUR_DECL_MEMBER3(SetReservationCookieDetour, void, uint64, uiCookie, char const *,pchReasonFormat, unsigned long, arg )
{
return DETOUR_MEMBER_CALL(SetReservationCookieDetour)(uiCookie, pchReasonFormat, arg);
}
I use DETOUR_MEMBER_MCALL_CALLBACK to call this function. So far I tried passing va_list reference, directly or a link to an empty va_list. Tried to pass 0 or remove the argument. It always leads to crashes.
PHP Code:
va_list empty_va_list = va_list();
DETOUR_MEMBER_MCALL_CALLBACK(SetReservationCookieDetour, g_pServer)(-602679911, "", empty_va_list);
What is the correct way to call this function?
In the leaked sources this function is called in 3 places:
PHP Code:
SetReservationCookie( nReservationCookie, "ReplyReservationRequest" );
SetReservationCookie( uiReservationCookie, "ReserveServerForQueuedGame: %s", szReservationPayload );
SetReservationCookie( *m_pnReservationCookieSession, "[R] Connect from %s", ns_address_render( adr ).String() );