diff options
author | Shauren <shauren.trinity@gmail.com> | 2017-09-21 21:59:59 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2017-09-21 21:59:59 +0200 |
commit | 3269a68427bcfa200837281c336cbedc3d114dd1 (patch) | |
tree | fc69a05185a21533af4133a8f2186850889d52b8 /src/server/bnetserver/Services/AuthenticationService.cpp | |
parent | 115dffde983019acb1f167583b60f0ce1aaa90de (diff) |
Core/Bnet: Implement a way to handle turn protobuf service calls into async requests
Diffstat (limited to 'src/server/bnetserver/Services/AuthenticationService.cpp')
-rw-r--r-- | src/server/bnetserver/Services/AuthenticationService.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/bnetserver/Services/AuthenticationService.cpp b/src/server/bnetserver/Services/AuthenticationService.cpp index 20c0ebe165c..45e9a0920f2 100644 --- a/src/server/bnetserver/Services/AuthenticationService.cpp +++ b/src/server/bnetserver/Services/AuthenticationService.cpp @@ -22,12 +22,17 @@ Battlenet::Services::Authentication::Authentication(Session* session) : Authenti { } -uint32 Battlenet::Services::Authentication::HandleLogon(authentication::v1::LogonRequest const* request, NoData* /*respons*/) +uint32 Battlenet::Services::Authentication::HandleLogon(authentication::v1::LogonRequest const* request, NoData* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { - return _session->HandleLogon(request); + uint32 status = _session->HandleLogon(request); + // turning this into async call will be done by stealing the continuation and calling it when done + // just a test here + continuation(this, status, response); + continuation = nullptr; + return status; } -uint32 Battlenet::Services::Authentication::HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* request, NoData* /*respons*/) +uint32 Battlenet::Services::Authentication::HandleVerifyWebCredentials(authentication::v1::VerifyWebCredentialsRequest const* request, NoData* /*response*/, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) { return _session->HandleVerifyWebCredentials(request); } |