Browse Source

Rename files to match code

master
Tiger Wang 1 year ago
parent
commit
34bf5c0d9d
  1. 4
      CMake/GenerateBindings.cmake
  2. 2
      CONTRIBUTING.md
  3. 4
      src/Bindings/AllToLua.pkg
  4. 2
      src/Bindings/LuaState.h
  5. 5
      src/CMakeLists.txt
  6. 6
      src/Entities/Player.cpp
  7. 2
      src/Entities/Player.h
  8. 1
      src/OSSupport/CMakeLists.txt
  9. 0
      src/OSSupport/Stopwatch.h
  10. 2
      src/Protocol/Palettes/Palette_1_13.h
  11. 2
      src/Protocol/Palettes/Palette_1_13_1.h
  12. 2
      src/Protocol/Palettes/Palette_1_14.h
  13. 2
      src/Protocol/Palettes/Palette_1_15.h
  14. 2
      src/Protocol/Palettes/Palette_1_16.h
  15. 2
      src/Protocol/Protocol_1_8.h
  16. 2
      src/Registries/CMakeLists.txt
  17. 0
      src/Registries/CustomStatistics.h
  18. 2
      src/StatisticsManager.cpp
  19. 12
      src/StatisticsManager.h
  20. 4
      src/WorldStorage/CMakeLists.txt
  21. 2
      src/WorldStorage/NamespaceSerializer.h
  22. 8
      src/WorldStorage/StatisticsSerializer.cpp
  23. 4
      src/WorldStorage/StatisticsSerializer.h
  24. 2
      tests/BlockTypeRegistry/BlockTypePaletteTest.cpp

4
CMake/GenerateBindings.cmake

@ -79,11 +79,11 @@ function(enable_bindings_generation)
Mobs/MonsterTypes.h
OSSupport/File.h
Protocol/MojangAPI.h
Registries/Statistics.h
Registries/CustomStatistics.h
Root.h
Scoreboard.h
Server.h
Statistics.h
StatisticsManager.h
StringUtils.h
UI/Window.h
UUID.h

2
CONTRIBUTING.md

@ -46,7 +46,7 @@ Here are the conventions:
- `Foo(Vector3d a_Param1, const cCuboid & a_Param2)`
- See the discussion in issue #3853
- Use the provided wrappers for OS stuff:
- Threading is done by inheriting from `cIsThread`, thread synchronization through `cCriticalSection` and `cEvent`, file access and filesystem operations through the `cFile` class, high-precision timing through `cStopWatch`
- Threading is done by inheriting from `cIsThread`, thread synchronization through `cCriticalSection` and `cEvent`, file access and filesystem operations through the `cFile` class, high-precision timing through `cStopwatch`
- No magic numbers, use named constants:
- `E_ITEM_XXX`, `E_BLOCK_XXX` and `E_META_XXX` for items and blocks.
- `cEntity::etXXX` for entity types, `cMonster::mtXXX` for mob types.

4
src/Bindings/AllToLua.pkg

@ -68,7 +68,7 @@ $cfile "../CompositeChat.h"
$cfile "../Map.h"
$cfile "../MapManager.h"
$cfile "../Scoreboard.h"
$cfile "../Statistics.h"
$cfile "../StatisticsManager.h"
$cfile "../Protocol/MojangAPI.h"
$cfile "../UUID.h"
@ -124,7 +124,7 @@ $cfile "../BlockEntities/MobSpawnerEntity.h"
$cfile "../BlockEntities/FlowerPotEntity.h"
// Registries:
$cfile "../Registries/Statistics.h"
$cfile "../Registries/CustomStatistics.h"

2
src/Bindings/LuaState.h

@ -37,7 +37,7 @@ extern "C"
#include "../Defines.h"
#include "../FunctionRef.h"
#include "../Registries/Statistics.h"
#include "../Registries/CustomStatistics.h"
#include "PluginManager.h"
#include "LuaState_Typedefs.inc"

5
src/CMakeLists.txt

