Browse Source

chore : add receive message interface

tags/0.1.0
DragonAura 3 years ago
parent
commit
2b47e6091a
5 changed files with 1308 additions and 105 deletions
  1. +117
    -13
      CAPI/proto/Message2Clients.grpc.pb.cc
  2. +479
    -69
      CAPI/proto/Message2Clients.grpc.pb.h
  3. +370
    -21
      CAPI/proto/Message2Clients.pb.cc
  4. +332
    -1
      CAPI/proto/Message2Clients.pb.h
  5. +10
    -1
      dependency/proto/Message2Clients.proto

+ 117
- 13
CAPI/proto/Message2Clients.grpc.pb.cc View File

@@ -29,6 +29,8 @@ namespace protobuf
"/protobuf.AvailableService/UseProp",
"/protobuf.AvailableService/UseSkill",
"/protobuf.AvailableService/SendMessage",
"/protobuf.AvailableService/HaveMessage",
"/protobuf.AvailableService/GetMessage",
"/protobuf.AvailableService/FixMachine",
"/protobuf.AvailableService/SaveHuman",
"/protobuf.AvailableService/Attack",
@@ -53,13 +55,15 @@ namespace protobuf
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_FixMachine_(AvailableService_method_names[6], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
rpcmethod_SaveHuman_(AvailableService_method_names[7], options.suffix_for_stats(), ::grpc::internal::RpcMethod::BIDI_STREAMING, channel),
rpcmethod_Attack_(AvailableService_method_names[8], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_CarryHuman_(AvailableService_method_names[9], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_ReleaseHuman_(AvailableService_method_names[10], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_HangHuman_(AvailableService_method_names[11], options.suffix_for_stats(), ::grpc::internal::RpcMethod::NORMAL_RPC, channel),
rpcmethod_Escape_(AvailableService_method_names[12], 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)
{
}

@@ -223,6 +227,62 @@ namespace protobuf
return result;
}

::grpc::Status AvailableService::Stub::HaveMessage(::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_HaveMessage_, context, request, response);
}

void AvailableService::Stub::async::HaveMessage(::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_HaveMessage_, context, request, response, std::move(f));
}

void AvailableService::Stub::async::HaveMessage(::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_HaveMessage_, context, request, response, reactor);
}

::grpc::ClientAsyncResponseReader<::protobuf::BoolRes>* AvailableService::Stub::PrepareAsyncHaveMessageRaw(::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_HaveMessage_, context, request);
}

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

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

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

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

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

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

