New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made world data paths adjustable, and added API to temporarily disable saving chunks to disk. #3912
Changes from 10 commits
b8c1e36
294a75f
6c701f0
bf7fcd3
1f39e2d
4604e1e
0a5c28d
a8d1d9a
aba3547
84f471f
73084a2
34bf661
7e03403
6faaa38
6459097
def0594
c1b7098
34fb313
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,6 +137,9 @@ class cRoot | |
/** Saves all chunks in all worlds */ | ||
void SaveAllChunks(void); // tolua_export | ||
|
||
/** Sets whether saving chunks is enabled */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
void SetSavingEnabled(bool a_SavingEnabled); // tolua_export | ||
|
||
/** Calls the callback for each player in all worlds */ | ||
bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS << | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
#include "ChunkSender.h" | ||
#include "Defines.h" | ||
#include "LightingThread.h" | ||
#include "IniFile.h" | ||
#include "Item.h" | ||
#include "Mobs/Monster.h" | ||
#include "Entities/ProjectileEntity.h" | ||
|
@@ -111,6 +112,12 @@ class cWorld : | |
|
||
// tolua_begin | ||
|
||
/** Get whether saving chunks is enabled */ | ||
bool GetSavingEnabled(void) const { return m_SavingEnabled; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename to |
||
|
||
/** Set whether saving chunks is enabled */ | ||
void SetSavingEnabled(bool a_SavingEnabled) { m_SavingEnabled = a_SavingEnabled; } | ||
|
||
int GetTicksUntilWeatherChange(void) const { return m_WeatherInterval; } | ||
|
||
/** Is the daylight cycle enabled? */ | ||
|
@@ -630,6 +637,9 @@ class cWorld : | |
/** Returns the name of the world */ | ||
const AString & GetName(void) const { return m_WorldName; } | ||
|
||
/** Returns the data path to the world data */ | ||
const AString & GetDataPath(void) const { return m_DataPath; } | ||
|
||
/** Returns the name of the world.ini file used by this world */ | ||
const AString & GetIniFileName(void) const {return m_IniFileName; } | ||
|
||
|
@@ -871,6 +881,9 @@ class cWorld : | |
|
||
AString m_WorldName; | ||
|
||
/** The path to the root directory for the world files */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
AString m_DataPath; | ||
|
||
/** The name of the overworld that portals in this world should link to. | ||
Only has effect if this world is a Nether or End world. */ | ||
AString m_LinkedOverworldName; | ||
|
@@ -882,6 +895,9 @@ class cWorld : | |
|
||
int m_StorageCompressionFactor; | ||
|
||
/** Whether or not writing chunks to disk is currently enabled */ | ||
std::atomic<bool> m_SavingEnabled; | ||
|
||
/** The dimension of the world, used by the client to provide correct lighting scheme */ | ||
eDimension m_Dimension; | ||
|
||
|
@@ -1036,7 +1052,7 @@ class cWorld : | |
cSetChunkDataPtrs m_SetChunkDataQueue; | ||
|
||
|
||
cWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_LinkedOverworldName = ""); | ||
cWorld(const AString & a_WorldName, const AString & a_DataPath, eDimension a_Dimension = dimOverworld, const AString & a_LinkedOverworldName = ""); | ||
virtual ~cWorld() override; | ||
|
||
void Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_LastTickDurationMSec); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adversely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Today I learned.