summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-07-31 16:49:10 +0200
committerMattes D <github@xoft.cz>2015-07-31 16:49:10 +0200
commit6e4122e551eeb41d3e950b363dd837d5586fe560 (patch)
treeb5ee221d8a8e63c7d3b7868da1db19bf717a6ffd /src/WorldStorage
parentMerge pull request #2400 from cuberite/OffloadBadChunks (diff)
downloadcuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.tar
cuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.tar.gz
cuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.tar.bz2
cuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.tar.lz
cuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.tar.xz
cuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.tar.zst
cuberite-6e4122e551eeb41d3e950b363dd837d5586fe560.zip
Diffstat (limited to 'src/WorldStorage')
-rw-r--r--src/WorldStorage/EnchantmentSerializer.h12
-rw-r--r--src/WorldStorage/NBTChunkSerializer.h9
-rw-r--r--src/WorldStorage/ScoreboardSerializer.h4
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp2
-rw-r--r--src/WorldStorage/WorldStorage.cpp2
-rw-r--r--src/WorldStorage/WorldStorage.h21
6 files changed, 29 insertions, 21 deletions
diff --git a/src/WorldStorage/EnchantmentSerializer.h b/src/WorldStorage/EnchantmentSerializer.h
index 7d6546aad..5c12e01bc 100644
--- a/src/WorldStorage/EnchantmentSerializer.h
+++ b/src/WorldStorage/EnchantmentSerializer.h
@@ -5,13 +5,21 @@ class cEnchantments;
class cFastNBTWriter;
class cParsedNBT;
+
+
+
+
namespace EnchantmentSerializer
{
- /// Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments")
+ /** Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments") */
void WriteToNBTCompound(const cEnchantments & a_Enchantments, cFastNBTWriter & a_Writer, const AString & a_ListTagName);
- /// Reads the enchantments from the specified NBT list tag (ench or StoredEnchantments)
+ /** Reads the enchantments from the specified NBT list tag (ench or StoredEnchantments) */
void ParseFromNBT(cEnchantments & a_Enchantments, const cParsedNBT & a_NBT, int a_EnchListTagIdx);
};
+
+
+
+
diff --git a/src/WorldStorage/NBTChunkSerializer.h b/src/WorldStorage/NBTChunkSerializer.h
index f30cd59d5..956738911 100644
--- a/src/WorldStorage/NBTChunkSerializer.h
+++ b/src/WorldStorage/NBTChunkSerializer.h
@@ -67,7 +67,7 @@ public:
cNBTChunkSerializer(cFastNBTWriter & a_Writer);
- /// Close NBT tags that we've opened
+ /** Close NBT tags that we've opened */
void Finish(void);
bool IsLightValid(void) const {return m_IsLightValid; }
@@ -78,8 +78,7 @@ protected:
- m_BlockTypes[]
- m_BlockMetas[]
- m_BlockLight[]
- - m_BlockSkyLight[]
- */
+ - m_BlockSkyLight[] */
cFastNBTWriter & m_Writer;
@@ -89,10 +88,10 @@ protected:
bool m_IsLightValid; // True if the chunk lighting is valid
- /// Writes an item into the writer, if slot >= 0, adds the Slot tag. The compound is named as requested.
+ /** Writes an item into the writer, if slot >= 0, adds the Slot tag. The compound is named as requested. */
void AddItem(const cItem & a_Item, int a_Slot, const AString & a_CompoundName = "");
- /// Writes an item grid into the writer; begins the stored slot numbers with a_BeginSlotNum. Note that it doesn't begin nor end the list tag
+ /** Writes an item grid into the writer; begins the stored slot numbers with a_BeginSlotNum. Note that it doesn't begin nor end the list tag */
void AddItemGrid(const cItemGrid & a_Grid, int a_BeginSlotNum = 0);
// Block entities:
diff --git a/src/WorldStorage/ScoreboardSerializer.h b/src/WorldStorage/ScoreboardSerializer.h
index f9065b35f..8b3a2c8b6 100644
--- a/src/WorldStorage/ScoreboardSerializer.h
+++ b/src/WorldStorage/ScoreboardSerializer.h
@@ -27,10 +27,10 @@ public:
cScoreboardSerializer(const AString & a_WorldName, cScoreboard * a_ScoreBoard);
- /// Try to load the scoreboard
+ /** Try to load the scoreboard */
bool Load(void);
- /// Try to save the scoreboard
+ /** Try to save the scoreboard */
bool Save(void);
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 4eb10fcc8..dc1b7faff 100755
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -1585,7 +1585,7 @@ void cWSSAnvil::LoadFallingBlockFromNBT(cEntityList & a_Entities, const cParsedN
return;
}
- int Type = a_NBT.GetInt(TypeIdx);
+ BLOCKTYPE Type = static_cast<BLOCKTYPE>(a_NBT.GetInt(TypeIdx));
NIBBLETYPE Meta = static_cast<NIBBLETYPE>(a_NBT.GetByte(MetaIdx));
std::unique_ptr<cFallingBlock> FallingBlock = cpp14::make_unique<cFallingBlock>(Vector3i(0, 0, 0), Type, Meta);
diff --git a/src/WorldStorage/WorldStorage.cpp b/src/WorldStorage/WorldStorage.cpp
index 7e6cadb7e..19fc2be56 100644
--- a/src/WorldStorage/WorldStorage.cpp
+++ b/src/WorldStorage/WorldStorage.cpp
@@ -16,7 +16,7 @@
-/// Example storage schema - forgets all chunks ;)
+/** Example storage schema - forgets all chunks */
class cWSSForgetful :
public cWSSchema
{
diff --git a/src/WorldStorage/WorldStorage.h b/src/WorldStorage/WorldStorage.h
index e9ba2a8e2..70cca9031 100644
--- a/src/WorldStorage/WorldStorage.h
+++ b/src/WorldStorage/WorldStorage.h
@@ -31,7 +31,7 @@ typedef cQueue<cChunkCoordsWithCallback> cChunkCoordsQueue;
-/// Interface that all the world storage schemas need to implement
+/** Interface that all the world storage schemas need to implement */
class cWSSchema abstract
{
public:
@@ -53,7 +53,7 @@ typedef std::list<cWSSchema *> cWSSchemaList;
-/// The actual world storage class
+/** The actual world storage class */
class cWorldStorage :
public cIsThread
{
@@ -87,26 +87,27 @@ protected:
cChunkCoordsQueue m_LoadQueue;
cChunkCoordsQueue m_SaveQueue;
- /// All the storage schemas (all used for loading)
+ /** All the storage schemas (all used for loading) */
cWSSchemaList m_Schemas;
- /// The one storage schema used for saving
- cWSSchema * m_SaveSchema;
+ /** The one storage schema used for saving */
+ cWSSchema * m_SaveSchema;
+
+ /** Set when there's any addition to the queues */
+ cEvent m_Event;
- /// Loads the chunk specified; returns true on success, false on failure
+ /** Loads the chunk specified; returns true on success, false on failure */
bool LoadChunk(int a_ChunkX, int a_ChunkZ);
void InitSchemas(int a_StorageCompressionFactor);
virtual void Execute(void) override;
- cEvent m_Event; // Set when there's any addition to the queues
-
- /// Loads one chunk from the queue (if any queued); returns true if there are more chunks in the load queue
+ /** Loads one chunk from the queue (if any queued); returns true if there are more chunks in the load queue */
bool LoadOneChunk(void);
- /// Saves one chunk from the queue (if any queued); returns true if there are more chunks in the save queue
+ /** Saves one chunk from the queue (if any queued); returns true if there are more chunks in the save queue */
bool SaveOneChunk(void);
} ;