移除python依赖
This commit is contained in:
parent
de22262a6c
commit
d259d03d2a
@ -10,9 +10,9 @@ include_directories(
|
||||
../../third_party/a8engine
|
||||
/usr/include/mysql
|
||||
/usr/include/jsoncpp
|
||||
/usr/include/python3.4m
|
||||
/usr/include/hiredis
|
||||
../../third_party
|
||||
.
|
||||
)
|
||||
|
||||
link_directories(
|
||||
@ -60,7 +60,6 @@ target_link_libraries(
|
||||
rt
|
||||
crypto
|
||||
ssl
|
||||
python3.4m
|
||||
jsoncpp
|
||||
curl
|
||||
hiredis
|
||||
|
@ -21,10 +21,10 @@ public:
|
||||
//packagelen + msgid + magiccode + msgbody
|
||||
//2 + 2 + 4+ xx + \0 + xx
|
||||
bool warning = false;
|
||||
while (buflen - offset >= sizeof(PackHead)) {
|
||||
PackHead* p = (PackHead*)&buf[offset];
|
||||
if (p->magic_code == MAGIC_CODE) {
|
||||
if (buflen - offset < sizeof(PackHead) + p->packlen) {
|
||||
while (buflen - offset >= sizeof(f8::PackHead)) {
|
||||
f8::PackHead* p = (f8::PackHead*)&buf[offset];
|
||||
if (p->magic_code == f8::MAGIC_CODE) {
|
||||
if (buflen - offset < sizeof(f8::PackHead) + p->packlen) {
|
||||
break;
|
||||
}
|
||||
App::Instance()->AddSocketMsg(SF_GameServer,
|
||||
@ -32,9 +32,9 @@ public:
|
||||
saddr,
|
||||
p->msgid,
|
||||
p->seqid,
|
||||
&buf[offset + sizeof(PackHead)],
|
||||
&buf[offset + sizeof(f8::PackHead)],
|
||||
p->packlen);
|
||||
offset += sizeof(PackHead) + p->packlen;
|
||||
offset += sizeof(f8::PackHead) + p->packlen;
|
||||
} else {
|
||||
warning = true;
|
||||
offset++;
|
||||
@ -94,20 +94,20 @@ void GSListener::UnInit()
|
||||
tcp_listener_ = nullptr;
|
||||
}
|
||||
|
||||
void GSListener::ForwardTargetConnMsg(MsgHdr& hdr)
|
||||
void GSListener::ForwardTargetConnMsg(f8::MsgHdr& hdr)
|
||||
{
|
||||
char* buff = (char*)malloc(sizeof(PackHead) + hdr.buflen);
|
||||
PackHead* head = (PackHead*)buff;
|
||||
char* buff = (char*)malloc(sizeof(f8::PackHead) + hdr.buflen);
|
||||
f8::PackHead* head = (f8::PackHead*)buff;
|
||||
head->packlen = hdr.buflen;
|
||||
head->msgid = hdr.msgid;
|
||||
head->seqid = hdr.seqid;
|
||||
head->magic_code = MAGIC_CODE;
|
||||
head->magic_code = f8::MAGIC_CODE;
|
||||
head->rpc_error_code = 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);
|
||||
}
|
||||
|
||||
|
@ -22,11 +22,11 @@ class GSListener : public a8::Singleton<GSListener>
|
||||
template <typename T>
|
||||
void SendMsg(unsigned short socket_handle, T& msg)
|
||||
{
|
||||
static int msgid = ::Net_GetMessageId(msg);
|
||||
Net_SendMsg(tcp_listener_, socket_handle, 0, msgid, msg);
|
||||
static int msgid = ::f8::Net_GetMessageId(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 ForceCloseClient(unsigned short sockhandle);
|
||||
|
@ -271,7 +271,7 @@ void App::DispatchMsg()
|
||||
msg_mutex_->unlock();
|
||||
}
|
||||
|
||||
MsgHdr hdr;
|
||||
f8::MsgHdr hdr;
|
||||
while (work_node_) {
|
||||
MsgNode *pdelnode = work_node_;
|
||||
work_node_ = pdelnode->next;
|
||||
@ -304,9 +304,9 @@ 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);
|
||||
if (handler) {
|
||||
switch (handler->handlerid) {
|
||||
|
@ -41,7 +41,7 @@ private:
|
||||
void DispatchMsg();
|
||||
void ProcessIMMsg();
|
||||
|
||||
void ProcessGSMsg(MsgHdr& hdr);
|
||||
void ProcessGSMsg(f8::MsgHdr& hdr);
|
||||
|
||||
void InitLog();
|
||||
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;
|
||||
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_;
|
||||
switch (msg.exec_type()) {
|
||||
|
@ -21,9 +21,9 @@ class DBPool : public a8::Singleton<DBPool>
|
||||
void UnInit();
|
||||
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:
|
||||
|
||||
|
@ -21,7 +21,7 @@ class HandlerMgr : public a8::Singleton<HandlerMgr>
|
||||
void Init();
|
||||
void UnInit();
|
||||
|
||||
NetMsgHandlerObject gsmsghandler;
|
||||
f8::NetMsgHandlerObject gsmsghandler;
|
||||
|
||||
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"
|
||||
|
@ -16,18 +16,18 @@ def printp_stdout(p):
|
||||
while not is_terminated():
|
||||
line = p.stdout.readline()
|
||||
if len(line) > 0:
|
||||
print line,
|
||||
except Exception, e:
|
||||
print 'build_pb stdout error:' + e
|
||||
print(line, end = '')
|
||||
except Exception as e:
|
||||
print('build_pb stdout error:' + e)
|
||||
|
||||
def printp_stderr(p):
|
||||
try:
|
||||
while is_terminated():
|
||||
line = p.stderr.readline()
|
||||
if len(line) > 0:
|
||||
print line,
|
||||
except Exception, e:
|
||||
print 'build_pb stderr error:' + e
|
||||
print(line, end = '')
|
||||
except Exception as e:
|
||||
print('build_pb stderr error:' + e)
|
||||
|
||||
def need_rebuild():
|
||||
for proto_name in ('ss_proto', 'ss_msgid'):
|
||||
@ -58,8 +58,8 @@ def rebuild():
|
||||
t1.join()
|
||||
t2.join()
|
||||
sys.exit(p.returncode)
|
||||
except Exception, e:
|
||||
print 'build_protocol rebuild error:' + str(e)
|
||||
except Exception as e:
|
||||
print('build_protocol rebuild error:' + str(e))
|
||||
|
||||
def repair_githooks():
|
||||
os.system('/bin/bash ../tools/scripts/githooks/install.sh')
|
||||
@ -68,4 +68,4 @@ repair_githooks()
|
||||
if need_rebuild():
|
||||
rebuild()
|
||||
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