2020-08-18 20:42:30 +00:00
|
|
|
#ifndef _PM_HPP
|
|
|
|
#define _PM_HPP
|
|
|
|
|
|
|
|
#include "Player.hpp"
|
|
|
|
#include "CNProtocol.hpp"
|
|
|
|
#include "CNStructs.hpp"
|
|
|
|
#include "CNShardServer.hpp"
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <list>
|
|
|
|
|
|
|
|
struct PlayerView {
|
|
|
|
std::list<CNSocket*> viewable;
|
|
|
|
Player plr;
|
2020-08-19 01:34:39 +00:00
|
|
|
int long lastHeartbeat;
|
2020-08-18 20:42:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
namespace PlayerManager {
|
|
|
|
extern std::map<CNSocket*, PlayerView> players;
|
|
|
|
void init();
|
|
|
|
|
|
|
|
void addPlayer(CNSocket* key, Player plr);
|
|
|
|
void removePlayer(CNSocket* key);
|
|
|
|
Player getPlayer(CNSocket* key);
|
|
|
|
|
|
|
|
void updatePlayerPosition(CNSocket* sock, int X, int Y, int Z);
|
|
|
|
|
|
|
|
void enterPlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void loadPlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void movePlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void stopPlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void jumpPlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void movePlatformPlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void gotoPlayer(CNSocket* sock, CNPacketData* data);
|
|
|
|
void setSpecialPlayer(CNSocket* sock, CNPacketData* data);
|
2020-08-19 01:34:39 +00:00
|
|
|
void heartbeatPlayer(CNSocket* sock, CNPacketData* data);
|
2020-08-19 17:22:54 +00:00
|
|
|
void exitGame(CNSocket* sock, CNPacketData* data);
|
2020-08-18 20:42:30 +00:00
|
|
|
}
|
|
|
|
|
2020-08-19 17:22:54 +00:00
|
|
|
#endif
|