/home/barant/Documents/Development/BMASockets/BMAGameSession.h
#ifndef __BMAGameSession_h__
#define __BMAGameSession_h__
#include "BMASession.h"
#include "BMAGameServer.h"
class BMAGameSession : public BMASession {
public:
BMAGameSession(BMAEPoll &ePoll, BMAGameServer &server);
~BMAGameSession();
std::string playerName;
bool isAuthenticated = false;
int zoneId = 1;
std::string pos;
protected:
void protocol(std::string data) override;
void output(BMASession *session);
private:
void login(std::string data);
void sendSpawnList();
class checkAuthenticatedandInZone : public BMASessionFilter {
public:
int zoneId;
checkAuthenticatedandInZone(int zoneId) : zoneId(zoneId) {};
bool test(BMASession &session) override {
return (((BMAGameSession &)session).zoneId == zoneId) && ((BMAGameSession &)session).isAuthenticated;
}
};
};
#endif
BMAEPoll
Definition: BMAEPoll.h:29
BMASessionFilter
Definition: BMASessionFilter.h:4
BMASession
Definition: BMASession.h:18
BMAGameServer
Definition: BMAGameServer.h:9
BMAGameSession
Definition: BMAGameSession.h:7