summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cWorld.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index b1a0d1813..2f5ed1c2b 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -183,6 +183,8 @@ cWorld::cWorld( const char* a_WorldName )
{
m_bAnimals = IniFile2.GetValueB("Monsters", "AnimalsOn", true );
m_SpawnMonsterRate = (float)IniFile2.GetValueF("Monsters", "AnimalSpawnInterval", 10 );
+ SetMaxPlayers(IniFile2.GetValueI("Server", "MaxPlayers", 9001));
+ m_Description = IniFile2.GetValue("Server", "Description", "MCServer! - It's OVER 9000!").c_str();
}
m_ChunkMap = new cChunkMap( 32, 32, this );
@@ -766,6 +768,25 @@ void cWorld::Broadcast( const cPacket & a_Packet, cClientHandle* a_Exclude /* =
}
}
+std::string cWorld::GetDescription()
+{
+ return this->m_Description;
+}
+
+unsigned int cWorld::GetMaxPlayers()
+{
+ return this->m_MaxPlayers;
+}
+
+void cWorld::SetMaxPlayers(int iMax)
+{
+ this->m_MaxPlayers = MAX_PLAYERS;
+ if (iMax > 0 && iMax < MAX_PLAYERS)
+ {
+ this->m_MaxPlayers = iMax;
+ }
+}
+
void cWorld::AddPlayer( cPlayer* a_Player )
{
m_pState->m_Players.remove( a_Player );