Declared one mutex as mutable in order to allow for const correct get accessors.
This commit is contained in:
parent
5bed1c09bc
commit
4dd7610381
@ -453,14 +453,14 @@ void cClientHandle::HandlePing(void)
|
|||||||
{
|
{
|
||||||
// Somebody tries to retrieve information about the server
|
// Somebody tries to retrieve information about the server
|
||||||
AString Reply;
|
AString Reply;
|
||||||
cServer * Server = cRoot::Get()->GetServer();
|
const cServer & Server = *cRoot::Get()->GetServer();
|
||||||
|
|
||||||
Printf(Reply, "%s%s%i%s%i",
|
Printf(Reply, "%s%s%i%s%i",
|
||||||
Server->GetDescription().c_str(),
|
Server.GetDescription().c_str(),
|
||||||
cChatColor::Delimiter.c_str(),
|
cChatColor::Delimiter.c_str(),
|
||||||
Server->GetNumPlayers(),
|
Server.GetNumPlayers(),
|
||||||
cChatColor::Delimiter.c_str(),
|
cChatColor::Delimiter.c_str(),
|
||||||
Server->GetMaxPlayers()
|
Server.GetMaxPlayers()
|
||||||
);
|
);
|
||||||
Kick(Reply);
|
Kick(Reply);
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ bool cServer::InitServer(cIniFile & a_SettingsIni)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int cServer::GetNumPlayers(void)
|
int cServer::GetNumPlayers(void) const
|
||||||
{
|
{
|
||||||
cCSLock Lock(m_CSPlayerCount);
|
cCSLock Lock(m_CSPlayerCount);
|
||||||
return m_PlayerCount;
|
return m_PlayerCount;
|
||||||
|
@ -59,7 +59,7 @@ public: // tolua_export
|
|||||||
|
|
||||||
// Player counts:
|
// Player counts:
|
||||||
int GetMaxPlayers(void) const {return m_MaxPlayers; }
|
int GetMaxPlayers(void) const {return m_MaxPlayers; }
|
||||||
int GetNumPlayers(void);
|
int GetNumPlayers(void) const;
|
||||||
void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; }
|
void SetMaxPlayers(int a_MaxPlayers) { m_MaxPlayers = a_MaxPlayers; }
|
||||||
|
|
||||||
// Hardcore mode or not:
|
// Hardcore mode or not:
|
||||||
@ -168,7 +168,7 @@ private:
|
|||||||
cClientHandleList m_Clients; ///< Clients that are connected to the server and not yet assigned to a cWorld
|
cClientHandleList m_Clients; ///< Clients that are connected to the server and not yet assigned to a cWorld
|
||||||
cClientHandleList m_ClientsToRemove; ///< Clients that have just been moved into a world and are to be removed from m_Clients in the next Tick()
|
cClientHandleList m_ClientsToRemove; ///< Clients that have just been moved into a world and are to be removed from m_Clients in the next Tick()
|
||||||
|
|
||||||
cCriticalSection m_CSPlayerCount; ///< Locks the m_PlayerCount
|
mutable cCriticalSection m_CSPlayerCount; ///< Locks the m_PlayerCount
|
||||||
int m_PlayerCount; ///< Number of players currently playing in the server
|
int m_PlayerCount; ///< Number of players currently playing in the server
|
||||||
cCriticalSection m_CSPlayerCountDiff; ///< Locks the m_PlayerCountDiff
|
cCriticalSection m_CSPlayerCountDiff; ///< Locks the m_PlayerCountDiff
|
||||||
int m_PlayerCountDiff; ///< Adjustment to m_PlayerCount to be applied in the Tick thread
|
int m_PlayerCountDiff; ///< Adjustment to m_PlayerCount to be applied in the Tick thread
|
||||||
|
Loading…
Reference in New Issue
Block a user