mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
Fixed "n records" in WR menu capping at shavit_wr_recordlimit
This commit is contained in:
parent
596934c735
commit
225dd2fadf
@ -1356,8 +1356,7 @@ void StartWRMenu(int client, const char[] map, int style, int track)
|
||||
gH_SQL.Escape(map, sEscapedMap, iLength);
|
||||
|
||||
char[] sQuery = new char[512];
|
||||
FormatEx(sQuery, 512, "SELECT p.id, u.name, p.time, p.jumps, p.auth FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE map = '%s' AND style = %d AND track = %d ORDER BY time ASC, date ASC LIMIT %d;", gS_MySQLPrefix, gS_MySQLPrefix, sEscapedMap, style, track, gI_RecordsLimit);
|
||||
PrintToServer("%s", sQuery);
|
||||
FormatEx(sQuery, 512, "SELECT p.id, u.name, p.time, p.jumps, p.auth FROM %splayertimes p JOIN %susers u ON p.auth = u.auth WHERE map = '%s' AND style = %d AND track = %d ORDER BY time ASC, date ASC;", gS_MySQLPrefix, gS_MySQLPrefix, sEscapedMap, style, track);
|
||||
gH_SQL.Query(SQL_WR_Callback, sQuery, dp);
|
||||
}
|
||||
|
||||
@ -1396,26 +1395,29 @@ public void SQL_WR_Callback(Database db, DBResultSet results, const char[] error
|
||||
|
||||
while(results.FetchRow())
|
||||
{
|
||||
// 0 - record id, for statistic purposes.
|
||||
int id = results.FetchInt(0);
|
||||
char[] sID = new char[8];
|
||||
IntToString(id, sID, 8);
|
||||
if(++iCount <= gI_RecordsLimit)
|
||||
{
|
||||
// 0 - record id, for statistic purposes.
|
||||
int id = results.FetchInt(0);
|
||||
char[] sID = new char[8];
|
||||
IntToString(id, sID, 8);
|
||||
|
||||
// 1 - player name
|
||||
char[] sName = new char[MAX_NAME_LENGTH];
|
||||
results.FetchString(1, sName, MAX_NAME_LENGTH);
|
||||
// 1 - player name
|
||||
char[] sName = new char[MAX_NAME_LENGTH];
|
||||
results.FetchString(1, sName, MAX_NAME_LENGTH);
|
||||
|
||||
// 2 - time
|
||||
float time = results.FetchFloat(2);
|
||||
char[] sTime = new char[16];
|
||||
FormatSeconds(time, sTime, 16);
|
||||
// 2 - time
|
||||
float time = results.FetchFloat(2);
|
||||
char[] sTime = new char[16];
|
||||
FormatSeconds(time, sTime, 16);
|
||||
|
||||
// 3 - jumps
|
||||
int jumps = results.FetchInt(3);
|
||||
// 3 - jumps
|
||||
int jumps = results.FetchInt(3);
|
||||
|
||||
char[] sDisplay = new char[128];
|
||||
FormatEx(sDisplay, 128, "#%d - %s - %s (%d %T)", ++iCount, sName, sTime, jumps, "WRJumps", client);
|
||||
menu.AddItem(sID, sDisplay);
|
||||
char[] sDisplay = new char[128];
|
||||
FormatEx(sDisplay, 128, "#%d - %s - %s (%d %T)", ++iCount, sName, sTime, jumps, "WRJumps", client);
|
||||
menu.AddItem(sID, sDisplay);
|
||||
}
|
||||
|
||||
// check if record exists in the map's top X
|
||||
char[] sQueryAuth = new char[32];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user