::grpc::ClientReaderWriter<::protobuf::IDMsg, ::protobuf::BoolRes>* AvailableService::Stub::FixMachineRaw(::grpc::ClientContext* context)
{
return ::grpc::internal::ClientReaderWriterFactory<::protobuf::IDMsg, ::protobuf::BoolRes>::Create(channel_.get(), rpcmethod_FixMachine_, context);
@@ -491,6 +551,34 @@ namespace protobuf
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[6],
::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->HaveMessage(ctx, req, resp);
},
this
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[7],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::MsgRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
::grpc::ServerContext* ctx,
const ::protobuf::IDMsg* req,
::protobuf::MsgRes* resp)
{
return service->GetMessage(ctx, req, resp);
},
this
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[8],
::grpc::internal::RpcMethod::BIDI_STREAMING,
new ::grpc::internal::BidiStreamingHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes>(
[](AvailableService::Service* service,
@@ -503,7 +591,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[7],
AvailableService_method_names[9],
::grpc::internal::RpcMethod::BIDI_STREAMING,
new ::grpc::internal::BidiStreamingHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes>(
[](AvailableService::Service* service,
@@ -516,7 +604,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[8],
AvailableService_method_names[10],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::AttackMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -530,7 +618,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[9],
AvailableService_method_names[11],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler<AvailableService::Service, ::protobuf::IDMsg, ::protobuf::BoolRes, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](AvailableService::Service* service,
@@ -544,7 +632,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[10],
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,
@@ -558,7 +646,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[11],
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,
@@ -572,7 +660,7 @@ namespace protobuf
)
));
AddMethod(new ::grpc::internal::RpcServiceMethod(
AvailableService_method_names[12],
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,
@@ -639,6 +727,22 @@ namespace protobuf
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}

::grpc::Status AvailableService::Service::HaveMessage(::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::GetMessage(::grpc::ServerContext* context, const ::protobuf::IDMsg* request, ::protobuf::MsgRes* response)
{
(void)context;
(void)request;
(void)response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}

::grpc::Status AvailableService::Service::FixMachine(::grpc::ServerContext* context, ::grpc::ServerReaderWriter<::protobuf::BoolRes, ::protobuf::IDMsg>* stream)
{
(void)context;


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


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

@@ -269,8 +269,31 @@ namespace protobuf
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT BoolResDefaultTypeInternal _BoolRes_default_instance_;
constexpr MsgRes::MsgRes(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized
) :
message_received_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string),
from_player_id_(int64_t{0}),
have_message_(false)
{
}
struct MsgResDefaultTypeInternal
{
constexpr MsgResDefaultTypeInternal() :
_instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{})
{
}
~MsgResDefaultTypeInternal()
{
}
union
{
MsgRes _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT MsgResDefaultTypeInternal _MsgRes_default_instance_;
} // namespace protobuf
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_Message2Clients_2eproto[9];
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_Message2Clients_2eproto[10];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_Message2Clients_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_Message2Clients_2eproto = nullptr;

@@ -379,6 +402,15 @@ const uint32_t TableStruct_Message2Clients_2eproto::offsets[] PROTOBUF_SECTION_V
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::protobuf::BoolRes, act_success_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, have_message_),
PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, from_player_id_),
PROTOBUF_FIELD_OFFSET(::protobuf::MsgRes, message_received_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{0, -1, -1, sizeof(::protobuf::MessageOfHuman)},
@@ -390,6 +422,7 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB
{79, -1, -1, sizeof(::protobuf::MessageToClient)},
{89, -1, -1, sizeof(::protobuf::MoveRes)},
{97, -1, -1, sizeof(::protobuf::BoolRes)},
{104, -1, -1, sizeof(::protobuf::MsgRes)},
};

static ::PROTOBUF_NAMESPACE_ID::Message const* const file_default_instances[] = {
@@ -402,6 +435,7 @@ static ::PROTOBUF_NAMESPACE_ID::Message const* const file_default_instances[] =
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::protobuf::_MessageToClient_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::protobuf::_MoveRes_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::protobuf::_BoolRes_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::protobuf::_MsgRes_default_instance_),
};

