summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-11-14 22:53:12 +0100
committerHowaner <franzi.moos@googlemail.com>2014-11-14 22:53:12 +0100
commit83d3f3347b5c812b06be87804b7582a92d0294d3 (patch)
treea3e50b52ed513401b11a231c62a3a24eaf698756 /src/ClientHandle.h
parentMerge branch 'master' into ViewDistance (diff)
downloadcuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.tar
cuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.tar.gz
cuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.tar.bz2
cuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.tar.lz
cuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.tar.xz
cuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.tar.zst
cuberite-83d3f3347b5c812b06be87804b7582a92d0294d3.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 082ed2fcc..20789621d 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_UsedViewDistance; }
+
+ /** Returns the view distance that the player set, not the used view distance. */
+ int GetSettedViewDistance(void) const { return m_SetViewDistance; }
+
void SetLocale(AString & a_Locale) { m_Locale = a_Locale; }
AString GetLocale(void) const { return m_Locale; }
@@ -334,11 +340,11 @@ private:
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;
-
+ int m_UsedViewDistance;
+
+ /** The original view distance from the player. It isn't clamped with 1 and the max view distance of the world. */
+ int m_SetViewDistance;
+
AString m_IPString;
AString m_Username;