Show player/server count in server list
This commit is contained in:
@ -9,4 +9,7 @@ namespace server_list
|
||||
void handle_info_response(const game::netadr_s& address, const utils::info_string& info);
|
||||
|
||||
bool sl_key_event(int key, int down);
|
||||
|
||||
int get_player_count();
|
||||
int get_server_count();
|
||||
}
|
@ -17,6 +17,7 @@
|
||||
#include "fastfiles.hpp"
|
||||
#include "scripting.hpp"
|
||||
#include "updater.hpp"
|
||||
#include "server_list.hpp"
|
||||
|
||||
#include "game/ui_scripting/execution.hpp"
|
||||
#include "game/scripting/execution.hpp"
|
||||
@ -342,6 +343,12 @@ namespace ui_scripting
|
||||
::game::Dvar_SetFromStringByNameFromSource("virtualLobbyPresentable", "1", ::game::DvarSetSource::DVAR_SOURCE_INTERNAL);
|
||||
};
|
||||
|
||||
auto server_list_table = table();
|
||||
lua["serverlist"] = server_list_table;
|
||||
|
||||
server_list_table["getplayercount"] = server_list::get_player_count;
|
||||
server_list_table["getservercount"] = server_list::get_server_count;
|
||||
|
||||
auto updater_table = table();
|
||||
lua["updater"] = updater_table;
|
||||
|
||||
|
Reference in New Issue
Block a user