mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-09-28 18:57:35 +00:00
huge refactoring, chunking added
This commit is contained in:
@@ -4,15 +4,17 @@
|
||||
#include "CNProtocol.hpp"
|
||||
#include "CNStructs.hpp"
|
||||
#include "CNShardServer.hpp"
|
||||
#include "ChunkManager.hpp"
|
||||
|
||||
#include <utility>
|
||||
#include <map>
|
||||
#include <list>
|
||||
|
||||
struct WarpLocation;
|
||||
|
||||
struct PlayerView {
|
||||
std::list<CNSocket*> viewable;
|
||||
std::list<int32_t> viewableNPCs;
|
||||
std::pair<int, int> chunkPos;
|
||||
std::vector<Chunk*> currentChunks;
|
||||
Player *plr;
|
||||
time_t lastHeartbeat;
|
||||
};
|
||||
@@ -25,9 +27,13 @@ namespace PlayerManager {
|
||||
void addPlayer(CNSocket* key, Player plr);
|
||||
void removePlayer(CNSocket* key);
|
||||
|
||||
void removePlayerFromChunks(std::vector<Chunk*> chunks, CNSocket* sock);
|
||||
void addPlayerToChunks(std::vector<Chunk*> chunks, CNSocket* sock);
|
||||
|
||||
void updatePlayerPosition(CNSocket* sock, int X, int Y, int Z);
|
||||
void updatePlayerPosition(CNSocket* sock, int X, int Y, int Z, int angle);
|
||||
std::list<CNSocket*> getNearbyPlayers(int X, int Y, int dist);
|
||||
|
||||
void sendToViewable(CNSocket* sock, void* buf, uint32_t type, size_t size);
|
||||
|
||||
void enterPlayer(CNSocket* sock, CNPacketData* data);
|
||||
void loadPlayer(CNSocket* sock, CNPacketData* data);
|
||||
|
Reference in New Issue
Block a user