diff options
author | Mattes D <github@xoft.cz> | 2014-11-20 10:13:10 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-11-20 10:13:10 +0100 |
commit | 288cbf12cb66ed9f026f81bb13e945c68cfefd13 (patch) | |
tree | fa97f48bbd8b871aa556c79974a2f64e76272ac0 /src/ClientHandle.h | |
parent | Mobs: Fixed crash with terrain too high. (diff) | |
parent | Merge pull request #1603 from mc-server/ImprovedNoise (diff) | |
download | cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.tar cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.tar.gz cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.tar.bz2 cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.tar.lz cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.tar.xz cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.tar.zst cuberite-288cbf12cb66ed9f026f81bb13e945c68cfefd13.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.h | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 082ed2fcc..f195b6be7 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -217,9 +217,15 @@ public: inline short GetPing(void) const { return m_Ping; } + /** Sets the maximal view distance. */ void SetViewDistance(int a_ViewDistance); - int GetViewDistance(void) const { return m_ViewDistance; } - + + /** Returns the view distance that the player currently have. */ + int GetViewDistance(void) const { return m_CurrentViewDistance; } + + /** Returns the view distance that the player request, not the used view distance. */ + int GetRequestedViewDistance(void) const { return m_RequestedViewDistance; } + void SetLocale(AString & a_Locale) { m_Locale = a_Locale; } AString GetLocale(void) const { return m_Locale; } @@ -333,12 +339,12 @@ private: /** The type used for storing the names of registered plugin channels. */ typedef std::set<AString> cChannels; - /** Number of chunks the player can see in each direction */ - int m_ViewDistance; - - /** Server generates this many chunks AHEAD of player sight. */ - static const int GENERATEDISTANCE = 2; - + /** The actual view distance used, the minimum of client's requested view distance and world's max view distance. */ + int m_CurrentViewDistance; + + /** The requested view distance from the player. It isn't clamped with 1 and the max view distance of the world. */ + int m_RequestedViewDistance; + AString m_IPString; AString m_Username; @@ -432,6 +438,9 @@ private: /** Client Settings */ AString m_Locale; + + /** The positions from the last sign that the player placed. It's needed to verify the sign text change. */ + Vector3i m_LastPlacedSign; /** The plugin channels that the client has registered. */ cChannels m_PluginChannels; |