Browse Source

feat: add test connection service

增加了一个测试服务器是否在线的功能
tags/0.1.0
DragonAura 3 years ago
parent
commit
2f1761f81a
7 changed files with 488 additions and 227 deletions
  1. +81
    -29
      CAPI/proto/Message2Clients.grpc.pb.cc
  2. +341
    -136
      CAPI/proto/Message2Clients.grpc.pb.h
  3. +23
    -21
      CAPI/proto/Message2Clients.pb.cc
  4. +19
    -19
      CAPI/proto/Message2Server.pb.cc
  5. +21
    -21
      CAPI/proto/Message2Server.pb.h
  6. +2
    -0
      dependency/proto/Message2Clients.proto
  7. +1
    -1
      dependency/proto/Message2Server.proto

+ 81
- 29
CAPI/proto/Message2Clients.grpc.pb.cc View File

@@ -23,6 +23,7 @@ namespace protobuf
{

static const char* AvailableService_method_names[] = {
"/protobuf.AvailableService/TryConnection",
"/protobuf.AvailableService/AddPlayer",
"/protobuf.AvailableService/Move",
"/protobuf.AvailableService/PickProp",
@@ -49,24 +50,53 @@ namespace protobuf

AvailableService::Stub::Stub(const std::shared_ptr<::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) :
channel_(channel),
rpcmethod_AddPlayer_(AvailableService_method_names[0], options.suffix_for_stats(), ::grpc::internal::RpcMethod::SERVER_STREAMING, channel),
rpcmethod_Move_(AvailableService_method_names[1], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_PickProp_(AvailableService_method_names[2], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_UseProp_(AvailableService_method_names[3], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_UseSkill_(AvailableService_method_names[4], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_SendMessage_(AvailableService_method_names[5], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_HaveMessage_(AvailableService_method_names[6], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_GetMessage_(AvailableService_method_names[7], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_FixMachine_(AvailableService_method_names[8], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
rpcmethod_SaveHuman_(AvailableService_method_names[9], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
rpcmethod_Attack_(AvailableService_method_names[10], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_CarryHuman_(AvailableService_method_names[11], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_ReleaseHuman_(AvailableService_method_names[12], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_HangHuman_(AvailableService_method_names[13], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_Escape_(AvailableService_method_names[14], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
rpcmethod_TryConnection_(AvailableService_method_names[0], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_AddPlayer_(AvailableService_method_names[1], options.suffix_for_stats(), ::grpc::internal::RpcMethod::SERVER_STREAMING, channel),
rpcmethod_Move_(AvailableService_method_names[2], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_PickProp_(AvailableService_method_names[3], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_UseProp_(AvailableService_method_names[4], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_UseSkill_(AvailableService_method_names[5], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_SendMessage_(AvailableService_method_names[6], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_HaveMessage_(AvailableService_method_names[7], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_GetMessage_(AvailableService_method_names[8], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_FixMachine_(AvailableService_method_names[9], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
rpcmethod_SaveHuman_(AvailableService_method_names[10], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
rpcmethod_Attack_(AvailableService_method_names[11], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_CarryHuman_(AvailableService_method_names[12], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_ReleaseHuman_(AvailableService_method_names[13], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_HangHuman_(AvailableService_method_names[14], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_Escape_(AvailableService_method_names[15], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel)
{
}

::grpc::Status AvailableService::Stub::TryConnection(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::protobuf::BoolRes* response)
{
return ::grpc::internal::BlockingUnaryCall<::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_TryConnection_, context, request, response);
}

void AvailableService::Stub::async::TryConnection(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, std::function<void(::grpc::Status)> f)
{
::grpc::internal::CallbackUnaryCall<::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TryConnection_, context, request, response, std::move(f));
}

void AvailableService::Stub::async::TryConnection(::grpc::ClientContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response, ::grpc::ClientUnaryReactor* reactor)
{
::grpc::internal::ClientCallbackUnaryFactory::Create<::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_TryConnection_, context, request, response, reactor);
}

::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::PrepareAsyncTryConnectionRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
{
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create<::protobuf::BoolRes, ::protobuf::IDMsg, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_TryConnection_, context, request);
}

::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::AsyncTryConnectionRaw(::grpc::ClientContext* context, const ::protobuf::IDMsg& request, ::grpc::CompletionQueue* cq)
{
auto* result =
this->PrepareAsyncTryConnectionRaw(context, request, cq);
result->StartCall();
return result;
}

::grpc::ClientReader<::protobuf::MessageToClient>* AvailableService::Stub::AddPlayerRaw(::grpc::ClientContext* context, const ::protobuf::PlayerMsg& request)
{
return ::grpc::internal::ClientReaderFactory<::protobuf::MessageToClient>::Create(channel_.get(), rpcmethod_AddPlayer_, context, request);
@@ -467,6 +497,20 @@ namespace protobuf
{
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[0],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
::grpc::ServerContext* ctx,
const ::protobuf::IDMsg* req,
::protobuf::BoolRes* resp)
{
return service->TryConnection(ctx, req, resp);
},
this
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[1],
::grpc::internal::RpcMethod::SERVER_STREAMING,
new ::grpc::internal::ServerStreamingHandler<AvailableService::Service, ::protobuf::PlayerMsg, ::protobuf::MessageToClient>(
[](AvailableService::Service* service,
@@ -480,7 +524,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[1],
AvailableService_method_names[2],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::MoveMsg, ::protobuf::MoveRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -494,7 +538,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[2],
AvailableService_method_names[3],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::PickMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -508,7 +552,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[3],
AvailableService_method_names[4],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -522,7 +566,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[4],
AvailableService_method_names[5],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -536,7 +580,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[5],
AvailableService_method_names[6],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::SendMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -550,7 +594,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[6],
AvailableService_method_names[7],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -564,7 +608,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[7],
AvailableService_method_names[8],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::MsgRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -578,7 +622,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[8],
AvailableService_method_names[9],
::grpc::internal::RpcMethod::BIDI_STREAMING,
new ::grpc::internal::BidiStreamingHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes>(
[](AvailableService::Service* service,
@@ -591,7 +635,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[9],
AvailableService_method_names[10],
::grpc::internal::RpcMethod::BIDI_STREAMING,
new ::grpc::internal::BidiStreamingHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes>(
[](AvailableService::Service* service,
@@ -604,7 +648,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[10],
AvailableService_method_names[11],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::AttackMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -618,7 +662,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[11],
AvailableService_method_names[12],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -632,7 +676,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[12],
AvailableService_method_names[13],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -646,7 +690,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[13],
AvailableService_method_names[14],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -660,7 +704,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[14],
AvailableService_method_names[15],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -679,6 +723,14 @@ namespace protobuf
{
}

::grpc::Status AvailableService::Service::TryConnection(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::BoolRes* response)
{
(void)context;
(void)request;
(void)response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}

::grpc::Status AvailableService::Service::AddPlayer(::grpc::ServerContext* context, const ::protobuf::PlayerMsg* request, ::grpc::ServerWriter<::protobuf::MessageToClient>* writer)
{
(void)context;


+ 341
- 136
CAPI/proto/Message2Clients.grpc.pb.h
File diff suppressed because it is too large
View File


+ 23
- 21
CAPI/proto/Message2Clients.pb.cc View File

@@ -483,26 +483,28 @@ const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_
"_angle\030\002 \001(\001\"\036\n\007BoolRes\022\023\n\013act_success\030\001"
" \001(\010\"P\n\006MsgRes\022\024\n\014have_message\030\001 \001(\010\022\026\n\016"
"from_player_id\030\002 \001(\003\022\030\n\020message_received"
"\030\003 \001(\t2\213\006\n\020AvailableService\022=\n\tAddPlayer"
"\022\023.protobuf.PlayerMsg\032\031.protobuf.Message"
"ToClient0\001\022,\n\004Move\022\021.protobuf.MoveMsg\032\021."
"protobuf.MoveRes\0220\n\010PickProp\022\021.protobuf."
"PickMsg\032\021.protobuf.BoolRes\022-\n\007UseProp\022\017."
"protobuf.IDMsg\032\021.protobuf.BoolRes\022.\n\010Use"
"Skill\022\017.protobuf.IDMsg\032\021.protobuf.BoolRe"
"s\0223\n\013SendMessage\022\021.protobuf.SendMsg\032\021.pr"
"otobuf.BoolRes\0221\n\013HaveMessage\022\017.protobuf"
".IDMsg\032\021.protobuf.BoolRes\022/\n\nGetMessage\022"
"\017.protobuf.IDMsg\032\020.protobuf.MsgRes\0224\n\nFi"
"xMachine\022\017.protobuf.IDMsg\032\021.protobuf.Boo"
"lRes(\0010\001\0223\n\tSaveHuman\022\017.protobuf.IDMsg\032\021"
".protobuf.BoolRes(\0010\001\0220\n\006Attack\022\023.protob"
"uf.AttackMsg\032\021.protobuf.BoolRes\0220\n\nCarry"
"Human\022\017.protobuf.IDMsg\032\021.protobuf.BoolRe"
"s\0222\n\014ReleaseHuman\022\017.protobuf.IDMsg\032\021.pro"
"tobuf.BoolRes\022/\n\tHangHuman\022\017.protobuf.ID"
"Msg\032\021.protobuf.BoolRes\022,\n\006Escape\022\017.proto"
"buf.IDMsg\032\021.protobuf.BoolResb\006proto3";
"\030\003 \001(\t2\300\006\n\020AvailableService\0223\n\rTryConnec"
"tion\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes"
"\022=\n\tAddPlayer\022\023.protobuf.PlayerMsg\032\031.pro"
"tobuf.MessageToClient0\001\022,\n\004Move\022\021.protob"
"uf.MoveMsg\032\021.protobuf.MoveRes\0220\n\010PickPro"
"p\022\021.protobuf.PickMsg\032\021.protobuf.BoolRes\022"
"-\n\007UseProp\022\017.protobuf.IDMsg\032\021.protobuf.B"
"oolRes\022.\n\010UseSkill\022\017.protobuf.IDMsg\032\021.pr"
"otobuf.BoolRes\0223\n\013SendMessage\022\021.protobuf"
".SendMsg\032\021.protobuf.BoolRes\0221\n\013HaveMessa"
"ge\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes\022/"
"\n\nGetMessage\022\017.protobuf.IDMsg\032\020.protobuf"
".MsgRes\0224\n\nFixMachine\022\017.protobuf.IDMsg\032\021"
".protobuf.BoolRes(\0010\001\0223\n\tSaveHuman\022\017.pro"
"tobuf.IDMsg\032\021.protobuf.BoolRes(\0010\001\0220\n\006At"
"tack\022\023.protobuf.AttackMsg\032\021.protobuf.Boo"
"lRes\0220\n\nCarryHuman\022\017.protobuf.IDMsg\032\021.pr"
"otobuf.BoolRes\0222\n\014ReleaseHuman\022\017.protobu"
"f.IDMsg\032\021.protobuf.BoolRes\022/\n\tHangHuman\022"
"\017.protobuf.IDMsg\032\021.protobuf.BoolRes\022,\n\006E"
"scape\022\017.protobuf.IDMsg\032\021.protobuf.BoolRe"
"sb\006proto3";
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[2] = {
&::descriptor_table_Message2Server_2eproto,
&::descriptor_table_MessageType_2eproto,
@@ -511,7 +513,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_Message2Cli
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Message2Clients_2eproto = {
false,
false,
2396,
2449,
descriptor_table_protodef_Message2Clients_2eproto,
"Message2Clients.proto",
&descriptor_table_Message2Clients_2eproto_once,


+ 19
- 19
CAPI/proto/Message2Server.pb.cc View File

@@ -136,7 +136,7 @@ namespace protobuf
constexpr IDMsg::IDMsg(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized
) :
playerid_(int64_t{0})
player_id_(int64_t{0})
{
}
struct IDMsgDefaultTypeInternal
@@ -211,7 +211,7 @@ const uint32_t TableStruct_Message2Server_2eproto::offsets[] PROTOBUF_SECTION_VA
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::protobuf::IDMsg, playerid_),
PROTOBUF_FIELD_OFFSET(::protobuf::IDMsg, player_id_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::protobuf::PlayerMsg)},
@@ -244,8 +244,8 @@ const char descriptor_table_protodef_Message2Server_2eproto[] PROTOBUF_SECTION_V
"obuf.PropType\"C\n\007SendMsg\022\021\n\tplayer_id\030\001 "
"\001(\003\022\024\n\014to_player_id\030\002 \001(\003\022\017\n\007message\030\003 \001"
"(\t\"-\n\tAttackMsg\022\021\n\tplayer_id\030\001 \001(\003\022\r\n\005an"
"gle\030\002 \001(\001\"\031\n\005IDMsg\022\020\n\010playerID\030\001 \001(\003b\006pr"
"oto3";
"gle\030\002 \001(\001\"\032\n\005IDMsg\022\021\n\tplayer_id\030\001 \001(\003b\006p"
"roto3";
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* const descriptor_table_Message2Server_2eproto_deps[1] = {
&::descriptor_table_MessageType_2eproto,
};
@@ -253,7 +253,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_Message2Ser
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Message2Server_2eproto = {
false,
false,
524,
525,
descriptor_table_protodef_Message2Server_2eproto,
"Message2Server.proto",
&descriptor_table_Message2Server_2eproto_once,
@@ -1773,13 +1773,13 @@ namespace protobuf
::PROTOBUF_NAMESPACE_ID::Message()
{
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
playerid_ = from.playerid_;
player_id_ = from.player_id_;
// @@protoc_insertion_point(copy_constructor:protobuf.IDMsg)
}

inline void IDMsg::SharedCtor()
{
playerid_ = int64_t{0};
player_id_ = int64_t{0};
}

IDMsg::~IDMsg()
@@ -1816,7 +1816,7 @@ namespace protobuf
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;

playerid_ = int64_t{0};
player_id_ = int64_t{0};
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

@@ -1831,11 +1831,11 @@ namespace protobuf
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
switch (tag >> 3)
{
// int64 playerID = 1;
// int64 player_id = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8))
{
playerid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
player_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
}
else
@@ -1875,11 +1875,11 @@ namespace protobuf
uint32_t cached_has_bits = 0;
(void)cached_has_bits;

// int64 playerID = 1;
if (this->_internal_playerid() != 0)
// int64 player_id = 1;
if (this->_internal_player_id() != 0)
{
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_playerid(), target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_player_id(), target);
}

if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields()))
@@ -1901,10 +1901,10 @@ namespace protobuf
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;

// int64 playerID = 1;
if (this->_internal_playerid() != 0)
// int64 player_id = 1;
if (this->_internal_player_id() != 0)
{
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_playerid());
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_player_id());
}

return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
@@ -1932,9 +1932,9 @@ namespace protobuf
uint32_t cached_has_bits = 0;
(void)cached_has_bits;

if (from._internal_playerid() != 0)
if (from._internal_player_id() != 0)
{
_internal_set_playerid(from._internal_playerid());
_internal_set_player_id(from._internal_player_id());
}
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}
@@ -1957,7 +1957,7 @@ namespace protobuf
{
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(playerid_, other->playerid_);
swap(player_id_, other->player_id_);
}

::PROTOBUF_NAMESPACE_ID::Metadata IDMsg::GetMetadata() const


+ 21
- 21
CAPI/proto/Message2Server.pb.h View File

@@ -1331,16 +1331,16 @@ namespace protobuf

enum : int
{
kPlayerIDFieldNumber = 1,
kPlayerIdFieldNumber = 1,
};
// int64 playerID = 1;
void clear_playerid();
int64_t playerid() const;
void set_playerid(int64_t value);
// int64 player_id = 1;
void clear_player_id();
int64_t player_id() const;
void set_player_id(int64_t value);

private:
int64_t _internal_playerid() const;
void _internal_set_playerid(int64_t value);
int64_t _internal_player_id() const;
void _internal_set_player_id(int64_t value);

public:
// @@protoc_insertion_point(class_scope:protobuf.IDMsg)
@@ -1352,7 +1352,7 @@ namespace protobuf
friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
int64_t playerid_;
int64_t player_id_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_Message2Server_2eproto;
};
@@ -1817,28 +1817,28 @@ namespace protobuf

// IDMsg

// int64 playerID = 1;
inline void IDMsg::clear_playerid()
// int64 player_id = 1;
inline void IDMsg::clear_player_id()
{
playerid_ = int64_t{0};
player_id_ = int64_t{0};
}
inline int64_t IDMsg::_internal_playerid() const
inline int64_t IDMsg::_internal_player_id() const
{
return playerid_;
return player_id_;
}
inline int64_t IDMsg::playerid() const
inline int64_t IDMsg::player_id() const
{
// @@protoc_insertion_point(field_get:protobuf.IDMsg.playerID)
return _internal_playerid();
// @@protoc_insertion_point(field_get:protobuf.IDMsg.player_id)
return _internal_player_id();
}
inline void IDMsg::_internal_set_playerid(int64_t value)
inline void IDMsg::_internal_set_player_id(int64_t value)
{
playerid_ = value;
player_id_ = value;
}
inline void IDMsg::set_playerid(int64_t value)
inline void IDMsg::set_player_id(int64_t value)
{
_internal_set_playerid(value);
// @@protoc_insertion_point(field_set:protobuf.IDMsg.playerID)
_internal_set_player_id(value);
// @@protoc_insertion_point(field_set:protobuf.IDMsg.player_id)
}

#ifdef __GNUC__


+ 2
- 0
dependency/proto/Message2Clients.proto View File

@@ -101,6 +101,8 @@ message MsgRes // 用于获取队友发来的消息

service AvailableService
{
rpc TryConnection(IDMsg) returns(BoolRes);

// 游戏开局调用一次的服务
rpc AddPlayer(PlayerMsg) returns(stream MessageToClient); // 连接上后等待游戏开始,server会定时通过该服务向所有client发送消息。



+ 1
- 1
dependency/proto/Message2Server.proto View File

@@ -43,7 +43,7 @@ message AttackMsg

message IDMsg
{
int64 playerID = 1;
int64 player_id = 1;
}

// 基本继承于THUAI5,为了使发送的信息尽可能不被浪费,暂定不发这类大包。


Loading…
Cancel
Save