1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00
sapphire/src/servers/Server_Zone/Session.h

60 lines
1 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _SESSION_H_
#define _SESSION_H_
#include <boost/enable_shared_from_this.hpp>
#include <boost/shared_ptr.hpp>
#include "Forwards.h"
namespace Core {
class Session : public boost::enable_shared_from_this< Session >
{
public:
Session( uint32_t sessionId );
~Session();
void setZoneConnection( Network::GameConnectionPtr zoneCon );
void setChatConnection( Network::GameConnectionPtr chatCon );
2017-08-08 13:53:47 +02:00
Network::GameConnectionPtr getZoneConnection() const;
Network::GameConnectionPtr getChatConnection() const;
2017-08-08 13:53:47 +02:00
uint32_t getLastDataTime() const;
void updateLastDataTime();
void close();
uint32_t getId() const;
bool loadPlayer();
void update();
bool isValid() const;
2017-08-08 13:53:47 +02:00
Entity::PlayerPtr getPlayer() const;
private:
uint32_t m_sessionId;
Entity::PlayerPtr m_pPlayer;
uint32_t m_lastDataTime;
bool m_isValid;
2017-08-08 13:53:47 +02:00
Network::GameConnectionPtr m_pZoneConnection;
Network::GameConnectionPtr m_pChatConnection;
2017-08-08 13:53:47 +02:00
};
}
#endif