mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-30 21:56:44 +00:00
cleanup: flatten dead branches in world io level network and stats
This commit is contained in:
@@ -444,7 +444,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData,
|
||||
// save file at a time, and the pages should be decommitted in the dtor, so
|
||||
// pages committed should always be zero at this point.
|
||||
if (pagesCommitted != 0) {
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
__debugbreak();
|
||||
#endif
|
||||
}
|
||||
@@ -455,7 +455,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData,
|
||||
void* pvRet = VirtualAlloc(pvHeap, pagesRequired * CSF_PAGE_SIZE,
|
||||
COMMIT_ALLOCATION, PAGE_READWRITE);
|
||||
if (pvRet == NULL) {
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
// Out of physical memory
|
||||
__debugbreak();
|
||||
#endif
|
||||
@@ -516,7 +516,7 @@ void ConsoleSaveFileSplit::_init(const std::wstring& fileName, void* pvSaveData,
|
||||
// Corrupt save, although most of the terrain should
|
||||
// actually be ok
|
||||
app.DebugPrintf("Failed to decompress save data!\n");
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
__debugbreak();
|
||||
#endif
|
||||
ZeroMemory(pvSaveMem, fileSize);
|
||||
@@ -541,11 +541,6 @@ ConsoleSaveFileSplit::~ConsoleSaveFileSplit() {
|
||||
pagesCommitted = 0;
|
||||
// Make sure we don't have any thumbnail data still waiting round - we can't
|
||||
// need it now we've destroyed the save file anyway
|
||||
#if 0
|
||||
app.GetSaveThumbnail(NULL, NULL);
|
||||
#elif 0
|
||||
app.GetSaveThumbnail(NULL, NULL, NULL, NULL);
|
||||
#endif
|
||||
|
||||
for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) {
|
||||
delete it->second;
|
||||
@@ -962,7 +957,7 @@ void ConsoleSaveFileSplit::tick() {
|
||||
|
||||
writeRequired = true;
|
||||
}
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
{
|
||||
unsigned int totalDirty = 0;
|
||||
unsigned int totalDirtyBytes = 0;
|
||||
@@ -976,16 +971,6 @@ void ConsoleSaveFileSplit::tick() {
|
||||
totalDirtyBytes += it->second->fileEntry->getFileSize();
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
PIXReportCounter(L"Dirty regions", (float)totalDirty);
|
||||
PIXReportCounter(L"Dirty MB", (float)totalDirtyBytes / (1024 * 1024));
|
||||
PIXReportCounter(L"Dirty oldest age",
|
||||
((float)currentTime - oldestDirty));
|
||||
PIXReportCounter(L"Region writing bandwidth",
|
||||
((float)bytesInTimePeriod /
|
||||
WRITE_BANDWIDTH_MEASUREMENT_PERIOD_SECONDS) /
|
||||
(1024 * 1024));
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1231,22 +1216,6 @@ std::wstring ConsoleSaveFileSplit::GetNameFromNumericIdentifier(
|
||||
// Compress any dirty region files, and tell the storage manager about them so
|
||||
// that it will process them when we ask it to save sub files
|
||||
void ConsoleSaveFileSplit::processSubfilesForWrite() {
|
||||
#if 0
|
||||
// 4J Stu - There are debug reasons where we want to force a save of all regions
|
||||
StorageManager.ResetSubfiles();
|
||||
for(AUTO_VAR(it,regionFiles.begin()); it != regionFiles.end(); it++ )
|
||||
{
|
||||
RegionFileReference* region = it->second;
|
||||
int index = StorageManager.AddSubfile(region->fileEntry->data.regionIndex);
|
||||
//if( region->dirty )
|
||||
{
|
||||
region->Compress();
|
||||
StorageManager.UpdateSubfile(index, region->dataCompressed, region->dataCompressedSize);
|
||||
region->dirty = false;
|
||||
region->lastWritten = System::currentTimeMillis();
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++) {
|
||||
RegionFileReference* region = it->second;
|
||||
if (region->dirty) {
|
||||
@@ -1257,7 +1226,6 @@ void ConsoleSaveFileSplit::processSubfilesForWrite() {
|
||||
region->lastWritten = System::currentTimeMillis();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Clean up any memory allocated for compressed data when we have finished
|
||||
@@ -1282,20 +1250,10 @@ bool ConsoleSaveFileSplit::doesFileExist(ConsoleSavePath file) {
|
||||
void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
|
||||
LockSaveAccess();
|
||||
|
||||
#if 0
|
||||
MinecraftServer* server = MinecraftServer::getInstance();
|
||||
#endif
|
||||
|
||||
// The storage manage might potentially be busy doing a sub-file write
|
||||
// initiated from the tick. Wait until this is totally processed.
|
||||
while (StorageManager.GetSaveState() != C4JStorage::ESaveGame_Idle) {
|
||||
#if 0
|
||||
if (server && server->IsSuspending()) {
|
||||
// If the server is mid-suspend we need to tick the storage manager
|
||||
// ourselves
|
||||
StorageManager.Tick();
|
||||
}
|
||||
#endif
|
||||
|
||||
app.DebugPrintf("Flush wait\n");
|
||||
Sleep(10);
|
||||
@@ -1387,12 +1345,6 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
|
||||
std::uint8_t* pbDataSaveImage = NULL;
|
||||
unsigned int dwDataSizeSaveImage = 0;
|
||||
|
||||
#if (0 || 0)
|
||||
app.GetSaveThumbnail(&pbThumbnailData, &dwThumbnailDataSize);
|
||||
#elif (0 || 0)
|
||||
app.GetSaveThumbnail(&pbThumbnailData, &dwThumbnailDataSize,
|
||||
&pbDataSaveImage, &dwDataSizeSaveImage);
|
||||
#endif
|
||||
|
||||
std::uint8_t bTextMetadata[88];
|
||||
ZeroMemory(bTextMetadata, 88);
|
||||
@@ -1429,7 +1381,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) {
|
||||
// save the data
|
||||
StorageManager.SaveSaveData(&ConsoleSaveFileSplit::SaveSaveDataCallback,
|
||||
this);
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
if (app.DebugSettingsOn()) {
|
||||
if (app.GetWriteSavesToFolderEnabled()) {
|
||||
DebugFlushToFile(compData, compLength + 8);
|
||||
@@ -1462,7 +1414,7 @@ int ConsoleSaveFileSplit::SaveRegionFilesCallback(void* lpParam, bool bRes) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
#if !defined(_CONTENT_PACKAGE)
|
||||
void ConsoleSaveFileSplit::DebugFlushToFile(
|
||||
void* compressedData /*= NULL*/, unsigned int compressedDataSize /*= 0*/) {
|
||||
LockSaveAccess();
|
||||
@@ -1546,19 +1498,6 @@ std::vector<FileEntry*>* ConsoleSaveFileSplit::getRegionFilesByDimension(
|
||||
return files;
|
||||
}
|
||||
|
||||
#if 0 || 0
|
||||
std::wstring ConsoleSaveFileSplit::getPlayerDataFilenameForLoad(
|
||||
const PlayerUID& pUID) {
|
||||
return header.getPlayerDataFilenameForLoad(pUID);
|
||||
}
|
||||
std::wstring ConsoleSaveFileSplit::getPlayerDataFilenameForSave(
|
||||
const PlayerUID& pUID) {
|
||||
return header.getPlayerDataFilenameForSave(pUID);
|
||||
}
|
||||
std::vector<FileEntry*>* ConsoleSaveFileSplit::getValidPlayerDatFiles() {
|
||||
return header.getValidPlayerDatFiles();
|
||||
}
|
||||
#endif
|
||||
|
||||
int ConsoleSaveFileSplit::getSaveVersion() { return header.getSaveVersion(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user