Commit ba525072 authored by Neoony's avatar Neoony
Browse files

v0.1 WIP31 -Add fast refreshing for the lobby itself

parent f420c1ae
Pipeline #6107 passed with stages
in 3 minutes and 5 seconds
......@@ -22,7 +22,7 @@
#include <socket>
#include <cURL>
#define PluginVer "v0.1 WIP30"
#define PluginVer "v0.1 WIP31"
public Plugin myinfo =
{
......@@ -1201,7 +1201,7 @@ public Action RefreshServersTmr(Handle timer)
if (GetConVarInt(l_refreshservers) != 0)
{
char RSGetAllServersAddr[1024];
Format(RSGetAllServersAddr, sizeof(RSGetAllServersAddr), "SELECT * FROM `LobbyDB`.`servers` WHERE password=0 AND isenabled=1 AND name NOT LIKE '%%LOBBY%%' 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:27015' AND addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT 10;");
SQL_TQuery(hDatabase, RSAllServersAddr, RSGetAllServersAddr);
}
}
......@@ -1251,7 +1251,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 addr, players, bots, xp FROM `LobbyDB`.`servers` WHERE password=0 AND isenabled=1 AND name NOT LIKE '%%LOBBY%%' AND addr!='80.112.155.100:27015' AND addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT %i,1;", ServerIndex);
Format(RSGetAllServersAddrEach, sizeof(RSGetAllServersAddrEach), "SELECT addr, players, bots, xp 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 %i,1;", ServerIndex);
//PrintToServer("%s", ServerIndexChar);
SQL_TQuery(hDatabase, RSInfoOfServer, RSGetAllServersAddrEach, ServerIndex);
}
......@@ -1310,6 +1310,10 @@ public void RSInfoOfServer(Handle RShDriver, Handle RShResult, const char[] sErr
{
Format(RSaddrx[ServerIndex], 256, "192.168.1.3:17701");
}
if (StrEqual(RSaddrx[ServerIndex], "185.165.242.40:27015") == true)
{
Format(RSaddrx[ServerIndex], 256, "192.168.1.111:27015");
}
}
char IPPort[2][64];
......@@ -1577,6 +1581,10 @@ public Action UpdateSQL(int ServerIndexx)
{
Format(RSaddrx[ServerIndexx], 256, "185.165.242.40:17701");
}
if (StrEqual(RSaddrx[ServerIndexx], "192.168.1.111:27015") == true)
{
Format(RSaddrx[ServerIndexx], 256, "185.165.242.40:27015");
}
}
if (GetConVarInt(l_debug) == 1)
......@@ -1613,6 +1621,10 @@ public Action UpdateSQLServerDown(int ServerIndexx)
{
Format(RSaddrx[ServerIndexx], 256, "185.165.242.40:17701");
}
if (StrEqual(RSaddrx[ServerIndexx], "192.168.1.111:27015") == true)
{
Format(RSaddrx[ServerIndexx], 256, "185.165.242.40:27015");
}
}
if (hDatabase != null)
{
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "v0.1 WIP30"
"Latest" "v0.1 WIP31"
}
"Notes" "First release"
......@@ -50,13 +50,12 @@
"Notes" "WIP28: Added showing XP support of servers when voting"
"Notes" "WIP29: Fix for WIP27"
"Notes" "WIP30: Vote menu is now paginated with 6 items maximum per page"
"Notes" "WIP31: Add fast refreshing for the lobby itself"
}
"Files"
{
"Plugin" "Path_Mod/addons/sourcemod/plugins/Lobby.smx"
"Plugin" "Path_Mod/addons/sourcemod/extensions/curl.ext.dll"
"Plugin" "Path_Mod/addons/sourcemod/extensions/curl.ext.so"
"Source" "Path_Mod/addons/sourcemod/scripting/Lobby.sp"
"Source" "Path_Mod/addons/sourcemod/scripting/include/socket.inc"
......
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