const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
@@ -442,24 +476,29 @@ const char descriptor_table_protodef_Message2Clients_2eproto[] PROTOBUF_SECTION_
"+\n\013map_massage\030\004 \001(\0132\026.protobuf.MessageO"
"fMap\"5\n\007MoveRes\022\024\n\014actual_speed\030\001 \001(\003\022\024\n"
"\014actual_angle\030\002 \001(\001\"\036\n\007BoolRes\022\023\n\013act_su"
"ccess\030\001 \001(\0102\247\005\n\020AvailableService\022=\n\tAddP"
"layer\022\023.protobuf.PlayerMsg\032\031.protobuf.Me"
"ssageToClient0\001\022,\n\004Move\022\021.protobuf.MoveM"
"sg\032\021.protobuf.MoveRes\0220\n\010PickProp\022\021.prot"
"obuf.PickMsg\032\021.protobuf.BoolRes\022-\n\007UsePr"
"op\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes\022."
"\n\010UseSkill\022\017.protobuf.IDMsg\032\021.protobuf.B"
"oolRes\0223\n\013SendMessage\022\021.protobuf.SendMsg"
"\032\021.protobuf.BoolRes\0224\n\nFixMachine\022\017.prot"
"obuf.IDMsg\032\021.protobuf.BoolRes(\0010\001\0223\n\tSav"
"eHuman\022\017.protobuf.IDMsg\032\021.protobuf.BoolR"
"es(\0010\001\0220\n\006Attack\022\023.protobuf.AttackMsg\032\021."
"protobuf.BoolRes\0220\n\nCarryHuman\022\017.protobu"
"f.IDMsg\032\021.protobuf.BoolRes\0222\n\014ReleaseHum"
"an\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes\022/"
"\n\tHangHuman\022\017.protobuf.IDMsg\032\021.protobuf."
"BoolRes\022,\n\006Escape\022\017.protobuf.IDMsg\032\021.pro"
"tobuf.BoolResb\006proto3";
"ccess\030\001 \001(\010\"P\n\006MsgRes\022\024\n\014have_message\030\001 "
"\001(\010\022\026\n\016from_player_id\030\002 \001(\003\022\030\n\020message_r"
"eceived\030\003 \001(\t2\213\006\n\020AvailableService\022=\n\tAd"
"dPlayer\022\023.protobuf.PlayerMsg\032\031.protobuf."
"MessageToClient0\001\022,\n\004Move\022\021.protobuf.Mov"
"eMsg\032\021.protobuf.MoveRes\0220\n\010PickProp\022\021.pr"
"otobuf.PickMsg\032\021.protobuf.BoolRes\022-\n\007Use"
"Prop\022\017.protobuf.IDMsg\032\021.protobuf.BoolRes"
"\022.\n\010UseSkill\022\017.protobuf.IDMsg\032\021.protobuf"
".BoolRes\0223\n\013SendMessage\022\021.protobuf.SendM"
"sg\032\021.protobuf.BoolRes\0221\n\013HaveMessage\022\017.p"
"rotobuf.IDMsg\032\021.protobuf.BoolRes\022/\n\nGetM"
"essage\022\017.protobuf.IDMsg\032\020.protobuf.MsgRe"
"s\0224\n\nFixMachine\022\017.protobuf.IDMsg\032\021.proto"
"buf.BoolRes(\0010\001\0223\n\tSaveHuman\022\017.protobuf."
"IDMsg\032\021.protobuf.BoolRes(\0010\001\0220\n\006Attack\022\023"
".protobuf.AttackMsg\032\021.protobuf.BoolRes\0220"
"\n\nCarryHuman\022\017.protobuf.IDMsg\032\021.protobuf"
".BoolRes\0222\n\014ReleaseHuman\022\017.protobuf.IDMs"
"g\032\021.protobuf.BoolRes\022/\n\tHangHuman\022\017.prot"
"obuf.IDMsg\032\021.protobuf.BoolRes\022,\n\006Escape\022"
"\017.protobuf.IDMsg\032\021.protobuf.BoolResb\006pro"
"to3";
static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable* const descriptor_table_Message2Clients_2eproto_deps[2] = {
&::descriptor_table_Message2Server_2eproto,
&::descriptor_table_MessageType_2eproto,
@@ -468,13 +507,13 @@ static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_Message2Cli
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_Message2Clients_2eproto = {
false,
false,
2181,
2363,
descriptor_table_protodef_Message2Clients_2eproto,
"Message2Clients.proto",
&descriptor_table_Message2Clients_2eproto_once,
descriptor_table_Message2Clients_2eproto_deps,
2,
9,
10,
schemas,
file_default_instances,
TableStruct_Message2Clients_2eproto::offsets,
@@ -3831,6 +3870,311 @@ namespace protobuf
);
}

// ===================================================================

class MsgRes::_Internal
{
public:
};

MsgRes::MsgRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) :
::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned)
{
SharedCtor();
if (!is_message_owned)
{
RegisterArenaDtor(arena);
}
// @@protoc_insertion_point(arena_constructor:protobuf.MsgRes)
}
MsgRes::MsgRes(const MsgRes& from) :
::PROTOBUF_NAMESPACE_ID::Message()
{
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
message_received_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
message_received_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (!from._internal_message_received().empty())
{
message_received_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_message_received(), GetArenaForAllocation());
}
::memcpy(&from_player_id_, &from.from_player_id_, static_cast<size_t>(reinterpret_cast<char*>(&have_message_) - reinterpret_cast<char*>(&from_player_id_)) + sizeof(have_message_));
// @@protoc_insertion_point(copy_constructor:protobuf.MsgRes)
}

inline void MsgRes::SharedCtor()
{
message_received_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
message_received_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(reinterpret_cast<char*>(&from_player_id_) - reinterpret_cast<char*>(this)), 0, static_cast<size_t>(reinterpret_cast<char*>(&have_message_) - reinterpret_cast<char*>(&from_player_id_)) + sizeof(have_message_));
}

