summaryrefslogtreecommitdiffstats
path: root/src/Protocol/MojangAPI.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-30 13:44:03 +0200
committermadmaxoft <github@xoft.cz>2014-07-30 13:56:29 +0200
commit6476bd0e2ee7e128e3eaa56159f169f0a53736ff (patch)
treef98c5f99fc6155ea460b03791206bf0d6d16a332 /src/Protocol/MojangAPI.h
parentAdded a cMojangAPI class for PlayerName -> UUID lookups, with cache. (diff)
downloadcuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.tar
cuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.tar.gz
cuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.tar.bz2
cuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.tar.lz
cuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.tar.xz
cuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.tar.zst
cuberite-6476bd0e2ee7e128e3eaa56159f169f0a53736ff.zip
Diffstat (limited to 'src/Protocol/MojangAPI.h')
-rw-r--r--src/Protocol/MojangAPI.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Protocol/MojangAPI.h b/src/Protocol/MojangAPI.h
index 789fdf818..cc2902a19 100644
--- a/src/Protocol/MojangAPI.h
+++ b/src/Protocol/MojangAPI.h
@@ -15,9 +15,12 @@
+// tolua_begin
class cMojangAPI
{
public:
+ // tolua_end
+
cMojangAPI(void);
~cMojangAPI();
@@ -30,6 +33,8 @@ public:
Returns true if all was successful, false on failure. */
static bool SecureRequest(const AString & a_ServerName, const AString & a_Request, AString & a_Response);
+ // tolua_begin
+
/** Converts the given UUID to its short form (32 bytes, no dashes).
Logs a warning and returns empty string if not a UUID. */
static AString MakeUUIDShort(const AString & a_UUID);
@@ -38,16 +43,22 @@ public:
Logs a warning and returns empty string if not a UUID. */
static AString MakeUUIDDashed(const AString & a_UUID);
+ // tolua_end
+
/** Converts the player names into UUIDs.
a_PlayerName[idx] will be converted to UUID and returned as idx-th value
The UUID will be empty on error.
Blocking operation, do not use in world-tick thread! */
AStringVector GetUUIDsFromPlayerNames(const AStringVector & a_PlayerName);
+ // tolua_begin
+
/** Called by the Authenticator to add a PlayerName -> UUID mapping that it has received from
authenticating a user. This adds the cache item and "refreshes" it if existing, adjusting its datetime
stamp to now. */
void AddPlayerNameToUUIDMapping(const AString & a_PlayerName, const AString & a_UUID);
+
+ // tolua_end
protected:
struct sUUIDRecord
@@ -95,7 +106,7 @@ protected:
Names that are not valid are not added into the cache.
ASSUMEs that a_PlayerNames contains lowercased player names. */
void CacheNamesToUUIDs(const AStringVector & a_PlayerNames);
-} ;
+} ; // tolua_export