summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-11-16 15:13:39 +0100
committerMattes D <github@xoft.cz>2014-11-16 15:13:39 +0100
commita63eb1ac6e1838a23cd4c97eefd5085c7d97b43f (patch)
tree7d3535001019a6d648e83eb526be30ba538e485a /src/ClientHandle.h
parentAPIDump: Fixed example cCompositeChat URL (diff)
parentRenamed m_UsedViewDistance to m_CurrentViewDistance (diff)
downloadcuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.tar
cuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.tar.gz
cuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.tar.bz2
cuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.tar.lz
cuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.tar.xz
cuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.tar.zst
cuberite-a63eb1ac6e1838a23cd4c97eefd5085c7d97b43f.zip
Diffstat (limited to 'src/ClientHandle.h')
-rw-r--r--src/ClientHandle.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 082ed2fcc..8d241c1e7 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;