MsgRes::~MsgRes()
{
// @@protoc_insertion_point(destructor:protobuf.MsgRes)
if (GetArenaForAllocation() != nullptr)
return;
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

inline void MsgRes::SharedDtor()
{
GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
message_received_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}

void MsgRes::ArenaDtor(void* object)
{
MsgRes* _this = reinterpret_cast<MsgRes*>(object);
(void)_this;
}
void MsgRes::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*)
{
}
void MsgRes::SetCachedSize(int size) const
{
_cached_size_.Set(size);
}

void MsgRes::Clear()
{
// @@protoc_insertion_point(message_clear_start:protobuf.MsgRes)
uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;

message_received_.ClearToEmpty();
::memset(&from_player_id_, 0, static_cast<size_t>(reinterpret_cast<char*>(&have_message_) - reinterpret_cast<char*>(&from_player_id_)) + sizeof(have_message_));
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}

const char* MsgRes::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx)
{
#define CHK_(x) \
if (PROTOBUF_PREDICT_FALSE(!(x))) \
goto failure
while (!ctx->Done(&ptr))
{
uint32_t tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
switch (tag >> 3)
{
// bool have_message = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8))
{
have_message_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
}
else
goto handle_unusual;
continue;
// int64 from_player_id = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16))
{
from_player_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
CHK_(ptr);
}
else
goto handle_unusual;
continue;
// string message_received = 3;
case 3:
if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26))
{
auto str = _internal_mutable_message_received();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "protobuf.MsgRes.message_received"));
CHK_(ptr);
}
else
goto handle_unusual;
continue;
default:
goto handle_unusual;
} // switch
handle_unusual:
if ((tag == 0) || ((tag & 7) == 4))
{
CHK_(ptr);
ctx->SetLastTag(tag);
goto message_done;
}
ptr = UnknownFieldParse(
tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr,
ctx
);
CHK_(ptr != nullptr);
} // while
message_done:
return ptr;
failure:
ptr = nullptr;
goto message_done;
#undef CHK_
}

uint8_t* MsgRes::_InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream
) const
{
// @@protoc_insertion_point(serialize_to_array_start:protobuf.MsgRes)
uint32_t cached_has_bits = 0;
(void)cached_has_bits;

// bool have_message = 1;
if (this->_internal_have_message() != 0)
{
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_have_message(), target);
}

// int64 from_player_id = 2;
if (this->_internal_from_player_id() != 0)
{
target = stream->EnsureSpace(target);
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_from_player_id(), target);
}

// string message_received = 3;
if (!this->_internal_message_received().empty())
{
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_message_received().data(), static_cast<int>(this->_internal_message_received().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, "protobuf.MsgRes.message_received"
);
target = stream->WriteStringMaybeAliased(
3, this->_internal_message_received(), target
);
}

if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields()))
{
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream
);
}
// @@protoc_insertion_point(serialize_to_array_end:protobuf.MsgRes)
return target;
}

size_t MsgRes::ByteSizeLong() const
{
// @@protoc_insertion_point(message_byte_size_start:protobuf.MsgRes)
size_t total_size = 0;

uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void)cached_has_bits;

// string message_received = 3;
if (!this->_internal_message_received().empty())
{
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_message_received()
);
}

// int64 from_player_id = 2;
if (this->_internal_from_player_id() != 0)
{
total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64SizePlusOne(this->_internal_from_player_id());
}

// bool have_message = 1;
if (this->_internal_have_message() != 0)
{
total_size += 1 + 1;
}

return MaybeComputeUnknownFieldsSize(total_size, &_cached_size_);
}

const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MsgRes::_class_data_ = {
::PROTOBUF_NAMESPACE_ID::Message::CopyWithSizeCheck,
MsgRes::MergeImpl};
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* MsgRes::GetClassData() const
{
return &_class_data_;
}

void MsgRes::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from)
{
static_cast<MsgRes*>(to)->MergeFrom(
static_cast<const MsgRes&>(from)
);
}

