[Loginserver] Add config option to display player count (#1738)

* [Loginserver] Add config option to display player count

* Update name
This commit is contained in:
Chris Miles 2021-11-11 22:38:41 -06:00 committed by GitHub
parent cbea7045fa
commit a6c85babfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 1 deletions

View File

@ -553,7 +553,7 @@ void Client::DoSuccessfulLogin(
login_reply.unk2 = 0;
login_reply.lsid = db_account_id;
login_reply.failed_attempts = 0;
login_reply.show_player_count = false; // todo: config option
login_reply.show_player_count = server.options.IsShowPlayerCountEnabled();
login_reply.offer_min_days = 99;
login_reply.offer_min_views = -1;
login_reply.offer_cooldown_minutes = 0;

View File

@ -11,6 +11,7 @@
},
"worldservers": {
"unregistered_allowed": true,
"show_player_count": false,
"reject_duplicate_servers": false
},
"web_api": {

View File

@ -64,6 +64,7 @@ void LoadServerConfig()
false
));
server.options.AllowUnregistered(server.config.GetVariableBool("worldservers", "unregistered_allowed", true));
server.options.SetShowPlayerCount(server.config.GetVariableBool("worldservers", "show_player_count", false));
/**
* Account
@ -240,6 +241,7 @@ int main(int argc, char **argv)
#endif
LogInfo("[Config] [WorldServer] IsRejectingDuplicateServers [{0}]", server.options.IsRejectingDuplicateServers());
LogInfo("[Config] [WorldServer] IsUnregisteredAllowed [{0}]", server.options.IsUnregisteredAllowed());
LogInfo("[Config] [WorldServer] ShowPlayerCount [{0}]", server.options.IsShowPlayerCountEnabled());
LogInfo("[Config] [Security] GetEncryptionMode [{0}]", server.options.GetEncryptionMode());
LogInfo("[Config] [Security] IsTokenLoginAllowed [{0}]", server.options.IsTokenLoginAllowed());
LogInfo("[Config] [Security] IsPasswordLoginAllowed [{0}]", server.options.IsPasswordLoginAllowed());

View File

@ -113,6 +113,15 @@ public:
inline void UpdateInsecurePasswords(bool b) { update_insecure_passwords = b; }
inline bool IsUpdatingInsecurePasswords() const { return update_insecure_passwords; }
inline bool IsShowPlayerCountEnabled() const
{
return show_player_count;
}
inline void SetShowPlayerCount(bool show_player_count)
{
Options::show_player_count = show_player_count;
}
private:
bool allow_unregistered;
bool trace;
@ -122,6 +131,7 @@ private:
bool reject_duplicate_servers;
bool allow_token_login;
bool allow_password_login;
bool show_player_count;
bool auto_create_accounts;
bool auto_link_accounts;
bool update_insecure_passwords;
@ -130,5 +140,6 @@ private:
std::string default_loginserver_name;
};
#endif