41 lines
826 B
C++
41 lines
826 B
C++
#pragma once
|
|
|
|
namespace cs
|
|
{
|
|
class CMAuthSession;
|
|
class CMCharEnum;
|
|
}
|
|
|
|
struct TempSession
|
|
{
|
|
int account_id = 0;
|
|
};
|
|
|
|
class Player;
|
|
class PlayerMgr : public a8::Singleton<PlayerMgr>
|
|
{
|
|
public:
|
|
enum { HID = HID_PlayerMgr };
|
|
|
|
private:
|
|
PlayerMgr() {};
|
|
friend class a8::Singleton<PlayerMgr>;
|
|
|
|
public:
|
|
void Init();
|
|
void UnInit();
|
|
|
|
void _CMAuthSession(f8::MsgHdr& hdr, const cs::CMAuthSession& msg);
|
|
void _CMCharEnum(f8::MsgHdr& hdr, const cs::CMCharEnum& msg);
|
|
|
|
int OnlineNum();
|
|
Player* GetPlayerBySocket(int socket);
|
|
void OnClientDisconnect(a8::XParams& param);
|
|
void RemovePlayerBySocket(int socket_handle);
|
|
TempSession* GetTempSessionBySocket(int socket_handle);
|
|
|
|
private:
|
|
std::map<int, Player*> socket_hash_;
|
|
std::map<int, TempSession*> tmp_session_hash_;
|
|
};
|