void MsgRes::MergeFrom(const MsgRes& from)
{
// @@protoc_insertion_point(class_specific_merge_from_start:protobuf.MsgRes)
GOOGLE_DCHECK_NE(&from, this);
uint32_t cached_has_bits = 0;
(void)cached_has_bits;

if (!from._internal_message_received().empty())
{
_internal_set_message_received(from._internal_message_received());
}
if (from._internal_from_player_id() != 0)
{
_internal_set_from_player_id(from._internal_from_player_id());
}
if (from._internal_have_message() != 0)
{
_internal_set_have_message(from._internal_have_message());
}
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
}

void MsgRes::CopyFrom(const MsgRes& from)
{
// @@protoc_insertion_point(class_specific_copy_from_start:protobuf.MsgRes)
if (&from == this)
return;
Clear();
MergeFrom(from);
}

bool MsgRes::IsInitialized() const
{
return true;
}

void MsgRes::InternalSwap(MsgRes* other)
{
using std::swap;
auto* lhs_arena = GetArenaForAllocation();
auto* rhs_arena = other->GetArenaForAllocation();
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(),
&message_received_,
lhs_arena,
&other->message_received_,
rhs_arena
);
::PROTOBUF_NAMESPACE_ID::internal::memswap<
PROTOBUF_FIELD_OFFSET(MsgRes, have_message_) + sizeof(MsgRes::have_message_) - PROTOBUF_FIELD_OFFSET(MsgRes, from_player_id_)>(
reinterpret_cast<char*>(&from_player_id_),
reinterpret_cast<char*>(&other->from_player_id_)
);
}

::PROTOBUF_NAMESPACE_ID::Metadata MsgRes::GetMetadata() const
{
return ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(
&descriptor_table_Message2Clients_2eproto_getter, &descriptor_table_Message2Clients_2eproto_once, file_level_metadata_Message2Clients_2eproto[9]
);
}

