mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-17 19:22:32 +00:00
Use standard locals in storage and connection
This commit is contained in:
parent
e5d5fb07be
commit
ee7945ea54
|
|
@ -33,7 +33,7 @@ ChunkStorage *McRegionLevelStorage::createChunkStorage(Dimension *dimension)
|
||||||
std::vector<FileEntry *> *netherFiles = m_saveFile->getRegionFilesByDimension(1);
|
std::vector<FileEntry *> *netherFiles = m_saveFile->getRegionFilesByDimension(1);
|
||||||
if(netherFiles!=NULL)
|
if(netherFiles!=NULL)
|
||||||
{
|
{
|
||||||
DWORD bytesWritten = 0;
|
unsigned int bytesWritten = 0;
|
||||||
for(AUTO_VAR(it, netherFiles->begin()); it != netherFiles->end(); ++it)
|
for(AUTO_VAR(it, netherFiles->begin()); it != netherFiles->end(); ++it)
|
||||||
{
|
{
|
||||||
m_saveFile->zeroFile(*it, (*it)->getFileSize(), &bytesWritten);
|
m_saveFile->zeroFile(*it, (*it)->getFileSize(), &bytesWritten);
|
||||||
|
|
@ -100,4 +100,4 @@ void McRegionLevelStorage::saveLevelData(LevelData *levelData, std::vector<std::
|
||||||
void McRegionLevelStorage::closeAll()
|
void McRegionLevelStorage::closeAll()
|
||||||
{
|
{
|
||||||
RegionFileCache::clear();
|
RegionFileCache::clear();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -606,7 +606,7 @@ int Connection::runWrite(void* lpParam)
|
||||||
|
|
||||||
// 4J Stu - Adding this to force us to run through the writeTick at least once after the event is fired
|
// 4J Stu - Adding this to force us to run through the writeTick at least once after the event is fired
|
||||||
// Otherwise there is a race between the calling thread setting the running flag and this loop checking the condition
|
// Otherwise there is a race between the calling thread setting the running flag and this loop checking the condition
|
||||||
DWORD waitResult = WAIT_TIMEOUT;
|
unsigned int waitResult = WAIT_TIMEOUT;
|
||||||
|
|
||||||
while ((con->running || waitResult == 0 ) && ShutdownManager::ShouldRun(ShutdownManager::eConnectionWriteThreads))
|
while ((con->running || waitResult == 0 ) && ShutdownManager::ShouldRun(ShutdownManager::eConnectionWriteThreads))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue