Add playernumber to favorites list

pull/825/merge
sapier 2013-07-15 23:28:55 +02:00 committed by PilzAdam
parent 8a1658ec3e
commit d6c052038f
2 changed files with 14 additions and 3 deletions

View File

@ -44,6 +44,9 @@ function render_favourite(spec,render_details)
return text return text
end end
local details = "" local details = ""
if spec.password == true then if spec.password == true then
details = details .. "*" details = details .. "*"
@ -70,7 +73,15 @@ function render_favourite(spec,render_details)
end end
details = details .. " " details = details .. " "
return fs_escape_string(details) .. text local playercount = ""
if spec.clients ~= nil and
spec.clients_max ~= nil then
playercount = string.format("%03d",spec.clients) .. "/" ..
string.format("%03d",spec.clients_max) .. " "
end
return playercount .. fs_escape_string(details) .. text
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -556,7 +556,7 @@ int guiLuaApi::l_get_favorites(lua_State *L)
if (servers[i]["clients_max"].asString().size()) { if (servers[i]["clients_max"].asString().size()) {
const char* clients_max_raw = servers[i]["clients"].asString().c_str(); const char* clients_max_raw = servers[i]["clients_max"].asString().c_str();
char* endptr = 0; char* endptr = 0;
int numbervalue = strtol(clients_max_raw,&endptr,10); int numbervalue = strtol(clients_max_raw,&endptr,10);