From bf19f7ae9ceacf9e6a65e097be443ae3f5c85232 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 23 Feb 2012 22:51:03 +0000 Subject: Made the viewdistance settable by users and default in settings.ini. The default is 9. git-svn-id: http://mc-server.googlecode.com/svn/trunk@326 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source/cClientHandle.h') diff --git a/source/cClientHandle.h b/source/cClientHandle.h index ffe25db2b..6b567a88b 100644 --- a/source/cClientHandle.h +++ b/source/cClientHandle.h @@ -65,8 +65,12 @@ public: }; static const int MAXBLOCKCHANGEINTERACTIONS = 10; // 5 didn't help, 10 seems to have done the trick + + static const int DEFAULT_VIEW_DISTANCE = 9; // The default ViewDistance (used when no value is set in Settings.ini) + static const int MAX_VIEW_DISTANCE = 10; + static const int MIN_VIEW_DISTANCE = 4; - cClientHandle(const cSocket & a_Socket); + cClientHandle(const cSocket & a_Socket, int a_ViewDistance); ~cClientHandle(); const cSocket & GetSocket(void) const {return m_Socket; } @@ -99,11 +103,14 @@ public: const AString & GetUsername(void) const; inline short GetPing() { return m_Ping; } + + void SetViewDistance(int a_ViewDistance); private: - static const int VIEWDISTANCE = 4; // Number of chunks the player can see in each direction; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 ) - static const int GENERATEDISTANCE = 1; // Server generates this many chunks AHEAD of player sight. + int m_ViewDistance; // Number of chunks the player can see in each direction; 4 is the minimum ( http://wiki.vg/Protocol_FAQ#.E2.80.A6all_connecting_clients_spasm_and_jerk_uncontrollably.21 ) + + static const int GENERATEDISTANCE = 2; // Server generates this many chunks AHEAD of player sight. 2 is the minimum, since foliage is generated 1 step behind chunk terrain generation int m_ProtocolVersion; AString m_Username; -- cgit v1.2.3