aboutsummaryrefslogtreecommitdiff
path: root/contrib/protoc-bnet
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/protoc-bnet')
-rw-r--r--contrib/protoc-bnet/BnetServiceGenerator.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/protoc-bnet/BnetServiceGenerator.cpp b/contrib/protoc-bnet/BnetServiceGenerator.cpp
index a47df61f6bf..955eb00bd70 100644
--- a/contrib/protoc-bnet/BnetServiceGenerator.cpp
+++ b/contrib/protoc-bnet/BnetServiceGenerator.cpp
@@ -173,11 +173,12 @@ void BnetServiceGenerator::GenerateClientMethodImplementations(pb::io::Printer*
"void $classname$::$name$($input_type$ const* request, std::function<void($output_type$ const*)> responseCallback) { \n"
" TC_LOG_DEBUG(\"service.protobuf\", \"%s Server called client method $full_name$($input_type_name${ %s })\",\n"
" GetCallerInfo().c_str(), request->ShortDebugString().c_str());\n"
- " SendRequest(service_hash_, $method_id$, request, [callback{ std::move(responseCallback) }](MessageBuffer buffer) {\n"
+ " std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void {\n"
" $output_type$ response;\n"
" if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize()))\n"
- " callback(&response);\n"
- " });\n"
+ " responseCallback(&response);\n"
+ " };\n"
+ " SendRequest(service_hash_, $method_id$, request, std::move(callback));\n"
"}\n"
"\n");
}