1
This commit is contained in:
parent
ec4b6dcb62
commit
4b24ebe296
@ -126,11 +126,11 @@ bool CustomPbSerialize(char* buf, int buflen, google::protobuf::Message* msg)
|
||||
int offset = 0;
|
||||
for (int i = 0; i < descriptor->field_count(); ++i) {
|
||||
const google::protobuf::FieldDescriptor* field_desc = descriptor->field(i);
|
||||
int fixed_len = field_desc->options().GetExtension(cs::fixed_len);
|
||||
switch (field_desc->cpp_type()) {
|
||||
case google::protobuf::FieldDescriptor::CPPTYPE_STRING:
|
||||
{
|
||||
std::string val = reflection->GetString(*msg, field_desc);
|
||||
int fixed_len = field_desc->options().GetExtension(cs::fixed_len);
|
||||
if (field_desc->type() == google::protobuf::FieldDescriptor::TYPE_BYTES && fixed_len > 0) {
|
||||
if (offset + fixed_len > buflen) {
|
||||
abort();
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include "playermgr.h"
|
||||
#include "cs_proto.pb.h"
|
||||
#include "dbengine.h"
|
||||
#include "GCListener.h"
|
||||
|
||||
void PlayerMgr::Init()
|
||||
{
|
||||
@ -16,6 +18,15 @@ void PlayerMgr::UnInit()
|
||||
void PlayerMgr::_CMAuthSession(f8::MsgHdr& hdr, const cs::CMAuthSession& msg)
|
||||
{
|
||||
std::string digest = msg.digest();
|
||||
int ret = DBEngine::Instance()->ExecQuery("SELECT id, gmlevel, sessionkey, last_ip, locked, v, s, mutetime,"
|
||||
" locale, os FROM zeor_realm.account WHERE username='%s';",
|
||||
{
|
||||
msg.account()
|
||||
});
|
||||
assert(ret > 0);
|
||||
cs::SMAuthResponse respmsg;
|
||||
respmsg.set_errcode(0);
|
||||
GCListener::Instance()->SendMsg(hdr.socket_handle, respmsg);
|
||||
}
|
||||
|
||||
int PlayerMgr::OnlineNum()
|
||||
|
@ -11,6 +11,14 @@ message SMAuthChallenge
|
||||
optional uint32 seed = 1;
|
||||
}
|
||||
|
||||
message SMAuthResponse
|
||||
{
|
||||
optional int32 errcode = 1 [(fixed_len) = 1];
|
||||
optional int32 billing_time_remaining = 2;
|
||||
optional int32 billing_plan_flags = 3 [(fixed_len) = 1];
|
||||
optional int32 billing_time_rested = 4;
|
||||
}
|
||||
|
||||
message CMAuthSession
|
||||
{
|
||||
optional uint32 built_number_client = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user