2008-04-17 06:58:09 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
|
|
|
* =============================================================================
|
|
|
|
* SourceMod Client Preferences Extension
|
|
|
|
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
|
|
|
* =============================================================================
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
|
|
* Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
|
|
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
|
|
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
|
|
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
|
|
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
|
|
* this exception to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
|
|
* or <http://www.sourcemod.net/license.php>.
|
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
2009-08-30 09:21:42 +02:00
|
|
|
#include <sourcemod_version.h>
|
2008-04-17 06:58:09 +02:00
|
|
|
#include "extension.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file extension.cpp
|
|
|
|
* @brief Implement extension code here.
|
|
|
|
*/
|
|
|
|
|
|
|
|
ClientPrefs g_ClientPrefs; /**< Global singleton for extension's main interface */
|
|
|
|
|
|
|
|
SMEXT_LINK(&g_ClientPrefs);
|
|
|
|
|
|
|
|
HandleType_t g_CookieType = 0;
|
|
|
|
CookieTypeHandler g_CookieTypeHandler;
|
|
|
|
|
2008-05-12 10:06:47 +02:00
|
|
|
HandleType_t g_CookieIterator = 0;
|
|
|
|
CookieIteratorHandler g_CookieIteratorHandler;
|
2008-10-20 10:40:46 +02:00
|
|
|
DbDriver g_DriverType;
|
2009-02-01 05:42:35 +01:00
|
|
|
static const DatabaseInfo *storage_local = NULL;
|
2008-04-17 06:58:09 +02:00
|
|
|
|
|
|
|
bool ClientPrefs::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
2008-07-15 02:24:08 +02:00
|
|
|
{
|
|
|
|
queryMutex = threader->MakeMutex();
|
|
|
|
cookieMutex = threader->MakeMutex();
|
|
|
|
|
|
|
|
DBInfo = dbi->FindDatabaseConf("clientprefs");
|
2008-04-17 06:58:09 +02:00
|
|
|
|
|
|
|
if (DBInfo == NULL)
|
|
|
|
{
|
|
|
|
DBInfo = dbi->FindDatabaseConf("default");
|
|
|
|
|
2009-02-01 05:42:35 +01:00
|
|
|
if (DBInfo == NULL ||
|
|
|
|
(strcmp(DBInfo->host, "localhost") == 0 &&
|
|
|
|
strcmp(DBInfo->database, "sourcemod") == 0 &&
|
|
|
|
strcmp(DBInfo->user, "root") == 0 &&
|
|
|
|
strcmp(DBInfo->pass, "") == 0 &&
|
|
|
|
strcmp(DBInfo->driver, "") == 0))
|
|
|
|
{
|
|
|
|
storage_local = dbi->FindDatabaseConf("storage-local");
|
|
|
|
if (DBInfo == NULL)
|
|
|
|
{
|
|
|
|
DBInfo = storage_local;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-17 06:58:09 +02:00
|
|
|
if (DBInfo == NULL)
|
|
|
|
{
|
|
|
|
snprintf(error, maxlength, "Could not find \"clientprefs\" or \"default\" database configs");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (DBInfo->driver[0] != '\0')
|
|
|
|
{
|
|
|
|
Driver = dbi->FindOrLoadDriver(DBInfo->driver);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Driver = dbi->GetDefaultDriver();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Driver == NULL)
|
|
|
|
{
|
|
|
|
snprintf(error, maxlength, "Could not load DB Driver \"%s\"", DBInfo->driver);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2008-07-15 02:24:08 +02:00
|
|
|
Database = NULL;
|
|
|
|
databaseLoading = true;
|
|
|
|
TQueryOp *op = new TQueryOp(Query_Connect, 0);
|
|
|
|
dbi->AddToThreadQueue(op, PrioQueue_High);
|
2008-04-17 06:58:09 +02:00
|
|
|
|
2008-07-01 08:13:09 +02:00
|
|
|
dbi->AddDependency(myself, Driver);
|
|
|
|
|
2008-04-17 06:58:09 +02:00
|
|
|
sharesys->AddNatives(myself, g_ClientPrefNatives);
|
|
|
|
sharesys->RegisterLibrary(myself, "clientprefs");
|
2012-07-03 13:51:12 +02:00
|
|
|
identity = sharesys->CreateIdentity(sharesys->CreateIdentType("ClientPrefs"), this);
|
2008-05-12 10:06:47 +02:00
|
|
|
g_CookieManager.cookieDataLoadedForward = forwards->CreateForward("OnClientCookiesCached", ET_Ignore, 1, NULL, Param_Cell);
|
2008-04-17 06:58:09 +02:00
|
|
|
|
|
|
|
g_CookieType = handlesys->CreateType("Cookie",
|
|
|
|
&g_CookieTypeHandler,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
myself->GetIdentity(),
|
|
|
|
NULL);
|
|
|
|
|
2008-05-12 10:06:47 +02:00
|
|
|
g_CookieIterator = handlesys->CreateType("CookieIterator",
|
|
|
|
&g_CookieIteratorHandler,
|
|
|
|
0,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
myself->GetIdentity(),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
IMenuStyle *style = menus->GetDefaultStyle();
|
2012-07-03 13:51:12 +02:00
|
|
|
g_CookieManager.clientMenu = style->CreateMenu(&g_Handler, identity);
|
2008-05-12 10:06:47 +02:00
|
|
|
g_CookieManager.clientMenu->SetDefaultTitle("Client Settings:");
|
|
|
|
|
|
|
|
plsys->AddPluginsListener(&g_CookieManager);
|
|
|
|
|
|
|
|
phrases = translator->CreatePhraseCollection();
|
|
|
|
phrases->AddPhraseFile("clientprefs.phrases");
|
|
|
|
phrases->AddPhraseFile("common.phrases");
|
|
|
|
|
2009-03-17 00:28:05 +01:00
|
|
|
if (late)
|
|
|
|
{
|
|
|
|
int maxclients = playerhelpers->GetMaxClients();
|
|
|
|
|
|
|
|
for (int i = 1; i <= maxclients; i++)
|
|
|
|
{
|
|
|
|
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(i);
|
|
|
|
|
|
|
|
if (!pPlayer || !pPlayer->IsAuthorized())
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_CookieManager.OnClientAuthorized(i, pPlayer->GetAuthString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-17 06:58:09 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ClientPrefs::SDK_OnAllLoaded()
|
|
|
|
{
|
|
|
|
playerhelpers->AddClientListener(&g_CookieManager);
|
|
|
|
}
|
|
|
|
|
2008-07-01 08:13:09 +02:00
|
|
|
bool ClientPrefs::QueryInterfaceDrop(SMInterface *pInterface)
|
|
|
|
{
|
|
|
|
if ((void *)pInterface == (void *)(Database->GetDriver()))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ClientPrefs::NotifyInterfaceDrop(SMInterface *pInterface)
|
|
|
|
{
|
|
|
|
if (Database != NULL && (void *)pInterface == (void *)(Database->GetDriver()))
|
|
|
|
{
|
|
|
|
Database->Close();
|
|
|
|
Database = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-04-17 06:58:09 +02:00
|
|
|
void ClientPrefs::SDK_OnUnload()
|
|
|
|
{
|
|
|
|
handlesys->RemoveType(g_CookieType, myself->GetIdentity());
|
2008-07-01 01:07:54 +02:00
|
|
|
handlesys->RemoveType(g_CookieIterator, myself->GetIdentity());
|
2008-04-17 06:58:09 +02:00
|
|
|
|
|
|
|
g_CookieManager.Unload();
|
|
|
|
|
2008-07-01 08:13:09 +02:00
|
|
|
if (Database != NULL)
|
|
|
|
{
|
|
|
|
Database->Close();
|
|
|
|
}
|
2008-04-17 06:58:09 +02:00
|
|
|
|
2008-05-12 10:06:47 +02:00
|
|
|
forwards->ReleaseForward(g_CookieManager.cookieDataLoadedForward);
|
|
|
|
|
2012-07-03 13:51:12 +02:00
|
|
|
HandleSecurity sec = HandleSecurity(identity, identity);
|
|
|
|
HandleError err = handlesys->FreeHandle(g_CookieManager.clientMenu->GetHandle(), &sec);
|
|
|
|
if (HandleError_None != err)
|
|
|
|
{
|
|
|
|
g_pSM->LogError(myself, "Error %d when attempting to free client menu handle", err);
|
|
|
|
}
|
2008-07-01 01:07:54 +02:00
|
|
|
|
|
|
|
phrases->Destroy();
|
|
|
|
|
2012-07-03 13:51:12 +02:00
|
|
|
sharesys->DestroyIdentity( identity );
|
|
|
|
|
2008-07-01 01:07:54 +02:00
|
|
|
plsys->RemovePluginsListener(&g_CookieManager);
|
|
|
|
playerhelpers->RemoveClientListener(&g_CookieManager);
|
2008-07-15 02:24:08 +02:00
|
|
|
|
|
|
|
queryMutex->DestroyThis();
|
|
|
|
cookieMutex->DestroyThis();
|
|
|
|
}
|
|
|
|
|
2012-05-24 17:07:28 +02:00
|
|
|
void ClientPrefs::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
|
|
|
{
|
|
|
|
if (Database == NULL && !databaseLoading)
|
|
|
|
{
|
|
|
|
g_pSM->LogMessage(myself, "Attempting to reconnect to database...");
|
|
|
|
|
|
|
|
databaseLoading = true;
|
|
|
|
|
|
|
|
TQueryOp *op = new TQueryOp(Query_Connect, 0);
|
|
|
|
dbi->AddToThreadQueue(op, PrioQueue_High);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-07-15 02:24:08 +02:00
|
|
|
void ClientPrefs::DatabaseConnect()
|
|
|
|
{
|
|
|
|
char error[256];
|
|
|
|
int errCode = 0;
|
|
|
|
|
|
|
|
Database = Driver->Connect(DBInfo, true, error, sizeof(error));
|
|
|
|
|
2009-02-01 05:42:35 +01:00
|
|
|
if (Database == NULL &&
|
|
|
|
DBInfo != storage_local &&
|
|
|
|
storage_local != NULL)
|
|
|
|
{
|
|
|
|
DBInfo = storage_local;
|
|
|
|
Database = Driver->Connect(DBInfo, true, error, sizeof(error));
|
|
|
|
}
|
|
|
|
|
2008-07-15 02:24:08 +02:00
|
|
|
if (Database == NULL)
|
|
|
|
{
|
|
|
|
g_pSM->LogError(myself, error);
|
|
|
|
databaseLoading = false;
|
|
|
|
ProcessQueryCache();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *identifier = Driver->GetIdentifier();
|
|
|
|
|
|
|
|
if (strcmp(identifier, "sqlite") == 0)
|
|
|
|
{
|
2008-10-20 10:40:46 +02:00
|
|
|
g_DriverType = Driver_SQLite;
|
2008-07-15 02:24:08 +02:00
|
|
|
|
2008-10-05 08:09:58 +02:00
|
|
|
if (!Database->DoSimpleQuery(
|
2008-07-15 02:24:08 +02:00
|
|
|
"CREATE TABLE IF NOT EXISTS sm_cookies \
|
|
|
|
( \
|
|
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT, \
|
|
|
|
name varchar(30) NOT NULL UNIQUE, \
|
|
|
|
description varchar(255), \
|
|
|
|
access INTEGER \
|
2008-10-05 08:09:58 +02:00
|
|
|
)"))
|
2008-08-05 10:00:54 +02:00
|
|
|
{
|
2008-10-05 08:09:58 +02:00
|
|
|
g_pSM->LogMessage(myself, "Failed to CreateTable sm_cookies: %s", Database->GetError());
|
|
|
|
goto fatal_fail;
|
2008-08-05 10:00:54 +02:00
|
|
|
}
|
|
|
|
|
2008-10-05 08:09:58 +02:00
|
|
|
if (!Database->DoSimpleQuery(
|
2008-07-15 02:24:08 +02:00
|
|
|
"CREATE TABLE IF NOT EXISTS sm_cookie_cache \
|
|
|
|
( \
|
|
|
|
player varchar(65) NOT NULL, \
|
|
|
|
cookie_id int(10) NOT NULL, \
|
|
|
|
value varchar(100), \
|
|
|
|
timestamp int, \
|
|
|
|
PRIMARY KEY (player, cookie_id) \
|
2008-10-05 08:09:58 +02:00
|
|
|
)"))
|
2008-08-05 10:00:54 +02:00
|
|
|
{
|
2008-10-05 08:09:58 +02:00
|
|
|
g_pSM->LogMessage(myself, "Failed to CreateTable sm_cookie_cache: %s", Database->GetError());
|
|
|
|
goto fatal_fail;
|
2008-08-05 10:00:54 +02:00
|
|
|
}
|
2008-07-15 02:24:08 +02:00
|
|
|
}
|
|
|
|
else if (strcmp(identifier, "mysql") == 0)
|
|
|
|
{
|
2008-10-20 10:40:46 +02:00
|
|
|
g_DriverType = Driver_MySQL;
|
2008-07-15 02:24:08 +02:00
|
|
|
|
2008-10-05 08:09:58 +02:00
|
|
|
if (!Database->DoSimpleQuery(
|
2008-07-15 02:24:08 +02:00
|
|
|
"CREATE TABLE IF NOT EXISTS sm_cookies \
|
|
|
|
( \
|
|
|
|
id INTEGER unsigned NOT NULL auto_increment, \
|
|
|
|
name varchar(30) NOT NULL UNIQUE, \
|
|
|
|
description varchar(255), \
|
|
|
|
access INTEGER, \
|
|
|
|
PRIMARY KEY (id) \
|
2008-10-05 08:09:58 +02:00
|
|
|
)"))
|
2008-08-05 10:00:54 +02:00
|
|
|
{
|
2008-10-05 08:09:58 +02:00
|
|
|
g_pSM->LogMessage(myself, "Failed to CreateTable sm_cookies: %s", Database->GetError());
|
|
|
|
goto fatal_fail;
|
2008-08-05 10:00:54 +02:00
|
|
|
}
|
|
|
|
|
2008-10-05 08:09:58 +02:00
|
|
|
if (!Database->DoSimpleQuery(
|
2008-07-15 02:24:08 +02:00
|
|
|
"CREATE TABLE IF NOT EXISTS sm_cookie_cache \
|
|
|
|
( \
|
|
|
|
player varchar(65) NOT NULL, \
|
|
|
|
cookie_id int(10) NOT NULL, \
|
|
|
|
value varchar(100), \
|
|
|
|
timestamp int NOT NULL, \
|
|
|
|
PRIMARY KEY (player, cookie_id) \
|
2008-10-05 08:09:58 +02:00
|
|
|
)"))
|
2008-08-05 10:00:54 +02:00
|
|
|
{
|
2008-10-05 08:09:58 +02:00
|
|
|
g_pSM->LogMessage(myself, "Failed to CreateTable sm_cookie_cache: %s", Database->GetError());
|
|
|
|
goto fatal_fail;
|
2008-08-05 10:00:54 +02:00
|
|
|
}
|
2008-07-15 02:24:08 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_pSM->LogError(myself, "Unsupported driver \"%s\"", identifier);
|
2008-10-05 08:09:58 +02:00
|
|
|
goto fatal_fail;
|
2008-07-15 02:24:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
databaseLoading = false;
|
|
|
|
|
|
|
|
ProcessQueryCache();
|
|
|
|
|
|
|
|
return;
|
2008-10-05 08:09:58 +02:00
|
|
|
|
|
|
|
fatal_fail:
|
|
|
|
Database->Close();
|
|
|
|
Database = NULL;
|
|
|
|
databaseLoading = false;
|
|
|
|
ProcessQueryCache();
|
2008-07-15 02:24:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ClientPrefs::AddQueryToQueue( TQueryOp *query )
|
|
|
|
{
|
|
|
|
queryMutex->Lock();
|
|
|
|
|
|
|
|
if (Database == NULL && databaseLoading)
|
|
|
|
{
|
|
|
|
cachedQueries.push_back(query);
|
|
|
|
queryMutex->Unlock();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
queryMutex->Unlock();
|
|
|
|
|
|
|
|
if (Database)
|
|
|
|
{
|
|
|
|
query->SetDatabase(Database);
|
2008-10-20 10:40:46 +02:00
|
|
|
dbi->AddToThreadQueue(query, PrioQueue_Normal);
|
2008-07-15 02:24:08 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-08-05 10:00:54 +02:00
|
|
|
query->Destroy();
|
|
|
|
|
2008-07-15 02:24:08 +02:00
|
|
|
/* If Database is NULL and we're not in the loading phase it must have failed - Can't do much */
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ClientPrefs::ProcessQueryCache()
|
|
|
|
{
|
|
|
|
SourceHook::List<TQueryOp *>::iterator iter;
|
|
|
|
|
|
|
|
queryMutex->Lock();
|
|
|
|
|
|
|
|
iter = cachedQueries.begin();
|
|
|
|
|
|
|
|
while (iter != cachedQueries.end())
|
|
|
|
{
|
2008-10-15 10:01:36 +02:00
|
|
|
TQueryOp *op = *iter;
|
2008-07-15 02:24:08 +02:00
|
|
|
|
|
|
|
if (Database != NULL)
|
|
|
|
{
|
|
|
|
op->SetDatabase(Database);
|
2008-10-20 10:40:46 +02:00
|
|
|
dbi->AddToThreadQueue(op, PrioQueue_Normal);
|
2008-07-15 02:24:08 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-10-15 10:01:36 +02:00
|
|
|
op->Destroy();
|
2008-07-15 02:24:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
iter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
cachedQueries.clear();
|
|
|
|
|
|
|
|
queryMutex->Unlock();
|
2008-05-12 10:06:47 +02:00
|
|
|
}
|
|
|
|
|
2011-10-14 17:28:53 +02:00
|
|
|
size_t IsAuthIdConnected(char *authID)
|
|
|
|
{
|
|
|
|
IGamePlayer *player;
|
|
|
|
int maxPlayers = playerhelpers->GetMaxClients();
|
|
|
|
|
|
|
|
for (int playerIndex = 1; playerIndex <= maxPlayers; playerIndex++)
|
|
|
|
{
|
|
|
|
player = playerhelpers->GetGamePlayer(playerIndex);
|
|
|
|
if (!player || !player->IsConnected())
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
const char *authString = player->GetAuthString();
|
|
|
|
if (!authString || authString[0] == '\0')
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcmp(authString, authID) == 0)
|
|
|
|
{
|
|
|
|
return playerIndex;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-05-12 10:06:47 +02:00
|
|
|
size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
|
|
size_t len = vsnprintf(buffer, maxlength, fmt, ap);
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
if (len >= maxlength)
|
|
|
|
{
|
|
|
|
buffer[maxlength - 1] = '\0';
|
|
|
|
return (maxlength - 1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Translate(char *buffer,
|
|
|
|
size_t maxlength,
|
|
|
|
const char *format,
|
|
|
|
unsigned int numparams,
|
|
|
|
size_t *pOutLength,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
unsigned int i;
|
|
|
|
const char *fail_phrase;
|
|
|
|
void *params[MAX_TRANSLATE_PARAMS];
|
|
|
|
|
|
|
|
if (numparams > MAX_TRANSLATE_PARAMS)
|
|
|
|
{
|
|
|
|
assert(false);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
va_start(ap, pOutLength);
|
|
|
|
for (i = 0; i < numparams; i++)
|
|
|
|
{
|
|
|
|
params[i] = va_arg(ap, void *);
|
|
|
|
}
|
|
|
|
va_end(ap);
|
|
|
|
|
|
|
|
if (!g_ClientPrefs.phrases->FormatString(buffer,
|
|
|
|
maxlength,
|
|
|
|
format,
|
|
|
|
params,
|
|
|
|
numparams,
|
|
|
|
pOutLength,
|
|
|
|
&fail_phrase))
|
|
|
|
{
|
|
|
|
if (fail_phrase != NULL)
|
|
|
|
{
|
|
|
|
g_pSM->LogError(myself, "[SM] Could not find core phrase: %s", fail_phrase);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_pSM->LogError(myself, "[SM] Unknown fatal error while translating a core phrase.");
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2008-04-17 06:58:09 +02:00
|
|
|
}
|
|
|
|
|
2012-07-03 13:51:12 +02:00
|
|
|
IdentityToken_t *ClientPrefs::GetIdentity() const
|
|
|
|
{
|
|
|
|
return identity;
|
|
|
|
}
|
|
|
|
|
2009-08-30 10:54:45 +02:00
|
|
|
const char *ClientPrefs::GetExtensionVerString()
|
2009-08-30 09:21:42 +02:00
|
|
|
{
|
2012-08-26 02:33:54 +02:00
|
|
|
return SM_VERSION_STRING;
|
2009-08-30 09:21:42 +02:00
|
|
|
}
|
2008-04-17 06:58:09 +02:00
|
|
|
|
2009-08-30 10:54:45 +02:00
|
|
|
const char *ClientPrefs::GetExtensionDateString()
|
2009-08-30 09:21:42 +02:00
|
|
|
{
|
|
|
|
return SM_BUILD_TIMESTAMP;
|
|
|
|
}
|
2008-05-12 10:06:47 +02:00
|
|
|
|