From 4e24f711abd3d6a93f01ee7c297eb67c8aedbd37 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 14 Jul 2014 19:49:31 +0100 Subject: Player properties are now retrieved --- src/Protocol/Authenticator.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Protocol/Authenticator.h') diff --git a/src/Protocol/Authenticator.h b/src/Protocol/Authenticator.h index 211f51394..04fa3e09c 100644 --- a/src/Protocol/Authenticator.h +++ b/src/Protocol/Authenticator.h @@ -73,13 +73,18 @@ private: AString m_Server; AString m_Address; + AString m_PropertiesAddress; bool m_ShouldAuthenticate; /** cIsThread override: */ virtual void Execute(void) override; + bool ConnectSecurelyToAddress(const AString & a_CACerts, const AString & a_ExpectedPeerName, const AString & a_Data, AString & a_Response); + /** Returns true if the user authenticated okay, false on error; iLevel is the recursion deptht (bails out if too deep) */ bool AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID); + + bool GetPlayerProperties(const AString & a_UUID, AString & a_Properties); }; -- cgit v1.2.3 From 1f6854792cdd6792b27c4f9f3d7d857df9dd64bf Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 16 Jul 2014 00:03:47 +0100 Subject: Store properties as Json::Value --- src/Protocol/Authenticator.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Protocol/Authenticator.h') diff --git a/src/Protocol/Authenticator.h b/src/Protocol/Authenticator.h index 04fa3e09c..9f6dd60ca 100644 --- a/src/Protocol/Authenticator.h +++ b/src/Protocol/Authenticator.h @@ -23,6 +23,11 @@ // fwd: "cRoot.h" class cRoot; +namespace Json +{ + class Value; +} + @@ -79,12 +84,14 @@ private: /** cIsThread override: */ virtual void Execute(void) override; + /** Connects to a hostname using SSL, sends given data, and sets the response, returning whether all was successful or not */ bool ConnectSecurelyToAddress(const AString & a_CACerts, const AString & a_ExpectedPeerName, const AString & a_Data, AString & a_Response); /** Returns true if the user authenticated okay, false on error; iLevel is the recursion deptht (bails out if too deep) */ bool AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID); - bool GetPlayerProperties(const AString & a_UUID, AString & a_Properties); + /** Gets the properties, such as skin, of a player based on their UUID via Mojang's API */ + bool GetPlayerProperties(const AString & a_UUID, Json::Value & a_Properties); }; -- cgit v1.2.3 From f2c4f56ccd1862fb6d02f6f2dfb3230123f465cf Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 16 Jul 2014 11:21:02 +0100 Subject: Unified functions Thanks @Howaner! --- src/Protocol/Authenticator.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/Protocol/Authenticator.h') diff --git a/src/Protocol/Authenticator.h b/src/Protocol/Authenticator.h index 9f6dd60ca..9c2405315 100644 --- a/src/Protocol/Authenticator.h +++ b/src/Protocol/Authenticator.h @@ -85,13 +85,12 @@ private: virtual void Execute(void) override; /** Connects to a hostname using SSL, sends given data, and sets the response, returning whether all was successful or not */ - bool ConnectSecurelyToAddress(const AString & a_CACerts, const AString & a_ExpectedPeerName, const AString & a_Data, AString & a_Response); + bool ConnectSecurelyToAddress(const AString & a_CACerts, const AString & a_ExpectedPeerName, const AString & a_Request, AString & a_Response); - /** Returns true if the user authenticated okay, false on error; iLevel is the recursion deptht (bails out if too deep) */ - bool AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID); - - /** Gets the properties, such as skin, of a player based on their UUID via Mojang's API */ - bool GetPlayerProperties(const AString & a_UUID, Json::Value & a_Properties); + /** Returns true if the user authenticated okay, false on error + Sets the username, UUID, and properties (i.e. skin) fields + */ + bool AuthWithYggdrasil(AString & a_UserName, const AString & a_ServerId, AString & a_UUID, Json::Value & a_Properties); }; -- cgit v1.2.3 From ad247735fdd28f9dec6c8e86507bc7e75e50e448 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 16 Jul 2014 11:23:26 +0100 Subject: Function rename --- src/Protocol/Authenticator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Protocol/Authenticator.h') diff --git a/src/Protocol/Authenticator.h b/src/Protocol/Authenticator.h index 9c2405315..244d94c0b 100644 --- a/src/Protocol/Authenticator.h +++ b/src/Protocol/Authenticator.h @@ -85,7 +85,7 @@ private: virtual void Execute(void) override; /** Connects to a hostname using SSL, sends given data, and sets the response, returning whether all was successful or not */ - bool ConnectSecurelyToAddress(const AString & a_CACerts, const AString & a_ExpectedPeerName, const AString & a_Request, AString & a_Response); + bool SecureGetFromAddress(const AString & a_CACerts, const AString & a_ExpectedPeerName, const AString & a_Request, AString & a_Response); /** Returns true if the user authenticated okay, false on error Sets the username, UUID, and properties (i.e. skin) fields -- cgit v1.2.3