// @@protoc_insertion_point(namespace_scope)
} // namespace protobuf
PROTOBUF_NAMESPACE_OPEN
@@ -3879,6 +4223,11 @@ PROTOBUF_NOINLINE ::protobuf::BoolRes* Arena::CreateMaybeMessage<::protobuf::Boo
{
return Arena::CreateMessageInternal<::protobuf::BoolRes>(arena);
}
template<>
PROTOBUF_NOINLINE ::protobuf::MsgRes* Arena::CreateMaybeMessage<::protobuf::MsgRes>(Arena* arena)
{
return Arena::CreateMessageInternal<::protobuf::MsgRes>(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)


+ 332
- 1
CAPI/proto/Message2Clients.pb.h View File

@@ -48,7 +48,7 @@ struct TableStruct_Message2Clients_2eproto
{
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[9] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[10] PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
static const uint32_t offsets[];
@@ -83,6 +83,9 @@ namespace protobuf
class MoveRes;
struct MoveResDefaultTypeInternal;
extern MoveResDefaultTypeInternal _MoveRes_default_instance_;
class MsgRes;
struct MsgResDefaultTypeInternal;
extern MsgResDefaultTypeInternal _MsgRes_default_instance_;
} // namespace protobuf
PROTOBUF_NAMESPACE_OPEN
template<>
@@ -103,6 +106,8 @@ template<>
::protobuf::MessageToClient* Arena::CreateMaybeMessage<::protobuf::MessageToClient>(Arena*);
template<>
::protobuf::MoveRes* Arena::CreateMaybeMessage<::protobuf::MoveRes>(Arena*);
template<>
::protobuf::MsgRes* Arena::CreateMaybeMessage<::protobuf::MsgRes>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace protobuf
{
@@ -2372,6 +2377,221 @@ namespace protobuf
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_Message2Clients_2eproto;
};
// -------------------------------------------------------------------

class MsgRes final :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:protobuf.MsgRes) */
{
public:
inline MsgRes() :
MsgRes(nullptr)
{
}
~MsgRes() override;
explicit constexpr MsgRes(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);

MsgRes(const MsgRes& from);
MsgRes(MsgRes&& from) noexcept
:
MsgRes()
{
*this = ::std::move(from);
}

inline MsgRes& operator=(const MsgRes& from)
{
CopyFrom(from);
return *this;
}
inline MsgRes& operator=(MsgRes&& from) noexcept
{
if (this == &from)
return *this;
if (GetOwningArena() == from.GetOwningArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetOwningArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
)
{
InternalSwap(&from);
}
else
{
CopyFrom(from);
}
return *this;
}

static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor()
{
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor()
{
return default_instance().GetMetadata().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection()
{
return default_instance().GetMetadata().reflection;
}
static const MsgRes& default_instance()
{
return *internal_default_instance();
}
static inline const MsgRes* internal_default_instance()
{
return reinterpret_cast<const MsgRes*>(
&_MsgRes_default_instance_
);
}
static constexpr int kIndexInFileMessages =
9;

friend void swap(MsgRes& a, MsgRes& b)
{
a.Swap(&b);
}
inline void Swap(MsgRes* other)
{
if (other == this)
return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() != nullptr &&
GetOwningArena() == other->GetOwningArena())
{
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetOwningArena() == other->GetOwningArena())
{
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
}
else
{
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(MsgRes* other)
{
if (other == this)
return;
GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena());
InternalSwap(other);
}

// implements Message ----------------------------------------------

MsgRes* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final
{
return CreateMaybeMessage<MsgRes>(arena);
}
using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom;
void CopyFrom(const MsgRes& from);
using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom;
void MergeFrom(const MsgRes& from);

private:
static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message* to, const ::PROTOBUF_NAMESPACE_ID::Message& from);

public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;

size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
uint8_t* _InternalSerialize(
uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream
) const final;
int GetCachedSize() const final
{
return _cached_size_.Get();
}

private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(MsgRes* other);

private:
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName()
{
return "protobuf.MsgRes";
}

protected:
explicit MsgRes(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false);

private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);

public:
static const ClassData _class_data_;
const ::PROTOBUF_NAMESPACE_ID::Message::ClassData* GetClassData() const final;

::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;

// nested types ----------------------------------------------------

// accessors -------------------------------------------------------

enum : int
{
kMessageReceivedFieldNumber = 3,
kFromPlayerIdFieldNumber = 2,
kHaveMessageFieldNumber = 1,
};
// string message_received = 3;
void clear_message_received();
const std::string& message_received() const;
template<typename ArgT0 = const std::string&, typename... ArgT>
void set_message_received(ArgT0&& arg0, ArgT... args);
std::string* mutable_message_received();
PROTOBUF_NODISCARD std::string* release_message_received();
void set_allocated_message_received(std::string* message_received);

private:
const std::string& _internal_message_received() const;
inline PROTOBUF_ALWAYS_INLINE void _internal_set_message_received(const std::string& value);
std::string* _internal_mutable_message_received();

public:
// int64 from_player_id = 2;
void clear_from_player_id();
int64_t from_player_id() const;
void set_from_player_id(int64_t value);

private:
int64_t _internal_from_player_id() const;
void _internal_set_from_player_id(int64_t value);

public:
// bool have_message = 1;
void clear_have_message();
bool have_message() const;
void set_have_message(bool value);

private:
bool _internal_have_message() const;
void _internal_set_have_message(bool value);

public:
// @@protoc_insertion_point(class_scope:protobuf.MsgRes)

private:
class _Internal;

template<typename T>
friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr message_received_;
int64_t from_player_id_;
bool have_message_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_Message2Clients_2eproto;
};
// ===================================================================

// ===================================================================
@@ -3895,6 +4115,115 @@ namespace protobuf
// @@protoc_insertion_point(field_set:protobuf.BoolRes.act_success)
}

// -------------------------------------------------------------------

// MsgRes

// bool have_message = 1;
inline void MsgRes::clear_have_message()
{
have_message_ = false;
}
inline bool MsgRes::_internal_have_message() const
{
return have_message_;
}
inline bool MsgRes::have_message() const
{
// @@protoc_insertion_point(field_get:protobuf.MsgRes.have_message)
return _internal_have_message();
}
inline void MsgRes::_internal_set_have_message(bool value)
{
have_message_ = value;
}
inline void MsgRes::set_have_message(bool value)
{
_internal_set_have_message(value);
// @@protoc_insertion_point(field_set:protobuf.MsgRes.have_message)
}

