diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-05-08 00:12:36 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-05-08 00:12:36 +0200 |
commit | 4c85198ed6135b42f9dfe0ad16901f7d741b64c6 (patch) | |
tree | 9ae77f5720c8d9107bbff684df101326c994b231 /src/server/proto | |
parent | 1aaa3131d0f67ebefe312f2988d49751f1cfebb4 (diff) |
Core/protobuf: Remove unneccessary methods from generated services
Diffstat (limited to 'src/server/proto')
28 files changed, 519 insertions, 2113 deletions
diff --git a/src/server/proto/Client/account_service.pb.cc b/src/server/proto/Client/account_service.pb.cc index 4f729fcd000..e86b507a604 100644 --- a/src/server/proto/Client/account_service.pb.cc +++ b/src/server/proto/Client/account_service.pb.cc @@ -8133,159 +8133,27 @@ google::protobuf::ServiceDescriptor const* AccountService::descriptor() { return AccountService_descriptor_; } -void AccountService::ResolveAccount(::bgs::protocol::account::v1::ResolveAccountRequest const* request, std::function<void(::bgs::protocol::account::v1::ResolveAccountResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.ResolveAccount(bgs.protocol.account.v1.ResolveAccountRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::ResolveAccountResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 13, request, std::move(callback)); -} - -void AccountService::IsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.IsIgrAddress(bgs.protocol.account.v1.IsIgrAddressRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 15, request, std::move(callback)); -} - -void AccountService::Subscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, std::function<void(::bgs::protocol::account::v1::SubscriptionUpdateResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.Subscribe(bgs.protocol.account.v1.SubscriptionUpdateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::SubscriptionUpdateResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 25, request, std::move(callback)); -} - -void AccountService::Unsubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.Unsubscribe(bgs.protocol.account.v1.SubscriptionUpdateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 26, request, std::move(callback)); -} - -void AccountService::GetAccountState(::bgs::protocol::account::v1::GetAccountStateRequest const* request, std::function<void(::bgs::protocol::account::v1::GetAccountStateResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetAccountState(bgs.protocol.account.v1.GetAccountStateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetAccountStateResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 30, request, std::move(callback)); -} - -void AccountService::GetGameAccountState(::bgs::protocol::account::v1::GetGameAccountStateRequest const* request, std::function<void(::bgs::protocol::account::v1::GetGameAccountStateResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetGameAccountState(bgs.protocol.account.v1.GetGameAccountStateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetGameAccountStateResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 31, request, std::move(callback)); -} - -void AccountService::GetLicenses(::bgs::protocol::account::v1::GetLicensesRequest const* request, std::function<void(::bgs::protocol::account::v1::GetLicensesResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetLicenses(bgs.protocol.account.v1.GetLicensesRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetLicensesResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 32, request, std::move(callback)); -} - -void AccountService::GetGameTimeRemainingInfo(::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest const* request, std::function<void(::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetGameTimeRemainingInfo(bgs.protocol.account.v1.GetGameTimeRemainingInfoRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 33, request, std::move(callback)); -} - -void AccountService::GetGameSessionInfo(::bgs::protocol::account::v1::GetGameSessionInfoRequest const* request, std::function<void(::bgs::protocol::account::v1::GetGameSessionInfoResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetGameSessionInfo(bgs.protocol.account.v1.GetGameSessionInfoRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetGameSessionInfoResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 34, request, std::move(callback)); -} - -void AccountService::GetCAISInfo(::bgs::protocol::account::v1::GetCAISInfoRequest const* request, std::function<void(::bgs::protocol::account::v1::GetCAISInfoResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetCAISInfo(bgs.protocol.account.v1.GetCAISInfoRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetCAISInfoResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 35, request, std::move(callback)); -} - -void AccountService::GetAuthorizedData(::bgs::protocol::account::v1::GetAuthorizedDataRequest const* request, std::function<void(::bgs::protocol::account::v1::GetAuthorizedDataResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetAuthorizedData(bgs.protocol.account.v1.GetAuthorizedDataRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetAuthorizedDataResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 37, request, std::move(callback)); -} - -void AccountService::GetSignedAccountState(::bgs::protocol::account::v1::GetSignedAccountStateRequest const* request, std::function<void(::bgs::protocol::account::v1::GetSignedAccountStateResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AccountService.GetSignedAccountState(bgs.protocol.account.v1.GetSignedAccountStateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::account::v1::GetSignedAccountStateResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 44, request, std::move(callback)); -} - void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 13: { ::bgs::protocol::account::v1::ResolveAccountRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.ResolveAccount server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 13, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.ResolveAccount(bgs.protocol.account.v1.ResolveAccountRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::ResolveAccountResponse::descriptor()); AccountService* self = static_cast<AccountService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.ResolveAccount() returned bgs.protocol.account.v1.ResolveAccountResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 13, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 13, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::ResolveAccountResponse response; uint32 status = HandleResolveAccount(&request, &response, continuation); @@ -8297,21 +8165,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::IsIgrAddressRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.IsIgrAddress server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 15, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 15, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleIsIgrAddress(&request, &response, continuation); @@ -8323,21 +8191,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::SubscriptionUpdateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.Subscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 25, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 25, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::SubscriptionUpdateResponse response; uint32 status = HandleSubscribe(&request, &response, continuation); @@ -8349,21 +8217,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::SubscriptionUpdateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.Unsubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 26, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 26, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUnsubscribe(&request, &response, continuation); @@ -8375,21 +8243,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetAccountStateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetAccountState server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 30, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 30, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetAccountStateResponse response; uint32 status = HandleGetAccountState(&request, &response, continuation); @@ -8401,21 +8269,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetGameAccountStateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetGameAccountState server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 31, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 31, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetGameAccountStateResponse response; uint32 status = HandleGetGameAccountState(&request, &response, continuation); @@ -8427,21 +8295,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetLicensesRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetLicenses server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 32, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 32, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetLicensesResponse response; uint32 status = HandleGetLicenses(&request, &response, continuation); @@ -8453,21 +8321,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetGameTimeRemainingInfo server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 33, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 33, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse response; uint32 status = HandleGetGameTimeRemainingInfo(&request, &response, continuation); @@ -8479,21 +8347,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetGameSessionInfoRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetGameSessionInfo server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 34, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 34, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetGameSessionInfoResponse response; uint32 status = HandleGetGameSessionInfo(&request, &response, continuation); @@ -8505,21 +8373,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetCAISInfoRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetCAISInfo server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 35, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 35, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetCAISInfoResponse response; uint32 status = HandleGetCAISInfo(&request, &response, continuation); @@ -8531,21 +8399,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetAuthorizedDataRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetAuthorizedData server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 37, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 37, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetAuthorizedDataResponse response; uint32 status = HandleGetAuthorizedData(&request, &response, continuation); @@ -8557,21 +8425,21 @@ void AccountService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::account::v1::GetSignedAccountStateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountService.GetSignedAccountState server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 44, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetSignedAccountState(bgs.protocol.account.v1.GetSignedAccountStateRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::account::v1::GetSignedAccountStateResponse::descriptor()); AccountService* self = static_cast<AccountService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method AccountService.GetSignedAccountState() returned bgs.protocol.account.v1.GetSignedAccountStateResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 44, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 44, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::account::v1::GetSignedAccountStateResponse response; uint32 status = HandleGetSignedAccountState(&request, &response, continuation); @@ -8671,117 +8539,33 @@ 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, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AccountListener::OnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request) { +void AccountListener::OnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AccountListener::OnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request) { +void AccountListener::OnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 3 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AccountListener::OnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request) { +void AccountListener::OnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); -} - -void AccountListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 1: { - ::bgs::protocol::account::v1::AccountStateNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountListener.OnAccountStateUpdated server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 1, token, status); - break; - } - case 2: { - ::bgs::protocol::account::v1::GameAccountStateNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountListener.OnGameAccountStateUpdated server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 2, token, status); - break; - } - case 3: { - ::bgs::protocol::account::v1::GameAccountNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountListener.OnGameAccountsUpdated server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 3, token, status); - break; - } - case 4: { - ::bgs::protocol::account::v1::GameAccountSessionNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AccountListener.OnGameSessionUpdated server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 4, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 AccountListener::HandleOnAccountStateUpdated(::bgs::protocol::account::v1::AccountStateNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountListener.OnAccountStateUpdated({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AccountListener::HandleOnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountListener.OnGameAccountStateUpdated({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; + SendRequest(service_hash_, 4 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -uint32 AccountListener::HandleOnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountListener.OnGameAccountsUpdated({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AccountListener::HandleOnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AccountListener.OnGameSessionUpdated({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void AccountListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } diff --git a/src/server/proto/Client/account_service.pb.h b/src/server/proto/Client/account_service.pb.h index 16ac00ab718..b9fefb380d5 100644 --- a/src/server/proto/Client/account_service.pb.h +++ b/src/server/proto/Client/account_service.pb.h @@ -2532,25 +2532,10 @@ class TC_PROTO_API AccountService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void ResolveAccount(::bgs::protocol::account::v1::ResolveAccountRequest const* request, std::function<void(::bgs::protocol::account::v1::ResolveAccountResponse const*)> responseCallback); - void IsIgrAddress(::bgs::protocol::account::v1::IsIgrAddressRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void Subscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, std::function<void(::bgs::protocol::account::v1::SubscriptionUpdateResponse const*)> responseCallback); - void Unsubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GetAccountState(::bgs::protocol::account::v1::GetAccountStateRequest const* request, std::function<void(::bgs::protocol::account::v1::GetAccountStateResponse const*)> responseCallback); - void GetGameAccountState(::bgs::protocol::account::v1::GetGameAccountStateRequest const* request, std::function<void(::bgs::protocol::account::v1::GetGameAccountStateResponse const*)> responseCallback); - void GetLicenses(::bgs::protocol::account::v1::GetLicensesRequest const* request, std::function<void(::bgs::protocol::account::v1::GetLicensesResponse const*)> responseCallback); - void GetGameTimeRemainingInfo(::bgs::protocol::account::v1::GetGameTimeRemainingInfoRequest const* request, std::function<void(::bgs::protocol::account::v1::GetGameTimeRemainingInfoResponse const*)> responseCallback); - void GetGameSessionInfo(::bgs::protocol::account::v1::GetGameSessionInfoRequest const* request, std::function<void(::bgs::protocol::account::v1::GetGameSessionInfoResponse const*)> responseCallback); - void GetCAISInfo(::bgs::protocol::account::v1::GetCAISInfoRequest const* request, std::function<void(::bgs::protocol::account::v1::GetCAISInfoResponse const*)> responseCallback); - void GetAuthorizedData(::bgs::protocol::account::v1::GetAuthorizedDataRequest const* request, std::function<void(::bgs::protocol::account::v1::GetAuthorizedDataResponse const*)> responseCallback); - void GetSignedAccountState(::bgs::protocol::account::v1::GetSignedAccountStateRequest const* request, std::function<void(::bgs::protocol::account::v1::GetSignedAccountStateResponse const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- virtual uint32 HandleResolveAccount(::bgs::protocol::account::v1::ResolveAccountRequest const* request, ::bgs::protocol::account::v1::ResolveAccountResponse* 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 HandleSubscribe(::bgs::protocol::account::v1::SubscriptionUpdateRequest const* request, ::bgs::protocol::account::v1::SubscriptionUpdateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); @@ -2585,20 +2570,12 @@ class TC_PROTO_API AccountListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- + void OnAccountStateUpdated(::bgs::protocol::account::v1::AccountStateNotification const* request, bool client = false, bool server = false); + void OnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request, bool client = false, bool server = false); + void OnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request, bool client = false, bool server = false); + void OnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request, bool client = false, bool server = false); - void OnAccountStateUpdated(::bgs::protocol::account::v1::AccountStateNotification const* request); - void OnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request); - void OnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request); - void OnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - protected: - virtual uint32 HandleOnAccountStateUpdated(::bgs::protocol::account::v1::AccountStateNotification const* request); - virtual uint32 HandleOnGameAccountStateUpdated(::bgs::protocol::account::v1::GameAccountStateNotification const* request); - virtual uint32 HandleOnGameAccountsUpdated(::bgs::protocol::account::v1::GameAccountNotification const* request); - virtual uint32 HandleOnGameSessionUpdated(::bgs::protocol::account::v1::GameAccountSessionNotification const* request); + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; diff --git a/src/server/proto/Client/api/client/v2/report_service.pb.cc b/src/server/proto/Client/api/client/v2/report_service.pb.cc index 0a786bfdf85..fcb131ba79c 100644 --- a/src/server/proto/Client/api/client/v2/report_service.pb.cc +++ b/src/server/proto/Client/api/client/v2/report_service.pb.cc @@ -592,38 +592,27 @@ google::protobuf::ServiceDescriptor const* ReportService::descriptor() { return ReportService_descriptor_; } -void ReportService::SubmitReport(::bgs::protocol::report::v2::SubmitReportRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ReportService.SubmitReport(bgs.protocol.report.v2.SubmitReportRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::report::v2::SubmitReportRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ReportService.SubmitReport server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ReportService.SubmitReport(bgs.protocol.report.v2.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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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_, 1, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSubmitReport(&request, &response, continuation); diff --git a/src/server/proto/Client/api/client/v2/report_service.pb.h b/src/server/proto/Client/api/client/v2/report_service.pb.h index fb033acc335..97a7f9ab57c 100644 --- a/src/server/proto/Client/api/client/v2/report_service.pb.h +++ b/src/server/proto/Client/api/client/v2/report_service.pb.h @@ -202,14 +202,10 @@ class TC_PROTO_API ReportService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void SubmitReport(::bgs::protocol::report::v2::SubmitReportRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- virtual uint32 HandleSubmitReport(::bgs::protocol::report::v2::SubmitReportRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); private: diff --git a/src/server/proto/Client/authentication_service.pb.cc b/src/server/proto/Client/authentication_service.pb.cc index 55c251ce1c8..34cb995e1ee 100644 --- a/src/server/proto/Client/authentication_service.pb.cc +++ b/src/server/proto/Client/authentication_service.pb.cc @@ -7100,13 +7100,13 @@ 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, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { +void AuthenticationListener::OnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -7114,22 +7114,22 @@ void AuthenticationListener::OnModuleMessage(::bgs::protocol::authentication::v1 if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 2, request, std::move(callback)); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void AuthenticationListener::OnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request) { +void AuthenticationListener::OnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 4 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request) { +void AuthenticationListener::OnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 5 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, std::function<void(::bgs::protocol::authentication::v1::MemModuleLoadResponse const*)> responseCallback) { +void AuthenticationListener::OnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, std::function<void(::bgs::protocol::authentication::v1::MemModuleLoadResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationListener.OnMemModuleLoad(bgs.protocol.authentication.v1.MemModuleLoadRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -7137,270 +7137,42 @@ void AuthenticationListener::OnMemModuleLoad(::bgs::protocol::authentication::v1 if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 6, request, std::move(callback)); + SendRequest(service_hash_, 6 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void AuthenticationListener::OnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request) { +void AuthenticationListener::OnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 10 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request) { +void AuthenticationListener::OnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 11 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request) { +void AuthenticationListener::OnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 12 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnLogonQueueEnd(::bgs::protocol::NoData const* request) { +void AuthenticationListener::OnLogonQueueEnd(::bgs::protocol::NoData const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 13 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::OnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request) { +void AuthenticationListener::OnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 14 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 1: { - ::bgs::protocol::authentication::v1::ModuleLoadRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnModuleLoad server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 1, token, status); - break; - } - case 2: { - ::bgs::protocol::authentication::v1::ModuleMessageRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnModuleMessage server method call.", GetCallerInfo().c_str()); - 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, continuation); - if (continuation) - continuation(this, status, &response); - break; - } - case 4: { - ::bgs::protocol::authentication::v1::ServerStateChangeRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnServerStateChange server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 4, token, status); - break; - } - case 5: { - ::bgs::protocol::authentication::v1::LogonResult request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnLogonComplete server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 5, token, status); - break; - } - case 6: { - ::bgs::protocol::authentication::v1::MemModuleLoadRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnMemModuleLoad server method call.", GetCallerInfo().c_str()); - 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, continuation); - if (continuation) - continuation(this, status, &response); - break; - } - case 10: { - ::bgs::protocol::authentication::v1::LogonUpdateRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnLogonUpdate server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 10, token, status); - break; - } - case 11: { - ::bgs::protocol::authentication::v1::VersionInfoNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnVersionInfoUpdated server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 11, token, status); - break; - } - case 12: { - ::bgs::protocol::authentication::v1::LogonQueueUpdateRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnLogonQueueUpdate server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 12, token, status); - break; - } - case 13: { - ::bgs::protocol::NoData request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnLogonQueueEnd server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 13, token, status); - break; - } - case 14: { - ::bgs::protocol::authentication::v1::GameAccountSelectedRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationListener.OnGameAccountSelected server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 14, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 AuthenticationListener::HandleOnModuleLoad(::bgs::protocol::authentication::v1::ModuleLoadRequest const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnModuleLoad({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -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; -} - -uint32 AuthenticationListener::HandleOnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnServerStateChange({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AuthenticationListener::HandleOnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnLogonComplete({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -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; -} - -uint32 AuthenticationListener::HandleOnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnLogonUpdate({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AuthenticationListener::HandleOnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnVersionInfoUpdated({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AuthenticationListener::HandleOnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnLogonQueueUpdate({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AuthenticationListener::HandleOnLogonQueueEnd(::bgs::protocol::NoData const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnLogonQueueEnd({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 AuthenticationListener::HandleOnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method AuthenticationListener.OnGameAccountSelected({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void AuthenticationListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } // =================================================================== @@ -7416,115 +7188,27 @@ google::protobuf::ServiceDescriptor const* AuthenticationService::descriptor() { return AuthenticationService_descriptor_; } -void AuthenticationService::Logon(::bgs::protocol::authentication::v1::LogonRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.Logon(bgs.protocol.authentication.v1.LogonRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - -void AuthenticationService::ModuleNotify(::bgs::protocol::authentication::v1::ModuleNotification const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.ModuleNotify(bgs.protocol.authentication.v1.ModuleNotification{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 2, request, std::move(callback)); -} - -void AuthenticationService::ModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.ModuleMessage(bgs.protocol.authentication.v1.ModuleMessageRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 3, request, std::move(callback)); -} - -void AuthenticationService::SelectGameAccount_DEPRECATED(::bgs::protocol::EntityId const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.SelectGameAccount_DEPRECATED(bgs.protocol.EntityId{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 4, request, std::move(callback)); -} - -void AuthenticationService::GenerateSSOToken(::bgs::protocol::authentication::v1::GenerateSSOTokenRequest const* request, std::function<void(::bgs::protocol::authentication::v1::GenerateSSOTokenResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.GenerateSSOToken(bgs.protocol.authentication.v1.GenerateSSOTokenRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 5, request, std::move(callback)); -} - -void AuthenticationService::SelectGameAccount(::bgs::protocol::authentication::v1::SelectGameAccountRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.SelectGameAccount(bgs.protocol.authentication.v1.SelectGameAccountRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 6, request, std::move(callback)); -} - -void AuthenticationService::VerifyWebCredentials(::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.VerifyWebCredentials(bgs.protocol.authentication.v1.VerifyWebCredentialsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 7, request, std::move(callback)); -} - -void AuthenticationService::GenerateWebCredentials(::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest const* request, std::function<void(::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method AuthenticationService.GenerateWebCredentials(bgs.protocol.authentication.v1.GenerateWebCredentialsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 8, request, std::move(callback)); -} - void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::authentication::v1::LogonRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.Logon server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleLogon(&request, &response, continuation); @@ -7536,21 +7220,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::authentication::v1::ModuleNotification request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.ModuleNotify server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleModuleNotify(&request, &response, continuation); @@ -7562,21 +7246,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::authentication::v1::ModuleMessageRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.ModuleMessage server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 3, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleModuleMessage(&request, &response, continuation); @@ -7588,21 +7272,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::EntityId request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.SelectGameAccount_DEPRECATED server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 4, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSelectGameAccount_DEPRECATED(&request, &response, continuation); @@ -7614,21 +7298,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::authentication::v1::GenerateSSOTokenRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.GenerateSSOToken server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 5, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::authentication::v1::GenerateSSOTokenResponse response; uint32 status = HandleGenerateSSOToken(&request, &response, continuation); @@ -7640,21 +7324,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::authentication::v1::SelectGameAccountRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.SelectGameAccount server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 6, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSelectGameAccount(&request, &response, continuation); @@ -7666,21 +7350,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.VerifyWebCredentials server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 7, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleVerifyWebCredentials(&request, &response, continuation); @@ -7692,21 +7376,21 @@ void AuthenticationService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for AuthenticationService.GenerateWebCredentials server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 8, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse response; uint32 status = HandleGenerateWebCredentials(&request, &response, continuation); diff --git a/src/server/proto/Client/authentication_service.pb.h b/src/server/proto/Client/authentication_service.pb.h index 2040321e561..cb1ad1b55f8 100644 --- a/src/server/proto/Client/authentication_service.pb.h +++ b/src/server/proto/Client/authentication_service.pb.h @@ -2166,32 +2166,18 @@ class TC_PROTO_API AuthenticationListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- - - void OnModuleLoad(::bgs::protocol::authentication::v1::ModuleLoadRequest const* request); - void OnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void OnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request); - void OnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request); - void OnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, std::function<void(::bgs::protocol::authentication::v1::MemModuleLoadResponse const*)> responseCallback); - void OnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request); - void OnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request); - void OnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request); - void OnLogonQueueEnd(::bgs::protocol::NoData const* request); - void OnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - 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, 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, 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); - virtual uint32 HandleOnLogonQueueEnd(::bgs::protocol::NoData const* request); - virtual uint32 HandleOnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request); + void OnModuleLoad(::bgs::protocol::authentication::v1::ModuleLoadRequest const* request, bool client = false, bool server = false); + void OnModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback, bool client = false, bool server = false); + void OnServerStateChange(::bgs::protocol::authentication::v1::ServerStateChangeRequest const* request, bool client = false, bool server = false); + void OnLogonComplete(::bgs::protocol::authentication::v1::LogonResult const* request, bool client = false, bool server = false); + void OnMemModuleLoad(::bgs::protocol::authentication::v1::MemModuleLoadRequest const* request, std::function<void(::bgs::protocol::authentication::v1::MemModuleLoadResponse const*)> responseCallback, bool client = false, bool server = false); + void OnLogonUpdate(::bgs::protocol::authentication::v1::LogonUpdateRequest const* request, bool client = false, bool server = false); + void OnVersionInfoUpdated(::bgs::protocol::authentication::v1::VersionInfoNotification const* request, bool client = false, bool server = false); + void OnLogonQueueUpdate(::bgs::protocol::authentication::v1::LogonQueueUpdateRequest const* request, bool client = false, bool server = false); + void OnLogonQueueEnd(::bgs::protocol::NoData const* request, bool client = false, bool server = false); + void OnGameAccountSelected(::bgs::protocol::authentication::v1::GameAccountSelectedRequest const* request, bool client = false, bool server = false); + + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; @@ -2213,21 +2199,10 @@ class TC_PROTO_API AuthenticationService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void Logon(::bgs::protocol::authentication::v1::LogonRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void ModuleNotify(::bgs::protocol::authentication::v1::ModuleNotification const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void ModuleMessage(::bgs::protocol::authentication::v1::ModuleMessageRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void SelectGameAccount_DEPRECATED(::bgs::protocol::EntityId const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GenerateSSOToken(::bgs::protocol::authentication::v1::GenerateSSOTokenRequest const* request, std::function<void(::bgs::protocol::authentication::v1::GenerateSSOTokenResponse const*)> responseCallback); - void SelectGameAccount(::bgs::protocol::authentication::v1::SelectGameAccountRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void VerifyWebCredentials(::bgs::protocol::authentication::v1::VerifyWebCredentialsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GenerateWebCredentials(::bgs::protocol::authentication::v1::GenerateWebCredentialsRequest const* request, std::function<void(::bgs::protocol::authentication::v1::GenerateWebCredentialsResponse const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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); diff --git a/src/server/proto/Client/challenge_service.pb.cc b/src/server/proto/Client/challenge_service.pb.cc index b710ef26e3a..4ef80fc4ec7 100644 --- a/src/server/proto/Client/challenge_service.pb.cc +++ b/src/server/proto/Client/challenge_service.pb.cc @@ -789,65 +789,21 @@ google::protobuf::ServiceDescriptor const* ChallengeListener::descriptor() { return ChallengeListener_descriptor_; } -void ChallengeListener::OnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request) { +void ChallengeListener::OnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 3 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ChallengeListener::OnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request) { +void ChallengeListener::OnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 4 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ChallengeListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 3: { - ::bgs::protocol::challenge::v1::ChallengeExternalRequest request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ChallengeListener.OnExternalChallenge server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 3, token, status); - break; - } - case 4: { - ::bgs::protocol::challenge::v1::ChallengeExternalResult request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ChallengeListener.OnExternalChallengeResult server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 4, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 ChallengeListener::HandleOnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChallengeListener.OnExternalChallenge({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ChallengeListener::HandleOnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ChallengeListener.OnExternalChallengeResult({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void ChallengeListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } diff --git a/src/server/proto/Client/challenge_service.pb.h b/src/server/proto/Client/challenge_service.pb.h index fa93153d38c..02ee63616ed 100644 --- a/src/server/proto/Client/challenge_service.pb.h +++ b/src/server/proto/Client/challenge_service.pb.h @@ -267,16 +267,10 @@ class TC_PROTO_API ChallengeListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- + void OnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request, bool client = false, bool server = false); + void OnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request, bool client = false, bool server = false); - void OnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request); - void OnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - protected: - virtual uint32 HandleOnExternalChallenge(::bgs::protocol::challenge::v1::ChallengeExternalRequest const* request); - virtual uint32 HandleOnExternalChallengeResult(::bgs::protocol::challenge::v1::ChallengeExternalResult const* request); + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; diff --git a/src/server/proto/Client/club_membership_listener.pb.cc b/src/server/proto/Client/club_membership_listener.pb.cc index ff3d4011159..6a9b713f146 100644 --- a/src/server/proto/Client/club_membership_listener.pb.cc +++ b/src/server/proto/Client/club_membership_listener.pb.cc @@ -2721,221 +2721,57 @@ google::protobuf::ServiceDescriptor const* ClubMembershipListener::descriptor() return ClubMembershipListener_descriptor_; } -void ClubMembershipListener::OnClubAdded(::bgs::protocol::club::v1::membership::ClubAddedNotification const* request) { +void ClubMembershipListener::OnClubAdded(::bgs::protocol::club::v1::membership::ClubAddedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnClubAdded(bgs.protocol.club.v1.membership.ClubAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 1, request); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnClubRemoved(::bgs::protocol::club::v1::membership::ClubRemovedNotification const* request) { +void ClubMembershipListener::OnClubRemoved(::bgs::protocol::club::v1::membership::ClubRemovedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnClubRemoved(bgs.protocol.club.v1.membership.ClubRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 2, request); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnReceivedInvitationAdded(::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification const* request) { +void ClubMembershipListener::OnReceivedInvitationAdded(::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnReceivedInvitationAdded(bgs.protocol.club.v1.membership.ReceivedInvitationAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 3, request); + SendRequest(service_hash_, 3 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnReceivedInvitationRemoved(::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification const* request) { +void ClubMembershipListener::OnReceivedInvitationRemoved(::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnReceivedInvitationRemoved(bgs.protocol.club.v1.membership.ReceivedInvitationRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 4, request); + SendRequest(service_hash_, 4 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnSharedSettingsChanged(::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification const* request) { +void ClubMembershipListener::OnSharedSettingsChanged(::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnSharedSettingsChanged(bgs.protocol.club.v1.membership.SharedSettingsChangedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 5, request); + SendRequest(service_hash_, 5 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnStreamMentionAdded(::bgs::protocol::club::v1::membership::StreamMentionAddedNotification const* request) { +void ClubMembershipListener::OnStreamMentionAdded(::bgs::protocol::club::v1::membership::StreamMentionAddedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnStreamMentionAdded(bgs.protocol.club.v1.membership.StreamMentionAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 6, request); + SendRequest(service_hash_, 6 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnStreamMentionRemoved(::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification const* request) { +void ClubMembershipListener::OnStreamMentionRemoved(::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnStreamMentionRemoved(bgs.protocol.club.v1.membership.StreamMentionRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 7, request); + SendRequest(service_hash_, 7 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::OnStreamMentionAdvanceViewTime(::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification const* request) { +void ClubMembershipListener::OnStreamMentionAdvanceViewTime(::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipListener.OnStreamMentionAdvanceViewTime(bgs.protocol.club.v1.membership.StreamMentionAdvanceViewTimeNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 8, request); + SendRequest(service_hash_, 8 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ClubMembershipListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 1: { - ::bgs::protocol::club::v1::membership::ClubAddedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnClubAdded server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnClubAdded(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnClubAdded(bgs.protocol.club.v1.membership.ClubAddedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 1, token, status); - break; - } - case 2: { - ::bgs::protocol::club::v1::membership::ClubRemovedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnClubRemoved server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnClubRemoved(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnClubRemoved(bgs.protocol.club.v1.membership.ClubRemovedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 2, token, status); - break; - } - case 3: { - ::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnReceivedInvitationAdded server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnReceivedInvitationAdded(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnReceivedInvitationAdded(bgs.protocol.club.v1.membership.ReceivedInvitationAddedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 3, token, status); - break; - } - case 4: { - ::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnReceivedInvitationRemoved server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnReceivedInvitationRemoved(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnReceivedInvitationRemoved(bgs.protocol.club.v1.membership.ReceivedInvitationRemovedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 4, token, status); - break; - } - case 5: { - ::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnSharedSettingsChanged server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnSharedSettingsChanged(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnSharedSettingsChanged(bgs.protocol.club.v1.membership.SharedSettingsChangedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 5, token, status); - break; - } - case 6: { - ::bgs::protocol::club::v1::membership::StreamMentionAddedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnStreamMentionAdded server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnStreamMentionAdded(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnStreamMentionAdded(bgs.protocol.club.v1.membership.StreamMentionAddedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 6, token, status); - break; - } - case 7: { - ::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnStreamMentionRemoved server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnStreamMentionRemoved(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnStreamMentionRemoved(bgs.protocol.club.v1.membership.StreamMentionRemovedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 7, token, status); - break; - } - case 8: { - ::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipListener.OnStreamMentionAdvanceViewTime server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnStreamMentionAdvanceViewTime(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipListener.OnStreamMentionAdvanceViewTime(bgs.protocol.club.v1.membership.StreamMentionAdvanceViewTimeNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 8, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 ClubMembershipListener::HandleOnClubAdded(::bgs::protocol::club::v1::membership::ClubAddedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnClubAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnClubRemoved(::bgs::protocol::club::v1::membership::ClubRemovedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnClubRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnReceivedInvitationAdded(::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnReceivedInvitationAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnReceivedInvitationRemoved(::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnReceivedInvitationRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnSharedSettingsChanged(::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnSharedSettingsChanged({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnStreamMentionAdded(::bgs::protocol::club::v1::membership::StreamMentionAddedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnStreamMentionAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnStreamMentionRemoved(::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnStreamMentionRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 ClubMembershipListener::HandleOnStreamMentionAdvanceViewTime(::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method ClubMembershipListener.OnStreamMentionAdvanceViewTime({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void ClubMembershipListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } diff --git a/src/server/proto/Client/club_membership_listener.pb.h b/src/server/proto/Client/club_membership_listener.pb.h index 25a60e35a6c..4bdab0fbb8c 100644 --- a/src/server/proto/Client/club_membership_listener.pb.h +++ b/src/server/proto/Client/club_membership_listener.pb.h @@ -836,28 +836,16 @@ class TC_PROTO_API ClubMembershipListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- - - void OnClubAdded(::bgs::protocol::club::v1::membership::ClubAddedNotification const* request); - void OnClubRemoved(::bgs::protocol::club::v1::membership::ClubRemovedNotification const* request); - void OnReceivedInvitationAdded(::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification const* request); - void OnReceivedInvitationRemoved(::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification const* request); - void OnSharedSettingsChanged(::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification const* request); - void OnStreamMentionAdded(::bgs::protocol::club::v1::membership::StreamMentionAddedNotification const* request); - void OnStreamMentionRemoved(::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification const* request); - void OnStreamMentionAdvanceViewTime(::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - protected: - virtual uint32 HandleOnClubAdded(::bgs::protocol::club::v1::membership::ClubAddedNotification const* request); - virtual uint32 HandleOnClubRemoved(::bgs::protocol::club::v1::membership::ClubRemovedNotification const* request); - virtual uint32 HandleOnReceivedInvitationAdded(::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification const* request); - virtual uint32 HandleOnReceivedInvitationRemoved(::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification const* request); - virtual uint32 HandleOnSharedSettingsChanged(::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification const* request); - virtual uint32 HandleOnStreamMentionAdded(::bgs::protocol::club::v1::membership::StreamMentionAddedNotification const* request); - virtual uint32 HandleOnStreamMentionRemoved(::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification const* request); - virtual uint32 HandleOnStreamMentionAdvanceViewTime(::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification const* request); + void OnClubAdded(::bgs::protocol::club::v1::membership::ClubAddedNotification const* request, bool client = false, bool server = false); + void OnClubRemoved(::bgs::protocol::club::v1::membership::ClubRemovedNotification const* request, bool client = false, bool server = false); + void OnReceivedInvitationAdded(::bgs::protocol::club::v1::membership::ReceivedInvitationAddedNotification const* request, bool client = false, bool server = false); + void OnReceivedInvitationRemoved(::bgs::protocol::club::v1::membership::ReceivedInvitationRemovedNotification const* request, bool client = false, bool server = false); + void OnSharedSettingsChanged(::bgs::protocol::club::v1::membership::SharedSettingsChangedNotification const* request, bool client = false, bool server = false); + void OnStreamMentionAdded(::bgs::protocol::club::v1::membership::StreamMentionAddedNotification const* request, bool client = false, bool server = false); + void OnStreamMentionRemoved(::bgs::protocol::club::v1::membership::StreamMentionRemovedNotification const* request, bool client = false, bool server = false); + void OnStreamMentionAdvanceViewTime(::bgs::protocol::club::v1::membership::StreamMentionAdvanceViewTimeNotification const* request, bool client = false, bool server = false); + + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; diff --git a/src/server/proto/Client/club_membership_service.pb.cc b/src/server/proto/Client/club_membership_service.pb.cc index fb747b3750f..69231051e52 100644 --- a/src/server/proto/Client/club_membership_service.pb.cc +++ b/src/server/proto/Client/club_membership_service.pb.cc @@ -2996,104 +2996,27 @@ google::protobuf::ServiceDescriptor const* ClubMembershipService::descriptor() { return ClubMembershipService_descriptor_; } -void ClubMembershipService::Subscribe(::bgs::protocol::club::v1::membership::SubscribeRequest const* request, std::function<void(::bgs::protocol::club::v1::membership::SubscribeResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.Subscribe(bgs.protocol.club.v1.membership.SubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::club::v1::membership::SubscribeResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - -void ClubMembershipService::Unsubscribe(::bgs::protocol::club::v1::membership::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.Unsubscribe(bgs.protocol.club.v1.membership.UnsubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 2, request, std::move(callback)); -} - -void ClubMembershipService::GetState(::bgs::protocol::club::v1::membership::GetStateRequest const* request, std::function<void(::bgs::protocol::club::v1::membership::GetStateResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.GetState(bgs.protocol.club.v1.membership.GetStateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::club::v1::membership::GetStateResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 3, request, std::move(callback)); -} - -void ClubMembershipService::UpdateClubSharedSettings(::bgs::protocol::club::v1::membership::UpdateClubSharedSettingsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.UpdateClubSharedSettings(bgs.protocol.club.v1.membership.UpdateClubSharedSettingsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 4, request, std::move(callback)); -} - -void ClubMembershipService::GetStreamMentions(::bgs::protocol::club::v1::membership::GetStreamMentionsRequest const* request, std::function<void(::bgs::protocol::club::v1::membership::GetStreamMentionsResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.GetStreamMentions(bgs.protocol.club.v1.membership.GetStreamMentionsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::club::v1::membership::GetStreamMentionsResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 5, request, std::move(callback)); -} - -void ClubMembershipService::RemoveStreamMentions(::bgs::protocol::club::v1::membership::RemoveStreamMentionsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.RemoveStreamMentions(bgs.protocol.club.v1.membership.RemoveStreamMentionsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 6, request, std::move(callback)); -} - -void ClubMembershipService::AdvanceStreamMentionViewTime(::bgs::protocol::club::v1::membership::AdvanceStreamMentionViewTimeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ClubMembershipService.AdvanceStreamMentionViewTime(bgs.protocol.club.v1.membership.AdvanceStreamMentionViewTimeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 7, request, std::move(callback)); -} - void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::club::v1::membership::SubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.Subscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.Subscribe(bgs.protocol.club.v1.membership.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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::club::v1::membership::SubscribeResponse::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.Subscribe() returned bgs.protocol.club.v1.membership.SubscribeResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 1, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::club::v1::membership::SubscribeResponse response; uint32 status = HandleSubscribe(&request, &response, continuation); @@ -3105,21 +3028,21 @@ void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::club::v1::membership::UnsubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.Unsubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.Unsubscribe(bgs.protocol.club.v1.membership.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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUnsubscribe(&request, &response, continuation); @@ -3131,21 +3054,21 @@ void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::club::v1::membership::GetStateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.GetState server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.GetState(bgs.protocol.club.v1.membership.GetStateRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::club::v1::membership::GetStateResponse::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.GetState() returned bgs.protocol.club.v1.membership.GetStateResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 3, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 3, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::club::v1::membership::GetStateResponse response; uint32 status = HandleGetState(&request, &response, continuation); @@ -3157,21 +3080,21 @@ void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::club::v1::membership::UpdateClubSharedSettingsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.UpdateClubSharedSettings server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.UpdateClubSharedSettings(bgs.protocol.club.v1.membership.UpdateClubSharedSettingsRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.UpdateClubSharedSettings() 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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 4, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUpdateClubSharedSettings(&request, &response, continuation); @@ -3183,21 +3106,21 @@ void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::club::v1::membership::GetStreamMentionsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.GetStreamMentions server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.GetStreamMentions(bgs.protocol.club.v1.membership.GetStreamMentionsRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::club::v1::membership::GetStreamMentionsResponse::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.GetStreamMentions() returned bgs.protocol.club.v1.membership.GetStreamMentionsResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 5, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 5, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::club::v1::membership::GetStreamMentionsResponse response; uint32 status = HandleGetStreamMentions(&request, &response, continuation); @@ -3209,21 +3132,21 @@ void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::club::v1::membership::RemoveStreamMentionsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.RemoveStreamMentions server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.RemoveStreamMentions(bgs.protocol.club.v1.membership.RemoveStreamMentionsRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.RemoveStreamMentions() 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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 6, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleRemoveStreamMentions(&request, &response, continuation); @@ -3235,21 +3158,21 @@ void ClubMembershipService::CallServerMethod(uint32 token, uint32 methodId, Mess ::bgs::protocol::club::v1::membership::AdvanceStreamMentionViewTimeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ClubMembershipService.AdvanceStreamMentionViewTime server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.AdvanceStreamMentionViewTime(bgs.protocol.club.v1.membership.AdvanceStreamMentionViewTimeRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::NoData::descriptor()); ClubMembershipService* self = static_cast<ClubMembershipService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method ClubMembershipService.AdvanceStreamMentionViewTime() 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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 7, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleAdvanceStreamMentionViewTime(&request, &response, continuation); diff --git a/src/server/proto/Client/club_membership_service.pb.h b/src/server/proto/Client/club_membership_service.pb.h index 89f9aed3a56..20f45fd9c9e 100644 --- a/src/server/proto/Client/club_membership_service.pb.h +++ b/src/server/proto/Client/club_membership_service.pb.h @@ -960,20 +960,10 @@ class TC_PROTO_API ClubMembershipService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void Subscribe(::bgs::protocol::club::v1::membership::SubscribeRequest const* request, std::function<void(::bgs::protocol::club::v1::membership::SubscribeResponse const*)> responseCallback); - void Unsubscribe(::bgs::protocol::club::v1::membership::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GetState(::bgs::protocol::club::v1::membership::GetStateRequest const* request, std::function<void(::bgs::protocol::club::v1::membership::GetStateResponse const*)> responseCallback); - void UpdateClubSharedSettings(::bgs::protocol::club::v1::membership::UpdateClubSharedSettingsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GetStreamMentions(::bgs::protocol::club::v1::membership::GetStreamMentionsRequest const* request, std::function<void(::bgs::protocol::club::v1::membership::GetStreamMentionsResponse const*)> responseCallback); - void RemoveStreamMentions(::bgs::protocol::club::v1::membership::RemoveStreamMentionsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void AdvanceStreamMentionViewTime(::bgs::protocol::club::v1::membership::AdvanceStreamMentionViewTimeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- virtual uint32 HandleSubscribe(::bgs::protocol::club::v1::membership::SubscribeRequest const* request, ::bgs::protocol::club::v1::membership::SubscribeResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleUnsubscribe(::bgs::protocol::club::v1::membership::UnsubscribeRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleGetState(::bgs::protocol::club::v1::membership::GetStateRequest const* request, ::bgs::protocol::club::v1::membership::GetStateResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); diff --git a/src/server/proto/Client/connection_service.pb.cc b/src/server/proto/Client/connection_service.pb.cc index c98ae05dee6..105a0b01c90 100644 --- a/src/server/proto/Client/connection_service.pb.cc +++ b/src/server/proto/Client/connection_service.pb.cc @@ -3754,7 +3754,7 @@ google::protobuf::ServiceDescriptor const* ConnectionService::descriptor() { return ConnectionService_descriptor_; } -void ConnectionService::Connect(::bgs::protocol::connection::v1::ConnectRequest const* request, std::function<void(::bgs::protocol::connection::v1::ConnectResponse const*)> responseCallback) { +void ConnectionService::Connect(::bgs::protocol::connection::v1::ConnectRequest const* request, std::function<void(::bgs::protocol::connection::v1::ConnectResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.Connect(bgs.protocol.connection.v1.ConnectRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -3762,10 +3762,10 @@ void ConnectionService::Connect(::bgs::protocol::connection::v1::ConnectRequest if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 1, request, std::move(callback)); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void ConnectionService::Bind(::bgs::protocol::connection::v1::BindRequest const* request, std::function<void(::bgs::protocol::connection::v1::BindResponse const*)> responseCallback) { +void ConnectionService::Bind(::bgs::protocol::connection::v1::BindRequest const* request, std::function<void(::bgs::protocol::connection::v1::BindResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.Bind(bgs.protocol.connection.v1.BindRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -3773,10 +3773,10 @@ void ConnectionService::Bind(::bgs::protocol::connection::v1::BindRequest const* if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 2, request, std::move(callback)); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void ConnectionService::Echo(::bgs::protocol::connection::v1::EchoRequest const* request, std::function<void(::bgs::protocol::connection::v1::EchoResponse const*)> responseCallback) { +void ConnectionService::Echo(::bgs::protocol::connection::v1::EchoRequest const* request, std::function<void(::bgs::protocol::connection::v1::EchoResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.Echo(bgs.protocol.connection.v1.EchoRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -3784,22 +3784,22 @@ void ConnectionService::Echo(::bgs::protocol::connection::v1::EchoRequest const* if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 3, request, std::move(callback)); + SendRequest(service_hash_, 3 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void ConnectionService::ForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request) { +void ConnectionService::ForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 4 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ConnectionService::KeepAlive(::bgs::protocol::NoData const* request) { +void ConnectionService::KeepAlive(::bgs::protocol::NoData const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 5 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void ConnectionService::Encrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { +void ConnectionService::Encrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method ConnectionService.Encrypt(bgs.protocol.connection.v1.EncryptRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -3807,36 +3807,36 @@ void ConnectionService::Encrypt(::bgs::protocol::connection::v1::EncryptRequest if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 6, request, std::move(callback)); + SendRequest(service_hash_, 6 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void ConnectionService::RequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request) { +void ConnectionService::RequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 7 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::connection::v1::ConnectRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.Connect server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::connection::v1::ConnectResponse response; uint32 status = HandleConnect(&request, &response, continuation); @@ -3848,21 +3848,21 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB ::bgs::protocol::connection::v1::BindRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.Bind server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::connection::v1::BindResponse response; uint32 status = HandleBind(&request, &response, continuation); @@ -3874,21 +3874,21 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB ::bgs::protocol::connection::v1::EchoRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.Echo server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 3, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::connection::v1::EchoResponse response; uint32 status = HandleEcho(&request, &response, continuation); @@ -3900,49 +3900,49 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB ::bgs::protocol::connection::v1::DisconnectNotification request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.ForceDisconnect server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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); if (status) - SendResponse(service_hash_, 4, token, status); + SendResponse(service_hash_, methodId, token, status); break; } case 5: { ::bgs::protocol::NoData request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.KeepAlive server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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); if (status) - SendResponse(service_hash_, 5, token, status); + SendResponse(service_hash_, methodId, token, status); break; } case 6: { ::bgs::protocol::connection::v1::EncryptRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.Encrypt server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 6, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleEncrypt(&request, &response, continuation); @@ -3954,14 +3954,14 @@ void ConnectionService::CallServerMethod(uint32 token, uint32 methodId, MessageB ::bgs::protocol::connection::v1::DisconnectRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ConnectionService.RequestDisconnect server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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); if (status) - SendResponse(service_hash_, 7, token, status); + SendResponse(service_hash_, methodId, token, status); break; } default: diff --git a/src/server/proto/Client/connection_service.pb.h b/src/server/proto/Client/connection_service.pb.h index be7e0e2f3b1..9c22d5221b1 100644 --- a/src/server/proto/Client/connection_service.pb.h +++ b/src/server/proto/Client/connection_service.pb.h @@ -1174,19 +1174,18 @@ class TC_PROTO_API ConnectionService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- + void Connect(::bgs::protocol::connection::v1::ConnectRequest const* request, std::function<void(::bgs::protocol::connection::v1::ConnectResponse const*)> responseCallback, bool client = false, bool server = false); + void Bind(::bgs::protocol::connection::v1::BindRequest const* request, std::function<void(::bgs::protocol::connection::v1::BindResponse const*)> responseCallback, bool client = false, bool server = false); + void Echo(::bgs::protocol::connection::v1::EchoRequest const* request, std::function<void(::bgs::protocol::connection::v1::EchoResponse const*)> responseCallback, bool client = false, bool server = false); + void ForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request, bool client = false, bool server = false); + void KeepAlive(::bgs::protocol::NoData const* request, bool client = false, bool server = false); + void Encrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback, bool client = false, bool server = false); + void RequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request, bool client = false, bool server = false); - void Connect(::bgs::protocol::connection::v1::ConnectRequest const* request, std::function<void(::bgs::protocol::connection::v1::ConnectResponse const*)> responseCallback); - void Bind(::bgs::protocol::connection::v1::BindRequest const* request, std::function<void(::bgs::protocol::connection::v1::BindResponse const*)> responseCallback); - void Echo(::bgs::protocol::connection::v1::EchoRequest const* request, std::function<void(::bgs::protocol::connection::v1::EchoResponse const*)> responseCallback); - void ForceDisconnect(::bgs::protocol::connection::v1::DisconnectNotification const* request); - void KeepAlive(::bgs::protocol::NoData const* request); - void Encrypt(::bgs::protocol::connection::v1::EncryptRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void RequestDisconnect(::bgs::protocol::connection::v1::DisconnectRequest const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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); diff --git a/src/server/proto/Client/friends_service.pb.cc b/src/server/proto/Client/friends_service.pb.cc index 75ad7243a13..4f662cb77b3 100644 --- a/src/server/proto/Client/friends_service.pb.cc +++ b/src/server/proto/Client/friends_service.pb.cc @@ -6695,170 +6695,27 @@ google::protobuf::ServiceDescriptor const* FriendsService::descriptor() { return FriendsService_descriptor_; } -void FriendsService::Subscribe(::bgs::protocol::friends::v1::SubscribeRequest const* request, std::function<void(::bgs::protocol::friends::v1::SubscribeResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.Subscribe(bgs.protocol.friends.v1.SubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::friends::v1::SubscribeResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - -void FriendsService::SendInvitation(::bgs::protocol::friends::v1::SendInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.SendInvitation(bgs.protocol.friends.v1.SendInvitationRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 2, request, std::move(callback)); -} - -void FriendsService::AcceptInvitation(::bgs::protocol::friends::v1::AcceptInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.AcceptInvitation(bgs.protocol.friends.v1.AcceptInvitationRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 3, request, std::move(callback)); -} - -void FriendsService::RevokeInvitation(::bgs::protocol::friends::v1::RevokeInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.RevokeInvitation(bgs.protocol.friends.v1.RevokeInvitationRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 4, request, std::move(callback)); -} - -void FriendsService::DeclineInvitation(::bgs::protocol::friends::v1::DeclineInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.DeclineInvitation(bgs.protocol.friends.v1.DeclineInvitationRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 5, request, std::move(callback)); -} - -void FriendsService::IgnoreInvitation(::bgs::protocol::friends::v1::IgnoreInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.IgnoreInvitation(bgs.protocol.friends.v1.IgnoreInvitationRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 6, request, std::move(callback)); -} - -void FriendsService::RemoveFriend(::bgs::protocol::friends::v1::RemoveFriendRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.RemoveFriend(bgs.protocol.friends.v1.RemoveFriendRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 8, request, std::move(callback)); -} - -void FriendsService::ViewFriends(::bgs::protocol::friends::v1::ViewFriendsRequest const* request, std::function<void(::bgs::protocol::friends::v1::ViewFriendsResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.ViewFriends(bgs.protocol.friends.v1.ViewFriendsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::friends::v1::ViewFriendsResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 9, request, std::move(callback)); -} - -void FriendsService::UpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.UpdateFriendState(bgs.protocol.friends.v1.UpdateFriendStateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 10, request, std::move(callback)); -} - -void FriendsService::Unsubscribe(::bgs::protocol::friends::v1::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.Unsubscribe(bgs.protocol.friends.v1.UnsubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 11, request, std::move(callback)); -} - -void FriendsService::RevokeAllInvitations(::bgs::protocol::friends::v1::RevokeAllInvitationsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.RevokeAllInvitations(bgs.protocol.friends.v1.RevokeAllInvitationsRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 12, request, std::move(callback)); -} - -void FriendsService::GetFriendList(::bgs::protocol::friends::v1::GetFriendListRequest const* request, std::function<void(::bgs::protocol::friends::v1::GetFriendListResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.GetFriendList(bgs.protocol.friends.v1.GetFriendListRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::friends::v1::GetFriendListResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 13, request, std::move(callback)); -} - -void FriendsService::CreateFriendship(::bgs::protocol::friends::v1::CreateFriendshipRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsService.CreateFriendship(bgs.protocol.friends.v1.CreateFriendshipRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 14, request, std::move(callback)); -} - void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::friends::v1::SubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.Subscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::friends::v1::SubscribeResponse response; uint32 status = HandleSubscribe(&request, &response, continuation); @@ -6870,21 +6727,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::SendInvitationRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.SendInvitation server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.SendInvitation(bgs.protocol.friends.v1.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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSendInvitation(&request, &response, continuation); @@ -6896,21 +6753,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::AcceptInvitationRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.AcceptInvitation server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.AcceptInvitation(bgs.protocol.friends.v1.AcceptInvitationRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 3, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleAcceptInvitation(&request, &response, continuation); @@ -6922,21 +6779,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::RevokeInvitationRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.RevokeInvitation server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeInvitation(bgs.protocol.friends.v1.RevokeInvitationRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 4, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleRevokeInvitation(&request, &response, continuation); @@ -6948,21 +6805,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::DeclineInvitationRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.DeclineInvitation server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.DeclineInvitation(bgs.protocol.friends.v1.DeclineInvitationRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 5, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleDeclineInvitation(&request, &response, continuation); @@ -6974,21 +6831,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::IgnoreInvitationRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.IgnoreInvitation server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.IgnoreInvitation(bgs.protocol.friends.v1.IgnoreInvitationRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 6, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleIgnoreInvitation(&request, &response, continuation); @@ -7000,21 +6857,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::RemoveFriendRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.RemoveFriend server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RemoveFriend(bgs.protocol.friends.v1.RemoveFriendRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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.RemoveFriend() returned bgs.protocol.NoData{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 8, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 8, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleRemoveFriend(&request, &response, continuation); @@ -7026,21 +6883,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::ViewFriendsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.ViewFriends server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 9, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 9, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::friends::v1::ViewFriendsResponse response; uint32 status = HandleViewFriends(&request, &response, continuation); @@ -7052,21 +6909,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::UpdateFriendStateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.UpdateFriendState server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 10, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUpdateFriendState(&request, &response, continuation); @@ -7078,21 +6935,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::UnsubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.Unsubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 11, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUnsubscribe(&request, &response, continuation); @@ -7104,21 +6961,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::RevokeAllInvitationsRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.RevokeAllInvitations server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 12, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method FriendsService.RevokeAllInvitations(bgs.protocol.friends.v1.RevokeAllInvitationsRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 12, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleRevokeAllInvitations(&request, &response, continuation); @@ -7130,21 +6987,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::GetFriendListRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.GetFriendList server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 13, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 13, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::friends::v1::GetFriendListResponse response; uint32 status = HandleGetFriendList(&request, &response, continuation); @@ -7156,21 +7013,21 @@ void FriendsService::CallServerMethod(uint32 token, uint32 methodId, MessageBuff ::bgs::protocol::friends::v1::CreateFriendshipRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsService.CreateFriendship server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 14, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 14, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleCreateFriendship(&request, &response, continuation); @@ -7276,195 +7133,51 @@ 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, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void FriendsListener::OnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request) { +void FriendsListener::OnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void FriendsListener::OnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request) { +void FriendsListener::OnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 3 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void FriendsListener::OnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request) { +void FriendsListener::OnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 4 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void FriendsListener::OnSentInvitationAdded(::bgs::protocol::friends::v1::SentInvitationAddedNotification const* request) { +void FriendsListener::OnSentInvitationAdded(::bgs::protocol::friends::v1::SentInvitationAddedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnSentInvitationAdded(bgs.protocol.friends.v1.SentInvitationAddedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 5, request); + SendRequest(service_hash_, 5 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void FriendsListener::OnSentInvitationRemoved(::bgs::protocol::friends::v1::SentInvitationRemovedNotification const* request) { +void FriendsListener::OnSentInvitationRemoved(::bgs::protocol::friends::v1::SentInvitationRemovedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method FriendsListener.OnSentInvitationRemoved(bgs.protocol.friends.v1.SentInvitationRemovedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 6, request); + SendRequest(service_hash_, 6 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void FriendsListener::OnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request) { +void FriendsListener::OnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); -} - -void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 1: { - ::bgs::protocol::friends::v1::FriendNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnFriendAdded server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 1, token, status); - break; - } - case 2: { - ::bgs::protocol::friends::v1::FriendNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnFriendRemoved server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 2, token, status); - break; - } - case 3: { - ::bgs::protocol::friends::v1::InvitationNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnReceivedInvitationAdded server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 3, token, status); - break; - } - case 4: { - ::bgs::protocol::friends::v1::InvitationNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnReceivedInvitationRemoved server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 4, token, status); - break; - } - case 5: { - ::bgs::protocol::friends::v1::SentInvitationAddedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnSentInvitationAdded server method call.", GetCallerInfo().c_str()); - 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.SentInvitationAddedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 5, token, status); - break; - } - case 6: { - ::bgs::protocol::friends::v1::SentInvitationRemovedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnSentInvitationRemoved server method call.", GetCallerInfo().c_str()); - 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.SentInvitationRemovedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 6, token, status); - break; - } - case 7: { - ::bgs::protocol::friends::v1::UpdateFriendStateNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for FriendsListener.OnUpdateFriendState server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 7, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 FriendsListener::HandleOnFriendAdded(::bgs::protocol::friends::v1::FriendNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnFriendAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 FriendsListener::HandleOnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnFriendRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; + SendRequest(service_hash_, 7 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -uint32 FriendsListener::HandleOnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnReceivedInvitationAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 FriendsListener::HandleOnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnReceivedInvitationRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 FriendsListener::HandleOnSentInvitationAdded(::bgs::protocol::friends::v1::SentInvitationAddedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnSentInvitationAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 FriendsListener::HandleOnSentInvitationRemoved(::bgs::protocol::friends::v1::SentInvitationRemovedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnSentInvitationRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 FriendsListener::HandleOnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method FriendsListener.OnUpdateFriendState({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void FriendsListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } diff --git a/src/server/proto/Client/friends_service.pb.h b/src/server/proto/Client/friends_service.pb.h index e009f190ffa..73b9f6faad3 100644 --- a/src/server/proto/Client/friends_service.pb.h +++ b/src/server/proto/Client/friends_service.pb.h @@ -2045,26 +2045,10 @@ class TC_PROTO_API FriendsService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void Subscribe(::bgs::protocol::friends::v1::SubscribeRequest const* request, std::function<void(::bgs::protocol::friends::v1::SubscribeResponse const*)> responseCallback); - void SendInvitation(::bgs::protocol::friends::v1::SendInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void AcceptInvitation(::bgs::protocol::friends::v1::AcceptInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void RevokeInvitation(::bgs::protocol::friends::v1::RevokeInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void DeclineInvitation(::bgs::protocol::friends::v1::DeclineInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void IgnoreInvitation(::bgs::protocol::friends::v1::IgnoreInvitationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void RemoveFriend(::bgs::protocol::friends::v1::RemoveFriendRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void ViewFriends(::bgs::protocol::friends::v1::ViewFriendsRequest const* request, std::function<void(::bgs::protocol::friends::v1::ViewFriendsResponse const*)> responseCallback); - void UpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void Unsubscribe(::bgs::protocol::friends::v1::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void RevokeAllInvitations(::bgs::protocol::friends::v1::RevokeAllInvitationsRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GetFriendList(::bgs::protocol::friends::v1::GetFriendListRequest const* request, std::function<void(::bgs::protocol::friends::v1::GetFriendListResponse const*)> responseCallback); - void CreateFriendship(::bgs::protocol::friends::v1::CreateFriendshipRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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::friends::v1::SendInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleAcceptInvitation(::bgs::protocol::friends::v1::AcceptInvitationRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); @@ -2100,26 +2084,15 @@ class TC_PROTO_API FriendsListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- - - void OnFriendAdded(::bgs::protocol::friends::v1::FriendNotification const* request); - void OnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request); - void OnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request); - void OnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request); - void OnSentInvitationAdded(::bgs::protocol::friends::v1::SentInvitationAddedNotification const* request); - void OnSentInvitationRemoved(::bgs::protocol::friends::v1::SentInvitationRemovedNotification const* request); - void OnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - protected: - virtual uint32 HandleOnFriendAdded(::bgs::protocol::friends::v1::FriendNotification const* request); - virtual uint32 HandleOnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request); - virtual uint32 HandleOnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request); - virtual uint32 HandleOnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request); - virtual uint32 HandleOnSentInvitationAdded(::bgs::protocol::friends::v1::SentInvitationAddedNotification const* request); - virtual uint32 HandleOnSentInvitationRemoved(::bgs::protocol::friends::v1::SentInvitationRemovedNotification const* request); - virtual uint32 HandleOnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request); + void OnFriendAdded(::bgs::protocol::friends::v1::FriendNotification const* request, bool client = false, bool server = false); + void OnFriendRemoved(::bgs::protocol::friends::v1::FriendNotification const* request, bool client = false, bool server = false); + void OnReceivedInvitationAdded(::bgs::protocol::friends::v1::InvitationNotification const* request, bool client = false, bool server = false); + void OnReceivedInvitationRemoved(::bgs::protocol::friends::v1::InvitationNotification const* request, bool client = false, bool server = false); + void OnSentInvitationAdded(::bgs::protocol::friends::v1::SentInvitationAddedNotification const* request, bool client = false, bool server = false); + void OnSentInvitationRemoved(::bgs::protocol::friends::v1::SentInvitationRemovedNotification const* request, bool client = false, bool server = false); + void OnUpdateFriendState(::bgs::protocol::friends::v1::UpdateFriendStateNotification const* request, bool client = false, bool server = false); + + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; diff --git a/src/server/proto/Client/game_utilities_service.pb.cc b/src/server/proto/Client/game_utilities_service.pb.cc index f4577e1d77f..8e7a1ef9b7e 100644 --- a/src/server/proto/Client/game_utilities_service.pb.cc +++ b/src/server/proto/Client/game_utilities_service.pb.cc @@ -5014,7 +5014,7 @@ google::protobuf::ServiceDescriptor const* GameUtilitiesService::descriptor() { return GameUtilitiesService_descriptor_; } -void GameUtilitiesService::ProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ClientResponse const*)> responseCallback) { +void GameUtilitiesService::ProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ClientResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.ProcessClientRequest(bgs.protocol.game_utilities.v1.ClientRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5022,10 +5022,10 @@ void GameUtilitiesService::ProcessClientRequest(::bgs::protocol::game_utilities: if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 1, request, std::move(callback)); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void GameUtilitiesService::PresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { +void GameUtilitiesService::PresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.PresenceChannelCreated(bgs.protocol.game_utilities.v1.PresenceChannelCreatedRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5033,10 +5033,10 @@ void GameUtilitiesService::PresenceChannelCreated(::bgs::protocol::game_utilitie if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 2, request, std::move(callback)); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void GameUtilitiesService::GetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse const*)> responseCallback) { +void GameUtilitiesService::GetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.GetPlayerVariables(bgs.protocol.game_utilities.v1.GetPlayerVariablesRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5044,10 +5044,10 @@ void GameUtilitiesService::GetPlayerVariables(::bgs::protocol::game_utilities::v if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 3, request, std::move(callback)); + SendRequest(service_hash_, 3 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void GameUtilitiesService::ProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ServerResponse const*)> responseCallback) { +void GameUtilitiesService::ProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ServerResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.ProcessServerRequest(bgs.protocol.game_utilities.v1.ServerRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5055,22 +5055,22 @@ void GameUtilitiesService::ProcessServerRequest(::bgs::protocol::game_utilities: if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 6, request, std::move(callback)); + SendRequest(service_hash_, 6 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), 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, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 7 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void GameUtilitiesService::OnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request) { +void GameUtilitiesService::OnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 8 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void GameUtilitiesService::GetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse const*)> responseCallback) { +void GameUtilitiesService::GetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.GetAchievementsFile(bgs.protocol.game_utilities.v1.GetAchievementsFileRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5078,10 +5078,10 @@ void GameUtilitiesService::GetAchievementsFile(::bgs::protocol::game_utilities:: if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 9, request, std::move(callback)); + SendRequest(service_hash_, 9 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void GameUtilitiesService::GetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse const*)> responseCallback) { +void GameUtilitiesService::GetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.GetAllValuesForAttribute(bgs.protocol.game_utilities.v1.GetAllValuesForAttributeRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5089,10 +5089,10 @@ void GameUtilitiesService::GetAllValuesForAttribute(::bgs::protocol::game_utilit if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 10, request, std::move(callback)); + SendRequest(service_hash_, 10 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void GameUtilitiesService::RegisterUtilities(::bgs::protocol::game_utilities::v1::RegisterUtilitiesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::RegisterUtilitiesResponse const*)> responseCallback) { +void GameUtilitiesService::RegisterUtilities(::bgs::protocol::game_utilities::v1::RegisterUtilitiesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::RegisterUtilitiesResponse const*)> responseCallback, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.RegisterUtilities(bgs.protocol.game_utilities.v1.RegisterUtilitiesRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { @@ -5100,36 +5100,36 @@ void GameUtilitiesService::RegisterUtilities(::bgs::protocol::game_utilities::v1 if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) responseCallback(&response); }; - SendRequest(service_hash_, 11, request, std::move(callback)); + SendRequest(service_hash_, 11 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request, std::move(callback)); } -void GameUtilitiesService::UnregisterUtilities(::bgs::protocol::game_utilities::v1::UnregisterUtilitiesRequest const* request) { +void GameUtilitiesService::UnregisterUtilities(::bgs::protocol::game_utilities::v1::UnregisterUtilitiesRequest const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method GameUtilitiesService.UnregisterUtilities(bgs.protocol.game_utilities.v1.UnregisterUtilitiesRequest{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 12, request); + SendRequest(service_hash_, 12 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::game_utilities::v1::ClientRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.ProcessClientRequest server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::game_utilities::v1::ClientResponse response; uint32 status = HandleProcessClientRequest(&request, &response, continuation); @@ -5141,21 +5141,21 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.PresenceChannelCreated server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandlePresenceChannelCreated(&request, &response, continuation); @@ -5167,21 +5167,21 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.GetPlayerVariables server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 3, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse response; uint32 status = HandleGetPlayerVariables(&request, &response, continuation); @@ -5193,21 +5193,21 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::ServerRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.ProcessServerRequest server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 6, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 6, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::game_utilities::v1::ServerResponse response; uint32 status = HandleProcessServerRequest(&request, &response, continuation); @@ -5219,49 +5219,49 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::GameAccountOnlineNotification request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.OnGameAccountOnline server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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); if (status) - SendResponse(service_hash_, 7, token, status); + SendResponse(service_hash_, methodId, token, status); break; } case 8: { ::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.OnGameAccountOffline server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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); if (status) - SendResponse(service_hash_, 8, token, status); + SendResponse(service_hash_, methodId, token, status); break; } case 9: { ::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.GetAchievementsFile server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 9, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 9, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse response; uint32 status = HandleGetAchievementsFile(&request, &response, continuation); @@ -5273,21 +5273,21 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.GetAllValuesForAttribute server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 10, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse response; uint32 status = HandleGetAllValuesForAttribute(&request, &response, continuation); @@ -5299,21 +5299,21 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::RegisterUtilitiesRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.RegisterUtilities server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.RegisterUtilities(bgs.protocol.game_utilities.v1.RegisterUtilitiesRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::game_utilities::v1::RegisterUtilitiesResponse::descriptor()); GameUtilitiesService* self = static_cast<GameUtilitiesService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.RegisterUtilities() returned bgs.protocol.game_utilities.v1.RegisterUtilitiesResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 11, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 11, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::game_utilities::v1::RegisterUtilitiesResponse response; uint32 status = HandleRegisterUtilities(&request, &response, continuation); @@ -5325,14 +5325,14 @@ void GameUtilitiesService::CallServerMethod(uint32 token, uint32 methodId, Messa ::bgs::protocol::game_utilities::v1::UnregisterUtilitiesRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for GameUtilitiesService.UnregisterUtilities server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 12, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } uint32 status = HandleUnregisterUtilities(&request); TC_LOG_DEBUG("service.protobuf", "%s Client called server method GameUtilitiesService.UnregisterUtilities(bgs.protocol.game_utilities.v1.UnregisterUtilitiesRequest{ %s }) status %u.", GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); if (status) - SendResponse(service_hash_, 12, token, status); + SendResponse(service_hash_, methodId, token, status); break; } default: diff --git a/src/server/proto/Client/game_utilities_service.pb.h b/src/server/proto/Client/game_utilities_service.pb.h index f7ecb4ce696..1b7b375f5d5 100644 --- a/src/server/proto/Client/game_utilities_service.pb.h +++ b/src/server/proto/Client/game_utilities_service.pb.h @@ -1589,22 +1589,21 @@ class TC_PROTO_API GameUtilitiesService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- - - void ProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ClientResponse const*)> responseCallback); - void PresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void GetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse const*)> responseCallback); - void ProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ServerResponse const*)> responseCallback); - void OnGameAccountOnline(::bgs::protocol::game_utilities::v1::GameAccountOnlineNotification const* request); - void OnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request); - void GetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse const*)> responseCallback); - void GetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse const*)> responseCallback); - void RegisterUtilities(::bgs::protocol::game_utilities::v1::RegisterUtilitiesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::RegisterUtilitiesResponse const*)> responseCallback); - void UnregisterUtilities(::bgs::protocol::game_utilities::v1::UnregisterUtilitiesRequest const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void ProcessClientRequest(::bgs::protocol::game_utilities::v1::ClientRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ClientResponse const*)> responseCallback, bool client = false, bool server = false); + void PresenceChannelCreated(::bgs::protocol::game_utilities::v1::PresenceChannelCreatedRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback, bool client = false, bool server = false); + void GetPlayerVariables(::bgs::protocol::game_utilities::v1::GetPlayerVariablesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetPlayerVariablesResponse const*)> responseCallback, bool client = false, bool server = false); + void ProcessServerRequest(::bgs::protocol::game_utilities::v1::ServerRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::ServerResponse const*)> responseCallback, bool client = false, bool server = false); + void OnGameAccountOnline(::bgs::protocol::game_utilities::v1::GameAccountOnlineNotification const* request, bool client = false, bool server = false); + void OnGameAccountOffline(::bgs::protocol::game_utilities::v1::GameAccountOfflineNotification const* request, bool client = false, bool server = false); + void GetAchievementsFile(::bgs::protocol::game_utilities::v1::GetAchievementsFileRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAchievementsFileResponse const*)> responseCallback, bool client = false, bool server = false); + void GetAllValuesForAttribute(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::GetAllValuesForAttributeResponse const*)> responseCallback, bool client = false, bool server = false); + void RegisterUtilities(::bgs::protocol::game_utilities::v1::RegisterUtilitiesRequest const* request, std::function<void(::bgs::protocol::game_utilities::v1::RegisterUtilitiesResponse const*)> responseCallback, bool client = false, bool server = false); + void UnregisterUtilities(::bgs::protocol::game_utilities::v1::UnregisterUtilitiesRequest const* request, bool client = false, bool server = false); + + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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); diff --git a/src/server/proto/Client/presence_listener.pb.cc b/src/server/proto/Client/presence_listener.pb.cc index f26505ede53..7b997d52be8 100644 --- a/src/server/proto/Client/presence_listener.pb.cc +++ b/src/server/proto/Client/presence_listener.pb.cc @@ -701,65 +701,21 @@ google::protobuf::ServiceDescriptor const* PresenceListener::descriptor() { return PresenceListener_descriptor_; } -void PresenceListener::OnSubscribe(::bgs::protocol::presence::v1::SubscribeNotification const* request) { +void PresenceListener::OnSubscribe(::bgs::protocol::presence::v1::SubscribeNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceListener.OnSubscribe(bgs.protocol.presence.v1.SubscribeNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 1, request); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void PresenceListener::OnStateChanged(::bgs::protocol::presence::v1::StateChangedNotification const* request) { +void PresenceListener::OnStateChanged(::bgs::protocol::presence::v1::StateChangedNotification const* request, bool client /*= false*/, bool server /*= false*/) { TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceListener.OnStateChanged(bgs.protocol.presence.v1.StateChangedNotification{ %s })", GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - SendRequest(service_hash_, 2, request); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void PresenceListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 1: { - ::bgs::protocol::presence::v1::SubscribeNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceListener.OnSubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnSubscribe(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceListener.OnSubscribe(bgs.protocol.presence.v1.SubscribeNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 1, token, status); - break; - } - case 2: { - ::bgs::protocol::presence::v1::StateChangedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceListener.OnStateChanged server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); - return; - } - uint32 status = HandleOnStateChanged(&request); - TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceListener.OnStateChanged(bgs.protocol.presence.v1.StateChangedNotification{ %s }) status %u.", - GetCallerInfo().c_str(), request.ShortDebugString().c_str(), status); - if (status) - SendResponse(service_hash_, 2, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 PresenceListener::HandleOnSubscribe(::bgs::protocol::presence::v1::SubscribeNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceListener.OnSubscribe({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 PresenceListener::HandleOnStateChanged(::bgs::protocol::presence::v1::StateChangedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method PresenceListener.OnStateChanged({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void PresenceListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } diff --git a/src/server/proto/Client/presence_listener.pb.h b/src/server/proto/Client/presence_listener.pb.h index c26ce820f77..6e14a4fdf1d 100644 --- a/src/server/proto/Client/presence_listener.pb.h +++ b/src/server/proto/Client/presence_listener.pb.h @@ -249,16 +249,10 @@ class TC_PROTO_API PresenceListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- + void OnSubscribe(::bgs::protocol::presence::v1::SubscribeNotification const* request, bool client = false, bool server = false); + void OnStateChanged(::bgs::protocol::presence::v1::StateChangedNotification const* request, bool client = false, bool server = false); - void OnSubscribe(::bgs::protocol::presence::v1::SubscribeNotification const* request); - void OnStateChanged(::bgs::protocol::presence::v1::StateChangedNotification const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - protected: - virtual uint32 HandleOnSubscribe(::bgs::protocol::presence::v1::SubscribeNotification const* request); - virtual uint32 HandleOnStateChanged(::bgs::protocol::presence::v1::StateChangedNotification const* request); + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; diff --git a/src/server/proto/Client/presence_service.pb.cc b/src/server/proto/Client/presence_service.pb.cc index 0eb0d475ae9..ba3a9918b15 100644 --- a/src/server/proto/Client/presence_service.pb.cc +++ b/src/server/proto/Client/presence_service.pb.cc @@ -3751,115 +3751,27 @@ google::protobuf::ServiceDescriptor const* PresenceService::descriptor() { return PresenceService_descriptor_; } -void PresenceService::Subscribe(::bgs::protocol::presence::v1::SubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.Subscribe(bgs.protocol.presence.v1.SubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - -void PresenceService::Unsubscribe(::bgs::protocol::presence::v1::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.Unsubscribe(bgs.protocol.presence.v1.UnsubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 2, request, std::move(callback)); -} - -void PresenceService::Update(::bgs::protocol::presence::v1::UpdateRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.Update(bgs.protocol.presence.v1.UpdateRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 3, request, std::move(callback)); -} - -void PresenceService::Query(::bgs::protocol::presence::v1::QueryRequest const* request, std::function<void(::bgs::protocol::presence::v1::QueryResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.Query(bgs.protocol.presence.v1.QueryRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::presence::v1::QueryResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 4, request, std::move(callback)); -} - -void PresenceService::Ownership(::bgs::protocol::presence::v1::OwnershipRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.Ownership(bgs.protocol.presence.v1.OwnershipRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 5, request, std::move(callback)); -} - -void PresenceService::SubscribeNotification(::bgs::protocol::presence::v1::SubscribeNotificationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.SubscribeNotification(bgs.protocol.presence.v1.SubscribeNotificationRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 7, request, std::move(callback)); -} - -void PresenceService::BatchSubscribe(::bgs::protocol::presence::v1::BatchSubscribeRequest const* request, std::function<void(::bgs::protocol::presence::v1::BatchSubscribeResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.BatchSubscribe(bgs.protocol.presence.v1.BatchSubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::presence::v1::BatchSubscribeResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 8, request, std::move(callback)); -} - -void PresenceService::BatchUnsubscribe(::bgs::protocol::presence::v1::BatchUnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method PresenceService.BatchUnsubscribe(bgs.protocol.presence.v1.BatchUnsubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 9, request, std::move(callback)); -} - void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::presence::v1::SubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.Subscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSubscribe(&request, &response, continuation); @@ -3871,21 +3783,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::UnsubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.Unsubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUnsubscribe(&request, &response, continuation); @@ -3897,21 +3809,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::UpdateRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.Update server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 3, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 3, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUpdate(&request, &response, continuation); @@ -3923,21 +3835,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::QueryRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.Query server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 4, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 4, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::presence::v1::QueryResponse response; uint32 status = HandleQuery(&request, &response, continuation); @@ -3949,21 +3861,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::OwnershipRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.Ownership server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 5, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 5, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleOwnership(&request, &response, continuation); @@ -3975,21 +3887,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::SubscribeNotificationRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.SubscribeNotification server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 7, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 7, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSubscribeNotification(&request, &response, continuation); @@ -4001,21 +3913,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::BatchSubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.BatchSubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 8, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.BatchSubscribe(bgs.protocol.presence.v1.BatchSubscribeRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](ServiceBase* service, uint32 status, ::google::protobuf::Message const* response) { ASSERT(response->GetDescriptor() == ::bgs::protocol::presence::v1::BatchSubscribeResponse::descriptor()); PresenceService* self = static_cast<PresenceService*>(service); TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.BatchSubscribe() returned bgs.protocol.presence.v1.BatchSubscribeResponse{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 8, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 8, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::presence::v1::BatchSubscribeResponse response; uint32 status = HandleBatchSubscribe(&request, &response, continuation); @@ -4027,21 +3939,21 @@ void PresenceService::CallServerMethod(uint32 token, uint32 methodId, MessageBuf ::bgs::protocol::presence::v1::BatchUnsubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for PresenceService.BatchUnsubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 9, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, token, ERROR_RPC_MALFORMED_REQUEST); return; } TC_LOG_DEBUG("service.protobuf", "%s Client called server method PresenceService.BatchUnsubscribe(bgs.protocol.presence.v1.BatchUnsubscribeRequest{ %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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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.BatchUnsubscribe() returned bgs.protocol.NoData{ %s } status %u.", self->GetCallerInfo().c_str(), response->ShortDebugString().c_str(), status); if (!status) - self->SendResponse(self->service_hash_, 9, token, response); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 9, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleBatchUnsubscribe(&request, &response, continuation); diff --git a/src/server/proto/Client/presence_service.pb.h b/src/server/proto/Client/presence_service.pb.h index c402f97665c..303e9aeed7c 100644 --- a/src/server/proto/Client/presence_service.pb.h +++ b/src/server/proto/Client/presence_service.pb.h @@ -1184,21 +1184,10 @@ class TC_PROTO_API PresenceService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void Subscribe(::bgs::protocol::presence::v1::SubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void Unsubscribe(::bgs::protocol::presence::v1::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void Update(::bgs::protocol::presence::v1::UpdateRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void Query(::bgs::protocol::presence::v1::QueryRequest const* request, std::function<void(::bgs::protocol::presence::v1::QueryResponse const*)> responseCallback); - void Ownership(::bgs::protocol::presence::v1::OwnershipRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void SubscribeNotification(::bgs::protocol::presence::v1::SubscribeNotificationRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void BatchSubscribe(::bgs::protocol::presence::v1::BatchSubscribeRequest const* request, std::function<void(::bgs::protocol::presence::v1::BatchSubscribeResponse const*)> responseCallback); - void BatchUnsubscribe(::bgs::protocol::presence::v1::BatchUnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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); diff --git a/src/server/proto/Client/report_service.pb.cc b/src/server/proto/Client/report_service.pb.cc index 81fbd3a94e4..1994a12e860 100644 --- a/src/server/proto/Client/report_service.pb.cc +++ b/src/server/proto/Client/report_service.pb.cc @@ -750,49 +750,27 @@ google::protobuf::ServiceDescriptor const* ReportService::descriptor() { return ReportService_descriptor_; } -void ReportService::SendReport(::bgs::protocol::report::v1::SendReportRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ReportService.SendReport(bgs.protocol.report.v1.SendReportRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - -void ReportService::SubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ReportService.SubmitReport(bgs.protocol.report.v1.SubmitReportRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 2, request, std::move(callback)); -} - void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::report::v1::SendReportRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ReportService.SendReport server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSendReport(&request, &response, continuation); @@ -804,21 +782,21 @@ void ReportService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffe ::bgs::protocol::report::v1::SubmitReportRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ReportService.SubmitReport server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 2, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 2, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleSubmitReport(&request, &response, continuation); diff --git a/src/server/proto/Client/report_service.pb.h b/src/server/proto/Client/report_service.pb.h index a7b722c077e..9ce1e002f0a 100644 --- a/src/server/proto/Client/report_service.pb.h +++ b/src/server/proto/Client/report_service.pb.h @@ -254,15 +254,10 @@ class TC_PROTO_API ReportService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void SendReport(::bgs::protocol::report::v1::SendReportRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void SubmitReport(::bgs::protocol::report::v1::SubmitReportRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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); diff --git a/src/server/proto/Client/resource_service.pb.cc b/src/server/proto/Client/resource_service.pb.cc index 6e50f776f20..53b89f55bb2 100644 --- a/src/server/proto/Client/resource_service.pb.cc +++ b/src/server/proto/Client/resource_service.pb.cc @@ -438,38 +438,27 @@ google::protobuf::ServiceDescriptor const* ResourcesService::descriptor() { return ResourcesService_descriptor_; } -void ResourcesService::GetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, std::function<void(::bgs::protocol::ContentHandle const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method ResourcesService.GetContentHandle(bgs.protocol.resources.v1.ContentHandleRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::ContentHandle response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - void ResourcesService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::resources::v1::ContentHandleRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for ResourcesService.GetContentHandle server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::ContentHandle response; uint32 status = HandleGetContentHandle(&request, &response, continuation); diff --git a/src/server/proto/Client/resource_service.pb.h b/src/server/proto/Client/resource_service.pb.h index 43499303316..c5ea5531266 100644 --- a/src/server/proto/Client/resource_service.pb.h +++ b/src/server/proto/Client/resource_service.pb.h @@ -157,14 +157,10 @@ class TC_PROTO_API ResourcesService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void GetContentHandle(::bgs::protocol::resources::v1::ContentHandleRequest const* request, std::function<void(::bgs::protocol::ContentHandle const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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: diff --git a/src/server/proto/Client/user_manager_service.pb.cc b/src/server/proto/Client/user_manager_service.pb.cc index 1d4ac226a15..24b26102f33 100644 --- a/src/server/proto/Client/user_manager_service.pb.cc +++ b/src/server/proto/Client/user_manager_service.pb.cc @@ -3567,104 +3567,27 @@ google::protobuf::ServiceDescriptor const* UserManagerService::descriptor() { return UserManagerService_descriptor_; } -void UserManagerService::Subscribe(::bgs::protocol::user_manager::v1::SubscribeRequest const* request, std::function<void(::bgs::protocol::user_manager::v1::SubscribeResponse const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.Subscribe(bgs.protocol.user_manager.v1.SubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::user_manager::v1::SubscribeResponse response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 1, request, std::move(callback)); -} - -void UserManagerService::AddRecentPlayers(::bgs::protocol::user_manager::v1::AddRecentPlayersRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.AddRecentPlayers(bgs.protocol.user_manager.v1.AddRecentPlayersRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 10, request, std::move(callback)); -} - -void UserManagerService::ClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.ClearRecentPlayers(bgs.protocol.user_manager.v1.ClearRecentPlayersRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 11, request, std::move(callback)); -} - -void UserManagerService::BlockPlayer(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.BlockPlayer(bgs.protocol.user_manager.v1.BlockPlayerRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 20, request, std::move(callback)); -} - -void UserManagerService::UnblockPlayer(::bgs::protocol::user_manager::v1::UnblockPlayerRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.UnblockPlayer(bgs.protocol.user_manager.v1.UnblockPlayerRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 21, request, std::move(callback)); -} - -void UserManagerService::BlockPlayerForSession(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.BlockPlayerForSession(bgs.protocol.user_manager.v1.BlockPlayerRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 40, request, std::move(callback)); -} - -void UserManagerService::Unsubscribe(::bgs::protocol::user_manager::v1::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback) { - TC_LOG_DEBUG("service.protobuf", "%s Server called client method UserManagerService.Unsubscribe(bgs.protocol.user_manager.v1.UnsubscribeRequest{ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - std::function<void(MessageBuffer)> callback = [responseCallback](MessageBuffer buffer) -> void { - ::bgs::protocol::NoData response; - if (response.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) - responseCallback(&response); - }; - SendRequest(service_hash_, 51, request, std::move(callback)); -} - void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { + switch(methodId & 0x3FFFFFFF) { case 1: { ::bgs::protocol::user_manager::v1::SubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.Subscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 1, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 1, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::user_manager::v1::SubscribeResponse response; uint32 status = HandleSubscribe(&request, &response, continuation); @@ -3676,21 +3599,21 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message ::bgs::protocol::user_manager::v1::AddRecentPlayersRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.AddRecentPlayers server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 10, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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.AddRecentPlayers() 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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 10, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleAddRecentPlayers(&request, &response, continuation); @@ -3702,21 +3625,21 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message ::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.ClearRecentPlayers server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 11, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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.ClearRecentPlayers() 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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 11, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleClearRecentPlayers(&request, &response, continuation); @@ -3728,21 +3651,21 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message ::bgs::protocol::user_manager::v1::BlockPlayerRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.BlockPlayer server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 20, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 20, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleBlockPlayer(&request, &response, continuation); @@ -3754,21 +3677,21 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message ::bgs::protocol::user_manager::v1::UnblockPlayerRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.UnblockPlayer server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 21, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 21, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUnblockPlayer(&request, &response, continuation); @@ -3780,21 +3703,21 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message ::bgs::protocol::user_manager::v1::BlockPlayerRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.BlockPlayerForSession server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 40, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 40, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleBlockPlayerForSession(&request, &response, continuation); @@ -3806,21 +3729,21 @@ void UserManagerService::CallServerMethod(uint32 token, uint32 methodId, Message ::bgs::protocol::user_manager::v1::UnsubscribeRequest request; if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerService.Unsubscribe server method call.", GetCallerInfo().c_str()); - SendResponse(service_hash_, 51, token, ERROR_RPC_MALFORMED_REQUEST); + SendResponse(service_hash_, methodId, 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) + std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)> continuation = [token, methodId](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); + self->SendResponse(self->service_hash_, methodId, token, response); else - self->SendResponse(self->service_hash_, 51, token, status); + self->SendResponse(self->service_hash_, methodId, token, status); }; ::bgs::protocol::NoData response; uint32 status = HandleUnsubscribe(&request, &response, continuation); @@ -3890,117 +3813,33 @@ 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, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 1 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void UserManagerListener::OnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request) { +void UserManagerListener::OnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 2 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void UserManagerListener::OnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request) { +void UserManagerListener::OnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 11 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void UserManagerListener::OnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request) { +void UserManagerListener::OnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request, bool client /*= false*/, bool server /*= false*/) { 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); + SendRequest(service_hash_, 12 | (client ? 0x40000000 : 0) | (server ? 0x80000000 : 0), request); } -void UserManagerListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) { - switch(methodId) { - case 1: { - ::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerListener.OnBlockedPlayerAdded server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 1, token, status); - break; - } - case 2: { - ::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerListener.OnBlockedPlayerRemoved server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 2, token, status); - break; - } - case 11: { - ::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerListener.OnRecentPlayersAdded server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 11, token, status); - break; - } - case 12: { - ::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification request; - if (!request.ParseFromArray(buffer.GetReadPointer(), buffer.GetActiveSize())) { - TC_LOG_DEBUG("service.protobuf", "%s Failed to parse request for UserManagerListener.OnRecentPlayersRemoved server method call.", GetCallerInfo().c_str()); - 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); - if (status) - SendResponse(service_hash_, 12, token, status); - break; - } - default: - TC_LOG_ERROR("service.protobuf", "Bad method id %u.", methodId); - SendResponse(service_hash_, methodId, token, ERROR_RPC_INVALID_METHOD); - break; - } -} - -uint32 UserManagerListener::HandleOnBlockedPlayerAdded(::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerListener.OnBlockedPlayerAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 UserManagerListener::HandleOnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerListener.OnBlockedPlayerRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 UserManagerListener::HandleOnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerListener.OnRecentPlayersAdded({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; -} - -uint32 UserManagerListener::HandleOnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request) { - TC_LOG_ERROR("service.protobuf", "%s Client tried to call not implemented method UserManagerListener.OnRecentPlayersRemoved({ %s })", - GetCallerInfo().c_str(), request->ShortDebugString().c_str()); - return ERROR_RPC_NOT_IMPLEMENTED; +void UserManagerListener::CallServerMethod(uint32 token, uint32 methodId, MessageBuffer /*buffer*/) { + TC_LOG_ERROR("service.protobuf", "%s Server tried to call server method %u", + GetCallerInfo().c_str(), methodId); } diff --git a/src/server/proto/Client/user_manager_service.pb.h b/src/server/proto/Client/user_manager_service.pb.h index 9e56c0aefcd..7bdd083a75f 100644 --- a/src/server/proto/Client/user_manager_service.pb.h +++ b/src/server/proto/Client/user_manager_service.pb.h @@ -1125,20 +1125,10 @@ class TC_PROTO_API UserManagerService : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); - // client methods -------------------------------------------------- - - void Subscribe(::bgs::protocol::user_manager::v1::SubscribeRequest const* request, std::function<void(::bgs::protocol::user_manager::v1::SubscribeResponse const*)> responseCallback); - void AddRecentPlayers(::bgs::protocol::user_manager::v1::AddRecentPlayersRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void ClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void BlockPlayer(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void UnblockPlayer(::bgs::protocol::user_manager::v1::UnblockPlayerRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void BlockPlayerForSession(::bgs::protocol::user_manager::v1::BlockPlayerRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - void Unsubscribe(::bgs::protocol::user_manager::v1::UnsubscribeRequest const* request, std::function<void(::bgs::protocol::NoData const*)> responseCallback); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; protected: + // server methods -------------------------------------------------- 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::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); virtual uint32 HandleClearRecentPlayers(::bgs::protocol::user_manager::v1::ClearRecentPlayersRequest const* request, ::bgs::protocol::NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation); @@ -1168,20 +1158,12 @@ class TC_PROTO_API UserManagerListener : public ServiceBase static google::protobuf::ServiceDescriptor const* descriptor(); // client methods -------------------------------------------------- + void OnBlockedPlayerAdded(::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification const* request, bool client = false, bool server = false); + void OnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request, bool client = false, bool server = false); + void OnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request, bool client = false, bool server = false); + void OnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request, bool client = false, bool server = false); - void OnBlockedPlayerAdded(::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification const* request); - void OnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request); - void OnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request); - void OnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request); - // server methods -------------------------------------------------- - - void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) override final; - - protected: - virtual uint32 HandleOnBlockedPlayerAdded(::bgs::protocol::user_manager::v1::BlockedPlayerAddedNotification const* request); - virtual uint32 HandleOnBlockedPlayerRemoved(::bgs::protocol::user_manager::v1::BlockedPlayerRemovedNotification const* request); - virtual uint32 HandleOnRecentPlayersAdded(::bgs::protocol::user_manager::v1::RecentPlayersAddedNotification const* request); - virtual uint32 HandleOnRecentPlayersRemoved(::bgs::protocol::user_manager::v1::RecentPlayersRemovedNotification const* request); + void CallServerMethod(uint32 token, uint32 methodId, MessageBuffer buffer) final; private: uint32 service_hash_; |