2021-12-25 22:36:38 +01:00
|
|
|
#include "core/stdafx.h"
|
2023-03-31 22:37:53 +02:00
|
|
|
#include "tier1/cvar.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
#include "ebisusdk/EbisuSDK.h"
|
|
|
|
|
2022-08-22 03:53:38 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-31 22:37:53 +02:00
|
|
|
// Purpose: sets the EbisuSDK globals for dedicated to satisfy command callbacks
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void HEbisuSDK_Init()
|
|
|
|
{
|
|
|
|
#ifdef DEDICATED
|
|
|
|
*g_EbisuSDKInit = true; // <- 1st EbisuSDK
|
|
|
|
*g_EbisuProfileInit = true; // <- 2nd EbisuSDK
|
2023-04-29 20:36:57 +02:00
|
|
|
*g_NucleusID = 9990000; // <- 3rd EbisuSDK
|
2023-03-31 22:37:53 +02:00
|
|
|
#endif // DEDICATED
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Purpose: checks if the EbisuSDK is initialized
|
|
|
|
// Output : true on success, false on failure
|
2022-08-22 03:53:38 +02:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
bool IsOriginInitialized()
|
|
|
|
{
|
|
|
|
#ifndef DEDICATED
|
2022-08-22 12:42:41 +02:00
|
|
|
if ((!(*g_OriginErrorLevel)
|
2023-02-04 00:39:34 +01:00
|
|
|
&& (*g_EbisuSDKInit)
|
2022-08-22 12:42:41 +02:00
|
|
|
&& (*g_NucleusID)
|
2023-02-04 00:39:34 +01:00
|
|
|
&& (*g_EbisuProfileInit)))
|
2022-08-22 03:53:38 +02:00
|
|
|
// && (*g_OriginAuthCode)
|
2023-01-25 02:30:54 +01:00
|
|
|
// && (g_NucleusToken[0])))
|
2022-08-22 03:53:38 +02:00
|
|
|
#endif // DEDICATED
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2023-04-16 01:23:11 +02:00
|
|
|
#ifndef DEDICATED
|
2022-08-22 03:53:38 +02:00
|
|
|
return false;
|
2023-04-16 01:23:11 +02:00
|
|
|
#endif // DEDICATED
|
2022-08-22 03:53:38 +02:00
|
|
|
}
|
|
|
|
|
2023-04-01 22:58:43 +02:00
|
|
|
#ifndef CLIENT_DLL
|
2021-12-25 22:36:38 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-31 22:37:53 +02:00
|
|
|
// Purpose: validates if client's persona name meets EA's criteria
|
|
|
|
// Input : *pszName -
|
|
|
|
// Output : true on success, false on failure
|
2021-12-25 22:36:38 +01:00
|
|
|
//-----------------------------------------------------------------------------
|
2023-03-31 22:37:53 +02:00
|
|
|
bool IsValidPersonaName(const char* pszName)
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2023-03-31 22:37:53 +02:00
|
|
|
if (!sv_validatePersonaName->GetBool())
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t len = strlen(pszName);
|
|
|
|
|
|
|
|
if (len < sv_minPersonaNameLength->GetInt() ||
|
|
|
|
len > sv_maxPersonaNameLength->GetInt())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if the name contains any special characters.
|
2023-04-05 15:32:00 +02:00
|
|
|
size_t pos = strspn(pszName, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");
|
2023-03-31 22:37:53 +02:00
|
|
|
return pszName[pos] == '\0';
|
2021-12-25 22:36:38 +01:00
|
|
|
}
|
2023-04-01 22:58:43 +02:00
|
|
|
#endif // !CLIENT_DLL
|