1
0

Max. players and MOTD are now changeable in the settings.ini

Thanks to mtilden ( http://forum.mc-server.org/showthread.php?tid=183&pid=1381#pid1381 )

git-svn-id: http://mc-server.googlecode.com/svn/trunk@101 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
lapayo94@gmail.com
2011-12-23 23:58:54 +00:00
parent aa392170a2
commit ad610e63ba
4 changed files with 50 additions and 13 deletions

View File

@@ -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 );