1
0

Users file was pretty messed up with mixed unix and windows line endings. The ini failed to parse correctly under cygwin.

'Fixed' a 'bug' where MCServer would seemingly endlessly calculate lighting for an entire world (and then crash), when this entire world has 'wrong' lighting. This happens when running a converted map from Vanilla. Fixed this by only allowing a maximum of 50 chunks to recalculate their lighting per tick.
Fixed a small coding error in cChunkMap where it would check PakVersion twice, instead of also ChunkVersion.

DeNotch converter does not need the VS2010 runtime thingies anymore

git-svn-id: http://mc-server.googlecode.com/svn/trunk@138 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth 2011-12-27 22:57:33 +00:00
parent 105d69e27e
commit d57753cd68
5 changed files with 25 additions and 17 deletions

View File

@ -57,6 +57,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../zlib-1.2.5</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>

View File

@ -653,7 +653,7 @@ cChunkMap::cChunkLayer* cChunkMap::LoadLayer(int a_LayerX, int a_LayerZ )
if( fread( &PakVersion, sizeof(PakVersion), 1, f) != 1 ) { LOGERROR("ERROR 1 READING FROM FILE %s", SourceFile); fclose(f); return false; }
if( PakVersion != 1 ) { LOGERROR("WRONG PAK VERSION!"); fclose(f); return 0; }
if( fread( &ChunkVersion, sizeof(ChunkVersion), 1, f) != 1 ) { LOGERROR("ERROR 2 READING FROM FILE %s", SourceFile); fclose(f); return false; }
if( PakVersion != 1 ) { LOGERROR("WRONG CHUNK VERSION!"); fclose(f); return 0; }
if( ChunkVersion != 1 ) { LOGERROR("WRONG CHUNK VERSION!"); fclose(f); return 0; }
short NumChunks = 0;
if( fread( &NumChunks, sizeof(NumChunks), 1, f) != 1 ) { LOGERROR("ERROR 3 READING FROM FILE %s", SourceFile); fclose(f); return false; }

View File

@ -751,6 +751,7 @@ bool cPlayer::LoadFromDisk() // TODO - This should also get/set/whatever the cor
}
else
{
LOGWARN("WARNING: Failed to read ini file users.ini");
AddToGroup("Default");
}
ResolvePermissions();

View File

@ -419,13 +419,20 @@ void cWorld::Tick(float a_Dt)
LockChunks();
while( !m_pState->SpreadQueue.empty() )
int TimesSpreaded = 0;
while( !m_pState->SpreadQueue.empty() && TimesSpreaded < 50 ) // Spread a max of 50 times each tick, otherwise server will hang
{
cChunk* Chunk = (*m_pState->SpreadQueue.begin());
//LOG("Spreading: %p", Chunk );
Chunk->SpreadLight( Chunk->pGetSkyLight() );
Chunk->SpreadLight( Chunk->pGetLight() );
m_pState->SpreadQueue.remove( &*Chunk );
TimesSpreaded++;
}
if( TimesSpreaded >= 50 )
{
LOGWARN("Lots of lighting to do! At least %i chunks left!", m_pState->SpreadQueue.size() );
}
m_ChunkMap->Tick(a_Dt);

View File

@ -1,15 +1,14 @@
[FakeTruth]
Groups=Admins
[Duralex]
Groups=Admins
[Luthrandel]
Groups=Admins
[Cruisecho]
Groups=Admins
[Kwen]
Groups=Admins
[FakeTruth]
Groups=Admins
[Duralex]
Groups=Admins
[Luthrandel]
Groups=Admins
[Cruisecho]
Groups=Admins
[Kwen]
Groups=Admins