Commit c2f53fa6 authored by Neoony's avatar Neoony
Browse files

v0.1 WIP36 -Fix XP detection not creating new entries in the DB (related to WIP33)

parent 7522e401
Pipeline #6216 passed with stages
in 4 minutes and 46 seconds
......@@ -22,7 +22,7 @@
#include <socket>
#include <cURL>
#define PluginVer "v0.1 WIP35"
#define PluginVer "v0.1 WIP36"
public Plugin myinfo =
{
......@@ -1410,7 +1410,7 @@ public void RSAllServersAddr(Handle RShDriver, Handle RShResult, const char[] sE
//char[] ServerIndexChar = new char[64];
//IntToString(ServerIndex, ServerIndexChar, 64);
char RSGetAllServersAddrEach[1024];
Format(RSGetAllServersAddrEach, sizeof(RSGetAllServersAddrEach), "SELECT servers.addr as addr, servers.players as players, servers.bots as bots, xpdata.xp as xp FROM `LobbyDB`.`servers` LEFT JOIN `LobbyDB`.`xpdata` ON servers.addr = xpdata.addr WHERE servers.password=0 AND servers.isenabled=1 AND servers.addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT %i,1;", ServerIndex);
Format(RSGetAllServersAddrEach, sizeof(RSGetAllServersAddrEach), "SELECT servers.addr as addr, servers.players as players, servers.bots as bots, IFNULL(xpdata.xp,'-1') as xp FROM `LobbyDB`.`servers` LEFT JOIN `LobbyDB`.`xpdata` ON servers.addr = xpdata.addr WHERE servers.password=0 AND servers.isenabled=1 AND servers.addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT %i,1;", ServerIndex);
//PrintToServer("%s", ServerIndexChar);
SQL_TQuery(hDatabase, RSInfoOfServer, RSGetAllServersAddrEach, ServerIndex);
}
......@@ -1446,6 +1446,11 @@ public void RSInfoOfServer(Handle RShDriver, Handle RShResult, const char[] sErr
//PrintToServer("[Database] RSbots %i : %i", ServerIndex, RSbots[ServerIndex]);
XPsqlon[ServerIndex] = SQL_FetchInt(RShResult, 3);
if (GetConVarInt(l_debug) == 1)
{
PrintToServer("[L]XPsqlon[%i]: %i", ServerIndex, XPsqlon[ServerIndex]);
}
if (XPcheckcounter[ServerIndex] == 0)
{
Format(XPaddrx[ServerIndex], 256, RSaddrx[ServerIndex]);
......@@ -1912,7 +1917,7 @@ public ReadFunction(Handle hndl, const char[] buffer, const bytes, const nmemb,
XPserverhasxp[ServerIndexx] = 0;
}
if (XPsqlon[ServerIndexx] != XPserverhasxp[ServerIndexx])
if (XPsqlon[ServerIndexx] != XPserverhasxp[ServerIndexx] || XPsqlon[ServerIndexx] == -1)
{
if (hDatabase != null)
{
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "v0.1 WIP35"
"Latest" "v0.1 WIP36"
}
"Notes" "First release"
......@@ -59,6 +59,7 @@
"Notes" "WIP33: Fixed some SQL UPDATE queries trying to update DB when it has no new data to update"
"Notes" "WIP34: Redirect connecting players after they are already connected to Lobby, instead of while they are connecting"
"Notes" "WIP35: Add fast refreshing for the backup lobby itself"
"Notes" "WIP36: Fix XP detection not creating new entries in the DB (related to WIP33)"
}
"Files"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment