From 72c087cfd335b015139cb73ae78f74105d855cf0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 27 Sep 2014 14:28:14 +0100 Subject: Dropped support for <1.7.x --- src/ClientHandle.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 0a936a2ca..10cf6ae28 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -239,7 +239,6 @@ public: void HandleAnimation (char a_Animation); void HandleChat (const AString & a_Message); void HandleCreativeInventory(short a_SlotNum, const cItem & a_HeldItem); - void HandleDisconnect (const AString & a_Reason); void HandleEntityCrouch (int a_EntityID, bool a_IsCrouching); void HandleEntityLeaveBed (int a_EntityID); void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting); -- cgit v1.2.3 From d7066f43d3fd592457e69a46f0fed098c80b3190 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 30 Sep 2014 13:33:57 +0200 Subject: Rewritten plugin messages, vanilla are being parsed directly. This should finally fix the compatibility problems between 1.7 and 1.8 protocols with the changes in the vanilla plugin messages. --- src/ClientHandle.h | 55 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 15 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 10cf6ae28..1f22762c0 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -222,6 +222,13 @@ public: bool HasPluginChannel(const AString & a_PluginChannel); + /** Called by the protocol when it receives the MC|Brand plugin message. Also callable by plugins. + Simply stores the string value. */ + void SetClientBrand(const AString & a_ClientBrand) { m_ClientBrand = a_ClientBrand; } + + /** Returns the client brand received in the MC|Brand plugin message or set by a plugin. */ + const AString & GetClientBrand(void) const { return m_ClientBrand; } + // tolua_end /** Returns true if the client wants the chunk specified to be sent (in m_ChunksToSend) */ @@ -236,12 +243,31 @@ public: void PacketError(unsigned char a_PacketType); // Calls that cProtocol descendants use for handling packets: - void HandleAnimation (char a_Animation); - void HandleChat (const AString & a_Message); - void HandleCreativeInventory(short a_SlotNum, const cItem & a_HeldItem); - void HandleEntityCrouch (int a_EntityID, bool a_IsCrouching); - void HandleEntityLeaveBed (int a_EntityID); - void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting); + void HandleAnimation(char a_Animation); + + /** Called when the protocol receives a MC|ItemName plugin message, indicating that the player named + an item in the anvil UI. */ + void HandleAnvilItemName(const AString & a_ItemName); + + /** 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); + + /** Called when the protocol detects a chat packet. */ + void HandleChat(const AString & a_Message); + + /** Called when the protocol receives a MC|AdvCdm plugin message, indicating that the player set a new + command in the command block UI, for a block-based commandblock. */ + void HandleCommandBlockBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_NewCommand); + + /** Called when the protocol receives a MC|AdvCdm plugin message, indicating that the player set a new + command in the command block UI, for an entity-based commandblock (minecart?). */ + void HandleCommandBlockEntityChange(int a_EntityID, const AString & a_NewCommand); + + void HandleCreativeInventory (short a_SlotNum, const cItem & a_HeldItem); + void HandleEntityCrouch (int a_EntityID, bool a_IsCrouching); + void HandleEntityLeaveBed (int a_EntityID); + void HandleEntitySprinting (int a_EntityID, bool a_IsSprinting); /** Called when the protocol handshake has been received (for protocol versions that support it; otherwise the first instant when a username is received). @@ -251,6 +277,11 @@ public: void HandleKeepAlive (int a_KeepAliveID); void HandleLeftClick (int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, char a_Status); + + /** Called when the protocol receives a MC|TrSel packet, indicating that the player used a trade in + the NPC UI. */ + void HandleNPCTrade(int a_SlotNum); + void HandlePing (void); void HandlePlayerAbilities (bool a_CanFly, bool a_IsFlying, float FlyingSpeed, float WalkingSpeed); void HandlePlayerLook (float a_Rotation, float a_Pitch, bool a_IsOnGround); @@ -392,6 +423,9 @@ private: /** The plugin channels that the client has registered. */ cChannels m_PluginChannels; + + /** The brand identification of the client, as received in the MC|Brand plugin message or set from a plugin. */ + AString m_ClientBrand; /** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */ @@ -421,15 +455,6 @@ private: /** Removes all of the channels from the list of current plugin channels. Ignores channels that are not found. */ void UnregisterPluginChannels(const AStringVector & a_ChannelList); - /** Handles the "MC|Beacon" plugin message */ - void HandleBeaconSelection(const char * a_Data, size_t a_Length); - - /** Handles the "MC|AdvCdm" plugin message */ - void HandleCommandBlockMessage(const char * a_Data, size_t a_Length); - - /** Handles the "MC|ItemName" plugin message */ - void HandleAnvilItemName(const char * a_Data, size_t a_Length); - // cSocketThreads::cCallback overrides: virtual bool DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client virtual void GetOutgoingData(AString & a_Data) override; // Data can be sent to client -- cgit v1.2.3 From e65e0f1795e170dc339d5062eb2322e4c673560d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 1 Oct 2014 12:14:38 +0200 Subject: cClientHandle: Alpha-sorted the sending functions. --- src/ClientHandle.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 1f22762c0..20592c190 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -145,7 +145,9 @@ public: void SendCollectEntity (const cEntity & a_Entity, const cPlayer & a_Player); void SendDestroyEntity (const cEntity & a_Entity); void SendDisconnect (const AString & a_Reason); + void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display); void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ); + void SendEntityAnimation (const cEntity & a_Entity, char a_Animation); // tolua_export void SendEntityEffect (const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration); void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item); void SendEntityHeadLook (const cEntity & a_Entity); @@ -156,6 +158,8 @@ public: void SendEntityRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ); void SendEntityStatus (const cEntity & a_Entity, char a_Status); void SendEntityVelocity (const cEntity & a_Entity); + void SendExperience (void); + void SendExperienceOrb (const cExpOrb & a_ExpOrb); void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion); void SendGameMode (eGameMode a_GameMode); void SendHealth (void); @@ -164,15 +168,14 @@ public: void SendMapDecorators (int a_ID, const cMapDecoratorList & a_Decorators, unsigned int m_Scale); void SendMapInfo (int a_ID, unsigned int a_Scale); void SendPaintingSpawn (const cPainting & a_Painting); - void SendPickupSpawn (const cPickup & a_Pickup); - void SendEntityAnimation (const cEntity & a_Entity, char a_Animation); // tolua_export void SendParticleEffect (const AString & a_ParticleName, float a_SrcX, float a_SrcY, float a_SrcZ, float a_OffsetX, float a_OffsetY, float a_OffsetZ, float a_ParticleData, int a_ParticleAmount); + void SendPickupSpawn (const cPickup & a_Pickup); void SendPlayerAbilities (void); void SendPlayerListAddPlayer (const cPlayer & a_Player); void SendPlayerListRemovePlayer (const cPlayer & a_Player); + void SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName); void SendPlayerListUpdateGameMode (const cPlayer & a_Player); void SendPlayerListUpdatePing (const cPlayer & a_Player); - void SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName); void SendPlayerMaxSpeed (void); ///< Informs the client of the maximum player speed (1.6.1+) void SendPlayerMoveLook (void); void SendPlayerPosition (void); @@ -180,11 +183,8 @@ public: void SendPluginMessage (const AString & a_Channel, const AString & a_Message); // Exported in ManualBindings.cpp void SendRemoveEntityEffect (const cEntity & a_Entity, int a_EffectID); void SendRespawn (eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks = false); - void SendExperience (void); - void SendExperienceOrb (const cExpOrb & a_ExpOrb); - void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode); void SendScoreUpdate (const AString & a_Objective, const AString & a_Player, cObjective::Score a_Score, Byte a_Mode); - void SendDisplayObjective (const AString & a_Objective, cScoreboard::eDisplaySlot a_Display); + void SendScoreboardObjective (const AString & a_Name, const AString & a_DisplayName, Byte a_Mode); void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch); // tolua_export void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data); void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock); -- cgit v1.2.3 From 382e014ebcd44a72788bea8cdcec7f64861b063f Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 2 Oct 2014 23:50:41 +0200 Subject: Optimized chunk loader --- src/ClientHandle.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 20592c190..897fb8705 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -113,7 +113,11 @@ public: /** Authenticates the specified user, called by cAuthenticator */ void Authenticate(const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties); - void StreamChunks(void); + /** This function sends a new unloaded chunk to the player. */ + void StreamNextChunk(void); + + /** Remove all loaded chunks that are no longer in range */ + void UnloadOutOfRangeChunks(void); // Removes the client from all chunks. Used when switching worlds or destroying the player void RemoveFromAllChunks(void); @@ -352,10 +356,6 @@ private: cPlayer * m_Player; bool m_HasSentDC; ///< True if a D/C packet has been sent in either direction - - // Chunk position when the last StreamChunks() was called; used to avoid re-streaming while in the same chunk - int m_LastStreamedChunkX; - int m_LastStreamedChunkZ; /** Seconds since the last packet data was received (updated in Tick(), reset in DataReceived()) */ float m_TimeSinceLastPacket; -- cgit v1.2.3 From b5a2c6667ac0845d17a709cc436afb570079a9a7 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 3 Oct 2014 21:32:41 +0100 Subject: Improved furnaces * Fixed progress bar on 1.8 * Fixed bugs * Improved code * Fixes #1068 * Fixes #1070 --- src/ClientHandle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 20592c190..674a8cafd 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -204,7 +204,7 @@ public: void SendWholeInventory (const cWindow & a_Window); void SendWindowClose (const cWindow & a_Window); void SendWindowOpen (const cWindow & a_Window); - void SendWindowProperty (const cWindow & a_Window, int a_Property, int a_Value); + void SendWindowProperty (const cWindow & a_Window, short a_Property, short a_Value); // tolua_begin const AString & GetUsername(void) const; -- cgit v1.2.3 From a8aeceab9d6e5e5e36ef7bd58783b65aca4d8be7 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 5 Oct 2014 20:19:21 +0200 Subject: cClientHandle: Added protocol version knowledge. --- src/ClientHandle.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 20592c190..a9cc29d50 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -316,6 +316,12 @@ public: /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & a_WindowID, Byte & a_Enchantment); + + /** Called by the protocol recognizer when the protocol version is known. */ + void SetProtocolVersion(UInt32 a_ProtocolVersion) { m_ProtocolVersion = a_ProtocolVersion; } + + /** Returns the protocol version number of the protocol that the client is talking. Returns zero if the protocol version is not (yet) known. */ + UInt32 GetProtocolVersion(void) const { return m_ProtocolVersion; } // tolua_export private: @@ -427,6 +433,9 @@ private: /** The brand identification of the client, as received in the MC|Brand plugin message or set from a plugin. */ AString m_ClientBrand; + /** The version of the protocol that the client is talking, or 0 if unknown. */ + UInt32 m_ProtocolVersion; + /** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */ void HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, cItemHandler & a_ItemHandler); -- cgit v1.2.3 From 5a6b86180e0144a5671c747b838d14992c21afae Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 6 Oct 2014 17:38:17 +0200 Subject: Better StreamNextChunk() method --- src/ClientHandle.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 897fb8705..018c537c6 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -357,6 +357,10 @@ private: bool m_HasSentDC; ///< True if a D/C packet has been sent in either direction + // Chunk position when the last StreamChunks() was called; used to avoid re-streaming while in the same chunk + int m_LastStreamedChunkX; + int m_LastStreamedChunkZ; + /** Seconds since the last packet data was received (updated in Tick(), reset in DataReceived()) */ float m_TimeSinceLastPacket; -- cgit v1.2.3 From b493beb3bbac05d0402a6e388a61bf446c6c00ff Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 6 Oct 2014 21:27:53 +0200 Subject: Stream 4 chunks per tick. Added priority. --- src/ClientHandle.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index eb91b8487..c6444b1c2 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -21,6 +21,7 @@ #include "Enchantments.h" #include "UI/SlotArea.h" #include "json/json.h" +#include "ChunkSender.h" @@ -113,8 +114,8 @@ public: /** Authenticates the specified user, called by cAuthenticator */ void Authenticate(const AString & a_Name, const AString & a_UUID, const Json::Value & a_Properties); - /** This function sends a new unloaded chunk to the player. */ - void StreamNextChunk(void); + /** This function sends a new unloaded chunk to the player. Returns true if all chunks are loaded. */ + bool StreamNextChunk(); /** Remove all loaded chunks that are no longer in range */ void UnloadOutOfRangeChunks(void); @@ -448,7 +449,7 @@ private: bool CheckBlockInteractionsRate(void); /** Adds a single chunk to be streamed to the client; used by StreamChunks() */ - void StreamChunk(int a_ChunkX, int a_ChunkZ); + void StreamChunk(int a_ChunkX, int a_ChunkZ, cChunkSender::eChunkPriority a_Priority); /** Handles the DIG_STARTED dig packet: */ void HandleBlockDigStarted (int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta); -- cgit v1.2.3 From 8c2a99711e98ccfc2f6f31777a8b4e74e40c616c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 16 Oct 2014 21:12:26 +0200 Subject: Merged branch 'fix_chunks'. --- src/ClientHandle.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index a9cc29d50..1fc915280 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -343,6 +343,7 @@ private: cCriticalSection m_CSChunkLists; cChunkCoordsList m_LoadedChunks; // Chunks that the player belongs to cChunkCoordsList m_ChunksToSend; // Chunks that need to be sent to the player (queued because they weren't generated yet or there's not enough time to send them) + cChunkCoordsList m_SentChunks; // Store the coordinates of the chunks that the client has loaded cProtocol * m_Protocol; -- cgit v1.2.3 From cf73fee7e362134dc4caabc7c99f3a5bb0593a99 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 19 Oct 2014 18:45:32 +0200 Subject: Fixed minor style issues. --- src/ClientHandle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 9733ff32d..80cf16963 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -343,7 +343,7 @@ private: cCriticalSection m_CSChunkLists; cChunkCoordsList m_LoadedChunks; // Chunks that the player belongs to cChunkCoordsList m_ChunksToSend; // Chunks that need to be sent to the player (queued because they weren't generated yet or there's not enough time to send them) - cChunkCoordsList m_SentChunks; // Store the coordinates of the chunks that the client has loaded + cChunkCoordsList m_SentChunks; // Chunks that are currently sent to the client cProtocol * m_Protocol; -- cgit v1.2.3 From 83d3f3347b5c812b06be87804b7582a92d0294d3 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 14 Nov 2014 22:53:12 +0100 Subject: Use m_UsedViewDistance and m_SetViewDistance. --- src/ClientHandle.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/ClientHandle.h') 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 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; -- cgit v1.2.3 From 8c3c11d6b33c8ff71ad3f4e2c6ca67fc835dea33 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 15 Nov 2014 14:27:50 +0100 Subject: Renamed GetSettedViewDistance() to GetRequestedViewDistance() --- src/ClientHandle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 20789621d..db386d8a3 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -223,8 +223,8 @@ public: /** 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; } + /** Returns the view distance that the player request, not the used view distance. */ + int GetRequestedViewDistance(void) const { return m_SetViewDistance; } void SetLocale(AString & a_Locale) { m_Locale = a_Locale; } AString GetLocale(void) const { return m_Locale; } -- cgit v1.2.3 From 78fb7896313f2074fa814309901e30d4a4f218e2 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 15 Nov 2014 15:16:52 +0100 Subject: Fixed a security problem with signs. --- src/ClientHandle.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 082ed2fcc..a0dd4ff7a 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -125,6 +125,9 @@ public: inline bool IsLoggedIn(void) const { return (m_State >= csAuthenticating); } + /** Returns the positions from the last block that the player placed. */ + const Vector3i & GetLastPlacedBlock(void) const { return m_LastPlacedBlock; } // tolua_export + /** Called while the client is being ticked from the world via its cPlayer object */ void Tick(float a_Dt); @@ -432,6 +435,9 @@ private: /** Client Settings */ AString m_Locale; + + /** The positions from the last block that the player placed. It's needed to verify the sign text change. */ + Vector3i m_LastPlacedBlock; /** The plugin channels that the client has registered. */ cChannels m_PluginChannels; -- cgit v1.2.3 From 927d8d7702b71baa64dc70593ea71e1081c33a9c Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 15 Nov 2014 15:33:42 +0100 Subject: Renamed m_SetViewDistance to m_RequestedViewDistance --- src/ClientHandle.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index db386d8a3..c0826d7c4 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -224,7 +224,7 @@ public: int GetViewDistance(void) const { return m_UsedViewDistance; } /** Returns the view distance that the player request, not the used view distance. */ - int GetRequestedViewDistance(void) const { return m_SetViewDistance; } + int GetRequestedViewDistance(void) const { return m_RequestedViewDistance; } void SetLocale(AString & a_Locale) { m_Locale = a_Locale; } AString GetLocale(void) const { return m_Locale; } @@ -342,8 +342,8 @@ private: /** Number of chunks the player can see in each direction */ 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; + /** 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; -- cgit v1.2.3 From 09cea625fcf2d1eb1fb37a57c5712d992c96e4fd Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 15 Nov 2014 22:26:54 +0100 Subject: Renamed m_UsedViewDistance to m_CurrentViewDistance --- src/ClientHandle.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index c0826d7c4..8d241c1e7 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -221,7 +221,7 @@ public: void SetViewDistance(int a_ViewDistance); /** Returns the view distance that the player currently have. */ - int GetViewDistance(void) const { return m_UsedViewDistance; } + 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; } @@ -339,8 +339,8 @@ private: /** The type used for storing the names of registered plugin channels. */ typedef std::set cChannels; - /** Number of chunks the player can see in each direction */ - int m_UsedViewDistance; + /** 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; -- cgit v1.2.3 From 277151582fbb0652dcf4e15f67d41f90e08bdeeb Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 15 Nov 2014 22:36:31 +0100 Subject: Use LastPlacedSign instead of LastPlacedBlock. --- src/ClientHandle.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index a0dd4ff7a..d8cc3c643 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -125,9 +125,6 @@ public: inline bool IsLoggedIn(void) const { return (m_State >= csAuthenticating); } - /** Returns the positions from the last block that the player placed. */ - const Vector3i & GetLastPlacedBlock(void) const { return m_LastPlacedBlock; } // tolua_export - /** Called while the client is being ticked from the world via its cPlayer object */ void Tick(float a_Dt); @@ -436,8 +433,8 @@ private: /** Client Settings */ AString m_Locale; - /** The positions from the last block that the player placed. It's needed to verify the sign text change. */ - Vector3i m_LastPlacedBlock; + /** 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; -- cgit v1.2.3