diff options
author | archshift <admin@archshift.com> | 2014-07-12 02:37:28 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-07-12 02:37:28 +0200 |
commit | 83c69134c079ac204c2fda1f375987b9651510d6 (patch) | |
tree | 73e02b553e6f3218545d543f587ab25eb918c462 /src/Entities/Player.h | |
parent | For now, removed creator member from Entity Effect for pointer safety (diff) | |
parent | Simplified the player data loading. (diff) | |
download | cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.gz cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.bz2 cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.lz cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.xz cuberite-83c69134c079ac204c2fda1f375987b9651510d6.tar.zst cuberite-83c69134c079ac204c2fda1f375987b9651510d6.zip |
Diffstat (limited to 'src/Entities/Player.h')
-rw-r--r-- | src/Entities/Player.h | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 2053305ea..5aebe861a 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -41,6 +41,7 @@ public: cPlayer(cClientHandle * a_Client, const AString & a_PlayerName); + virtual ~cPlayer(); virtual void SpawnOn(cClientHandle & a_Client) override; @@ -335,7 +336,15 @@ public: bool MoveToWorld(const char * a_WorldName); // tolua_export bool SaveToDisk(void); + + /** Loads the player data from the disk file. + Returns true on success, false on failure. */ bool LoadFromDisk(void); + + /** Loads the player data from the specified file. + Returns true on success, false on failure. */ + bool LoadFromFile(const AString & a_FileName); + void LoadPermissionsFromDisk(void); // tolua_export const AString & GetLoadedWorldName() { return m_LoadedWorldName; } @@ -514,6 +523,24 @@ protected: cStatManager m_Stats; + /** Flag representing whether the player is currently in a bed + Set by a right click on unoccupied bed, unset by a time fast forward or teleport */ + bool m_bIsInBed; + + /** How long till the player's inventory will be saved + Default save interval is #defined in PLAYER_INVENTORY_SAVE_INTERVAL */ + unsigned int m_TicksUntilNextSave; + + /** Flag used by food handling system to determine whether a teleport has just happened + Will not apply food penalties if found to be true; will set to false after processing + */ + bool m_bIsTeleporting; + + /** The UUID of the player, as read from the ClientHandle. + If no ClientHandle is given, the UUID is initialized to empty. */ + AString m_UUID; + + /** Sets the speed and sends it to the client, so that they are forced to move so. */ virtual void DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ) override; @@ -540,19 +567,9 @@ protected: /** Adds food exhaustion based on the difference between Pos and LastPos, sprinting status and swimming (in water block) */ void ApplyFoodExhaustionFromMovement(); - /** Flag representing whether the player is currently in a bed - Set by a right click on unoccupied bed, unset by a time fast forward or teleport */ - bool m_bIsInBed; - - /** How long till the player's inventory will be saved - Default save interval is #defined in PLAYER_INVENTORY_SAVE_INTERVAL */ - unsigned int m_TicksUntilNextSave; - - /** Flag used by food handling system to determine whether a teleport has just happened - Will not apply food penalties if found to be true; will set to false after processing - */ - bool m_bIsTeleporting; - + /** Returns the filename for the player data based on the UUID given. + This can be used both for online and offline UUIDs. */ + AString GetUUIDFileName(const AString & a_UUID); } ; // tolua_export |