Fixed world time
git-svn-id: http://mc-server.googlecode.com/svn/trunk@78 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -317,7 +317,7 @@ void cWorld::Tick(float a_Dt)
|
||||
m_WorldTime %= 24000; // 24000 units in a day
|
||||
bSendTime = true;
|
||||
}
|
||||
if( bSendTime ) cRoot::Get()->GetServer()->Broadcast( cPacket_TimeUpdate( (m_WorldTime) ) );
|
||||
if( bSendTime ) Broadcast( cPacket_TimeUpdate( (m_WorldTime) ) );
|
||||
|
||||
LockEntities();
|
||||
for( cWorld::EntityList::iterator itr = GetEntities().begin(); itr != GetEntities().end();)
|
||||
@@ -651,6 +651,15 @@ const double & cWorld::GetSpawnY()
|
||||
return m_SpawnY;
|
||||
}
|
||||
|
||||
void cWorld::Broadcast( const cPacket & a_Packet, cClientHandle* a_Exclude /* = 0 */ )
|
||||
{
|
||||
for( PlayerList::iterator itr = m_pState->m_Players.begin(); itr != m_pState->m_Players.end(); ++itr)
|
||||
{
|
||||
if( (*itr)->GetClientHandle() == a_Exclude || !(*itr)->GetClientHandle()->IsLoggedIn() ) continue;
|
||||
(*itr)->GetClientHandle()->Send( a_Packet );
|
||||
}
|
||||
}
|
||||
|
||||
void cWorld::AddPlayer( cPlayer* a_Player )
|
||||
{
|
||||
m_pState->m_Players.remove( a_Player );
|
||||
|
||||
Reference in New Issue
Block a user