-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.h
More file actions
54 lines (44 loc) · 1.28 KB
/
user.h
File metadata and controls
54 lines (44 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef __USER_H__
#define __USER_H__
#include <iostream>
#include <string>
#include "base/fileconfig.h"
#include "base/logger.h"
#include "timerhandller.h"
#include "async_log.h"
using namespace std;
class SProxy;
class Connection; //连接
class DBMgr; //数据库
class DataCenter;
class UserMgr; //玩家管理器
class Context;
class GameUser
{
public:
GameUser(SProxy* p_proxy);
~GameUser(){};
public:
//玩家上线或连接过来统一回调该接口
void user_login(int plat_uid, const string& strIp,Connection* p_Conn);
//玩家断连统一回调该接口,清理存档玩家数据和玩家挂载子系统数据
void user_offline();
//void setStrIP(string ip) { m_strIP = ip; };
int get_userid() { return user_id; };
int get_puid() { return puid; };
string getstrIP() { return m_strIP; };
public:
//全局使用的对象,可以在各个模块按需要取用
//base::Logger* m_pLogger; //日志
AsyncSysLogger *m_pLogger;
Connection* m_pConn; //连接
DBMgr* m_pDbMgr; //数据库
FileConfig* m_pFileConf; //配置文件
UserMgr* m_pAllUsersMgr; //玩家管理器
SProxy* m_psproxy; //全局进程
private:
string m_strIP;
int user_id;
int puid;
};
#endif