@ -58,7 +58,7 @@ target_sources(
Scoreboard.cpp
Server.cpp
SpawnPrepare.cpp
Statistics.cpp
StatisticsManager.cpp
StringCompression.cpp
StringUtils.cpp
UUID.cpp
@ -138,8 +138,7 @@ target_sources(
SetChunkData.h
SettingsRepositoryInterface.h
SpawnPrepare.h
Statistics.h
Stopwatch.h
StatisticsManager.h
StringCompression.h
StringUtils.h
UUID.h

6
src/Entities/Player.cpp

@ -18,7 +18,7 @@
#include "../FastRandom.h"
#include "../ClientHandle.h"
#include "../WorldStorage/StatSerializer.h"
#include "../WorldStorage/StatisticsSerializer.h"
#include "../CompositeChat.h"
#include "../Blocks/BlockHandler.h"
@ -1925,7 +1925,7 @@ bool cPlayer::LoadFromFile(const AString & a_FileName)
{
// Load the player stats.
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
StatSerializer::Load(m_Stats, m_DefaultWorldPath, GetUUID().ToLongString());
StatisticsSerializer::Load(m_Stats, m_DefaultWorldPath, GetUUID().ToLongString());
}
catch (...)
{
@ -2059,7 +2059,7 @@ void cPlayer::SaveToDisk()
// Save the player stats.
// We use the default world name (like bukkit) because stats are shared between dimensions / worlds.
// TODO: save together with player.dat, not in some other place.
StatSerializer::Save(m_Stats, m_DefaultWorldPath, GetUUID().ToLongString());
StatisticsSerializer::Save(m_Stats, m_DefaultWorldPath, GetUUID().ToLongString());
}
catch (...)
{

2
src/Entities/Player.h

@ -7,7 +7,7 @@
#include "../World.h"
#include "../Items/ItemHandler.h"
#include "../Statistics.h"
#include "../StatisticsManager.h"
#include "../UUID.h"

1
src/OSSupport/CMakeLists.txt

@ -36,6 +36,7 @@ target_sources(
SleepResolutionBooster.h
StackTrace.h
StartAsService.h
Stopwatch.h
TCPLinkImpl.h
UDPEndpointImpl.h
WinStackWalker.h

0
src/Stopwatch.h → src/OSSupport/Stopwatch.h

2
src/Protocol/Palettes/Palette_1_13.h

@ -2,7 +2,7 @@
#include "BlockState.h"
#include "Registries/Items.h"
#include "Registries/Statistics.h"
#include "Registries/CustomStatistics.h"
namespace Palette_1_13
{

2
src/Protocol/Palettes/Palette_1_13_1.h

@ -2,7 +2,7 @@
#include "BlockState.h"
#include "Registries/Items.h"
#include "Registries/Statistics.h"
#include "Registries/CustomStatistics.h"
namespace Palette_1_13_1
{

2
src/Protocol/Palettes/Palette_1_14.h

@ -2,7 +2,7 @@
#include "BlockState.h"
#include "Registries/Items.h"
#include "Registries/Statistics.h"
#include "Registries/CustomStatistics.h"
namespace Palette_1_14
{

2
src/Protocol/Palettes/Palette_1_15.h

@ -2,7 +2,7 @@
#include "BlockState.h"
#include "Registries/Items.h"
#include "Registries/Statistics.h"
#include "Registries/CustomStatistics.h"
namespace Palette_1_15
{

2
src/Protocol/Palettes/Palette_1_16.h

@ -2,7 +2,7 @@
#include "BlockState.h"
#include "Registries/Items.h"
#include "Registries/Statistics.h"
#include "Registries/CustomStatistics.h"
namespace Palette_1_16
{

2
src/Protocol/Protocol_1_8.h

@ -15,7 +15,7 @@ Declares the 1.8 protocol classes:
#include "Protocol.h"
#include "../ByteBuffer.h"
#include "../Registries/Statistics.h"
#include "../Registries/CustomStatistics.h"
#include "../mbedTLS++/AesCfb128Decryptor.h"
#include "../mbedTLS++/AesCfb128Encryptor.h"

2
src/Registries/CMakeLists.txt

@ -5,6 +5,6 @@ target_sources(
BlockStates.h
BlockTypes.h
CustomStatistics.h
Items.h
Statistics.h
)

0
src/Registries/Statistics.h → src/Registries/CustomStatistics.h

2
src/Statistics.cpp → src/StatisticsManager.cpp

@ -3,7 +3,7 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Statistics.h"
#include "StatisticsManager.h"

12
src/Statistics.h → src/StatisticsManager.h

@ -1,10 +1,6 @@
// Statistics.h
#pragma once
#include "Registries/Statistics.h"
/* Hello fellow developer !
In case you are trying to add new statistics to Cuberite you need to do a few things:
---------------------------------------------------------------------------
@ -24,6 +20,14 @@ exported from the server https://wiki.vg/Data_Generators
#pragma once
#include "Registries/CustomStatistics.h"
/** Class that manages the statistics and achievements of a single player. */
struct StatisticsManager
{

4
src/WorldStorage/CMakeLists.txt

@ -9,7 +9,7 @@ target_sources(
NBTChunkSerializer.cpp
SchematicFileSerializer.cpp
ScoreboardSerializer.cpp
StatSerializer.cpp
StatisticsSerializer.cpp
WSSAnvil.cpp
WorldStorage.cpp
@ -21,7 +21,7 @@ target_sources(
NBTChunkSerializer.h
SchematicFileSerializer.h
ScoreboardSerializer.h
StatSerializer.h
StatisticsSerializer.h
WSSAnvil.h
WorldStorage.h
)

2
src/WorldStorage/NamespaceSerializer.h

@ -2,7 +2,7 @@
#include "Defines.h"
#include "Mobs/MonsterTypes.h"
#include "Registries/Statistics.h"
#include "Registries/CustomStatistics.h"
namespace NamespaceSerializer
{

8
src/WorldStorage/StatSerializer.cpp → src/WorldStorage/StatisticsSerializer.cpp

@ -1,10 +1,10 @@
// StatSerializer.cpp
// StatisticsSerializer.cpp
#include "Globals.h"
#include "../Statistics.h"
#include "StatSerializer.h"
#include "StatisticsManager.h"
#include "StatisticsSerializer.h"
#include "NamespaceSerializer.h"
#include <json/json.h>
@ -13,7 +13,7 @@
namespace StatSerializer
namespace StatisticsSerializer
{
static auto MakeStatisticsDirectory(const std::string & WorldPath, std::string && FileName)
{

4
src/WorldStorage/StatSerializer.h → src/WorldStorage/StatisticsSerializer.h

@ -1,5 +1,5 @@
// StatSerializer.h
// StatisticsSerializer.h
// Declares the cStatSerializer class that is used for saving stats into JSON
@ -20,7 +20,7 @@ namespace Json { class Value; }
namespace StatSerializer
namespace StatisticsSerializer
{
/* Try to load the player statistics. */
void Load(StatisticsManager & Manager, const std::string & WorldPath, std::string && FileName);

2
tests/BlockTypeRegistry/BlockTypePaletteTest.cpp

@ -1,7 +1,7 @@
#include "Globals.h"
#include "../TestHelpers.h"
#include "Bindings/BlockTypePalette.h"
#include "Stopwatch.h"
#include "OSSupport/Stopwatch.h"

Loading…
Cancel
Save