18 #ifndef LoginRESTService_h__
19 #define LoginRESTService_h__
24 #include <boost/asio/io_service.hpp>
25 #include <boost/asio/ip/tcp.hpp>
26 #include <boost/asio/ip/address.hpp>
27 #include <boost/asio/deadline_timer.hpp>
42 bool Start(boost::asio::io_service& ioService);
45 boost::asio::ip::tcp::endpoint
const&
GetAddressForClient(boost::asio::ip::address
const& address)
const;
47 std::unique_ptr<Battlenet::Session::AccountInfo>
VerifyLoginTicket(std::string
const&
id);
62 void AddLoginTicket(std::string
const&
id, std::unique_ptr<Battlenet::Session::AccountInfo> accountInfo);
70 std::unique_ptr<Battlenet::Session::AccountInfo>
Account;
108 #define sLoginService LoginRESTService::Instance()
110 #endif // LoginRESTService_h__
void Stop()
Definition: LoginRESTService.cpp:108
static int32 ChangeResponse(soap *s, int32 originalResponse, size_t contentLength)
Definition: LoginRESTService.cpp:411
int32(* fresponse)(soap *s, int32 status, size_t length)
Definition: LoginRESTService.h:81
void CleanupLoginTickets(boost::system::error_code const &error)
Definition: LoginRESTService.cpp:344
boost::asio::ip::tcp::endpoint _localAddress
Definition: LoginRESTService.h:102
void AddLoginTicket(std::string const &id, std::unique_ptr< Battlenet::Session::AccountInfo > accountInfo)
Definition: LoginRESTService.cpp:337
std::unique_ptr< Battlenet::Session::AccountInfo > Account
Definition: LoginRESTService.h:70
static void Destroy(soap *s, soap_plugin *p)
Definition: LoginRESTService.cpp:433
Definition: LoginRESTService.h:35
Definition: stdsoap2.h:1933
std::mutex _loginTicketMutex
Definition: LoginRESTService.h:103
boost::asio::deadline_timer * _loginTicketCleanupTimer
Definition: LoginRESTService.h:105
char const * ContentType
Definition: LoginRESTService.h:93
std::string Id
Definition: LoginRESTService.h:69
std::thread _thread
Definition: LoginRESTService.h:96
boost::asio::ip::tcp::endpoint const & GetAddressForClient(boost::asio::ip::address const &address) const
Definition: LoginRESTService.cpp:115
#define false
Definition: CascPort.h:18
int32 _port
Definition: LoginRESTService.h:100
static LoginRESTService & Instance()
Definition: LoginRESTService.cpp:383
std::atomic< bool > _stopped
Definition: LoginRESTService.h:97
Definition: message.h:165
static int32 Init(soap *s, soap_plugin *p, void *)
Definition: LoginRESTService.cpp:419
bool Start(boost::asio::io_service &ioService)
Definition: LoginRESTService.cpp:44
std::string _bindIP
Definition: LoginRESTService.h:99
std::unordered_map< std::string, LoginTicket > _validLoginTickets
Definition: LoginRESTService.h:104
friend int32 handle_post_plugin(soap *soapClient)
Definition: LoginRESTService.cpp:39
std::time_t ExpiryTime
Definition: LoginRESTService.h:71
int32 HandlePost(soap *soapClient)
Definition: LoginRESTService.cpp:200
std::unique_ptr< Battlenet::Session::AccountInfo > VerifyLoginTicket(std::string const &id)
Definition: LoginRESTService.cpp:319
Definition: stdsoap2.h:2250
int32_t int32
Definition: Define.h:146
int32 HandleGet(soap *soapClient)
Definition: LoginRESTService.cpp:186
float length(float v)
Definition: vectorMath.h:208
static void Destroy(soap *s, soap_plugin *p)
Definition: LoginRESTService.cpp:404
static char const *const PluginId
Definition: LoginRESTService.h:87
int32(* fposthdr)(soap *s, char const *key, char const *value)
Definition: LoginRESTService.h:92
void Run()
Definition: LoginRESTService.cpp:128
Definition: LoginRESTService.h:74
int32 ErrorCode
Definition: LoginRESTService.h:82
std::string CalculateShaPassHash(std::string const &name, std::string const &password)
Definition: LoginRESTService.cpp:304
int32_t int32
Definition: g3dmath.h:167
static int32 OnSetHeader(soap *s, char const *key, char const *value)
Definition: LoginRESTService.cpp:440
boost::asio::ip::tcp::endpoint _externalAddress
Definition: LoginRESTService.h:101
const FieldDescriptor value
Definition: descriptor.h:1522
friend int32 handle_get_plugin(soap *soapClient)
Definition: LoginRESTService.cpp:34
Battlenet::JSON::Login::FormInputs _formInputs
Definition: LoginRESTService.h:98
static char const *const PluginId
Definition: LoginRESTService.h:76
LoginTicket & operator=(LoginTicket &&right)
Definition: LoginRESTService.cpp:366
Definition: LoginRESTService.h:65
int32 SendResponse(soap *soapClient, google::protobuf::Message const &response)
Definition: LoginRESTService.cpp:295
LoginRESTService()
Definition: LoginRESTService.h:38
Definition: LoginRESTService.h:85
static int32 Init(soap *s, soap_plugin *, void *)
Definition: LoginRESTService.cpp:391