Skip to content

Commit

Permalink
Merge pull request #439 from Groruk/repo
Browse files Browse the repository at this point in the history
Fixed InsertServerInfo()
  • Loading branch information
Groruk committed Apr 10, 2018
2 parents 430ea98 + c7789c3 commit 16e1db5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
41 changes: 20 additions & 21 deletions game/addons/sourcemod/scripting/sbpp_main.sp
Expand Up @@ -2563,27 +2563,26 @@ stock CheckLoadAdmins()

stock InsertServerInfo()
{
if (DB == INVALID_HANDLE)
{
return;
}

char query[100], pieces[4];
int longip = GetConVarInt(CvarHostIp);

pieces[0] = (longip >> 24) & 0x000000FF;
pieces[1] = (longip >> 16) & 0x000000FF;
pieces[2] = (longip >> 8) & 0x000000FF;
pieces[3] = longip & 0x000000FF;

FormatEx(ServerIp, sizeof(ServerIp), "%d.%d.%d.%d", pieces[0], pieces[1], pieces[2], pieces[3]);
GetConVarString(CvarPort, ServerPort, sizeof(ServerPort));

if (AutoAdd != false)
{
FormatEx(query, sizeof(query), "SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s'", DatabasePrefix, ServerIp, ServerPort);
SQL_TQuery(DB, ServerInfoCallback, query);
}
if (DB == INVALID_HANDLE) {
return;
}

char query[100];
int pieces[4];
int longip = GetConVarInt(CvarHostIp);

pieces[0] = (longip >> 24) & 0x000000FF;
pieces[1] = (longip >> 16) & 0x000000FF;
pieces[2] = (longip >> 8) & 0x000000FF;
pieces[3] = longip & 0x000000FF;

FormatEx(ServerIp, sizeof(ServerIp), "%d.%d.%d.%d", pieces[0], pieces[1], pieces[2], pieces[3]);
GetConVarString(CvarPort, ServerPort, sizeof(ServerPort));

if (AutoAdd != false) {
FormatEx(query, sizeof(query), "SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s'", DatabasePrefix, ServerIp, ServerPort);
SQL_TQuery(DB, ServerInfoCallback, query);
}
}

stock void PrepareBan(int client, int target, int time, char[] reason, int size)
Expand Down
2 changes: 1 addition & 1 deletion web/version.json
@@ -1,5 +1,5 @@
{
"version": "1.6.3",
"git": "665",
"git": "674",
"dev": false
}

0 comments on commit 16e1db5

Please sign in to comment.