// int64 from_player_id = 2;
inline void MsgRes::clear_from_player_id()
{
from_player_id_ = int64_t{0};
}
inline int64_t MsgRes::_internal_from_player_id() const
{
return from_player_id_;
}
inline int64_t MsgRes::from_player_id() const
{
// @@protoc_insertion_point(field_get:protobuf.MsgRes.from_player_id)
return _internal_from_player_id();
}
inline void MsgRes::_internal_set_from_player_id(int64_t value)
{
from_player_id_ = value;
}
inline void MsgRes::set_from_player_id(int64_t value)
{
_internal_set_from_player_id(value);
// @@protoc_insertion_point(field_set:protobuf.MsgRes.from_player_id)
}

// string message_received = 3;
inline void MsgRes::clear_message_received()
{
message_received_.ClearToEmpty();
}
inline const std::string& MsgRes::message_received() const
{
// @@protoc_insertion_point(field_get:protobuf.MsgRes.message_received)
return _internal_message_received();
}
template<typename ArgT0, typename... ArgT>
inline PROTOBUF_ALWAYS_INLINE void MsgRes::set_message_received(ArgT0&& arg0, ArgT... args)
{
message_received_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, static_cast<ArgT0&&>(arg0), args..., GetArenaForAllocation());
// @@protoc_insertion_point(field_set:protobuf.MsgRes.message_received)
}
inline std::string* MsgRes::mutable_message_received()
{
std::string* _s = _internal_mutable_message_received();
// @@protoc_insertion_point(field_mutable:protobuf.MsgRes.message_received)
return _s;
}
inline const std::string& MsgRes::_internal_message_received() const
{
return message_received_.Get();
}
inline void MsgRes::_internal_set_message_received(const std::string& value)
{
message_received_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArenaForAllocation());
}
inline std::string* MsgRes::_internal_mutable_message_received()
{
return message_received_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArenaForAllocation());
}
inline std::string* MsgRes::release_message_received()
{
// @@protoc_insertion_point(field_release:protobuf.MsgRes.message_received)
return message_received_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArenaForAllocation());
}
inline void MsgRes::set_allocated_message_received(std::string* message_received)
{
if (message_received != nullptr)
{
}
else
{
}
message_received_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), message_received, GetArenaForAllocation());
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
if (message_received_.IsDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()))
{
message_received_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), "", GetArenaForAllocation());
}
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
// @@protoc_insertion_point(field_set_allocated:protobuf.MsgRes.message_received)
}

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
@@ -3914,6 +4243,8 @@ namespace protobuf

// -------------------------------------------------------------------

// -------------------------------------------------------------------

// @@protoc_insertion_point(namespace_scope)

} // namespace protobuf


+ 10
- 1
dependency/proto/Message2Clients.proto View File

@@ -90,6 +90,13 @@ message BoolRes // 用于只需要判断执行操作是否成功的行为,如
bool act_success = 1;
}

message MsgRes // 用于获取队友发来的消息
{
bool have_message = 1; // 是否有待接收的消息
int64 from_player_id = 2;
string message_received = 3;
}

service AvailableService
{
// 游戏开局调用一次的服务
@@ -101,6 +108,8 @@ service AvailableService
rpc UseProp(IDMsg) returns (BoolRes);
rpc UseSkill(IDMsg) returns (BoolRes);
rpc SendMessage(SendMsg) returns (BoolRes);
rpc HaveMessage(IDMsg) returns (BoolRes);
rpc GetMessage(IDMsg) returns (MsgRes);
rpc FixMachine(stream IDMsg) returns (stream BoolRes); // 若正常修复且未被打断则返回修复成功,位置错误/被打断则返回修复失败,下同
rpc SaveHuman(stream IDMsg) returns (stream BoolRes);
rpc Attack (AttackMsg) returns (BoolRes);
@@ -108,5 +117,5 @@ service AvailableService
rpc ReleaseHuman (IDMsg) returns (BoolRes);
rpc HangHuman (IDMsg) returns (BoolRes);
rpc Escape (IDMsg) returns (BoolRes);
}

Loading…
Cancel
Save