[refactor] Mark all internal functions static

All packet handlers and helper functions that are only used in the
source file they're declared in have been taken out of the namespaces in
the corresponding header files, have been marked static, and have been
reordered to avoid the need for declarations at the top of each source
file.

Each source file now contains a "using namespace" directive so that the
static functions don't need to prefix the source file's symbols with
their namespace. All redundant namespace prefixes found have been
removed.

An unused nano power resetting function in NanoManager has been removed.
This commit is contained in:
2021-03-16 22:06:10 +01:00
parent 04c56ce426
commit cee09f6344
36 changed files with 1808 additions and 1957 deletions

View File

@@ -22,14 +22,8 @@ enum {
};
namespace ChunkManager {
void init();
void cleanup();
extern std::map<ChunkPos, Chunk*> chunks;
void newChunk(ChunkPos pos);
void deleteChunk(ChunkPos pos);
void updatePlayerChunk(CNSocket* sock, ChunkPos from, ChunkPos to);
void updateNPCChunk(int32_t id, ChunkPos from, ChunkPos to);
@@ -44,13 +38,10 @@ namespace ChunkManager {
void removeNPCFromChunks(std::set<Chunk*> chnks, int32_t id);
bool chunkExists(ChunkPos chunk);
void emptyChunk(ChunkPos chunkPos);
ChunkPos chunkPosAt(int posX, int posY, uint64_t instanceID);
std::set<Chunk*> getViewableChunks(ChunkPos chunkPos);
std::vector<ChunkPos> getChunksInMap(uint64_t mapNum);
bool inPopulatedChunks(std::set<Chunk*>* chnks);
void createInstance(uint64_t);
void destroyInstance(uint64_t);
void destroyInstanceIfEmpty(uint64_t);
}