diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-10-05 14:09:42 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-12-18 22:03:40 +0100 |
commit | 090d8305e4e3c3ee085a897b72f2b4708e183eb8 (patch) | |
tree | e703cc7fcb7f16c85f16b094d5df0bd0a8d698e8 /src/ClientHandle.h | |
parent | Horsies: don't always broadcast metadata (diff) | |
download | cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.gz cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.bz2 cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.lz cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.xz cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.zst cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.zip |
Diffstat (limited to 'src/ClientHandle.h')
-rw-r--r-- | src/ClientHandle.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ClientHandle.h b/src/ClientHandle.h index e955911bf..33a9a8f8c 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -50,12 +50,12 @@ class cClientHandle // tolua_export public: // tolua_export #if defined(ANDROID) - static const int DEFAULT_VIEW_DISTANCE = 4; // The default ViewDistance (used when no value is set in Settings.ini) + static const unsigned DEFAULT_VIEW_DISTANCE = 4; // The default ViewDistance (used when no value is set in Settings.ini) #else - static const int DEFAULT_VIEW_DISTANCE = 10; + static const unsigned DEFAULT_VIEW_DISTANCE = 10; #endif - static const int MAX_VIEW_DISTANCE = 32; - static const int MIN_VIEW_DISTANCE = 1; + static const unsigned MAX_VIEW_DISTANCE = 32; + static const unsigned MIN_VIEW_DISTANCE = 1; /** The percentage how much a block has to be broken. Should be a value between 0.7 (70% broken) and 1 (100% broken) depending on lag. @@ -63,7 +63,7 @@ public: // tolua_export static float FASTBREAK_PERCENTAGE; /** Creates a new client with the specified IP address in its description and the specified initial view distance. */ - cClientHandle(const AString & a_IPString, int a_ViewDistance); + cClientHandle(const AString & a_IPString, unsigned a_ViewDistance); virtual ~cClientHandle() override; @@ -242,13 +242,13 @@ public: // tolua_export inline short GetPing(void) const { return static_cast<short>(std::chrono::duration_cast<std::chrono::milliseconds>(m_Ping).count()); } /** Sets the maximal view distance. */ - void SetViewDistance(int a_ViewDistance); + void SetViewDistance(unsigned a_ViewDistance); /** Returns the view distance that the player currently have. */ - int GetViewDistance(void) const { return m_CurrentViewDistance; } + unsigned 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; } + unsigned GetRequestedViewDistance(void) const { return m_RequestedViewDistance; } void SetLocale(const AString & a_Locale) { m_Locale = a_Locale; } AString GetLocale(void) const { return m_Locale; } @@ -304,7 +304,7 @@ public: // tolua_export /** Called when the protocol receives a MC|Beacon plugin message, indicating that the player set an effect in the beacon UI. */ - void HandleBeaconSelection(int a_PrimaryEffect, int a_SecondaryEffect); + void HandleBeaconSelection(unsigned a_PrimaryEffect, unsigned a_SecondaryEffect); /** Called when the protocol detects a chat packet. */ void HandleChat(const AString & a_Message); @@ -422,10 +422,10 @@ private: AStringMap m_ForgeMods; /** The actual view distance used, the minimum of client's requested view distance and world's max view distance. */ - int m_CurrentViewDistance; + unsigned 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; + unsigned m_RequestedViewDistance; AString m_IPString; |