202 boost::asio::ip::address_v4 address(soapClient->
ip);
203 std::string ip_address = address.to_string();
205 TC_LOG_DEBUG(
"server.rest",
"[%s:%d] Handling POST request path=\"%s\"", ip_address.c_str(), soapClient->
port, soapClient->
path);
207 static std::string
const expectedPath =
"/bnetserver/login/";
208 if (strstr(soapClient->
path, expectedPath.c_str()) != &soapClient->
path[0])
225 responseCode->ErrorCode = 400;
229 loginResult.
set_error_message(
"There was an internal error while connecting to Battle.net. Please try again later.");
234 std::string password;
252 std::unique_ptr<Battlenet::Session::AccountInfo> accountInfo = Trinity::make_unique<Battlenet::Session::AccountInfo>();
261 Field* fields = characterCountsResult->Fetch();
265 }
while (characterCountsResult->NextRow());
272 Field* fields = lastPlayerCharactersResult->Fetch();
275 .LastPlayedCharacters[realmId.GetSubRegionAddress()];
277 lastPlayedCharacter.
RealmId = realmId;
Definition: BigNumber.h:28
Definition: Login.pb.h:68
void set_error_message(const ::std::string &value)
Definition: Login.pb.h:1465
Definition: LoginDatabase.h:118
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
uint64 GetUInt64() const
Definition: Field.h:184
std::unordered_map< uint32, GameAccountInfo > GameAccounts
Definition: Session.h:120
unsigned long ip
Definition: stdsoap2.h:2097
void AddLoginTicket(std::string const &id, std::unique_ptr< Battlenet::Session::AccountInfo > accountInfo)
Definition: LoginRESTService.cpp:337
Class used to access individual fields of database query result.
Definition: Field.h:56
SOAP_FMAC1 int SOAP_FMAC2 soap_register_plugin_arg(struct soap *soap, int(*fcreate)(struct soap *, struct soap_plugin *, void *), void *arg)
Definition: stdsoap2.cpp:16908
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
Definition: Login.pb.h:65
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Battlenet::RealmHandle RealmId
Definition: Session.h:86
char path[SOAP_TAGLEN]
Definition: stdsoap2.h:2093
Definition: PreparedStatement.h:74
SOAP_FMAC1 void *SOAP_FMAC2 soap_lookup_plugin(struct soap *soap, const char *id)
Definition: stdsoap2.cpp:16947
std::string CharacterName
Definition: Session.h:87
Definition: LoginDatabase.h:117
void set_error_code(const ::std::string &value)
Definition: Login.pb.h:1389
LoginDatabaseWorkerPool LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
uint8 GetUInt8() const
Definition: Field.h:70
void set_login_ticket(const ::std::string &value)
Definition: Login.pb.h:1617
uint64 CharacterGUID
Definition: Session.h:88
int32_t int32
Definition: Define.h:146
TC_SHARED_API bool Deserialize(std::string json, google::protobuf::Message *message)
Definition: ProtobufJSON.cpp:445
const ::std::string & login_ticket() const
Definition: Login.pb.h:1613
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void SetRand(int32 numbits)
Definition: BigNumber.cpp:74
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
int port
Definition: stdsoap2.h:2098
void LoadResult(PreparedQueryResult result)
Definition: Session.cpp:29
std::string ByteArrayToHexStr(uint8 const *bytes, uint32 arrayLen, bool reverse)
Definition: Util.cpp:509
#define SOAP_OK
Definition: stdsoap2.h:1245
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
void set_authentication_state(::Battlenet::JSON::Login::AuthenticationState value)
Definition: Login.pb.h:1362
uint32 LastPlayedTime
Definition: Session.h:89
std::unique_ptr< uint8[]> AsByteArray(int32 minSize=0, bool littleEndian=true)
Definition: BigNumber.cpp:177
std::string CalculateShaPassHash(std::string const &name, std::string const &password)
Definition: LoginRESTService.cpp:304
uint32 GetUInt32() const
Definition: Field.h:146
Definition: LoginDatabase.h:113
Definition: Login.pb.h:477
#define ASSERT
Definition: Errors.h:55
bool Utf8ToUpperOnlyLatin(std::string &utf8String)
Definition: Util.cpp:498
static char const *const PluginId
Definition: LoginRESTService.h:76
std::string GetString() const
Definition: Field.h:276
int32 SendResponse(soap *soapClient, google::protobuf::Message const &response)
Definition: LoginRESTService.cpp:295
static int32 Init(soap *s, soap_plugin *, void *)
Definition: LoginRESTService.cpp:391
uint32 Id
Definition: Session.h:111
int soap_http_body(struct soap *soap, char **buf, size_t *len)
Definition: httppost.cpp:258