Skip to content

Commit 16e1db5

Browse files
authored
Merge pull request #439 from Groruk/repo
Fixed InsertServerInfo()
2 parents 430ea98 + c7789c3 commit 16e1db5

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

game/addons/sourcemod/scripting/sbpp_main.sp

+20-21
Original file line numberDiff line numberDiff line change
@@ -2563,27 +2563,26 @@ stock CheckLoadAdmins()
25632563

25642564
stock InsertServerInfo()
25652565
{
2566-
if (DB == INVALID_HANDLE)
2567-
{
2568-
return;
2569-
}
2570-
2571-
char query[100], pieces[4];
2572-
int longip = GetConVarInt(CvarHostIp);
2573-
2574-
pieces[0] = (longip >> 24) & 0x000000FF;
2575-
pieces[1] = (longip >> 16) & 0x000000FF;
2576-
pieces[2] = (longip >> 8) & 0x000000FF;
2577-
pieces[3] = longip & 0x000000FF;
2578-
2579-
FormatEx(ServerIp, sizeof(ServerIp), "%d.%d.%d.%d", pieces[0], pieces[1], pieces[2], pieces[3]);
2580-
GetConVarString(CvarPort, ServerPort, sizeof(ServerPort));
2581-
2582-
if (AutoAdd != false)
2583-
{
2584-
FormatEx(query, sizeof(query), "SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s'", DatabasePrefix, ServerIp, ServerPort);
2585-
SQL_TQuery(DB, ServerInfoCallback, query);
2586-
}
2566+
if (DB == INVALID_HANDLE) {
2567+
return;
2568+
}
2569+
2570+
char query[100];
2571+
int pieces[4];
2572+
int longip = GetConVarInt(CvarHostIp);
2573+
2574+
pieces[0] = (longip >> 24) & 0x000000FF;
2575+
pieces[1] = (longip >> 16) & 0x000000FF;
2576+
pieces[2] = (longip >> 8) & 0x000000FF;
2577+
pieces[3] = longip & 0x000000FF;
2578+
2579+
FormatEx(ServerIp, sizeof(ServerIp), "%d.%d.%d.%d", pieces[0], pieces[1], pieces[2], pieces[3]);
2580+
GetConVarString(CvarPort, ServerPort, sizeof(ServerPort));
2581+
2582+
if (AutoAdd != false) {
2583+
FormatEx(query, sizeof(query), "SELECT sid FROM %s_servers WHERE ip = '%s' AND port = '%s'", DatabasePrefix, ServerIp, ServerPort);
2584+
SQL_TQuery(DB, ServerInfoCallback, query);
2585+
}
25872586
}
25882587

25892588
stock void PrepareBan(int client, int target, int time, char[] reason, int size)

web/version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"version": "1.6.3",
3-
"git": "665",
3+
"git": "674",
44
"dev": false
55
}

0 commit comments

Comments
 (0)