Commit 7522e401 authored by Neoony's avatar Neoony
Browse files

v0.1 WIP35 -Add fast refreshing for the backup lobby itself

parent 00e4cd87
Pipeline #6212 passed with stages
in 4 minutes and 58 seconds
......@@ -22,7 +22,7 @@
#include <socket>
#include <cURL>
#define PluginVer "v0.1 WIP34"
#define PluginVer "v0.1 WIP35"
public Plugin myinfo =
{
......@@ -1337,7 +1337,7 @@ public Action RefreshServersTmr(Handle timer)
{
{
char RSGetAllServersAddr[1024];
Format(RSGetAllServersAddr, sizeof(RSGetAllServersAddr), "SELECT * FROM `LobbyDB`.`servers` WHERE password=0 AND isenabled=1 AND addr!='80.112.155.100:27015' AND addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT 10;");
Format(RSGetAllServersAddr, sizeof(RSGetAllServersAddr), "SELECT * FROM `LobbyDB`.`servers` WHERE password=0 AND isenabled=1 AND addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT 10;");
SQL_TQuery(hDatabase, RSAllServersAddr, RSGetAllServersAddr);
}
}
......@@ -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:27015' 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, 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);
//PrintToServer("%s", ServerIndexChar);
SQL_TQuery(hDatabase, RSInfoOfServer, RSGetAllServersAddrEach, ServerIndex);
}
......@@ -1487,6 +1487,10 @@ public void RSInfoOfServer(Handle RShDriver, Handle RShResult, const char[] sErr
{
Format(RSaddrx[ServerIndex], 256, "192.168.200.81:27016");
}
if (StrEqual(RSaddrx[ServerIndex], "80.112.155.100:27015") == true)
{
Format(RSaddrx[ServerIndex], 256, "192.168.200.81:27015");
}
}
if (EuropiresLocal == true)
......@@ -1759,6 +1763,10 @@ public Action UpdateSQL(int ServerIndexx)
{
Format(RSaddrx[ServerIndexx], 256, "80.112.155.100:27016");
}
if (StrEqual(RSaddrx[ServerIndexx], "192.168.200.81:27015") == true)
{
Format(RSaddrx[ServerIndexx], 256, "80.112.155.100:27015");
}
}
if (EuropiresLocal == true)
{
......@@ -1799,6 +1807,10 @@ public Action UpdateSQLServerDown(int ServerIndexx)
{
Format(RSaddrx[ServerIndexx], 256, "80.112.155.100:27016");
}
if (StrEqual(RSaddrx[ServerIndexx], "192.168.200.81:27015") == true)
{
Format(RSaddrx[ServerIndexx], 256, "80.112.155.100:27015");
}
}
if (EuropiresLocal == true)
{
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "v0.1 WIP34"
"Latest" "v0.1 WIP35"
}
"Notes" "First release"
......@@ -58,6 +58,7 @@
"Notes" "WIP33: Fix for XP detection"
"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"
}
"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