Skip to content

Commit

Permalink
Update to 3.1.6 Stable state
Browse files Browse the repository at this point in the history
Fixes not creating new players.
  • Loading branch information
Wend4r committed Jan 22, 2021
1 parent 74655ba commit d93e65e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
Binary file modified Game Server/addons/sourcemod/plugins/levelsranks.smx
Binary file not shown.
24 changes: 20 additions & 4 deletions Game Server/addons/sourcemod/scripting/levels_ranks/database.sp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ LIMIT 1;"

#define SQL_COUNT_PLAYERS "SELECT COUNT(`steam`) FROM `%s` WHERE `lastconnect` LIMIT 1;"

#define SQL_CREATE_DATA \
"INSERT INTO `%s` \
(\
`steam`, \
`name`, \
`value`, \
`lastconnect`\
) \
VALUES ('STEAM_%i:%i:%i', '%s', %i, %i);"

#define SQL_REPLACE_DATA \
"REPLACE INTO `%s` \
(\
Expand Down Expand Up @@ -265,10 +275,7 @@ void SaveDataPlayer(int iClient, bool bDisconnect = false)

CallForward_OnPlayerSaved(iClient, hTransaction);

if(g_hDatabase)
{
g_hDatabase.Execute(hTransaction, _, SQL_TransactionFailure, 1, DBPrio_High);
}
g_hDatabase.Execute(hTransaction, _, SQL_TransactionFailure, 1, DBPrio_High);

if(bDisconnect)
{
Expand Down Expand Up @@ -356,6 +363,15 @@ public void SQL_Callback(Database hDatabase, DBResultSet hResult, const char[] s

CallForward_OnPlayerLoaded(iClient);
}
else
{
int iAccountID = g_iPlayerInfo[iClient].iAccountID;

decl char sQuery[1024];

FormatEx(sQuery, sizeof(sQuery), SQL_CREATE_DATA, g_sTableName, g_iEngine == Engine_CSGO, iAccountID & 1, iAccountID >>> 1, GetPlayerName(iClient), g_Settings[LR_TypeStatistics] ? 1000 : 0, GetTime());
g_hDatabase.Query(SQL_Callback, sQuery, GetClientUserId(iClient) << 4 | LR_CreateDataPlayer);
}
}
}

Expand Down

0 comments on commit d93e65e

Please sign in to comment.