NetPlayClient: Make the NetSettings instance part of the NetPlayClient class

This is only ever read from externally, so we can expose a getter that ensures that
immutability, while making the actual instance internal. Given the
filling out of these settings depends on packets received by the client
instance, it makes more sense to make it a part of the client itself.

This trims off one lingering global.
This commit is contained in:
Lioncash 2018-07-09 15:52:31 -04:00
commit f209f5f2a4
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
4 changed files with 36 additions and 20 deletions

View file

@ -75,6 +75,7 @@ public:
void GetPlayerList(std::string& list, std::vector<int>& pid_list);
std::vector<const Player*> GetPlayers();
const NetSettings& GetNetSettings() const;
// Called from the GUI thread.
bool IsConnected() const { return m_is_connected; }
@ -173,6 +174,7 @@ private:
ConnectionState m_connection_state = ConnectionState::Failure;
PlayerId m_pid = 0;
NetSettings m_net_settings{};
std::map<PlayerId, Player> m_players;
std::string m_host_spec;
std::string m_player_name;