-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOuterFactoryImp.h
More file actions
126 lines (101 loc) · 2.59 KB
/
Copy pathOuterFactoryImp.h
File metadata and controls
126 lines (101 loc) · 2.59 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef _OUTER_FACTORY_IMP_H_
#define _OUTER_FACTORY_IMP_H_
#include <string>
#include <map>
#include "servant/Application.h"
#include "globe.h"
#include "OuterFactory.h"
#include "util/tc_hash_fun.h"
//wbl
#include <wbl/regex_util.h>
//配置服务
#include "ConfigServant.h"
#include "DBAgentServant.h"
#include "ActivityServant.h"
//
using namespace config;
using namespace dataproxy;
using namespace dbagent;
using namespace activity;
//
#define ONE_DAY_TIME (24*60*60)
#define ZONE_TIME_OFFSET (8*60*60)
//
class OuterFactoryImp;
typedef TC_AutoPtr<OuterFactoryImp> OuterFactoryImpPtr;
/**
* 外部工具接口对象工厂
*/
class OuterFactoryImp : public OuterFactory
{
private:
/**
*
*/
OuterFactoryImp();
/**
*
*/
~OuterFactoryImp();
///
friend class GameRecordServantImp;
friend class GameRecordServer;
public:
//框架中用到的outer接口(不能修改):
const OuterProxyFactoryPtr &getProxyFactory() const
{
return _pProxyFactory;
}
tars::TC_Config &getConfig() const
{
return *_pFileConf;
}
public:
//读取所有配置
void load();
//代理配置
void readPrxConfig();
//打印代理配置
void printPrxConfig();
private:
/**
*
*/
void createAllObject();
/**
*
*/
void deleteAllObject();
public:
//游戏配置服务代理
const ConfigServantPrx getConfigServantPrx();
//数据库代理服务代理
const DBAgentServantPrx getDBAgentServantPrx(const long uid);
//数据库代理服务代理
const DBAgentServantPrx getDBAgentServantPrx(const string key);
const ActivityServantPrx getActivityServantPrx(const long uid);
public:
//格式化时间
string GetTimeFormat();
private:
//拆分字符串成整形
int splitInt(string szSrc, vector<int> &vecInt);
private:
wbl::ReadWriteLocker m_rwlock; //读写锁,防止脏读
private:
//框架用到的共享对象(不能修改):
tars::TC_Config *_pFileConf;
OuterProxyFactoryPtr _pProxyFactory;
private:
//游戏配置服务
std::string _ConfigServantObj;
ConfigServantPrx _ConfigServerPrx;
//数据库代理服务
std::string _DBAgentServantObj;
DBAgentServantPrx _DBAgentServerPrx;
// ActivityServer的对象名称
std::string _ActivityServantObj;
activity::ActivityServantPrx _ActivityServantPrx;
};
////////////////////////////////////////////////////////////////////////////////
#endif