移除python依赖
This commit is contained in:
parent
de22262a6c
commit
d259d03d2a
@ -10,9 +10,9 @@ include_directories(
|
|||||||
../../third_party/a8engine
|
../../third_party/a8engine
|
||||||
/usr/include/mysql
|
/usr/include/mysql
|
||||||
/usr/include/jsoncpp
|
/usr/include/jsoncpp
|
||||||
/usr/include/python3.4m
|
|
||||||
/usr/include/hiredis
|
/usr/include/hiredis
|
||||||
../../third_party
|
../../third_party
|
||||||
|
.
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(
|
link_directories(
|
||||||
@ -60,7 +60,6 @@ target_link_libraries(
|
|||||||
rt
|
rt
|
||||||
crypto
|
crypto
|
||||||
ssl
|
ssl
|
||||||
python3.4m
|
|
||||||
jsoncpp
|
jsoncpp
|
||||||
curl
|
curl
|
||||||
hiredis
|
hiredis
|
||||||
|
@ -21,10 +21,10 @@ public:
|
|||||||
//packagelen + msgid + magiccode + msgbody
|
//packagelen + msgid + magiccode + msgbody
|
||||||
//2 + 2 + 4+ xx + \0 + xx
|
//2 + 2 + 4+ xx + \0 + xx
|
||||||
bool warning = false;
|
bool warning = false;
|
||||||
while (buflen - offset >= sizeof(PackHead)) {
|
while (buflen - offset >= sizeof(f8::PackHead)) {
|
||||||
PackHead* p = (PackHead*)&buf[offset];
|
f8::PackHead* p = (f8::PackHead*)&buf[offset];
|
||||||
if (p->magic_code == MAGIC_CODE) {
|
if (p->magic_code == f8::MAGIC_CODE) {
|
||||||
if (buflen - offset < sizeof(PackHead) + p->packlen) {
|
if (buflen - offset < sizeof(f8::PackHead) + p->packlen) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
App::Instance()->AddSocketMsg(SF_GameServer,
|
App::Instance()->AddSocketMsg(SF_GameServer,
|
||||||
@ -32,9 +32,9 @@ public:
|
|||||||
saddr,
|
saddr,
|
||||||
p->msgid,
|
p->msgid,
|
||||||
p->seqid,
|
p->seqid,
|
||||||
&buf[offset + sizeof(PackHead)],
|
&buf[offset + sizeof(f8::PackHead)],
|
||||||
p->packlen);
|
p->packlen);
|
||||||
offset += sizeof(PackHead) + p->packlen;
|
offset += sizeof(f8::PackHead) + p->packlen;
|
||||||
} else {
|
} else {
|
||||||
warning = true;
|
warning = true;
|
||||||
offset++;
|
offset++;
|
||||||
@ -94,20 +94,20 @@ void GSListener::UnInit()
|
|||||||
tcp_listener_ = nullptr;
|
tcp_listener_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSListener::ForwardTargetConnMsg(MsgHdr& hdr)
|
void GSListener::ForwardTargetConnMsg(f8::MsgHdr& hdr)
|
||||||
{
|
{
|
||||||
char* buff = (char*)malloc(sizeof(PackHead) + hdr.buflen);
|
char* buff = (char*)malloc(sizeof(f8::PackHead) + hdr.buflen);
|
||||||
PackHead* head = (PackHead*)buff;
|
f8::PackHead* head = (f8::PackHead*)buff;
|
||||||
head->packlen = hdr.buflen;
|
head->packlen = hdr.buflen;
|
||||||
head->msgid = hdr.msgid;
|
head->msgid = hdr.msgid;
|
||||||
head->seqid = hdr.seqid;
|
head->seqid = hdr.seqid;
|
||||||
head->magic_code = MAGIC_CODE;
|
head->magic_code = f8::MAGIC_CODE;
|
||||||
head->rpc_error_code = 0;
|
head->rpc_error_code = 0;
|
||||||
if (hdr.buflen > 0) {
|
if (hdr.buflen > 0) {
|
||||||
memmove(buff + sizeof(PackHead), hdr.buf, hdr.buflen);
|
memmove(buff + sizeof(f8::PackHead), hdr.buf, hdr.buflen);
|
||||||
}
|
}
|
||||||
|
|
||||||
tcp_listener_->SendClientMsg(hdr.socket_handle, buff, sizeof(PackHead) + head->packlen);
|
tcp_listener_->SendClientMsg(hdr.socket_handle, buff, sizeof(f8::PackHead) + head->packlen);
|
||||||
free(buff);
|
free(buff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +22,11 @@ class GSListener : public a8::Singleton<GSListener>
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void SendMsg(unsigned short socket_handle, T& msg)
|
void SendMsg(unsigned short socket_handle, T& msg)
|
||||||
{
|
{
|
||||||
static int msgid = ::Net_GetMessageId(msg);
|
static int msgid = ::f8::Net_GetMessageId(msg);
|
||||||
Net_SendMsg(tcp_listener_, socket_handle, 0, msgid, msg);
|
f8::Net_SendMsg(tcp_listener_, socket_handle, 0, msgid, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ForwardTargetConnMsg(MsgHdr& hdr);
|
void ForwardTargetConnMsg(f8::MsgHdr& hdr);
|
||||||
void SendText(unsigned short sockhandle, const std::string& text);
|
void SendText(unsigned short sockhandle, const std::string& text);
|
||||||
|
|
||||||
void ForceCloseClient(unsigned short sockhandle);
|
void ForceCloseClient(unsigned short sockhandle);
|
||||||
|
@ -271,7 +271,7 @@ void App::DispatchMsg()
|
|||||||
msg_mutex_->unlock();
|
msg_mutex_->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgHdr hdr;
|
f8::MsgHdr hdr;
|
||||||
while (work_node_) {
|
while (work_node_) {
|
||||||
MsgNode *pdelnode = work_node_;
|
MsgNode *pdelnode = work_node_;
|
||||||
work_node_ = pdelnode->next;
|
work_node_ = pdelnode->next;
|
||||||
@ -304,10 +304,10 @@ void App::DispatchMsg()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::ProcessGSMsg(MsgHdr& hdr)
|
void App::ProcessGSMsg(f8::MsgHdr& hdr)
|
||||||
{
|
{
|
||||||
NetMsgHandler* handler = GetNetMsgHandler(&HandlerMgr::Instance()->gsmsghandler,
|
f8::NetMsgHandler* handler = GetNetMsgHandler(&HandlerMgr::Instance()->gsmsghandler,
|
||||||
hdr.msgid);
|
hdr.msgid);
|
||||||
if (handler) {
|
if (handler) {
|
||||||
switch (handler->handlerid) {
|
switch (handler->handlerid) {
|
||||||
case HID_DBPool:
|
case HID_DBPool:
|
||||||
|
@ -41,7 +41,7 @@ private:
|
|||||||
void DispatchMsg();
|
void DispatchMsg();
|
||||||
void ProcessIMMsg();
|
void ProcessIMMsg();
|
||||||
|
|
||||||
void ProcessGSMsg(MsgHdr& hdr);
|
void ProcessGSMsg(f8::MsgHdr& hdr);
|
||||||
|
|
||||||
void InitLog();
|
void InitLog();
|
||||||
void UnInitLog();
|
void UnInitLog();
|
||||||
|
@ -229,13 +229,13 @@ void DBPool::Update()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBPool::_SS_Ping(MsgHdr& hdr, const ss::SS_Ping& msg)
|
void DBPool::_SS_Ping(f8::MsgHdr& hdr, const ss::SS_Ping& msg)
|
||||||
{
|
{
|
||||||
ss::SS_Pong respmsg;
|
ss::SS_Pong respmsg;
|
||||||
GSListener::Instance()->SendMsg(hdr.socket_handle, respmsg);
|
GSListener::Instance()->SendMsg(hdr.socket_handle, respmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBPool::_SS_GSM_ExecAsyncSql(MsgHdr& hdr, const ss::SS_GSM_ExecAsyncSql& msg)
|
void DBPool::_SS_GSM_ExecAsyncSql(f8::MsgHdr& hdr, const ss::SS_GSM_ExecAsyncSql& msg)
|
||||||
{
|
{
|
||||||
DBThread *db_thread = db_single_thread_;
|
DBThread *db_thread = db_single_thread_;
|
||||||
switch (msg.exec_type()) {
|
switch (msg.exec_type()) {
|
||||||
|
@ -21,9 +21,9 @@ class DBPool : public a8::Singleton<DBPool>
|
|||||||
void UnInit();
|
void UnInit();
|
||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
void _SS_Ping(MsgHdr& hdr, const ss::SS_Ping& msg);
|
void _SS_Ping(f8::MsgHdr& hdr, const ss::SS_Ping& msg);
|
||||||
|
|
||||||
void _SS_GSM_ExecAsyncSql(MsgHdr& hdr, const ss::SS_GSM_ExecAsyncSql& msg);
|
void _SS_GSM_ExecAsyncSql(f8::MsgHdr& hdr, const ss::SS_GSM_ExecAsyncSql& msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class HandlerMgr : public a8::Singleton<HandlerMgr>
|
|||||||
void Init();
|
void Init();
|
||||||
void UnInit();
|
void UnInit();
|
||||||
|
|
||||||
NetMsgHandlerObject gsmsghandler;
|
f8::NetMsgHandlerObject gsmsghandler;
|
||||||
|
|
||||||
void ProcGMMsg(int sockhandle, const std::string& url, const std::string& quyerstr);
|
void ProcGMMsg(int sockhandle, const std::string& url, const std::string& quyerstr);
|
||||||
|
|
||||||
|
@ -15,4 +15,5 @@ namespace google
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "framework/cpp/types.h"
|
||||||
#include "framework/cpp/protoutils.h"
|
#include "framework/cpp/protoutils.h"
|
||||||
|
@ -16,18 +16,18 @@ def printp_stdout(p):
|
|||||||
while not is_terminated():
|
while not is_terminated():
|
||||||
line = p.stdout.readline()
|
line = p.stdout.readline()
|
||||||
if len(line) > 0:
|
if len(line) > 0:
|
||||||
print line,
|
print(line, end = '')
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print 'build_pb stdout error:' + e
|
print('build_pb stdout error:' + e)
|
||||||
|
|
||||||
def printp_stderr(p):
|
def printp_stderr(p):
|
||||||
try:
|
try:
|
||||||
while is_terminated():
|
while is_terminated():
|
||||||
line = p.stderr.readline()
|
line = p.stderr.readline()
|
||||||
if len(line) > 0:
|
if len(line) > 0:
|
||||||
print line,
|
print(line, end = '')
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print 'build_pb stderr error:' + e
|
print('build_pb stderr error:' + e)
|
||||||
|
|
||||||
def need_rebuild():
|
def need_rebuild():
|
||||||
for proto_name in ('ss_proto', 'ss_msgid'):
|
for proto_name in ('ss_proto', 'ss_msgid'):
|
||||||
@ -58,8 +58,8 @@ def rebuild():
|
|||||||
t1.join()
|
t1.join()
|
||||||
t2.join()
|
t2.join()
|
||||||
sys.exit(p.returncode)
|
sys.exit(p.returncode)
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
print 'build_protocol rebuild error:' + str(e)
|
print('build_protocol rebuild error:' + str(e))
|
||||||
|
|
||||||
def repair_githooks():
|
def repair_githooks():
|
||||||
os.system('/bin/bash ../tools/scripts/githooks/install.sh')
|
os.system('/bin/bash ../tools/scripts/githooks/install.sh')
|
||||||
@ -68,4 +68,4 @@ repair_githooks()
|
|||||||
if need_rebuild():
|
if need_rebuild():
|
||||||
rebuild()
|
rebuild()
|
||||||
else:
|
else:
|
||||||
print 'pb files already is the latest'
|
print('pb files already is the latest')
|
||||||
|
2
third_party/a8engine
vendored
2
third_party/a8engine
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 52552756404c7047c4438cf11425299c88cb74a7
|
Subproject commit 3d34fc3fbe5e0491010b1224ca655909845f9d7d
|
2
third_party/framework
vendored
2
third_party/framework
vendored
@ -1 +1 @@
|
|||||||
Subproject commit ffe697539112bca297d7af73f8a02f9c83a38d58
|
Subproject commit 18133846b6672634219c080064b7a24720d17588
|
Loading…
x
Reference in New Issue
Block a user