diff options
Diffstat (limited to 'src')
52 files changed, 1527 insertions, 1044 deletions
diff --git a/src/server/bnetserver/Services/AccountService.cpp b/src/server/bnetserver/Services/AccountService.cpp index 7e8bd619109..1accd4a6491 100644 --- a/src/server/bnetserver/Services/AccountService.cpp +++ b/src/server/bnetserver/Services/AccountService.cpp @@ -22,12 +22,12 @@ Battlenet::Services::Account::Account(Session* session) : AccountService(session { } -uint32 Battlenet::Services::Account::HandleGetAccountState(account::v1::GetAccountStateRequest const* request, account::v1::GetAccountStateResponse* response) +uint32 Battlenet::Services::Account::HandleGetAccountState(account::v1::GetAccountStateRequest const* request, account::v1::GetAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { return _session->HandleGetAccountState(request, response); } -uint32 Battlenet::Services::Account::HandleGetGameAccountState(account::v1::GetGameAccountStateRequest const* request, account::v1::GetGameAccountStateResponse* response) +uint32 Battlenet::Services::Account::HandleGetGameAccountState(account::v1::GetGameAccountStateRequest const* request, account::v1::GetGameAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { return _session->HandleGetGameAccountState(request, response); } diff --git a/src/server/bnetserver/Services/AccountService.h b/src/server/bnetserver/Services/AccountService.h index 9f9e7d89933..f543094f8dc 100644 --- a/src/server/bnetserver/Services/AccountService.h +++ b/src/server/bnetserver/Services/AccountService.h @@ -35,8 +35,8 @@ namespace Battlenet public: Account(Session* session); - uint32 HandleGetAccountState(account::v1::GetAccountStateRequest const* request, account::v1::GetAccountStateResponse* response) override; - uint32 HandleGetGameAccountState(account::v1::GetGameAccountStateRequest const* request, account::v1::GetGameAccountStateResponse* response) override; + uint32 HandleGetAccountState(account::v1::GetAccountStateRequest const* request, account::v1::GetAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; + uint32 HandleGetGameAccountState(account::v1::GetGameAccountStateRequest const* request, account::v1::GetGameAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; }; } } diff --git a/src/server/bnetserver/Services/AuthenticationService.cpp b/src/server/bnetserver/Services/AuthenticationService.cpp index 20c0ebe165c..45e9a0920f2 100644 --- a/src/server/bnetserver/Services/AuthenticationService.cpp +++ b/src/server/bnetserver/Services/AuthenticationService.cpp @@ -22,12 +22,17 @@ Battlenet::Services::Authentication::Authentication(Session* session) : Authenti { } -uint32 Battlenet::Services::Authentication::HandleLogon(authentication::v1::LogonRequest const* request, NoData* /*respons*/) +uint32 Battlenet::Services::Authentication::HandleLogon(authentication::v1::LogonRequest const* request, NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { - return _session->HandleLogon(request); + uint32 status = _session->HandleLogon(request); + // turning this into async call will be done by stealing the continuation and calling it when done + // just a test here + continuation(this, status, response); + continuation = nullptr; + return status; } -uint32 Battlenet::Services::Authentication::HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* request, NoData* /*respons*/) +uint32 Battlenet::Services::Authentication::HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* request, NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { return _session->HandleVerifyWebCredentials(request); } diff --git a/src/server/bnetserver/Services/AuthenticationService.h b/src/server/bnetserver/Services/AuthenticationService.h index 6322361135a..76c82f9af22 100644 --- a/src/server/bnetserver/Services/AuthenticationService.h +++ b/src/server/bnetserver/Services/AuthenticationService.h @@ -35,8 +35,8 @@ namespace Battlenet public: Authentication(Session* session); - uint32 HandleLogon(authentication::v1::LogonRequest const* request, NoData* respons) override; - uint32 HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* request, NoData* respons) override; + uint32 HandleLogon(authentication::v1::LogonRequest const* request, NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; + uint32 HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* request, NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; }; } } diff --git a/src/server/bnetserver/Services/ConnectionService.cpp b/src/server/bnetserver/Services/ConnectionService.cpp index 2f6d5476682..b6988e7a265 100644 --- a/src/server/bnetserver/Services/ConnectionService.cpp +++ b/src/server/bnetserver/Services/ConnectionService.cpp @@ -26,7 +26,7 @@ Battlenet::Services::Connection::Connection(Session* session) : ConnectionServic { } -uint32 Battlenet::Services::Connection::HandleConnect(connection::v1::ConnectRequest const* request, connection::v1::ConnectResponse* response) +uint32 Battlenet::Services::Connection::HandleConnect(connection::v1::ConnectRequest const* request, connection::v1::ConnectResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { if (request->has_client_id()) response->mutable_client_id()->CopyFrom(request->client_id()); diff --git a/src/server/bnetserver/Services/ConnectionService.h b/src/server/bnetserver/Services/ConnectionService.h index 98f28c0a2dc..8d6fe8f2ce7 100644 --- a/src/server/bnetserver/Services/ConnectionService.h +++ b/src/server/bnetserver/Services/ConnectionService.h @@ -35,7 +35,7 @@ namespace Battlenet public: Connection(Session* session); - uint32 HandleConnect(connection::v1::ConnectRequest const* request, connection::v1::ConnectResponse* respons) override; + uint32 HandleConnect(connection::v1::ConnectRequest const* request, connection::v1::ConnectResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; uint32 HandleKeepAlive(NoData const* request) override; uint32 HandleRequestDisconnect(connection::v1::DisconnectRequest const* request) override; diff --git a/src/server/bnetserver/Services/GameUtilitiesService.cpp b/src/server/bnetserver/Services/GameUtilitiesService.cpp index ba9df96eac8..02f1dca707e 100644 --- a/src/server/bnetserver/Services/GameUtilitiesService.cpp +++ b/src/server/bnetserver/Services/GameUtilitiesService.cpp @@ -22,12 +22,12 @@ Battlenet::Services::GameUtilities::GameUtilities(Session* session) : GameUtilit { } -uint32 Battlenet::Services::GameUtilities::HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response) +uint32 Battlenet::Services::GameUtilities::HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { return _session->HandleProcessClientRequest(request, response); } -uint32 Battlenet::Services::GameUtilities::HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response) +uint32 Battlenet::Services::GameUtilities::HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { return _session->HandleGetAllValuesForAttribute(request, response); } diff --git a/src/server/bnetserver/Services/GameUtilitiesService.h b/src/server/bnetserver/Services/GameUtilitiesService.h index fba84e3e4be..2f0811ef444 100644 --- a/src/server/bnetserver/Services/GameUtilitiesService.h +++ b/src/server/bnetserver/Services/GameUtilitiesService.h @@ -35,8 +35,8 @@ namespace Battlenet public: GameUtilities(Session* session); - uint32 HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response) override; - uint32 HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response) override; + uint32 HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; + uint32 HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; }; } } diff --git a/src/server/bnetserver/Services/ServiceDispatcher.cpp b/src/server/bnetserver/Services/ServiceDispatcher.cpp index d3eff79c0f0..08ccb0a4122 100644 --- a/src/server/bnetserver/Services/ServiceDispatcher.cpp +++ b/src/server/bnetserver/Services/ServiceDispatcher.cpp @@ -36,7 +36,7 @@ void Battlenet::ServiceDispatcher::Dispatch(Session* session, uint32 serviceHash { auto itr = _dispatchers.find(serviceHash); if (itr != _dispatchers.end()) - itr->second(session, token, methodId, std::forward<MessageBuffer>(buffer)); + itr->second(session, token, methodId, std::move(buffer)); else TC_LOG_DEBUG("session.rpc", "%s tried to call invalid service 0x%X", session->GetClientInfo().c_str(), serviceHash); } diff --git a/src/server/bnetserver/Services/ServiceDispatcher.h b/src/server/bnetserver/Services/ServiceDispatcher.h index 5838c2b80eb..cfeb055f86b 100644 --- a/src/server/bnetserver/Services/ServiceDispatcher.h +++ b/src/server/bnetserver/Services/ServiceDispatcher.h @@ -56,10 +56,12 @@ namespace Battlenet template<class Service> static void Dispatch(Session* session, uint32 token, uint32 methodId, MessageBuffer buffer) { - Service(session).CallServerMethod(token, methodId, std::forward<MessageBuffer>(buffer)); + Service(session).CallServerMethod(token, methodId, std::move(buffer)); } - std::unordered_map<uint32, std::function<void(Session*, uint32, uint32, MessageBuffer)>> _dispatchers; + typedef void(*ServiceMethod)(Session*, uint32, uint32, MessageBuffer); + // use identity hashing for map keys as they are already a hash (FNV1a of service name) + std::unordered_map<uint32, ServiceMethod, std::identity<uint32>> _dispatchers; }; } diff --git a/src/server/game/Services/WorldserverService.cpp b/src/server/game/Services/WorldserverService.cpp index 779bb10adac..a1fc28b9625 100644 --- a/src/server/game/Services/WorldserverService.cpp +++ b/src/server/game/Services/WorldserverService.cpp @@ -30,7 +30,7 @@ Battlenet::GameUtilitiesService::GameUtilitiesService(WorldSession* session) : B { } -uint32 Battlenet::GameUtilitiesService::HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response) +uint32 Battlenet::GameUtilitiesService::HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { Attribute const* command = nullptr; std::unordered_map<std::string, Variant const*> params; @@ -107,7 +107,7 @@ uint32 Battlenet::GameUtilitiesService::HandleRealmJoinRequest(std::unordered_ma return ERROR_WOW_SERVICES_INVALID_JOIN_TICKET; } -uint32 Battlenet::GameUtilitiesService::HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response) +uint32 Battlenet::GameUtilitiesService::HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& /*continuation*/) { if (request->attribute_key() == "Command_RealmListRequest_v1_b9") { diff --git a/src/server/game/Services/WorldserverService.h b/src/server/game/Services/WorldserverService.h index 54bb3a076c5..90eaf80f229 100644 --- a/src/server/game/Services/WorldserverService.h +++ b/src/server/game/Services/WorldserverService.h @@ -59,8 +59,8 @@ namespace Battlenet public: GameUtilitiesService(WorldSession* session); - uint32 HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response) override; - uint32 HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response) override; + uint32 HandleProcessClientRequest(game_utilities::v1::ClientRequest const* request, game_utilities::v1::ClientResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; + uint32 HandleGetAllValuesForAttribute(game_utilities::v1::GetAllValuesForAttributeRequest const* request, game_utilities::v1::GetAllValuesForAttributeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; private: uint32 HandleRealmListRequest(std::unordered_map<std::string, Variant const*> params, game_utilities::v1::ClientResponse* response); diff --git a/src/server/game/Services/WorldserverServiceDispatcher.cpp b/src/server/game/Services/WorldserverServiceDispatcher.cpp index 3e640542a1b..2dfbe3ec23d 100644 --- a/src/server/game/Services/WorldserverServiceDispatcher.cpp +++ b/src/server/game/Services/WorldserverServiceDispatcher.cpp @@ -37,7 +37,7 @@ void Battlenet::WorldserverServiceDispatcher::Dispatch(WorldSession* session, ui { auto itr = _dispatchers.find(serviceHash); if (itr != _dispatchers.end()) - itr->second(session, token, methodId, std::forward<MessageBuffer>(buffer)); + itr->second(session, token, methodId, std::move(buffer)); else TC_LOG_DEBUG("session.rpc", "%s tried to call invalid service 0x%X", session->GetPlayerInfo().c_str(), serviceHash); } diff --git a/src/server/game/Services/WorldserverServiceDispatcher.h b/src/server/game/Services/WorldserverServiceDispatcher.h index c84aa1f40cc..99e9446f80e 100644 --- a/src/server/game/Services/WorldserverServiceDispatcher.h +++ b/src/server/game/Services/WorldserverServiceDispatcher.h @@ -55,10 +55,12 @@ namespace Battlenet template<class Service> static void Dispatch(WorldSession* session, uint32 token, uint32 methodId, MessageBuffer buffer) { - Service(session).CallServerMethod(token, methodId, std::forward<MessageBuffer>(buffer)); + Service(session).CallServerMethod(token, methodId, std::move(buffer)); } - std::unordered_map<uint32, std::function<void(WorldSession*, uint32, uint32, MessageBuffer)>> _dispatchers; + typedef void(*ServiceMethod)(WorldSession*, uint32, uint32, MessageBuffer); + // use identity hashing for map keys as they are already a hash (FNV1a of service name) + std::unordered_map<uint32, ServiceMethod, std::identity<uint32>> _dispatchers; }; } diff --git a/src/server/proto/Client/account_service.pb.cc b/src/server/proto/Client/account_service.pb.cc index 0237fa685a7..3ce26ed5c28 100644 --- a/src/server/proto/Client/account_service.pb.cc +++ b/src/server/proto/Client/account_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace account { @@ -12574,7 +12570,7 @@ void AccountService::IsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequ SendRequest(service_hash_, 15, request, std::move(callback)); } -void AccountService::CacheExpire(::bgs::protocol::account::v1::CacheExpireRequest const* request) { +void AccountService::CacheExpire(::bgs::protocol::account::v1::CacheExpireRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.CacheExpire(bgs.protocol.account.v1.CacheExpireRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 20, request); @@ -12701,13 +12697,13 @@ void AccountService::GetAuthorizedData(::bgs::protocol::account::v1::GetAuthoriz SendRequest(service_hash_, 37, request, std::move(callback)); } -void AccountService::AccountFlagUpdate(::bgs::protocol::account::v1::AccountFlagUpdateRequest const* request) { +void AccountService::AccountFlagUpdate(::bgs::protocol::account::v1::AccountFlagUpdateRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.AccountFlagUpdate(bgs.protocol.account.v1.AccountFlagUpdateRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 38, request); } -void AccountService::GameAccountFlagUpdate(::bgs::protocol::account::v1::GameAccountFlagUpdateRequest const* request) { +void AccountService::GameAccountFlagUpdate(::bgs::protocol::account::v1::GameAccountFlagUpdateRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GameAccountFlagUpdate(bgs.protocol.account.v1.GameAccountFlagUpdateRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 39, request); @@ -12766,15 +12762,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 12, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccountBlob(bgs.protocol.account.v1.GameAccountHandle{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GameAccountBlob::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccountBlob() returned bgs.protocol.account.v1.GameAccountBlob{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 12, token, response); + else + self->SendResponse(self->service_hash_, 12, token, status); + }; ::bgs::protocol::account::v1::GameAccountBlob response; - uint32 status = HandleGetGameAccountBlob(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccountBlob(bgs.protocol.account.v1.GameAccountHandle{ %s }) returned bgs.protocol.account.v1.GameAccountBlob{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 12, token, &response); - else - SendResponse(service_hash_, 12, token, status); + uint32 status = HandleGetGameAccountBlob(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 13: { @@ -12784,15 +12788,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 13, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAccount(bgs.protocol.account.v1.GetAccountRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetAccountResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAccount() returned bgs.protocol.account.v1.GetAccountResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 13, token, response); + else + self->SendResponse(self->service_hash_, 13, token, status); + }; ::bgs::protocol::account::v1::GetAccountResponse response; - uint32 status = HandleGetAccount(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAccount(bgs.protocol.account.v1.GetAccountRequest{ %s }) returned bgs.protocol.account.v1.GetAccountResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 13, token, &response); - else - SendResponse(service_hash_, 13, token, status); + uint32 status = HandleGetAccount(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 14: { @@ -12802,15 +12814,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 14, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CreateGameAccount(bgs.protocol.account.v1.CreateGameAccountRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GameAccountHandle::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CreateGameAccount() returned bgs.protocol.account.v1.GameAccountHandle{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 14, token, response); + else + self->SendResponse(self->service_hash_, 14, token, status); + }; ::bgs::protocol::account::v1::GameAccountHandle response; - uint32 status = HandleCreateGameAccount(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CreateGameAccount(bgs.protocol.account.v1.CreateGameAccountRequest{ %s }) returned bgs.protocol.account.v1.GameAccountHandle{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 14, token, &response); - else - SendResponse(service_hash_, 14, token, status); + uint32 status = HandleCreateGameAccount(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 15: { @@ -12820,15 +12840,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 15, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.IsIgrAddress(bgs.protocol.account.v1.IsIgrAddressRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.IsIgrAddress() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 15, token, response); + else + self->SendResponse(self->service_hash_, 15, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleIsIgrAddress(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.IsIgrAddress(bgs.protocol.account.v1.IsIgrAddressRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 15, token, &response); - else - SendResponse(service_hash_, 15, token, status); + uint32 status = HandleIsIgrAddress(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 20: { @@ -12838,7 +12866,6 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 20, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleCacheExpire(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CacheExpire(bgs.protocol.account.v1.CacheExpireRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -12853,15 +12880,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 21, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CredentialUpdate(bgs.protocol.account.v1.CredentialUpdateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::CredentialUpdateResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CredentialUpdate() returned bgs.protocol.account.v1.CredentialUpdateResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 21, token, response); + else + self->SendResponse(self->service_hash_, 21, token, status); + }; ::bgs::protocol::account::v1::CredentialUpdateResponse response; - uint32 status = HandleCredentialUpdate(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CredentialUpdate(bgs.protocol.account.v1.CredentialUpdateRequest{ %s }) returned bgs.protocol.account.v1.CredentialUpdateResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 21, token, &response); - else - SendResponse(service_hash_, 21, token, status); + uint32 status = HandleCredentialUpdate(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 25: { @@ -12871,15 +12906,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 25, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.Subscribe(bgs.protocol.account.v1.SubscriptionUpdateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::SubscriptionUpdateResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.Subscribe() returned bgs.protocol.account.v1.SubscriptionUpdateResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 25, token, response); + else + self->SendResponse(self->service_hash_, 25, token, status); + }; ::bgs::protocol::account::v1::SubscriptionUpdateResponse response; - uint32 status = HandleSubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.Subscribe(bgs.protocol.account.v1.SubscriptionUpdateRequest{ %s }) returned bgs.protocol.account.v1.SubscriptionUpdateResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 25, token, &response); - else - SendResponse(service_hash_, 25, token, status); + uint32 status = HandleSubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 26: { @@ -12889,15 +12932,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 26, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.Unsubscribe(bgs.protocol.account.v1.SubscriptionUpdateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.Unsubscribe() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 26, token, response); + else + self->SendResponse(self->service_hash_, 26, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUnsubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.Unsubscribe(bgs.protocol.account.v1.SubscriptionUpdateRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 26, token, &response); - else - SendResponse(service_hash_, 26, token, status); + uint32 status = HandleUnsubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 30: { @@ -12907,15 +12958,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 30, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAccountState(bgs.protocol.account.v1.GetAccountStateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetAccountStateResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAccountState() returned bgs.protocol.account.v1.GetAccountStateResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 30, token, response); + else + self->SendResponse(self->service_hash_, 30, token, status); + }; ::bgs::protocol::account::v1::GetAccountStateResponse response; - uint32 status = HandleGetAccountState(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAccountState(bgs.protocol.account.v1.GetAccountStateRequest{ %s }) returned bgs.protocol.account.v1.GetAccountStateResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 30, token, &response); - else - SendResponse(service_hash_, 30, token, status); + uint32 status = HandleGetAccountState(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 31: { @@ -12925,15 +12984,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 31, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccountState(bgs.protocol.account.v1.GetGameAccountStateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetGameAccountStateResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccountState() returned bgs.protocol.account.v1.GetGameAccountStateResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 31, token, response); + else + self->SendResponse(self->service_hash_, 31, token, status); + }; ::bgs::protocol::account::v1::GetGameAccountStateResponse response; - uint32 status = HandleGetGameAccountState(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccountState(bgs.protocol.account.v1.GetGameAccountStateRequest{ %s }) returned bgs.protocol.account.v1.GetGameAccountStateResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 31, token, &response); - else - SendResponse(service_hash_, 31, token, status); + uint32 status = HandleGetGameAccountState(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 32: { @@ -12943,15 +13010,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 32, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetLicenses(bgs.protocol.account.v1.GetLicensesRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetLicensesResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetLicenses() returned bgs.protocol.account.v1.GetLicensesResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 32, token, response); + else + self->SendResponse(self->service_hash_, 32, token, status); + }; ::bgs::protocol::account::v1::GetLicensesResponse response; - uint32 status = HandleGetLicenses(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetLicenses(bgs.protocol.account.v1.GetLicensesRequest{ %s }) returned bgs.protocol.account.v1.GetLicensesResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 32, token, &response); - else - SendResponse(service_hash_, 32, token, status); + uint32 status = HandleGetLicenses(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 33: { @@ -12961,15 +13036,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 33, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameTimeRemainingInfo(bgs.protocol.account.v1.GetGameTimeRemainingInfoRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameTimeRemainingInfo() returned bgs.protocol.account.v1.GetGameTimeRemainingInfoResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 33, token, response); + else + self->SendResponse(self->service_hash_, 33, token, status); + }; ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse response; - uint32 status = HandleGetGameTimeRemainingInfo(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameTimeRemainingInfo(bgs.protocol.account.v1.GetGameTimeRemainingInfoRequest{ %s }) returned bgs.protocol.account.v1.GetGameTimeRemainingInfoResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 33, token, &response); - else - SendResponse(service_hash_, 33, token, status); + uint32 status = HandleGetGameTimeRemainingInfo(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 34: { @@ -12979,15 +13062,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 34, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameSessionInfo(bgs.protocol.account.v1.GetGameSessionInfoRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetGameSessionInfoResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameSessionInfo() returned bgs.protocol.account.v1.GetGameSessionInfoResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 34, token, response); + else + self->SendResponse(self->service_hash_, 34, token, status); + }; ::bgs::protocol::account::v1::GetGameSessionInfoResponse response; - uint32 status = HandleGetGameSessionInfo(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameSessionInfo(bgs.protocol.account.v1.GetGameSessionInfoRequest{ %s }) returned bgs.protocol.account.v1.GetGameSessionInfoResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 34, token, &response); - else - SendResponse(service_hash_, 34, token, status); + uint32 status = HandleGetGameSessionInfo(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 35: { @@ -12997,15 +13088,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 35, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetCAISInfo(bgs.protocol.account.v1.GetCAISInfoRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetCAISInfoResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetCAISInfo() returned bgs.protocol.account.v1.GetCAISInfoResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 35, token, response); + else + self->SendResponse(self->service_hash_, 35, token, status); + }; ::bgs::protocol::account::v1::GetCAISInfoResponse response; - uint32 status = HandleGetCAISInfo(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetCAISInfo(bgs.protocol.account.v1.GetCAISInfoRequest{ %s }) returned bgs.protocol.account.v1.GetCAISInfoResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 35, token, &response); - else - SendResponse(service_hash_, 35, token, status); + uint32 status = HandleGetCAISInfo(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 36: { @@ -13015,15 +13114,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 36, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.ForwardCacheExpire(bgs.protocol.account.v1.ForwardCacheExpireRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.ForwardCacheExpire() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 36, token, response); + else + self->SendResponse(self->service_hash_, 36, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleForwardCacheExpire(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.ForwardCacheExpire(bgs.protocol.account.v1.ForwardCacheExpireRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 36, token, &response); - else - SendResponse(service_hash_, 36, token, status); + uint32 status = HandleForwardCacheExpire(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 37: { @@ -13033,15 +13140,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 37, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAuthorizedData(bgs.protocol.account.v1.GetAuthorizedDataRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetAuthorizedDataResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAuthorizedData() returned bgs.protocol.account.v1.GetAuthorizedDataResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 37, token, response); + else + self->SendResponse(self->service_hash_, 37, token, status); + }; ::bgs::protocol::account::v1::GetAuthorizedDataResponse response; - uint32 status = HandleGetAuthorizedData(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetAuthorizedData(bgs.protocol.account.v1.GetAuthorizedDataRequest{ %s }) returned bgs.protocol.account.v1.GetAuthorizedDataResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 37, token, &response); - else - SendResponse(service_hash_, 37, token, status); + uint32 status = HandleGetAuthorizedData(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 38: { @@ -13051,7 +13166,6 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 38, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleAccountFlagUpdate(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.AccountFlagUpdate(bgs.protocol.account.v1.AccountFlagUpdateRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -13066,7 +13180,6 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 39, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleGameAccountFlagUpdate(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GameAccountFlagUpdate(bgs.protocol.account.v1.GameAccountFlagUpdateRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -13081,15 +13194,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 40, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.UpdateParentalControlsAndCAIS(bgs.protocol.account.v1.UpdateParentalControlsAndCAISRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.UpdateParentalControlsAndCAIS() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 40, token, response); + else + self->SendResponse(self->service_hash_, 40, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUpdateParentalControlsAndCAIS(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.UpdateParentalControlsAndCAIS(bgs.protocol.account.v1.UpdateParentalControlsAndCAISRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 40, token, &response); - else - SendResponse(service_hash_, 40, token, status); + uint32 status = HandleUpdateParentalControlsAndCAIS(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 41: { @@ -13099,15 +13220,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 41, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CreateGameAccount2(bgs.protocol.account.v1.CreateGameAccountRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::CreateGameAccountResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CreateGameAccount2() returned bgs.protocol.account.v1.CreateGameAccountResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 41, token, response); + else + self->SendResponse(self->service_hash_, 41, token, status); + }; ::bgs::protocol::account::v1::CreateGameAccountResponse response; - uint32 status = HandleCreateGameAccount2(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.CreateGameAccount2(bgs.protocol.account.v1.CreateGameAccountRequest{ %s }) returned bgs.protocol.account.v1.CreateGameAccountResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 41, token, &response); - else - SendResponse(service_hash_, 41, token, status); + uint32 status = HandleCreateGameAccount2(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 42: { @@ -13117,15 +13246,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 42, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccount(bgs.protocol.account.v1.GetGameAccountRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetGameAccountResponse::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccount() returned bgs.protocol.account.v1.GetGameAccountResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 42, token, response); + else + self->SendResponse(self->service_hash_, 42, token, status); + }; ::bgs::protocol::account::v1::GetGameAccountResponse response; - uint32 status = HandleGetGameAccount(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetGameAccount(bgs.protocol.account.v1.GetGameAccountRequest{ %s }) returned bgs.protocol.account.v1.GetGameAccountResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 42, token, &response); - else - SendResponse(service_hash_, 42, token, status); + uint32 status = HandleGetGameAccount(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 43: { @@ -13135,15 +13272,23 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 43, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.QueueDeductRecord(bgs.protocol.account.v1.QueueDeductRecordRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AccountService* self = static_cast<AccountService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.QueueDeductRecord() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 43, token, response); + else + self->SendResponse(self->service_hash_, 43, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleQueueDeductRecord(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.QueueDeductRecord(bgs.protocol.account.v1.QueueDeductRecordRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 43, token, &response); - else - SendResponse(service_hash_, 43, token, status); + uint32 status = HandleQueueDeductRecord(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -13153,25 +13298,25 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff } } -uint32 AccountService::HandleGetGameAccountBlob(::bgs::protocol::account::v1::GameAccountHandle const* request, ::bgs::protocol::account::v1::GameAccountBlob* response) { +uint32 AccountService::HandleGetGameAccountBlob(::bgs::protocol::account::v1::GameAccountHandle const* request, ::bgs::protocol::account::v1::GameAccountBlob* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetGameAccountBlob({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetAccount(::bgs::protocol::account::v1::GetAccountRequest const* request, ::bgs::protocol::account::v1::GetAccountResponse* response) { +uint32 AccountService::HandleGetAccount(::bgs::protocol::account::v1::GetAccountRequest const* request, ::bgs::protocol::account::v1::GetAccountResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetAccount({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleCreateGameAccount(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::GameAccountHandle* response) { +uint32 AccountService::HandleCreateGameAccount(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::GameAccountHandle* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.CreateGameAccount({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleIsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AccountService::HandleIsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.IsIgrAddress({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -13183,67 +13328,67 @@ uint32 AccountService::HandleCacheExpire(::bgs::protocol::account::v1::CacheExpi return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleCredentialUpdate(::bgs::protocol::account::v1::CredentialUpdateRequest const* request, ::bgs::protocol::account::v1::CredentialUpdateResponse* response) { +uint32 AccountService::HandleCredentialUpdate(::bgs::protocol::account::v1::CredentialUpdateRequest const* request, ::bgs::protocol::account::v1::CredentialUpdateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.CredentialUpdate({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleSubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::account::v1::SubscriptionUpdateResponse* response) { +uint32 AccountService::HandleSubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::account::v1::SubscriptionUpdateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.Subscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleUnsubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AccountService::HandleUnsubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.Unsubscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetAccountState(::bgs::protocol::account::v1::GetAccountStateRequest const* request, ::bgs::protocol::account::v1::GetAccountStateResponse* response) { +uint32 AccountService::HandleGetAccountState(::bgs::protocol::account::v1::GetAccountStateRequest const* request, ::bgs::protocol::account::v1::GetAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetAccountState({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetGameAccountState(::bgs::protocol::account::v1::GetGameAccountStateRequest const* request, ::bgs::protocol::account::v1::GetGameAccountStateResponse* response) { +uint32 AccountService::HandleGetGameAccountState(::bgs::protocol::account::v1::GetGameAccountStateRequest const* request, ::bgs::protocol::account::v1::GetGameAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetGameAccountState({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetLicenses(::bgs::protocol::account::v1::GetLicensesRequest const* request, ::bgs::protocol::account::v1::GetLicensesResponse* response) { +uint32 AccountService::HandleGetLicenses(::bgs::protocol::account::v1::GetLicensesRequest const* request, ::bgs::protocol::account::v1::GetLicensesResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetLicenses({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetGameTimeRemainingInfo(::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest const* request, ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse* response) { +uint32 AccountService::HandleGetGameTimeRemainingInfo(::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest const* request, ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetGameTimeRemainingInfo({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetGameSessionInfo(::bgs::protocol::account::v1::GetGameSessionInfoRequest const* request, ::bgs::protocol::account::v1::GetGameSessionInfoResponse* response) { +uint32 AccountService::HandleGetGameSessionInfo(::bgs::protocol::account::v1::GetGameSessionInfoRequest const* request, ::bgs::protocol::account::v1::GetGameSessionInfoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetGameSessionInfo({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetCAISInfo(::bgs::protocol::account::v1::GetCAISInfoRequest const* request, ::bgs::protocol::account::v1::GetCAISInfoResponse* response) { +uint32 AccountService::HandleGetCAISInfo(::bgs::protocol::account::v1::GetCAISInfoRequest const* request, ::bgs::protocol::account::v1::GetCAISInfoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetCAISInfo({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleForwardCacheExpire(::bgs::protocol::account::v1::ForwardCacheExpireRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AccountService::HandleForwardCacheExpire(::bgs::protocol::account::v1::ForwardCacheExpireRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.ForwardCacheExpire({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetAuthorizedData(::bgs::protocol::account::v1::GetAuthorizedDataRequest const* request, ::bgs::protocol::account::v1::GetAuthorizedDataResponse* response) { +uint32 AccountService::HandleGetAuthorizedData(::bgs::protocol::account::v1::GetAuthorizedDataRequest const* request, ::bgs::protocol::account::v1::GetAuthorizedDataResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetAuthorizedData({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -13261,25 +13406,25 @@ uint32 AccountService::HandleGameAccountFlagUpdate(::bgs::protocol::account::v1: return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleUpdateParentalControlsAndCAIS(::bgs::protocol::account::v1::UpdateParentalControlsAndCAISRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AccountService::HandleUpdateParentalControlsAndCAIS(::bgs::protocol::account::v1::UpdateParentalControlsAndCAISRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.UpdateParentalControlsAndCAIS({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleCreateGameAccount2(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::CreateGameAccountResponse* response) { +uint32 AccountService::HandleCreateGameAccount2(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::CreateGameAccountResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.CreateGameAccount2({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleGetGameAccount(::bgs::protocol::account::v1::GetGameAccountRequest const* request, ::bgs::protocol::account::v1::GetGameAccountResponse* response) { +uint32 AccountService::HandleGetGameAccount(::bgs::protocol::account::v1::GetGameAccountRequest const* request, ::bgs::protocol::account::v1::GetGameAccountResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.GetGameAccount({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AccountService::HandleQueueDeductRecord(::bgs::protocol::account::v1::QueueDeductRecordRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AccountService::HandleQueueDeductRecord(::bgs::protocol::account::v1::QueueDeductRecordRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountService.QueueDeductRecord({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -13298,25 +13443,25 @@ google::protobuf::ServiceDescriptor const* AccountListener::descriptor() { return AccountListener_descriptor_; } -void AccountListener::OnAccountStateUpdated(::bgs::protocol::account::v1::AccountStateNotification const* request) { +void AccountListener::OnAccountStateUpdated(::bgs::protocol::account::v1::AccountStateNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountListener.OnAccountStateUpdated(bgs.protocol.account.v1.AccountStateNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 1, request); } -void AccountListener::OnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request) { +void AccountListener::OnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountListener.OnGameAccountStateUpdated(bgs.protocol.account.v1.GameAccountStateNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 2, request); } -void AccountListener::OnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request) { +void AccountListener::OnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountListener.OnGameAccountsUpdated(bgs.protocol.account.v1.GameAccountNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 3, request); } -void AccountListener::OnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request) { +void AccountListener::OnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountListener.OnGameSessionUpdated(bgs.protocol.account.v1.GameAccountSessionNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 4, request); @@ -13331,7 +13476,6 @@ void AccountListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnAccountStateUpdated(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountListener.OnAccountStateUpdated(bgs.protocol.account.v1.AccountStateNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -13346,7 +13490,6 @@ void AccountListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnGameAccountStateUpdated(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountListener.OnGameAccountStateUpdated(bgs.protocol.account.v1.GameAccountStateNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -13361,7 +13504,6 @@ void AccountListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnGameAccountsUpdated(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountListener.OnGameAccountsUpdated(bgs.protocol.account.v1.GameAccountNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -13376,7 +13518,6 @@ void AccountListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnGameSessionUpdated(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountListener.OnGameSessionUpdated(bgs.protocol.account.v1.GameAccountSessionNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); diff --git a/src/server/proto/Client/account_service.pb.h b/src/server/proto/Client/account_service.pb.h index 50b084e17dd..5dec970ce07 100644 --- a/src/server/proto/Client/account_service.pb.h +++ b/src/server/proto/Client/account_service.pb.h @@ -3865,28 +3865,28 @@ class TC_PROTO_API AccountService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleGetGameAccountBlob(::bgs::protocol::account::v1::GameAccountHandle const* request, ::bgs::protocol::account::v1::GameAccountBlob* response); - virtual uint32 HandleGetAccount(::bgs::protocol::account::v1::GetAccountRequest const* request, ::bgs::protocol::account::v1::GetAccountResponse* response); - virtual uint32 HandleCreateGameAccount(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::GameAccountHandle* response); - virtual uint32 HandleIsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleGetGameAccountBlob(::bgs::protocol::account::v1::GameAccountHandle const* request, ::bgs::protocol::account::v1::GameAccountBlob* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetAccount(::bgs::protocol::account::v1::GetAccountRequest const* request, ::bgs::protocol::account::v1::GetAccountResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleCreateGameAccount(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::GameAccountHandle* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleIsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleCacheExpire(::bgs::protocol::account::v1::CacheExpireRequest const* request); - virtual uint32 HandleCredentialUpdate(::bgs::protocol::account::v1::CredentialUpdateRequest const* request, ::bgs::protocol::account::v1::CredentialUpdateResponse* response); - virtual uint32 HandleSubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::account::v1::SubscriptionUpdateResponse* response); - virtual uint32 HandleUnsubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleGetAccountState(::bgs::protocol::account::v1::GetAccountStateRequest const* request, ::bgs::protocol::account::v1::GetAccountStateResponse* response); - virtual uint32 HandleGetGameAccountState(::bgs::protocol::account::v1::GetGameAccountStateRequest const* request, ::bgs::protocol::account::v1::GetGameAccountStateResponse* response); - virtual uint32 HandleGetLicenses(::bgs::protocol::account::v1::GetLicensesRequest const* request, ::bgs::protocol::account::v1::GetLicensesResponse* response); - virtual uint32 HandleGetGameTimeRemainingInfo(::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest const* request, ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse* response); - virtual uint32 HandleGetGameSessionInfo(::bgs::protocol::account::v1::GetGameSessionInfoRequest const* request, ::bgs::protocol::account::v1::GetGameSessionInfoResponse* response); - virtual uint32 HandleGetCAISInfo(::bgs::protocol::account::v1::GetCAISInfoRequest const* request, ::bgs::protocol::account::v1::GetCAISInfoResponse* response); - virtual uint32 HandleForwardCacheExpire(::bgs::protocol::account::v1::ForwardCacheExpireRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleGetAuthorizedData(::bgs::protocol::account::v1::GetAuthorizedDataRequest const* request, ::bgs::protocol::account::v1::GetAuthorizedDataResponse* response); + virtual uint32 HandleCredentialUpdate(::bgs::protocol::account::v1::CredentialUpdateRequest const* request, ::bgs::protocol::account::v1::CredentialUpdateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::account::v1::SubscriptionUpdateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUnsubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetAccountState(::bgs::protocol::account::v1::GetAccountStateRequest const* request, ::bgs::protocol::account::v1::GetAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetGameAccountState(::bgs::protocol::account::v1::GetGameAccountStateRequest const* request, ::bgs::protocol::account::v1::GetGameAccountStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetLicenses(::bgs::protocol::account::v1::GetLicensesRequest const* request, ::bgs::protocol::account::v1::GetLicensesResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetGameTimeRemainingInfo(::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest const* request, ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetGameSessionInfo(::bgs::protocol::account::v1::GetGameSessionInfoRequest const* request, ::bgs::protocol::account::v1::GetGameSessionInfoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetCAISInfo(::bgs::protocol::account::v1::GetCAISInfoRequest const* request, ::bgs::protocol::account::v1::GetCAISInfoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleForwardCacheExpire(::bgs::protocol::account::v1::ForwardCacheExpireRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetAuthorizedData(::bgs::protocol::account::v1::GetAuthorizedDataRequest const* request, ::bgs::protocol::account::v1::GetAuthorizedDataResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleAccountFlagUpdate(::bgs::protocol::account::v1::AccountFlagUpdateRequest const* request); virtual uint32 HandleGameAccountFlagUpdate(::bgs::protocol::account::v1::GameAccountFlagUpdateRequest const* request); - virtual uint32 HandleUpdateParentalControlsAndCAIS(::bgs::protocol::account::v1::UpdateParentalControlsAndCAISRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleCreateGameAccount2(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::CreateGameAccountResponse* response); - virtual uint32 HandleGetGameAccount(::bgs::protocol::account::v1::GetGameAccountRequest const* request, ::bgs::protocol::account::v1::GetGameAccountResponse* response); - virtual uint32 HandleQueueDeductRecord(::bgs::protocol::account::v1::QueueDeductRecordRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleUpdateParentalControlsAndCAIS(::bgs::protocol::account::v1::UpdateParentalControlsAndCAISRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleCreateGameAccount2(::bgs::protocol::account::v1::CreateGameAccountRequest const* request, ::bgs::protocol::account::v1::CreateGameAccountResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetGameAccount(::bgs::protocol::account::v1::GetGameAccountRequest const* request, ::bgs::protocol::account::v1::GetGameAccountResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleQueueDeductRecord(::bgs::protocol::account::v1::QueueDeductRecordRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/account_types.pb.cc b/src/server/proto/Client/account_types.pb.cc index 7e6a8e1490b..ec77b9b7650 100644 --- a/src/server/proto/Client/account_types.pb.cc +++ b/src/server/proto/Client/account_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace account { diff --git a/src/server/proto/Client/attribute_types.pb.cc b/src/server/proto/Client/attribute_types.pb.cc index 105a72cf1bb..f2f7842ead0 100644 --- a/src/server/proto/Client/attribute_types.pb.cc +++ b/src/server/proto/Client/attribute_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { diff --git a/src/server/proto/Client/authentication_service.pb.cc b/src/server/proto/Client/authentication_service.pb.cc index 44a30da81b7..aa13b55441f 100644 --- a/src/server/proto/Client/authentication_service.pb.cc +++ b/src/server/proto/Client/authentication_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace authentication { @@ -7167,7 +7163,7 @@ google::protobuf::ServiceDescriptor const* AuthenticationListener::descriptor() return AuthenticationListener_descriptor_; } -void AuthenticationListener::OnModuleLoad(::bgs::protocol::authentication::v1::ModuleLoadRequest const* request) { +void AuthenticationListener::OnModuleLoad(::bgs::protocol::authentication::v1::ModuleLoadRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnModuleLoad(bgs.protocol.authentication.v1.ModuleLoadRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 1, request); @@ -7184,13 +7180,13 @@ void AuthenticationListener::OnModuleMessage(::bgs::protocol::authentication::v1 SendRequest(service_hash_, 2, request, std::move(callback)); } -void AuthenticationListener::OnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request) { +void AuthenticationListener::OnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnServerStateChange(bgs.protocol.authentication.v1.ServerStateChangeRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 4, request); } -void AuthenticationListener::OnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request) { +void AuthenticationListener::OnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnLogonComplete(bgs.protocol.authentication.v1.LogonResult{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 5, request); @@ -7207,31 +7203,31 @@ void AuthenticationListener::OnMemModuleLoad(::bgs::protocol::authentication::v1 SendRequest(service_hash_, 6, request, std::move(callback)); } -void AuthenticationListener::OnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request) { +void AuthenticationListener::OnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnLogonUpdate(bgs.protocol.authentication.v1.LogonUpdateRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 10, request); } -void AuthenticationListener::OnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request) { +void AuthenticationListener::OnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnVersionInfoUpdated(bgs.protocol.authentication.v1.VersionInfoNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 11, request); } -void AuthenticationListener::OnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request) { +void AuthenticationListener::OnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnLogonQueueUpdate(bgs.protocol.authentication.v1.LogonQueueUpdateRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 12, request); } -void AuthenticationListener::OnLogonQueueEnd(::bgs::protocol::NoData const* request) { +void AuthenticationListener::OnLogonQueueEnd(::bgs::protocol::NoData const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnLogonQueueEnd(bgs.protocol.NoData{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 13, request); } -void AuthenticationListener::OnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request) { +void AuthenticationListener::OnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnGameAccountSelected(bgs.protocol.authentication.v1.GameAccountSelectedRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 14, request); @@ -7246,7 +7242,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnModuleLoad(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnModuleLoad(bgs.protocol.authentication.v1.ModuleLoadRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7261,15 +7256,23 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationListener* self = static_cast<AuthenticationListener*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnModuleMessage() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleOnModuleMessage(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleOnModuleMessage(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -7279,7 +7282,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnServerStateChange(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnServerStateChange(bgs.protocol.authentication.v1.ServerStateChangeRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7294,7 +7296,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnLogonComplete(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnLogonComplete(bgs.protocol.authentication.v1.LogonResult{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7309,15 +7310,23 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnMemModuleLoad(bgs.protocol.authentication.v1.MemModuleLoadRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::authentication::v1::MemModuleLoadResponse::descriptor()); + AuthenticationListener* self = static_cast<AuthenticationListener*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnMemModuleLoad() returned bgs.protocol.authentication.v1.MemModuleLoadResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 6, token, response); + else + self->SendResponse(self->service_hash_, 6, token, status); + }; ::bgs::protocol::authentication::v1::MemModuleLoadResponse response; - uint32 status = HandleOnMemModuleLoad(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnMemModuleLoad(bgs.protocol.authentication.v1.MemModuleLoadRequest{ %s }) returned bgs.protocol.authentication.v1.MemModuleLoadResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 6, token, &response); - else - SendResponse(service_hash_, 6, token, status); + uint32 status = HandleOnMemModuleLoad(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 10: { @@ -7327,7 +7336,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnLogonUpdate(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnLogonUpdate(bgs.protocol.authentication.v1.LogonUpdateRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7342,7 +7350,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnVersionInfoUpdated(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnVersionInfoUpdated(bgs.protocol.authentication.v1.VersionInfoNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7357,7 +7364,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 12, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnLogonQueueUpdate(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnLogonQueueUpdate(bgs.protocol.authentication.v1.LogonQueueUpdateRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7372,7 +7378,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 13, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnLogonQueueEnd(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnLogonQueueEnd(bgs.protocol.NoData{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7387,7 +7392,6 @@ void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, Mes SendResponse(service_hash_, 14, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnGameAccountSelected(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationListener.OnGameAccountSelected(bgs.protocol.authentication.v1.GameAccountSelectedRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -7408,7 +7412,7 @@ uint32 AuthenticationListener::HandleOnModuleLoad(::bgs::protocol::authenticatio return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationListener::HandleOnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationListener::HandleOnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnModuleMessage({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -7426,7 +7430,7 @@ uint32 AuthenticationListener::HandleOnLogonComplete(::bgs::protocol::authentica return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationListener::HandleOnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, ::bgs::protocol::authentication::v1::MemModuleLoadResponse* response) { +uint32 AuthenticationListener::HandleOnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, ::bgs::protocol::authentication::v1::MemModuleLoadResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnMemModuleLoad({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -7572,15 +7576,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.Logon(bgs.protocol.authentication.v1.LogonRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.Logon() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleLogon(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.Logon(bgs.protocol.authentication.v1.LogonRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleLogon(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -7590,15 +7602,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.ModuleNotify(bgs.protocol.authentication.v1.ModuleNotification{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.ModuleNotify() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleModuleNotify(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.ModuleNotify(bgs.protocol.authentication.v1.ModuleNotification{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleModuleNotify(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -7608,15 +7628,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.ModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.ModuleMessage() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleModuleMessage(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.ModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleModuleMessage(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -7626,15 +7654,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.SelectGameAccount_DEPRECATED(bgs.protocol.EntityId{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.SelectGameAccount_DEPRECATED() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 4, token, response); + else + self->SendResponse(self->service_hash_, 4, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSelectGameAccount_DEPRECATED(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.SelectGameAccount_DEPRECATED(bgs.protocol.EntityId{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 4, token, &response); - else - SendResponse(service_hash_, 4, token, status); + uint32 status = HandleSelectGameAccount_DEPRECATED(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 5: { @@ -7644,15 +7680,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.GenerateSSOToken(bgs.protocol.authentication.v1.GenerateSSOTokenRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.GenerateSSOToken() returned bgs.protocol.authentication.v1.GenerateSSOTokenResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 5, token, response); + else + self->SendResponse(self->service_hash_, 5, token, status); + }; ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse response; - uint32 status = HandleGenerateSSOToken(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.GenerateSSOToken(bgs.protocol.authentication.v1.GenerateSSOTokenRequest{ %s }) returned bgs.protocol.authentication.v1.GenerateSSOTokenResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 5, token, &response); - else - SendResponse(service_hash_, 5, token, status); + uint32 status = HandleGenerateSSOToken(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 6: { @@ -7662,15 +7706,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.SelectGameAccount(bgs.protocol.authentication.v1.SelectGameAccountRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.SelectGameAccount() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 6, token, response); + else + self->SendResponse(self->service_hash_, 6, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSelectGameAccount(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.SelectGameAccount(bgs.protocol.authentication.v1.SelectGameAccountRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 6, token, &response); - else - SendResponse(service_hash_, 6, token, status); + uint32 status = HandleSelectGameAccount(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 7: { @@ -7680,15 +7732,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.VerifyWebCredentials(bgs.protocol.authentication.v1.VerifyWebCredentialsRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.VerifyWebCredentials() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 7, token, response); + else + self->SendResponse(self->service_hash_, 7, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleVerifyWebCredentials(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.VerifyWebCredentials(bgs.protocol.authentication.v1.VerifyWebCredentialsRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 7, token, &response); - else - SendResponse(service_hash_, 7, token, status); + uint32 status = HandleVerifyWebCredentials(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 8: { @@ -7698,15 +7758,23 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.GenerateWebCredentials(bgs.protocol.authentication.v1.GenerateWebCredentialsRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse::descriptor()); + AuthenticationService* self = static_cast<AuthenticationService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.GenerateWebCredentials() returned bgs.protocol.authentication.v1.GenerateWebCredentialsResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 8, token, response); + else + self->SendResponse(self->service_hash_, 8, token, status); + }; ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse response; - uint32 status = HandleGenerateWebCredentials(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method AuthenticationService.GenerateWebCredentials(bgs.protocol.authentication.v1.GenerateWebCredentialsRequest{ %s }) returned bgs.protocol.authentication.v1.GenerateWebCredentialsResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 8, token, &response); - else - SendResponse(service_hash_, 8, token, status); + uint32 status = HandleGenerateWebCredentials(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -7716,49 +7784,49 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess } } -uint32 AuthenticationService::HandleLogon(::bgs::protocol::authentication::v1::LogonRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationService::HandleLogon(::bgs::protocol::authentication::v1::LogonRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.Logon({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleModuleNotify(::bgs::protocol::authentication::v1::ModuleNotification const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationService::HandleModuleNotify(::bgs::protocol::authentication::v1::ModuleNotification const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.ModuleNotify({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationService::HandleModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.ModuleMessage({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleSelectGameAccount_DEPRECATED(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationService::HandleSelectGameAccount_DEPRECATED(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.SelectGameAccount_DEPRECATED({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleGenerateSSOToken(::bgs::protocol::authentication::v1::GenerateSSOTokenRequest const* request, ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse* response) { +uint32 AuthenticationService::HandleGenerateSSOToken(::bgs::protocol::authentication::v1::GenerateSSOTokenRequest const* request, ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.GenerateSSOToken({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleSelectGameAccount(::bgs::protocol::authentication::v1::SelectGameAccountRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationService::HandleSelectGameAccount(::bgs::protocol::authentication::v1::SelectGameAccountRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.SelectGameAccount({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleVerifyWebCredentials(::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest const* request, ::bgs::protocol::NoData* response) { +uint32 AuthenticationService::HandleVerifyWebCredentials(::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.VerifyWebCredentials({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 AuthenticationService::HandleGenerateWebCredentials(::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest const* request, ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse* response) { +uint32 AuthenticationService::HandleGenerateWebCredentials(::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest const* request, ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationService.GenerateWebCredentials({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; diff --git a/src/server/proto/Client/authentication_service.pb.h b/src/server/proto/Client/authentication_service.pb.h index cc3f3ce9b4a..b082cca58a7 100644 --- a/src/server/proto/Client/authentication_service.pb.h +++ b/src/server/proto/Client/authentication_service.pb.h @@ -2203,10 +2203,10 @@ class TC_PROTO_API AuthenticationListener : public ServiceBase protected: virtual uint32 HandleOnModuleLoad(::bgs::protocol::authentication::v1::ModuleLoadRequest const* request); - virtual uint32 HandleOnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleOnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleOnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request); virtual uint32 HandleOnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request); - virtual uint32 HandleOnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, ::bgs::protocol::authentication::v1::MemModuleLoadResponse* response); + virtual uint32 HandleOnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, ::bgs::protocol::authentication::v1::MemModuleLoadResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleOnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request); virtual uint32 HandleOnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request); virtual uint32 HandleOnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request); @@ -2248,14 +2248,14 @@ class TC_PROTO_API AuthenticationService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleLogon(::bgs::protocol::authentication::v1::LogonRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleModuleNotify(::bgs::protocol::authentication::v1::ModuleNotification const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleSelectGameAccount_DEPRECATED(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleGenerateSSOToken(::bgs::protocol::authentication::v1::GenerateSSOTokenRequest const* request, ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse* response); - virtual uint32 HandleSelectGameAccount(::bgs::protocol::authentication::v1::SelectGameAccountRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleVerifyWebCredentials(::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleGenerateWebCredentials(::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest const* request, ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse* response); + virtual uint32 HandleLogon(::bgs::protocol::authentication::v1::LogonRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleModuleNotify(::bgs::protocol::authentication::v1::ModuleNotification const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSelectGameAccount_DEPRECATED(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGenerateSSOToken(::bgs::protocol::authentication::v1::GenerateSSOTokenRequest const* request, ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSelectGameAccount(::bgs::protocol::authentication::v1::SelectGameAccountRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleVerifyWebCredentials(::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGenerateWebCredentials(::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest const* request, ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/challenge_service.pb.cc b/src/server/proto/Client/challenge_service.pb.cc index 222867f9feb..257a27eb289 100644 --- a/src/server/proto/Client/challenge_service.pb.cc +++ b/src/server/proto/Client/challenge_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace challenge { @@ -4525,15 +4521,23 @@ void ChallengeService::CallServerMethod(uint32 token, uint32 methodId, MessageBu SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengePicked(bgs.protocol.challenge.v1.ChallengePickedRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::challenge::v1::ChallengePickedResponse::descriptor()); + ChallengeService* self = static_cast<ChallengeService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengePicked() returned bgs.protocol.challenge.v1.ChallengePickedResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::challenge::v1::ChallengePickedResponse response; - uint32 status = HandleChallengePicked(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengePicked(bgs.protocol.challenge.v1.ChallengePickedRequest{ %s }) returned bgs.protocol.challenge.v1.ChallengePickedResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleChallengePicked(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -4543,15 +4547,23 @@ void ChallengeService::CallServerMethod(uint32 token, uint32 methodId, MessageBu SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengeAnswered(bgs.protocol.challenge.v1.ChallengeAnsweredRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::challenge::v1::ChallengeAnsweredResponse::descriptor()); + ChallengeService* self = static_cast<ChallengeService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengeAnswered() returned bgs.protocol.challenge.v1.ChallengeAnsweredResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::challenge::v1::ChallengeAnsweredResponse response; - uint32 status = HandleChallengeAnswered(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengeAnswered(bgs.protocol.challenge.v1.ChallengeAnsweredRequest{ %s }) returned bgs.protocol.challenge.v1.ChallengeAnsweredResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleChallengeAnswered(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -4561,15 +4573,23 @@ void ChallengeService::CallServerMethod(uint32 token, uint32 methodId, MessageBu SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengeCancelled(bgs.protocol.challenge.v1.ChallengeCancelledRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ChallengeService* self = static_cast<ChallengeService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengeCancelled() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleChallengeCancelled(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.ChallengeCancelled(bgs.protocol.challenge.v1.ChallengeCancelledRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleChallengeCancelled(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -4579,15 +4599,23 @@ void ChallengeService::CallServerMethod(uint32 token, uint32 methodId, MessageBu SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.SendChallengeToUser(bgs.protocol.challenge.v1.SendChallengeToUserRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::challenge::v1::SendChallengeToUserResponse::descriptor()); + ChallengeService* self = static_cast<ChallengeService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.SendChallengeToUser() returned bgs.protocol.challenge.v1.SendChallengeToUserResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 4, token, response); + else + self->SendResponse(self->service_hash_, 4, token, status); + }; ::bgs::protocol::challenge::v1::SendChallengeToUserResponse response; - uint32 status = HandleSendChallengeToUser(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeService.SendChallengeToUser(bgs.protocol.challenge.v1.SendChallengeToUserRequest{ %s }) returned bgs.protocol.challenge.v1.SendChallengeToUserResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 4, token, &response); - else - SendResponse(service_hash_, 4, token, status); + uint32 status = HandleSendChallengeToUser(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -4597,25 +4625,25 @@ void ChallengeService::CallServerMethod(uint32 token, uint32 methodId, MessageBu } } -uint32 ChallengeService::HandleChallengePicked(::bgs::protocol::challenge::v1::ChallengePickedRequest const* request, ::bgs::protocol::challenge::v1::ChallengePickedResponse* response) { +uint32 ChallengeService::HandleChallengePicked(::bgs::protocol::challenge::v1::ChallengePickedRequest const* request, ::bgs::protocol::challenge::v1::ChallengePickedResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChallengeService.ChallengePicked({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChallengeService::HandleChallengeAnswered(::bgs::protocol::challenge::v1::ChallengeAnsweredRequest const* request, ::bgs::protocol::challenge::v1::ChallengeAnsweredResponse* response) { +uint32 ChallengeService::HandleChallengeAnswered(::bgs::protocol::challenge::v1::ChallengeAnsweredRequest const* request, ::bgs::protocol::challenge::v1::ChallengeAnsweredResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChallengeService.ChallengeAnswered({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChallengeService::HandleChallengeCancelled(::bgs::protocol::challenge::v1::ChallengeCancelledRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ChallengeService::HandleChallengeCancelled(::bgs::protocol::challenge::v1::ChallengeCancelledRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChallengeService.ChallengeCancelled({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChallengeService::HandleSendChallengeToUser(::bgs::protocol::challenge::v1::SendChallengeToUserRequest const* request, ::bgs::protocol::challenge::v1::SendChallengeToUserResponse* response) { +uint32 ChallengeService::HandleSendChallengeToUser(::bgs::protocol::challenge::v1::SendChallengeToUserRequest const* request, ::bgs::protocol::challenge::v1::SendChallengeToUserResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChallengeService.SendChallengeToUser({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -4634,25 +4662,25 @@ google::protobuf::ServiceDescriptor const* ChallengeListener::descriptor() { return ChallengeListener_descriptor_; } -void ChallengeListener::OnChallengeUser(::bgs::protocol::challenge::v1::ChallengeUserRequest const* request) { +void ChallengeListener::OnChallengeUser(::bgs::protocol::challenge::v1::ChallengeUserRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChallengeListener.OnChallengeUser(bgs.protocol.challenge.v1.ChallengeUserRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 1, request); } -void ChallengeListener::OnChallengeResult(::bgs::protocol::challenge::v1::ChallengeResultRequest const* request) { +void ChallengeListener::OnChallengeResult(::bgs::protocol::challenge::v1::ChallengeResultRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChallengeListener.OnChallengeResult(bgs.protocol.challenge.v1.ChallengeResultRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 2, request); } -void ChallengeListener::OnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request) { +void ChallengeListener::OnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChallengeListener.OnExternalChallenge(bgs.protocol.challenge.v1.ChallengeExternalRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 3, request); } -void ChallengeListener::OnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request) { +void ChallengeListener::OnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChallengeListener.OnExternalChallengeResult(bgs.protocol.challenge.v1.ChallengeExternalResult{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 4, request); @@ -4667,7 +4695,6 @@ void ChallengeListener::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnChallengeUser(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeListener.OnChallengeUser(bgs.protocol.challenge.v1.ChallengeUserRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4682,7 +4709,6 @@ void ChallengeListener::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnChallengeResult(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeListener.OnChallengeResult(bgs.protocol.challenge.v1.ChallengeResultRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4697,7 +4723,6 @@ void ChallengeListener::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnExternalChallenge(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeListener.OnExternalChallenge(bgs.protocol.challenge.v1.ChallengeExternalRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4712,7 +4737,6 @@ void ChallengeListener::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnExternalChallengeResult(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChallengeListener.OnExternalChallengeResult(bgs.protocol.challenge.v1.ChallengeExternalResult{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); diff --git a/src/server/proto/Client/challenge_service.pb.h b/src/server/proto/Client/challenge_service.pb.h index a634f15ea2a..842a7e54d5e 100644 --- a/src/server/proto/Client/challenge_service.pb.h +++ b/src/server/proto/Client/challenge_service.pb.h @@ -1376,10 +1376,10 @@ class TC_PROTO_API ChallengeService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleChallengePicked(::bgs::protocol::challenge::v1::ChallengePickedRequest const* request, ::bgs::protocol::challenge::v1::ChallengePickedResponse* response); - virtual uint32 HandleChallengeAnswered(::bgs::protocol::challenge::v1::ChallengeAnsweredRequest const* request, ::bgs::protocol::challenge::v1::ChallengeAnsweredResponse* response); - virtual uint32 HandleChallengeCancelled(::bgs::protocol::challenge::v1::ChallengeCancelledRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleSendChallengeToUser(::bgs::protocol::challenge::v1::SendChallengeToUserRequest const* request, ::bgs::protocol::challenge::v1::SendChallengeToUserResponse* response); + virtual uint32 HandleChallengePicked(::bgs::protocol::challenge::v1::ChallengePickedRequest const* request, ::bgs::protocol::challenge::v1::ChallengePickedResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleChallengeAnswered(::bgs::protocol::challenge::v1::ChallengeAnsweredRequest const* request, ::bgs::protocol::challenge::v1::ChallengeAnsweredResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleChallengeCancelled(::bgs::protocol::challenge::v1::ChallengeCancelledRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSendChallengeToUser(::bgs::protocol::challenge::v1::SendChallengeToUserRequest const* request, ::bgs::protocol::challenge::v1::SendChallengeToUserResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/channel_service.pb.cc b/src/server/proto/Client/channel_service.pb.cc index 442d8df8c0f..f7b8092af7f 100644 --- a/src/server/proto/Client/channel_service.pb.cc +++ b/src/server/proto/Client/channel_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace channel { @@ -4883,15 +4879,23 @@ void ChannelService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.RemoveMember(bgs.protocol.channel.v1.RemoveMemberRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ChannelService* self = static_cast<ChannelService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.RemoveMember() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleRemoveMember(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.RemoveMember(bgs.protocol.channel.v1.RemoveMemberRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleRemoveMember(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -4901,15 +4905,23 @@ void ChannelService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.SendMessage(bgs.protocol.channel.v1.SendMessageRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ChannelService* self = static_cast<ChannelService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.SendMessage() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSendMessage(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.SendMessage(bgs.protocol.channel.v1.SendMessageRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleSendMessage(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -4919,15 +4931,23 @@ void ChannelService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.UpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ChannelService* self = static_cast<ChannelService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.UpdateChannelState() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 4, token, response); + else + self->SendResponse(self->service_hash_, 4, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUpdateChannelState(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.UpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 4, token, &response); - else - SendResponse(service_hash_, 4, token, status); + uint32 status = HandleUpdateChannelState(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 5: { @@ -4937,15 +4957,23 @@ void ChannelService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.UpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ChannelService* self = static_cast<ChannelService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.UpdateMemberState() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 5, token, response); + else + self->SendResponse(self->service_hash_, 5, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUpdateMemberState(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.UpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 5, token, &response); - else - SendResponse(service_hash_, 5, token, status); + uint32 status = HandleUpdateMemberState(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 6: { @@ -4955,15 +4983,23 @@ void ChannelService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.Dissolve(bgs.protocol.channel.v1.DissolveRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ChannelService* self = static_cast<ChannelService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.Dissolve() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 6, token, response); + else + self->SendResponse(self->service_hash_, 6, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleDissolve(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelService.Dissolve(bgs.protocol.channel.v1.DissolveRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 6, token, &response); - else - SendResponse(service_hash_, 6, token, status); + uint32 status = HandleDissolve(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -4973,31 +5009,31 @@ void ChannelService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff } } -uint32 ChannelService::HandleRemoveMember(::bgs::protocol::channel::v1::RemoveMemberRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ChannelService::HandleRemoveMember(::bgs::protocol::channel::v1::RemoveMemberRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChannelService.RemoveMember({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChannelService::HandleSendMessage(::bgs::protocol::channel::v1::SendMessageRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ChannelService::HandleSendMessage(::bgs::protocol::channel::v1::SendMessageRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChannelService.SendMessage({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChannelService::HandleUpdateChannelState(::bgs::protocol::channel::v1::UpdateChannelStateRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ChannelService::HandleUpdateChannelState(::bgs::protocol::channel::v1::UpdateChannelStateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChannelService.UpdateChannelState({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChannelService::HandleUpdateMemberState(::bgs::protocol::channel::v1::UpdateMemberStateRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ChannelService::HandleUpdateMemberState(::bgs::protocol::channel::v1::UpdateMemberStateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChannelService.UpdateMemberState({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ChannelService::HandleDissolve(::bgs::protocol::channel::v1::DissolveRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ChannelService::HandleDissolve(::bgs::protocol::channel::v1::DissolveRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChannelService.Dissolve({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -5016,43 +5052,43 @@ google::protobuf::ServiceDescriptor const* ChannelListener::descriptor() { return ChannelListener_descriptor_; } -void ChannelListener::OnJoin(::bgs::protocol::channel::v1::JoinNotification const* request) { +void ChannelListener::OnJoin(::bgs::protocol::channel::v1::JoinNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnJoin(bgs.protocol.channel.v1.JoinNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 1, request); } -void ChannelListener::OnMemberAdded(::bgs::protocol::channel::v1::MemberAddedNotification const* request) { +void ChannelListener::OnMemberAdded(::bgs::protocol::channel::v1::MemberAddedNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnMemberAdded(bgs.protocol.channel.v1.MemberAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 2, request); } -void ChannelListener::OnLeave(::bgs::protocol::channel::v1::LeaveNotification const* request) { +void ChannelListener::OnLeave(::bgs::protocol::channel::v1::LeaveNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnLeave(bgs.protocol.channel.v1.LeaveNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 3, request); } -void ChannelListener::OnMemberRemoved(::bgs::protocol::channel::v1::MemberRemovedNotification const* request) { +void ChannelListener::OnMemberRemoved(::bgs::protocol::channel::v1::MemberRemovedNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnMemberRemoved(bgs.protocol.channel.v1.MemberRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 4, request); } -void ChannelListener::OnSendMessage(::bgs::protocol::channel::v1::SendMessageNotification const* request) { +void ChannelListener::OnSendMessage(::bgs::protocol::channel::v1::SendMessageNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnSendMessage(bgs.protocol.channel.v1.SendMessageNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 5, request); } -void ChannelListener::OnUpdateChannelState(::bgs::protocol::channel::v1::UpdateChannelStateNotification const* request) { +void ChannelListener::OnUpdateChannelState(::bgs::protocol::channel::v1::UpdateChannelStateNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnUpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 6, request); } -void ChannelListener::OnUpdateMemberState(::bgs::protocol::channel::v1::UpdateMemberStateNotification const* request) { +void ChannelListener::OnUpdateMemberState(::bgs::protocol::channel::v1::UpdateMemberStateNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ChannelListener.OnUpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 7, request); @@ -5067,7 +5103,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnJoin(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnJoin(bgs.protocol.channel.v1.JoinNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5082,7 +5117,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnMemberAdded(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnMemberAdded(bgs.protocol.channel.v1.MemberAddedNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5097,7 +5131,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnLeave(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnLeave(bgs.protocol.channel.v1.LeaveNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5112,7 +5145,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnMemberRemoved(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnMemberRemoved(bgs.protocol.channel.v1.MemberRemovedNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5127,7 +5159,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnSendMessage(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnSendMessage(bgs.protocol.channel.v1.SendMessageNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5142,7 +5173,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnUpdateChannelState(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnUpdateChannelState(bgs.protocol.channel.v1.UpdateChannelStateNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5157,7 +5187,6 @@ void ChannelListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnUpdateMemberState(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ChannelListener.OnUpdateMemberState(bgs.protocol.channel.v1.UpdateMemberStateNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); diff --git a/src/server/proto/Client/channel_service.pb.h b/src/server/proto/Client/channel_service.pb.h index c369b3ac8fe..db49cd98a3a 100644 --- a/src/server/proto/Client/channel_service.pb.h +++ b/src/server/proto/Client/channel_service.pb.h @@ -1447,11 +1447,11 @@ class TC_PROTO_API ChannelService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleRemoveMember(::bgs::protocol::channel::v1::RemoveMemberRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleSendMessage(::bgs::protocol::channel::v1::SendMessageRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUpdateChannelState(::bgs::protocol::channel::v1::UpdateChannelStateRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUpdateMemberState(::bgs::protocol::channel::v1::UpdateMemberStateRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleDissolve(::bgs::protocol::channel::v1::DissolveRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleRemoveMember(::bgs::protocol::channel::v1::RemoveMemberRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSendMessage(::bgs::protocol::channel::v1::SendMessageRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUpdateChannelState(::bgs::protocol::channel::v1::UpdateChannelStateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUpdateMemberState(::bgs::protocol::channel::v1::UpdateMemberStateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleDissolve(::bgs::protocol::channel::v1::DissolveRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/channel_types.pb.cc b/src/server/proto/Client/channel_types.pb.cc index e17ccb48dd4..7e6a71a5245 100644 --- a/src/server/proto/Client/channel_types.pb.cc +++ b/src/server/proto/Client/channel_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace channel { diff --git a/src/server/proto/Client/connection_service.pb.cc b/src/server/proto/Client/connection_service.pb.cc index 8e4d5e5d1c3..61956fbd484 100644 --- a/src/server/proto/Client/connection_service.pb.cc +++ b/src/server/proto/Client/connection_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace connection { @@ -3680,13 +3676,13 @@ void ConnectionService::Echo(::bgs::protocol::connection::v1::EchoRequest const* SendRequest(service_hash_, 3, request, std::move(callback)); } -void ConnectionService::ForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request) { +void ConnectionService::ForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.ForceDisconnect(bgs.protocol.connection.v1.DisconnectNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 4, request); } -void ConnectionService::KeepAlive(::bgs::protocol::NoData const* request) { +void ConnectionService::KeepAlive(::bgs::protocol::NoData const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.KeepAlive(bgs.protocol.NoData{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 5, request); @@ -3703,7 +3699,7 @@ void ConnectionService::Encrypt(::bgs::protocol::connection::v1::EncryptRequest SendRequest(service_hash_, 6, request, std::move(callback)); } -void ConnectionService::RequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request) { +void ConnectionService::RequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.RequestDisconnect(bgs.protocol.connection.v1.DisconnectRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 7, request); @@ -3718,15 +3714,23 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Connect(bgs.protocol.connection.v1.ConnectRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::connection::v1::ConnectResponse::descriptor()); + ConnectionService* self = static_cast<ConnectionService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Connect() returned bgs.protocol.connection.v1.ConnectResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::connection::v1::ConnectResponse response; - uint32 status = HandleConnect(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Connect(bgs.protocol.connection.v1.ConnectRequest{ %s }) returned bgs.protocol.connection.v1.ConnectResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleConnect(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -3736,15 +3740,23 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Bind(bgs.protocol.connection.v1.BindRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::connection::v1::BindResponse::descriptor()); + ConnectionService* self = static_cast<ConnectionService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Bind() returned bgs.protocol.connection.v1.BindResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::connection::v1::BindResponse response; - uint32 status = HandleBind(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Bind(bgs.protocol.connection.v1.BindRequest{ %s }) returned bgs.protocol.connection.v1.BindResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleBind(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -3754,15 +3766,23 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Echo(bgs.protocol.connection.v1.EchoRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::connection::v1::EchoResponse::descriptor()); + ConnectionService* self = static_cast<ConnectionService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Echo() returned bgs.protocol.connection.v1.EchoResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::connection::v1::EchoResponse response; - uint32 status = HandleEcho(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Echo(bgs.protocol.connection.v1.EchoRequest{ %s }) returned bgs.protocol.connection.v1.EchoResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleEcho(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -3772,7 +3792,6 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleForceDisconnect(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.ForceDisconnect(bgs.protocol.connection.v1.DisconnectNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -3787,7 +3806,6 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleKeepAlive(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.KeepAlive(bgs.protocol.NoData{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -3802,15 +3820,23 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Encrypt(bgs.protocol.connection.v1.EncryptRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ConnectionService* self = static_cast<ConnectionService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Encrypt() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 6, token, response); + else + self->SendResponse(self->service_hash_, 6, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleEncrypt(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.Encrypt(bgs.protocol.connection.v1.EncryptRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 6, token, &response); - else - SendResponse(service_hash_, 6, token, status); + uint32 status = HandleEncrypt(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 7: { @@ -3820,7 +3846,6 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleRequestDisconnect(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ConnectionService.RequestDisconnect(bgs.protocol.connection.v1.DisconnectRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -3835,19 +3860,19 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB } } -uint32 ConnectionService::HandleConnect(::bgs::protocol::connection::v1::ConnectRequest const* request, ::bgs::protocol::connection::v1::ConnectResponse* response) { +uint32 ConnectionService::HandleConnect(::bgs::protocol::connection::v1::ConnectRequest const* request, ::bgs::protocol::connection::v1::ConnectResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ConnectionService.Connect({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ConnectionService::HandleBind(::bgs::protocol::connection::v1::BindRequest const* request, ::bgs::protocol::connection::v1::BindResponse* response) { +uint32 ConnectionService::HandleBind(::bgs::protocol::connection::v1::BindRequest const* request, ::bgs::protocol::connection::v1::BindResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ConnectionService.Bind({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ConnectionService::HandleEcho(::bgs::protocol::connection::v1::EchoRequest const* request, ::bgs::protocol::connection::v1::EchoResponse* response) { +uint32 ConnectionService::HandleEcho(::bgs::protocol::connection::v1::EchoRequest const* request, ::bgs::protocol::connection::v1::EchoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ConnectionService.Echo({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -3865,7 +3890,7 @@ uint32 ConnectionService::HandleKeepAlive(::bgs::protocol::NoData const* request return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ConnectionService::HandleEncrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ConnectionService::HandleEncrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ConnectionService.Encrypt({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; diff --git a/src/server/proto/Client/connection_service.pb.h b/src/server/proto/Client/connection_service.pb.h index 949648bb7ff..1814ad024bb 100644 --- a/src/server/proto/Client/connection_service.pb.h +++ b/src/server/proto/Client/connection_service.pb.h @@ -1160,12 +1160,12 @@ class TC_PROTO_API ConnectionService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleConnect(::bgs::protocol::connection::v1::ConnectRequest const* request, ::bgs::protocol::connection::v1::ConnectResponse* response); - virtual uint32 HandleBind(::bgs::protocol::connection::v1::BindRequest const* request, ::bgs::protocol::connection::v1::BindResponse* response); - virtual uint32 HandleEcho(::bgs::protocol::connection::v1::EchoRequest const* request, ::bgs::protocol::connection::v1::EchoResponse* response); + virtual uint32 HandleConnect(::bgs::protocol::connection::v1::ConnectRequest const* request, ::bgs::protocol::connection::v1::ConnectResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleBind(::bgs::protocol::connection::v1::BindRequest const* request, ::bgs::protocol::connection::v1::BindResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleEcho(::bgs::protocol::connection::v1::EchoRequest const* request, ::bgs::protocol::connection::v1::EchoResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request); virtual uint32 HandleKeepAlive(::bgs::protocol::NoData const* request); - virtual uint32 HandleEncrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleEncrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleRequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request); private: diff --git a/src/server/proto/Client/content_handle_types.pb.cc b/src/server/proto/Client/content_handle_types.pb.cc index 6f480167d10..837d924b9fc 100644 --- a/src/server/proto/Client/content_handle_types.pb.cc +++ b/src/server/proto/Client/content_handle_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { diff --git a/src/server/proto/Client/entity_types.pb.cc b/src/server/proto/Client/entity_types.pb.cc index 29e95bdf0e9..ca9b0c88bc4 100644 --- a/src/server/proto/Client/entity_types.pb.cc +++ b/src/server/proto/Client/entity_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { diff --git a/src/server/proto/Client/friends_service.pb.cc b/src/server/proto/Client/friends_service.pb.cc index 23cdc43f354..d6ca845341f 100644 --- a/src/server/proto/Client/friends_service.pb.cc +++ b/src/server/proto/Client/friends_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace friends { @@ -5034,15 +5030,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.Subscribe(bgs.protocol.friends.v1.SubscribeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::friends::v1::SubscribeResponse::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.Subscribe() returned bgs.protocol.friends.v1.SubscribeResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::friends::v1::SubscribeResponse response; - uint32 status = HandleSubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.Subscribe(bgs.protocol.friends.v1.SubscribeRequest{ %s }) returned bgs.protocol.friends.v1.SubscribeResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleSubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -5052,15 +5056,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.SendInvitation(bgs.protocol.SendInvitationRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.SendInvitation() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSendInvitation(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.SendInvitation(bgs.protocol.SendInvitationRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleSendInvitation(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -5070,15 +5082,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AcceptInvitation(bgs.protocol.GenericInvitationRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AcceptInvitation() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleAcceptInvitation(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AcceptInvitation(bgs.protocol.GenericInvitationRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleAcceptInvitation(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -5088,15 +5108,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeInvitation(bgs.protocol.GenericInvitationRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeInvitation() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 4, token, response); + else + self->SendResponse(self->service_hash_, 4, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleRevokeInvitation(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeInvitation(bgs.protocol.GenericInvitationRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 4, token, &response); - else - SendResponse(service_hash_, 4, token, status); + uint32 status = HandleRevokeInvitation(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 5: { @@ -5106,15 +5134,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.DeclineInvitation(bgs.protocol.GenericInvitationRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.DeclineInvitation() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 5, token, response); + else + self->SendResponse(self->service_hash_, 5, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleDeclineInvitation(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.DeclineInvitation(bgs.protocol.GenericInvitationRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 5, token, &response); - else - SendResponse(service_hash_, 5, token, status); + uint32 status = HandleDeclineInvitation(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 6: { @@ -5124,15 +5160,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.IgnoreInvitation(bgs.protocol.GenericInvitationRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.IgnoreInvitation() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 6, token, response); + else + self->SendResponse(self->service_hash_, 6, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleIgnoreInvitation(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.IgnoreInvitation(bgs.protocol.GenericInvitationRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 6, token, &response); - else - SendResponse(service_hash_, 6, token, status); + uint32 status = HandleIgnoreInvitation(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 7: { @@ -5142,15 +5186,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AssignRole(bgs.protocol.friends.v1.AssignRoleRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AssignRole() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 7, token, response); + else + self->SendResponse(self->service_hash_, 7, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleAssignRole(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AssignRole(bgs.protocol.friends.v1.AssignRoleRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 7, token, &response); - else - SendResponse(service_hash_, 7, token, status); + uint32 status = HandleAssignRole(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 8: { @@ -5160,15 +5212,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RemoveFriend(bgs.protocol.friends.v1.GenericFriendRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::friends::v1::GenericFriendResponse::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RemoveFriend() returned bgs.protocol.friends.v1.GenericFriendResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 8, token, response); + else + self->SendResponse(self->service_hash_, 8, token, status); + }; ::bgs::protocol::friends::v1::GenericFriendResponse response; - uint32 status = HandleRemoveFriend(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RemoveFriend(bgs.protocol.friends.v1.GenericFriendRequest{ %s }) returned bgs.protocol.friends.v1.GenericFriendResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 8, token, &response); - else - SendResponse(service_hash_, 8, token, status); + uint32 status = HandleRemoveFriend(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 9: { @@ -5178,15 +5238,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 9, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.ViewFriends(bgs.protocol.friends.v1.ViewFriendsRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::friends::v1::ViewFriendsResponse::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.ViewFriends() returned bgs.protocol.friends.v1.ViewFriendsResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 9, token, response); + else + self->SendResponse(self->service_hash_, 9, token, status); + }; ::bgs::protocol::friends::v1::ViewFriendsResponse response; - uint32 status = HandleViewFriends(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.ViewFriends(bgs.protocol.friends.v1.ViewFriendsRequest{ %s }) returned bgs.protocol.friends.v1.ViewFriendsResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 9, token, &response); - else - SendResponse(service_hash_, 9, token, status); + uint32 status = HandleViewFriends(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 10: { @@ -5196,15 +5264,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.UpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.UpdateFriendState() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 10, token, response); + else + self->SendResponse(self->service_hash_, 10, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUpdateFriendState(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.UpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 10, token, &response); - else - SendResponse(service_hash_, 10, token, status); + uint32 status = HandleUpdateFriendState(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 11: { @@ -5214,15 +5290,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.Unsubscribe(bgs.protocol.friends.v1.UnsubscribeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.Unsubscribe() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 11, token, response); + else + self->SendResponse(self->service_hash_, 11, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUnsubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.Unsubscribe(bgs.protocol.friends.v1.UnsubscribeRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 11, token, &response); - else - SendResponse(service_hash_, 11, token, status); + uint32 status = HandleUnsubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 12: { @@ -5232,15 +5316,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 12, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeAllInvitations(bgs.protocol.friends.v1.GenericFriendRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeAllInvitations() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 12, token, response); + else + self->SendResponse(self->service_hash_, 12, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleRevokeAllInvitations(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeAllInvitations(bgs.protocol.friends.v1.GenericFriendRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 12, token, &response); - else - SendResponse(service_hash_, 12, token, status); + uint32 status = HandleRevokeAllInvitations(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 13: { @@ -5250,15 +5342,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 13, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.GetFriendList(bgs.protocol.friends.v1.GetFriendListRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::friends::v1::GetFriendListResponse::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.GetFriendList() returned bgs.protocol.friends.v1.GetFriendListResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 13, token, response); + else + self->SendResponse(self->service_hash_, 13, token, status); + }; ::bgs::protocol::friends::v1::GetFriendListResponse response; - uint32 status = HandleGetFriendList(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.GetFriendList(bgs.protocol.friends.v1.GetFriendListRequest{ %s }) returned bgs.protocol.friends.v1.GetFriendListResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 13, token, &response); - else - SendResponse(service_hash_, 13, token, status); + uint32 status = HandleGetFriendList(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 14: { @@ -5268,15 +5368,23 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff SendResponse(service_hash_, 14, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.CreateFriendship(bgs.protocol.friends.v1.CreateFriendshipRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + FriendsService* self = static_cast<FriendsService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.CreateFriendship() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 14, token, response); + else + self->SendResponse(self->service_hash_, 14, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleCreateFriendship(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.CreateFriendship(bgs.protocol.friends.v1.CreateFriendshipRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 14, token, &response); - else - SendResponse(service_hash_, 14, token, status); + uint32 status = HandleCreateFriendship(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -5286,85 +5394,85 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff } } -uint32 FriendsService::HandleSubscribe(::bgs::protocol::friends::v1::SubscribeRequest const* request, ::bgs::protocol::friends::v1::SubscribeResponse* response) { +uint32 FriendsService::HandleSubscribe(::bgs::protocol::friends::v1::SubscribeRequest const* request, ::bgs::protocol::friends::v1::SubscribeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.Subscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleSendInvitation(::bgs::protocol::SendInvitationRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleSendInvitation(::bgs::protocol::SendInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.SendInvitation({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleAcceptInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleAcceptInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.AcceptInvitation({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleRevokeInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleRevokeInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.RevokeInvitation({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleDeclineInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleDeclineInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.DeclineInvitation({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleIgnoreInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleIgnoreInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.IgnoreInvitation({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleAssignRole(::bgs::protocol::friends::v1::AssignRoleRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleAssignRole(::bgs::protocol::friends::v1::AssignRoleRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.AssignRole({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleRemoveFriend(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::friends::v1::GenericFriendResponse* response) { +uint32 FriendsService::HandleRemoveFriend(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::friends::v1::GenericFriendResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.RemoveFriend({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleViewFriends(::bgs::protocol::friends::v1::ViewFriendsRequest const* request, ::bgs::protocol::friends::v1::ViewFriendsResponse* response) { +uint32 FriendsService::HandleViewFriends(::bgs::protocol::friends::v1::ViewFriendsRequest const* request, ::bgs::protocol::friends::v1::ViewFriendsResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.ViewFriends({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.UpdateFriendState({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleUnsubscribe(::bgs::protocol::friends::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleUnsubscribe(::bgs::protocol::friends::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.Unsubscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleRevokeAllInvitations(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleRevokeAllInvitations(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.RevokeAllInvitations({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleGetFriendList(::bgs::protocol::friends::v1::GetFriendListRequest const* request, ::bgs::protocol::friends::v1::GetFriendListResponse* response) { +uint32 FriendsService::HandleGetFriendList(::bgs::protocol::friends::v1::GetFriendListRequest const* request, ::bgs::protocol::friends::v1::GetFriendListResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.GetFriendList({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 FriendsService::HandleCreateFriendship(::bgs::protocol::friends::v1::CreateFriendshipRequest const* request, ::bgs::protocol::NoData* response) { +uint32 FriendsService::HandleCreateFriendship(::bgs::protocol::friends::v1::CreateFriendshipRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsService.CreateFriendship({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -5383,43 +5491,43 @@ google::protobuf::ServiceDescriptor const* FriendsListener::descriptor() { return FriendsListener_descriptor_; } -void FriendsListener::OnFriendAdded(::bgs::protocol::friends::v1::FriendNotification const* request) { +void FriendsListener::OnFriendAdded(::bgs::protocol::friends::v1::FriendNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnFriendAdded(bgs.protocol.friends.v1.FriendNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 1, request); } -void FriendsListener::OnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request) { +void FriendsListener::OnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnFriendRemoved(bgs.protocol.friends.v1.FriendNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 2, request); } -void FriendsListener::OnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request) { +void FriendsListener::OnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnReceivedInvitationAdded(bgs.protocol.friends.v1.InvitationNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 3, request); } -void FriendsListener::OnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request) { +void FriendsListener::OnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnReceivedInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 4, request); } -void FriendsListener::OnSentInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request) { +void FriendsListener::OnSentInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnSentInvitationAdded(bgs.protocol.friends.v1.InvitationNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 5, request); } -void FriendsListener::OnSentInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request) { +void FriendsListener::OnSentInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnSentInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 6, request); } -void FriendsListener::OnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request) { +void FriendsListener::OnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnUpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 7, request); @@ -5434,7 +5542,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnFriendAdded(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnFriendAdded(bgs.protocol.friends.v1.FriendNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5449,7 +5556,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnFriendRemoved(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnFriendRemoved(bgs.protocol.friends.v1.FriendNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5464,7 +5570,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnReceivedInvitationAdded(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnReceivedInvitationAdded(bgs.protocol.friends.v1.InvitationNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5479,7 +5584,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnReceivedInvitationRemoved(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnReceivedInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5494,7 +5598,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnSentInvitationAdded(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnSentInvitationAdded(bgs.protocol.friends.v1.InvitationNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5509,7 +5612,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnSentInvitationRemoved(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnSentInvitationRemoved(bgs.protocol.friends.v1.InvitationNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -5524,7 +5626,6 @@ void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnUpdateFriendState(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsListener.OnUpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); diff --git a/src/server/proto/Client/friends_service.pb.h b/src/server/proto/Client/friends_service.pb.h index 06161df0681..4092d79d28d 100644 --- a/src/server/proto/Client/friends_service.pb.h +++ b/src/server/proto/Client/friends_service.pb.h @@ -1505,20 +1505,20 @@ class TC_PROTO_API FriendsService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleSubscribe(::bgs::protocol::friends::v1::SubscribeRequest const* request, ::bgs::protocol::friends::v1::SubscribeResponse* response); - virtual uint32 HandleSendInvitation(::bgs::protocol::SendInvitationRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleAcceptInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleRevokeInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleDeclineInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleIgnoreInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleAssignRole(::bgs::protocol::friends::v1::AssignRoleRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleRemoveFriend(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::friends::v1::GenericFriendResponse* response); - virtual uint32 HandleViewFriends(::bgs::protocol::friends::v1::ViewFriendsRequest const* request, ::bgs::protocol::friends::v1::ViewFriendsResponse* response); - virtual uint32 HandleUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUnsubscribe(::bgs::protocol::friends::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleRevokeAllInvitations(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleGetFriendList(::bgs::protocol::friends::v1::GetFriendListRequest const* request, ::bgs::protocol::friends::v1::GetFriendListResponse* response); - virtual uint32 HandleCreateFriendship(::bgs::protocol::friends::v1::CreateFriendshipRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleSubscribe(::bgs::protocol::friends::v1::SubscribeRequest const* request, ::bgs::protocol::friends::v1::SubscribeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSendInvitation(::bgs::protocol::SendInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleAcceptInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleRevokeInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleDeclineInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleIgnoreInvitation(::bgs::protocol::GenericInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleAssignRole(::bgs::protocol::friends::v1::AssignRoleRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleRemoveFriend(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::friends::v1::GenericFriendResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleViewFriends(::bgs::protocol::friends::v1::ViewFriendsRequest const* request, ::bgs::protocol::friends::v1::ViewFriendsResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUnsubscribe(::bgs::protocol::friends::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleRevokeAllInvitations(::bgs::protocol::friends::v1::GenericFriendRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetFriendList(::bgs::protocol::friends::v1::GetFriendListRequest const* request, ::bgs::protocol::friends::v1::GetFriendListResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleCreateFriendship(::bgs::protocol::friends::v1::CreateFriendshipRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/friends_types.pb.cc b/src/server/proto/Client/friends_types.pb.cc index fca4bfed6d3..7c262f7cc3c 100644 --- a/src/server/proto/Client/friends_types.pb.cc +++ b/src/server/proto/Client/friends_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace friends { diff --git a/src/server/proto/Client/game_utilities_service.pb.cc b/src/server/proto/Client/game_utilities_service.pb.cc index a0d74bfa0d9..04dfb17c29a 100644 --- a/src/server/proto/Client/game_utilities_service.pb.cc +++ b/src/server/proto/Client/game_utilities_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace game_utilities { @@ -4300,13 +4296,13 @@ void GameUtilitiesService::ProcessServerRequest(::bgs::protocol::game_utilities: SendRequest(service_hash_, 6, request, std::move(callback)); } -void GameUtilitiesService::OnGameAccountOnline(::bgs::protocol::game_utilities::v1::GameAccountOnlineNotification const* request) { +void GameUtilitiesService::OnGameAccountOnline(::bgs::protocol::game_utilities::v1::GameAccountOnlineNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.OnGameAccountOnline(bgs.protocol.game_utilities.v1.GameAccountOnlineNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 7, request); } -void GameUtilitiesService::OnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request) { +void GameUtilitiesService::OnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.OnGameAccountOffline(bgs.protocol.game_utilities.v1.GameAccountOfflineNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 8, request); @@ -4343,15 +4339,23 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.ProcessClientRequest(bgs.protocol.game_utilities.v1.ClientRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::game_utilities::v1::ClientResponse::descriptor()); + GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.ProcessClientRequest() returned bgs.protocol.game_utilities.v1.ClientResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::game_utilities::v1::ClientResponse response; - uint32 status = HandleProcessClientRequest(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.ProcessClientRequest(bgs.protocol.game_utilities.v1.ClientRequest{ %s }) returned bgs.protocol.game_utilities.v1.ClientResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleProcessClientRequest(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -4361,15 +4365,23 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.PresenceChannelCreated(bgs.protocol.game_utilities.v1.PresenceChannelCreatedRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.PresenceChannelCreated() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandlePresenceChannelCreated(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.PresenceChannelCreated(bgs.protocol.game_utilities.v1.PresenceChannelCreatedRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandlePresenceChannelCreated(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -4379,15 +4391,23 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetPlayerVariables(bgs.protocol.game_utilities.v1.GetPlayerVariablesRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse::descriptor()); + GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetPlayerVariables() returned bgs.protocol.game_utilities.v1.GetPlayerVariablesResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse response; - uint32 status = HandleGetPlayerVariables(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetPlayerVariables(bgs.protocol.game_utilities.v1.GetPlayerVariablesRequest{ %s }) returned bgs.protocol.game_utilities.v1.GetPlayerVariablesResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleGetPlayerVariables(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 6: { @@ -4397,15 +4417,23 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.ProcessServerRequest(bgs.protocol.game_utilities.v1.ServerRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::game_utilities::v1::ServerResponse::descriptor()); + GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.ProcessServerRequest() returned bgs.protocol.game_utilities.v1.ServerResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 6, token, response); + else + self->SendResponse(self->service_hash_, 6, token, status); + }; ::bgs::protocol::game_utilities::v1::ServerResponse response; - uint32 status = HandleProcessServerRequest(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.ProcessServerRequest(bgs.protocol.game_utilities.v1.ServerRequest{ %s }) returned bgs.protocol.game_utilities.v1.ServerResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 6, token, &response); - else - SendResponse(service_hash_, 6, token, status); + uint32 status = HandleProcessServerRequest(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 7: { @@ -4415,7 +4443,6 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnGameAccountOnline(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.OnGameAccountOnline(bgs.protocol.game_utilities.v1.GameAccountOnlineNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4430,7 +4457,6 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnGameAccountOffline(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.OnGameAccountOffline(bgs.protocol.game_utilities.v1.GameAccountOfflineNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4445,15 +4471,23 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 9, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetAchievementsFile(bgs.protocol.game_utilities.v1.GetAchievementsFileRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse::descriptor()); + GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetAchievementsFile() returned bgs.protocol.game_utilities.v1.GetAchievementsFileResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 9, token, response); + else + self->SendResponse(self->service_hash_, 9, token, status); + }; ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse response; - uint32 status = HandleGetAchievementsFile(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetAchievementsFile(bgs.protocol.game_utilities.v1.GetAchievementsFileRequest{ %s }) returned bgs.protocol.game_utilities.v1.GetAchievementsFileResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 9, token, &response); - else - SendResponse(service_hash_, 9, token, status); + uint32 status = HandleGetAchievementsFile(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 10: { @@ -4463,15 +4497,23 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetAllValuesForAttribute(bgs.protocol.game_utilities.v1.GetAllValuesForAttributeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse::descriptor()); + GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetAllValuesForAttribute() returned bgs.protocol.game_utilities.v1.GetAllValuesForAttributeResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 10, token, response); + else + self->SendResponse(self->service_hash_, 10, token, status); + }; ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse response; - uint32 status = HandleGetAllValuesForAttribute(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.GetAllValuesForAttribute(bgs.protocol.game_utilities.v1.GetAllValuesForAttributeRequest{ %s }) returned bgs.protocol.game_utilities.v1.GetAllValuesForAttributeResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 10, token, &response); - else - SendResponse(service_hash_, 10, token, status); + uint32 status = HandleGetAllValuesForAttribute(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -4481,25 +4523,25 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa } } -uint32 GameUtilitiesService::HandleProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, ::bgs::protocol::game_utilities::v1::ClientResponse* response) { +uint32 GameUtilitiesService::HandleProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, ::bgs::protocol::game_utilities::v1::ClientResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method GameUtilitiesService.ProcessClientRequest({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 GameUtilitiesService::HandlePresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, ::bgs::protocol::NoData* response) { +uint32 GameUtilitiesService::HandlePresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method GameUtilitiesService.PresenceChannelCreated({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 GameUtilitiesService::HandleGetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse* response) { +uint32 GameUtilitiesService::HandleGetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method GameUtilitiesService.GetPlayerVariables({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 GameUtilitiesService::HandleProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, ::bgs::protocol::game_utilities::v1::ServerResponse* response) { +uint32 GameUtilitiesService::HandleProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, ::bgs::protocol::game_utilities::v1::ServerResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method GameUtilitiesService.ProcessServerRequest({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -4517,13 +4559,13 @@ uint32 GameUtilitiesService::HandleOnGameAccountOffline(::bgs::protocol::game_ut return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 GameUtilitiesService::HandleGetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse* response) { +uint32 GameUtilitiesService::HandleGetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method GameUtilitiesService.GetAchievementsFile({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 GameUtilitiesService::HandleGetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse* response) { +uint32 GameUtilitiesService::HandleGetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method GameUtilitiesService.GetAllValuesForAttribute({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; diff --git a/src/server/proto/Client/game_utilities_service.pb.h b/src/server/proto/Client/game_utilities_service.pb.h index 1b88f22621e..4ff00feb03d 100644 --- a/src/server/proto/Client/game_utilities_service.pb.h +++ b/src/server/proto/Client/game_utilities_service.pb.h @@ -1355,14 +1355,14 @@ class TC_PROTO_API GameUtilitiesService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, ::bgs::protocol::game_utilities::v1::ClientResponse* response); - virtual uint32 HandlePresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleGetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse* response); - virtual uint32 HandleProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, ::bgs::protocol::game_utilities::v1::ServerResponse* response); + virtual uint32 HandleProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, ::bgs::protocol::game_utilities::v1::ClientResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandlePresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, ::bgs::protocol::game_utilities::v1::ServerResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleOnGameAccountOnline(::bgs::protocol::game_utilities::v1::GameAccountOnlineNotification const* request); virtual uint32 HandleOnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request); - virtual uint32 HandleGetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse* response); - virtual uint32 HandleGetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse* response); + virtual uint32 HandleGetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleGetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/game_utilities_types.pb.cc b/src/server/proto/Client/game_utilities_types.pb.cc index cb72ee88ef3..c2b2b40df72 100644 --- a/src/server/proto/Client/game_utilities_types.pb.cc +++ b/src/server/proto/Client/game_utilities_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace game_utilities { diff --git a/src/server/proto/Client/invitation_types.pb.cc b/src/server/proto/Client/invitation_types.pb.cc index ba3ff70e8da..68757c13a29 100644 --- a/src/server/proto/Client/invitation_types.pb.cc +++ b/src/server/proto/Client/invitation_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { diff --git a/src/server/proto/Client/notification_types.pb.cc b/src/server/proto/Client/notification_types.pb.cc index 1f354557075..8ff883d39c9 100644 --- a/src/server/proto/Client/notification_types.pb.cc +++ b/src/server/proto/Client/notification_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace notification { diff --git a/src/server/proto/Client/presence_service.pb.cc b/src/server/proto/Client/presence_service.pb.cc index 14ee7fe2f4e..15cd49ec612 100644 --- a/src/server/proto/Client/presence_service.pb.cc +++ b/src/server/proto/Client/presence_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace presence { @@ -3091,15 +3087,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Subscribe(bgs.protocol.presence.v1.SubscribeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Subscribe() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Subscribe(bgs.protocol.presence.v1.SubscribeRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleSubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -3109,15 +3113,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Unsubscribe(bgs.protocol.presence.v1.UnsubscribeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Unsubscribe() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUnsubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Unsubscribe(bgs.protocol.presence.v1.UnsubscribeRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleUnsubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 3: { @@ -3127,15 +3139,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Update(bgs.protocol.presence.v1.UpdateRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Update() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 3, token, response); + else + self->SendResponse(self->service_hash_, 3, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUpdate(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Update(bgs.protocol.presence.v1.UpdateRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 3, token, &response); - else - SendResponse(service_hash_, 3, token, status); + uint32 status = HandleUpdate(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 4: { @@ -3145,15 +3165,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Query(bgs.protocol.presence.v1.QueryRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::presence::v1::QueryResponse::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Query() returned bgs.protocol.presence.v1.QueryResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 4, token, response); + else + self->SendResponse(self->service_hash_, 4, token, status); + }; ::bgs::protocol::presence::v1::QueryResponse response; - uint32 status = HandleQuery(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Query(bgs.protocol.presence.v1.QueryRequest{ %s }) returned bgs.protocol.presence.v1.QueryResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 4, token, &response); - else - SendResponse(service_hash_, 4, token, status); + uint32 status = HandleQuery(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 5: { @@ -3163,15 +3191,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Ownership(bgs.protocol.presence.v1.OwnershipRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Ownership() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 5, token, response); + else + self->SendResponse(self->service_hash_, 5, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleOwnership(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.Ownership(bgs.protocol.presence.v1.OwnershipRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 5, token, &response); - else - SendResponse(service_hash_, 5, token, status); + uint32 status = HandleOwnership(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 7: { @@ -3181,15 +3217,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.SubscribeNotification(bgs.protocol.presence.v1.SubscribeNotificationRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.SubscribeNotification() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 7, token, response); + else + self->SendResponse(self->service_hash_, 7, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSubscribeNotification(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.SubscribeNotification(bgs.protocol.presence.v1.SubscribeNotificationRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 7, token, &response); - else - SendResponse(service_hash_, 7, token, status); + uint32 status = HandleSubscribeNotification(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 8: { @@ -3199,15 +3243,23 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.MigrateOlympusCustomMessage(bgs.protocol.presence.v1.MigrateOlympusCustomMessageRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::presence::v1::MigrateOlympusCustomMessageResponse::descriptor()); + PresenceService* self = static_cast<PresenceService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.MigrateOlympusCustomMessage() returned bgs.protocol.presence.v1.MigrateOlympusCustomMessageResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 8, token, response); + else + self->SendResponse(self->service_hash_, 8, token, status); + }; ::bgs::protocol::presence::v1::MigrateOlympusCustomMessageResponse response; - uint32 status = HandleMigrateOlympusCustomMessage(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.MigrateOlympusCustomMessage(bgs.protocol.presence.v1.MigrateOlympusCustomMessageRequest{ %s }) returned bgs.protocol.presence.v1.MigrateOlympusCustomMessageResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 8, token, &response); - else - SendResponse(service_hash_, 8, token, status); + uint32 status = HandleMigrateOlympusCustomMessage(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -3217,43 +3269,43 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf } } -uint32 PresenceService::HandleSubscribe(::bgs::protocol::presence::v1::SubscribeRequest const* request, ::bgs::protocol::NoData* response) { +uint32 PresenceService::HandleSubscribe(::bgs::protocol::presence::v1::SubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.Subscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 PresenceService::HandleUnsubscribe(::bgs::protocol::presence::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response) { +uint32 PresenceService::HandleUnsubscribe(::bgs::protocol::presence::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.Unsubscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 PresenceService::HandleUpdate(::bgs::protocol::presence::v1::UpdateRequest const* request, ::bgs::protocol::NoData* response) { +uint32 PresenceService::HandleUpdate(::bgs::protocol::presence::v1::UpdateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.Update({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 PresenceService::HandleQuery(::bgs::protocol::presence::v1::QueryRequest const* request, ::bgs::protocol::presence::v1::QueryResponse* response) { +uint32 PresenceService::HandleQuery(::bgs::protocol::presence::v1::QueryRequest const* request, ::bgs::protocol::presence::v1::QueryResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.Query({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 PresenceService::HandleOwnership(::bgs::protocol::presence::v1::OwnershipRequest const* request, ::bgs::protocol::NoData* response) { +uint32 PresenceService::HandleOwnership(::bgs::protocol::presence::v1::OwnershipRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.Ownership({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 PresenceService::HandleSubscribeNotification(::bgs::protocol::presence::v1::SubscribeNotificationRequest const* request, ::bgs::protocol::NoData* response) { +uint32 PresenceService::HandleSubscribeNotification(::bgs::protocol::presence::v1::SubscribeNotificationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.SubscribeNotification({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 PresenceService::HandleMigrateOlympusCustomMessage(::bgs::protocol::presence::v1::MigrateOlympusCustomMessageRequest const* request, ::bgs::protocol::presence::v1::MigrateOlympusCustomMessageResponse* response) { +uint32 PresenceService::HandleMigrateOlympusCustomMessage(::bgs::protocol::presence::v1::MigrateOlympusCustomMessageRequest const* request, ::bgs::protocol::presence::v1::MigrateOlympusCustomMessageResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceService.MigrateOlympusCustomMessage({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; diff --git a/src/server/proto/Client/presence_service.pb.h b/src/server/proto/Client/presence_service.pb.h index af264f58b08..861103f133b 100644 --- a/src/server/proto/Client/presence_service.pb.h +++ b/src/server/proto/Client/presence_service.pb.h @@ -961,13 +961,13 @@ class TC_PROTO_API PresenceService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleSubscribe(::bgs::protocol::presence::v1::SubscribeRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUnsubscribe(::bgs::protocol::presence::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUpdate(::bgs::protocol::presence::v1::UpdateRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleQuery(::bgs::protocol::presence::v1::QueryRequest const* request, ::bgs::protocol::presence::v1::QueryResponse* response); - virtual uint32 HandleOwnership(::bgs::protocol::presence::v1::OwnershipRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleSubscribeNotification(::bgs::protocol::presence::v1::SubscribeNotificationRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleMigrateOlympusCustomMessage(::bgs::protocol::presence::v1::MigrateOlympusCustomMessageRequest const* request, ::bgs::protocol::presence::v1::MigrateOlympusCustomMessageResponse* response); + virtual uint32 HandleSubscribe(::bgs::protocol::presence::v1::SubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUnsubscribe(::bgs::protocol::presence::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUpdate(::bgs::protocol::presence::v1::UpdateRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleQuery(::bgs::protocol::presence::v1::QueryRequest const* request, ::bgs::protocol::presence::v1::QueryResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleOwnership(::bgs::protocol::presence::v1::OwnershipRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSubscribeNotification(::bgs::protocol::presence::v1::SubscribeNotificationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleMigrateOlympusCustomMessage(::bgs::protocol::presence::v1::MigrateOlympusCustomMessageRequest const* request, ::bgs::protocol::presence::v1::MigrateOlympusCustomMessageResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/presence_types.pb.cc b/src/server/proto/Client/presence_types.pb.cc index e57ad02268b..a94381dce57 100644 --- a/src/server/proto/Client/presence_types.pb.cc +++ b/src/server/proto/Client/presence_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace presence { diff --git a/src/server/proto/Client/profanity_filter_config.pb.cc b/src/server/proto/Client/profanity_filter_config.pb.cc index dfd5c1e0fac..cccd57aa6ae 100644 --- a/src/server/proto/Client/profanity_filter_config.pb.cc +++ b/src/server/proto/Client/profanity_filter_config.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace profanity { diff --git a/src/server/proto/Client/report_service.pb.cc b/src/server/proto/Client/report_service.pb.cc index 21d4e8733bb..8d14de09c83 100644 --- a/src/server/proto/Client/report_service.pb.cc +++ b/src/server/proto/Client/report_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace report { @@ -701,15 +697,23 @@ void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffe SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SendReport(bgs.protocol.report.v1.SendReportRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ReportService* self = static_cast<ReportService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SendReport() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSendReport(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SendReport(bgs.protocol.report.v1.SendReportRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleSendReport(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 2: { @@ -719,15 +723,23 @@ void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffe SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SubmitReport(bgs.protocol.report.v1.SubmitReportRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + ReportService* self = static_cast<ReportService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SubmitReport() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 2, token, response); + else + self->SendResponse(self->service_hash_, 2, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleSubmitReport(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SubmitReport(bgs.protocol.report.v1.SubmitReportRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 2, token, &response); - else - SendResponse(service_hash_, 2, token, status); + uint32 status = HandleSubmitReport(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -737,13 +749,13 @@ void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffe } } -uint32 ReportService::HandleSendReport(::bgs::protocol::report::v1::SendReportRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ReportService::HandleSendReport(::bgs::protocol::report::v1::SendReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ReportService.SendReport({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 ReportService::HandleSubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, ::bgs::protocol::NoData* response) { +uint32 ReportService::HandleSubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ReportService.SubmitReport({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; diff --git a/src/server/proto/Client/report_service.pb.h b/src/server/proto/Client/report_service.pb.h index 65ff6e9f877..10ec0a2a620 100644 --- a/src/server/proto/Client/report_service.pb.h +++ b/src/server/proto/Client/report_service.pb.h @@ -243,8 +243,8 @@ class TC_PROTO_API ReportService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleSendReport(::bgs::protocol::report::v1::SendReportRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleSubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleSendReport(::bgs::protocol::report::v1::SendReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleSubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/report_types.pb.cc b/src/server/proto/Client/report_types.pb.cc index 6e195461ba8..1fc8c19ce23 100644 --- a/src/server/proto/Client/report_types.pb.cc +++ b/src/server/proto/Client/report_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace report { diff --git a/src/server/proto/Client/resource_service.pb.cc b/src/server/proto/Client/resource_service.pb.cc index 3297f2246d6..260a88eac89 100644 --- a/src/server/proto/Client/resource_service.pb.cc +++ b/src/server/proto/Client/resource_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace resources { @@ -461,15 +457,23 @@ void ResourcesService::CallServerMethod(uint32 token, uint32 methodId, MessageBu SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ResourcesService.GetContentHandle(bgs.protocol.resources.v1.ContentHandleRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::ContentHandle::descriptor()); + ResourcesService* self = static_cast<ResourcesService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method ResourcesService.GetContentHandle() returned bgs.protocol.ContentHandle{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::ContentHandle response; - uint32 status = HandleGetContentHandle(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ResourcesService.GetContentHandle(bgs.protocol.resources.v1.ContentHandleRequest{ %s }) returned bgs.protocol.ContentHandle{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleGetContentHandle(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -479,7 +483,7 @@ void ResourcesService::CallServerMethod(uint32 token, uint32 methodId, MessageBu } } -uint32 ResourcesService::HandleGetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, ::bgs::protocol::ContentHandle* response) { +uint32 ResourcesService::HandleGetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, ::bgs::protocol::ContentHandle* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ResourcesService.GetContentHandle({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; diff --git a/src/server/proto/Client/resource_service.pb.h b/src/server/proto/Client/resource_service.pb.h index ca3b361c4f9..43499303316 100644 --- a/src/server/proto/Client/resource_service.pb.h +++ b/src/server/proto/Client/resource_service.pb.h @@ -165,7 +165,7 @@ class TC_PROTO_API ResourcesService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleGetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, ::bgs::protocol::ContentHandle* response); + virtual uint32 HandleGetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, ::bgs::protocol::ContentHandle* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/role_types.pb.cc b/src/server/proto/Client/role_types.pb.cc index 9a50d13a8b3..b44aa779a3b 100644 --- a/src/server/proto/Client/role_types.pb.cc +++ b/src/server/proto/Client/role_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { diff --git a/src/server/proto/Client/rpc_config.pb.cc b/src/server/proto/Client/rpc_config.pb.cc index 63597f6618d..9af51e1b041 100644 --- a/src/server/proto/Client/rpc_config.pb.cc +++ b/src/server/proto/Client/rpc_config.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace config { diff --git a/src/server/proto/Client/rpc_types.pb.cc b/src/server/proto/Client/rpc_types.pb.cc index 12e465c33f3..2107769319a 100644 --- a/src/server/proto/Client/rpc_types.pb.cc +++ b/src/server/proto/Client/rpc_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { diff --git a/src/server/proto/Client/user_manager_service.pb.cc b/src/server/proto/Client/user_manager_service.pb.cc index d29891864e1..53d41c42c96 100644 --- a/src/server/proto/Client/user_manager_service.pb.cc +++ b/src/server/proto/Client/user_manager_service.pb.cc @@ -16,14 +16,10 @@ #include <google/protobuf/reflection_ops.h> #include <google/protobuf/wire_format.h> #include "Log.h" +#include "Errors.h" #include "BattlenetRpcErrorCodes.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace user_manager { @@ -4207,15 +4203,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.Subscribe(bgs.protocol.user_manager.v1.SubscribeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::user_manager::v1::SubscribeResponse::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.Subscribe() returned bgs.protocol.user_manager.v1.SubscribeResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 1, token, response); + else + self->SendResponse(self->service_hash_, 1, token, status); + }; ::bgs::protocol::user_manager::v1::SubscribeResponse response; - uint32 status = HandleSubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.Subscribe(bgs.protocol.user_manager.v1.SubscribeRequest{ %s }) returned bgs.protocol.user_manager.v1.SubscribeResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 1, token, &response); - else - SendResponse(service_hash_, 1, token, status); + uint32 status = HandleSubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 10: { @@ -4225,15 +4229,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.AddRecentPlayers(bgs.protocol.user_manager.v1.AddRecentPlayersRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::user_manager::v1::AddRecentPlayersResponse::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.AddRecentPlayers() returned bgs.protocol.user_manager.v1.AddRecentPlayersResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 10, token, response); + else + self->SendResponse(self->service_hash_, 10, token, status); + }; ::bgs::protocol::user_manager::v1::AddRecentPlayersResponse response; - uint32 status = HandleAddRecentPlayers(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.AddRecentPlayers(bgs.protocol.user_manager.v1.AddRecentPlayersRequest{ %s }) returned bgs.protocol.user_manager.v1.AddRecentPlayersResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 10, token, &response); - else - SendResponse(service_hash_, 10, token, status); + uint32 status = HandleAddRecentPlayers(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 11: { @@ -4243,15 +4255,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.ClearRecentPlayers(bgs.protocol.user_manager.v1.ClearRecentPlayersRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::user_manager::v1::ClearRecentPlayersResponse::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.ClearRecentPlayers() returned bgs.protocol.user_manager.v1.ClearRecentPlayersResponse{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 11, token, response); + else + self->SendResponse(self->service_hash_, 11, token, status); + }; ::bgs::protocol::user_manager::v1::ClearRecentPlayersResponse response; - uint32 status = HandleClearRecentPlayers(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.ClearRecentPlayers(bgs.protocol.user_manager.v1.ClearRecentPlayersRequest{ %s }) returned bgs.protocol.user_manager.v1.ClearRecentPlayersResponse{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 11, token, &response); - else - SendResponse(service_hash_, 11, token, status); + uint32 status = HandleClearRecentPlayers(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 20: { @@ -4261,15 +4281,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 20, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.BlockPlayer(bgs.protocol.user_manager.v1.BlockPlayerRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.BlockPlayer() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 20, token, response); + else + self->SendResponse(self->service_hash_, 20, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleBlockPlayer(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.BlockPlayer(bgs.protocol.user_manager.v1.BlockPlayerRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 20, token, &response); - else - SendResponse(service_hash_, 20, token, status); + uint32 status = HandleBlockPlayer(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 21: { @@ -4279,15 +4307,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 21, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.UnblockPlayer(bgs.protocol.user_manager.v1.UnblockPlayerRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.UnblockPlayer() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 21, token, response); + else + self->SendResponse(self->service_hash_, 21, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUnblockPlayer(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.UnblockPlayer(bgs.protocol.user_manager.v1.UnblockPlayerRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 21, token, &response); - else - SendResponse(service_hash_, 21, token, status); + uint32 status = HandleUnblockPlayer(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 40: { @@ -4297,15 +4333,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 40, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.BlockPlayerForSession(bgs.protocol.user_manager.v1.BlockPlayerRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.BlockPlayerForSession() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 40, token, response); + else + self->SendResponse(self->service_hash_, 40, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleBlockPlayerForSession(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.BlockPlayerForSession(bgs.protocol.user_manager.v1.BlockPlayerRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 40, token, &response); - else - SendResponse(service_hash_, 40, token, status); + uint32 status = HandleBlockPlayerForSession(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 50: { @@ -4315,15 +4359,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 50, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.LoadBlockList(bgs.protocol.EntityId{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.LoadBlockList() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 50, token, response); + else + self->SendResponse(self->service_hash_, 50, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleLoadBlockList(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.LoadBlockList(bgs.protocol.EntityId{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 50, token, &response); - else - SendResponse(service_hash_, 50, token, status); + uint32 status = HandleLoadBlockList(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } case 51: { @@ -4333,15 +4385,23 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message SendResponse(service_hash_, 51, token, ERROR_RPC_MALFORMED_REQUEST); return; } - + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.Unsubscribe(bgs.protocol.user_manager.v1.UnsubscribeRequest{ %s }).", + GetCallerInfo().c_str(), request.ShortDebugString().c_str()); + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) + { + ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); + UserManagerService* self = static_cast<UserManagerService*>(service); + TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.Unsubscribe() returned bgs.protocol.NoData{ %s } status %u.", + self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); + if (!status) + self->SendResponse(self->service_hash_, 51, token, response); + else + self->SendResponse(self->service_hash_, 51, token, status); + }; ::bgs::protocol::NoData response; - uint32 status = HandleUnsubscribe(&request, &response); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerService.Unsubscribe(bgs.protocol.user_manager.v1.UnsubscribeRequest{ %s }) returned bgs.protocol.NoData{ %s } status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), response.ShortDebugString().c_str(), status); - if (!status) - SendResponse(service_hash_, 51, token, &response); - else - SendResponse(service_hash_, 51, token, status); + uint32 status = HandleUnsubscribe(&request, &response, continuation); + if (continuation) + continuation(this, status, &response); break; } default: @@ -4351,49 +4411,49 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message } } -uint32 UserManagerService::HandleSubscribe(::bgs::protocol::user_manager::v1::SubscribeRequest const* request, ::bgs::protocol::user_manager::v1::SubscribeResponse* response) { +uint32 UserManagerService::HandleSubscribe(::bgs::protocol::user_manager::v1::SubscribeRequest const* request, ::bgs::protocol::user_manager::v1::SubscribeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.Subscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleAddRecentPlayers(::bgs::protocol::user_manager::v1::AddRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::AddRecentPlayersResponse* response) { +uint32 UserManagerService::HandleAddRecentPlayers(::bgs::protocol::user_manager::v1::AddRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::AddRecentPlayersResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.AddRecentPlayers({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::ClearRecentPlayersResponse* response) { +uint32 UserManagerService::HandleClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::ClearRecentPlayersResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.ClearRecentPlayers({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleBlockPlayer(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response) { +uint32 UserManagerService::HandleBlockPlayer(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.BlockPlayer({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleUnblockPlayer(::bgs::protocol::user_manager::v1::UnblockPlayerRequest const* request, ::bgs::protocol::NoData* response) { +uint32 UserManagerService::HandleUnblockPlayer(::bgs::protocol::user_manager::v1::UnblockPlayerRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.UnblockPlayer({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleBlockPlayerForSession(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response) { +uint32 UserManagerService::HandleBlockPlayerForSession(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.BlockPlayerForSession({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleLoadBlockList(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response) { +uint32 UserManagerService::HandleLoadBlockList(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.LoadBlockList({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; } -uint32 UserManagerService::HandleUnsubscribe(::bgs::protocol::user_manager::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response) { +uint32 UserManagerService::HandleUnsubscribe(::bgs::protocol::user_manager::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerService.Unsubscribe({ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); return ERROR_RPC_NOT_IMPLEMENTED; @@ -4412,25 +4472,25 @@ google::protobuf::ServiceDescriptor const* UserManagerListener::descriptor() { return UserManagerListener_descriptor_; } -void UserManagerListener::OnBlockedPlayerAdded(::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification const* request) { +void UserManagerListener::OnBlockedPlayerAdded(::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerListener.OnBlockedPlayerAdded(bgs.protocol.user_manager.v1.BlockedPlayerAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 1, request); } -void UserManagerListener::OnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request) { +void UserManagerListener::OnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerListener.OnBlockedPlayerRemoved(bgs.protocol.user_manager.v1.BlockedPlayerRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 2, request); } -void UserManagerListener::OnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request) { +void UserManagerListener::OnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerListener.OnRecentPlayersAdded(bgs.protocol.user_manager.v1.RecentPlayersAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 11, request); } -void UserManagerListener::OnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request) { +void UserManagerListener::OnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerListener.OnRecentPlayersRemoved(bgs.protocol.user_manager.v1.RecentPlayersRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); SendRequest(service_hash_, 12, request); @@ -4445,7 +4505,6 @@ void UserManagerListener::CallServerMethod(uint32 token, uint32 methodId, Messag SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnBlockedPlayerAdded(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerListener.OnBlockedPlayerAdded(bgs.protocol.user_manager.v1.BlockedPlayerAddedNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4460,7 +4519,6 @@ void UserManagerListener::CallServerMethod(uint32 token, uint32 methodId, Messag SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnBlockedPlayerRemoved(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerListener.OnBlockedPlayerRemoved(bgs.protocol.user_manager.v1.BlockedPlayerRemovedNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4475,7 +4533,6 @@ void UserManagerListener::CallServerMethod(uint32 token, uint32 methodId, Messag SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnRecentPlayersAdded(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerListener.OnRecentPlayersAdded(bgs.protocol.user_manager.v1.RecentPlayersAddedNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); @@ -4490,7 +4547,6 @@ void UserManagerListener::CallServerMethod(uint32 token, uint32 methodId, Messag SendResponse(service_hash_, 12, token, ERROR_RPC_MALFORMED_REQUEST); return; } - uint32 status = HandleOnRecentPlayersRemoved(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method UserManagerListener.OnRecentPlayersRemoved(bgs.protocol.user_manager.v1.RecentPlayersRemovedNotification{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); diff --git a/src/server/proto/Client/user_manager_service.pb.h b/src/server/proto/Client/user_manager_service.pb.h index ce5a323e616..a89705e825a 100644 --- a/src/server/proto/Client/user_manager_service.pb.h +++ b/src/server/proto/Client/user_manager_service.pb.h @@ -1319,14 +1319,14 @@ class TC_PROTO_API UserManagerService : public ServiceBase void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; protected: - virtual uint32 HandleSubscribe(::bgs::protocol::user_manager::v1::SubscribeRequest const* request, ::bgs::protocol::user_manager::v1::SubscribeResponse* response); - virtual uint32 HandleAddRecentPlayers(::bgs::protocol::user_manager::v1::AddRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::AddRecentPlayersResponse* response); - virtual uint32 HandleClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::ClearRecentPlayersResponse* response); - virtual uint32 HandleBlockPlayer(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUnblockPlayer(::bgs::protocol::user_manager::v1::UnblockPlayerRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleBlockPlayerForSession(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleLoadBlockList(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response); - virtual uint32 HandleUnsubscribe(::bgs::protocol::user_manager::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response); + virtual uint32 HandleSubscribe(::bgs::protocol::user_manager::v1::SubscribeRequest const* request, ::bgs::protocol::user_manager::v1::SubscribeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleAddRecentPlayers(::bgs::protocol::user_manager::v1::AddRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::AddRecentPlayersResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, ::bgs::protocol::user_manager::v1::ClearRecentPlayersResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleBlockPlayer(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUnblockPlayer(::bgs::protocol::user_manager::v1::UnblockPlayerRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleBlockPlayerForSession(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleLoadBlockList(::bgs::protocol::EntityId const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); + virtual uint32 HandleUnsubscribe(::bgs::protocol::user_manager::v1::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: uint32 service_hash_; diff --git a/src/server/proto/Client/user_manager_types.pb.cc b/src/server/proto/Client/user_manager_types.pb.cc index cd3857a9b14..2606b6440c0 100644 --- a/src/server/proto/Client/user_manager_types.pb.cc +++ b/src/server/proto/Client/user_manager_types.pb.cc @@ -18,11 +18,6 @@ #include "Log.h" // @@protoc_insertion_point(includes) -// Fix stupid windows.h included from Log.h->Common.h -#ifdef SendMessage -#undef SendMessage -#endif - namespace bgs { namespace protocol { namespace user_manager { |