OpenFusion/src/CNLoginServer.hpp
dongresource 651ccba932 Replace ifdef guards with #pragma once
tl;dr this has potentially significant compilation speed benefits.
2020-08-23 19:14:54 +02:00

26 lines
621 B
C++

#pragma once
#include "CNProtocol.hpp"
#include "Defines.hpp"
#include "Player.hpp"
#include <map>
struct CNLoginData {
std::map<int64_t, Player> characters;
int64_t selectedChar;
};
// WARNING: THERE CAN ONLY BE ONE OF THESE SERVERS AT A TIME!!!!!! TODO: change loginSessions & packet handlers to be non-static
class CNLoginServer : public CNServer {
private:
static void handlePacket(CNSocket* sock, CNPacketData* data);
static std::map<CNSocket*, CNLoginData> loginSessions;
public:
CNLoginServer(uint16_t p);
void newConnection(CNSocket* cns);
void killConnection(CNSocket* cns);
};