1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 16:17:46 +00:00
sapphire/src/servers/sapphire_zone/Session.h

77 lines
1.3 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _SESSION_H_
#define _SESSION_H_
2017-08-08 13:53:47 +02:00
#include <boost/enable_shared_from_this.hpp>
#include <boost/shared_ptr.hpp>
#include "ForwardsZone.h"
2017-08-08 13:53:47 +02:00
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 );
Network::GameConnectionPtr getZoneConnection() const;
Network::GameConnectionPtr getChatConnection() const;
int64_t getLastDataTime() const;
int64_t getLastSqlTime() const;
2017-08-08 13:53:47 +02:00
void updateLastDataTime();
2017-08-08 13:53:47 +02:00
void updateLastSqlTime();
void startReplay( const std::string& folderpath );
2017-08-08 13:53:47 +02:00
void stopReplay();
2017-08-08 13:53:47 +02:00
void processReplay();
2017-08-08 13:53:47 +02:00
void sendReplayInfo();
2018-01-08 21:42:44 +01:00
void close();
2017-08-08 13:53:47 +02:00
uint32_t getId() const;
2017-08-08 13:53:47 +02:00
bool loadPlayer();
2017-08-08 13:53:47 +02:00
void update();
2017-08-08 13:53:47 +02:00
bool isValid() const;
Entity::PlayerPtr getPlayer() const;
2017-08-08 13:53:47 +02:00
private:
uint32_t m_sessionId;
2017-08-08 13:53:47 +02:00
Entity::PlayerPtr m_pPlayer;
2017-08-08 13:53:47 +02:00
int64_t m_lastDataTime;
2017-08-08 13:53:47 +02:00
int64_t m_lastSqlTime;
bool m_isValid;
bool m_isReplaying;
std::vector< std::tuple< uint64_t, std::string > > m_replayCache;
2018-01-08 21:42:44 +01:00
Network::GameConnectionPtr m_pZoneConnection;
Network::GameConnectionPtr m_pChatConnection;
2017-08-08 13:53:47 +02:00
};
2017-08-08 13:53:47 +02:00
}
#endif