From e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f Mon Sep 17 00:00:00 2001 From: faketruth Date: Mon, 31 Oct 2011 00:52:20 +0000 Subject: Prepared some parts of the code for multi world support, I created lots of TODO's git-svn-id: http://mc-server.googlecode.com/svn/trunk@29 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cServer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/cServer.cpp') diff --git a/source/cServer.cpp b/source/cServer.cpp index 511678939..8ea00a523 100644 --- a/source/cServer.cpp +++ b/source/cServer.cpp @@ -227,6 +227,7 @@ cServer::~cServer() delete m_pState; } +// TODO - Need to modify this or something, so it broadcasts to all worlds? And move this to cWorld? void cServer::Broadcast( const cPacket & a_Packet, cClientHandle* a_Exclude /* = 0 */ ) { //m_World->LockClientHandle(); @@ -239,6 +240,7 @@ void cServer::Broadcast( const cPacket & a_Packet, cClientHandle* a_Exclude /* = //m_World->UnlockClientHandle(); } +// TODO - Need to move this to cWorld I think void cServer::SendAllEntitiesTo(cClientHandle* a_Target) { cWorld* World = cRoot::Get()->GetWorld(); @@ -261,7 +263,7 @@ void cServer::StartListenClient() LOG("%s connected!", ClientIP); cClientHandle *NewHandle = new cClientHandle( SClient ); - cWorld* World = cRoot::Get()->GetWorld(); + cWorld* World = cRoot::Get()->GetWorld(); // TODO - I don't think the world cares for the client at this stage, besides for calling the tick function World->LockClientHandle(); World->AddClient( NewHandle ); World->UnlockClientHandle(); @@ -282,7 +284,7 @@ bool cServer::Tick(float a_Dt) m_Millisecondsf = m_Millisecondsf - (int)m_Millisecondsf; } - cWorld* World = cRoot::Get()->GetWorld(); + cWorld* World = cRoot::Get()->GetWorld(); // TODO - Iterate through all worlds, or give all worlds their own thread World->Tick(a_Dt); World->LockClientHandle(); @@ -440,7 +442,7 @@ void cServer::ServerCommand( const char* a_Cmd ) } if( split[0].compare( "save-all" ) == 0 ) { - cRoot::Get()->GetWorld()->SaveAllChunks(); + cRoot::Get()->GetWorld()->SaveAllChunks(); // TODO - Force ALL worlds to save their chunks return; } if( split[0].compare( "list" ) == 0 ) -- cgit v1.2.3