Commit 37ae7a26 authored by Neoony's avatar Neoony
Browse files

v0.1 WIP8 -Adjust query to not include full servers for the vote

parent ee0a7c74
Pipeline #4017 passed with stages
in 1 minute and 25 seconds
......@@ -20,7 +20,7 @@
#include <sdkhooks>
//#include <emputils>
#define PluginVer "v0.1 WIP7"
#define PluginVer "v0.1 WIP8"
public Plugin myinfo =
{
......@@ -464,7 +464,7 @@ public void GotDatabase(Database db, const char[] error, any data)
public Action QueryNumberOfServers()
{
char GetNumberOfServers[1024];
Format(GetNumberOfServers, sizeof(GetNumberOfServers), "SELECT * FROM `LobbyDB`.`online_servers` WHERE addr!='80.112.155.100:27015' AND addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT 200;");
Format(GetNumberOfServers, sizeof(GetNumberOfServers), "SELECT * FROM `LobbyDB`.`online_servers` WHERE addr!='80.112.155.100:27015' AND addr!='80.112.155.100:27017' AND players < maxplayers - %i ORDER BY players DESC LIMIT 200;", GetClientCount());
SQL_TQuery(hDatabase, QNumberOfServers, GetNumberOfServers);
}
......@@ -508,7 +508,7 @@ public Action QueryServersData(int args)
//char[] ServerIndexChar = new char[64];
//IntToString(ServerIndex, ServerIndexChar, 64);
char GetInfoOfServer[512];
Format(GetInfoOfServer, 512, "SELECT name, addr, players, maxplayers FROM `LobbyDB`.`online_servers` WHERE addr!='80.112.155.100:27015' AND addr!='80.112.155.100:27017' ORDER BY players DESC LIMIT %i,1;", ServerIndex);
Format(GetInfoOfServer, 512, "SELECT name, addr, players, maxplayers FROM `LobbyDB`.`online_servers` WHERE addr!='80.112.155.100:27015' AND addr!='80.112.155.100:27017' AND players < maxplayers - %i ORDER BY players DESC LIMIT %i,1;", GetClientCount(), ServerIndex);
//PrintToServer("%s", ServerIndexChar);
SQL_TQuery(hDatabase, InfoOfServer, GetInfoOfServer, ServerIndex);
}
......
......@@ -20,6 +20,7 @@
"Notes" "WIP5: Added failsafe measures in case of connecting to DB fail, or if no servers are found while the vote wants to start'"
"Notes" "WIP6: Bugfix of l_forceredirect"
"Notes" "WIP7: Quickadd on not redirecting players to a full server. Still needs work"
"Notes" "WIP8: Adjust query to not include full servers for the vote"
}
"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