From 296d0acbffc053b4edc4c4b02503603081180ecf Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Mon, 7 Apr 2014 20:13:45 +0200 Subject: Added deleted things for merging --- src/ClientHandle.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 0c367ec7d..01765cc85 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -230,6 +230,9 @@ public: /** Called when the player moves into a different world; queues sreaming the new chunks */ void MoveToWorld(cWorld & a_World, bool a_SendRespawnPacket); + ///Handle item enchanting + void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); + private: /** Handles the block placing packet when it is a real block placement (not block-using, item-using or eating) */ -- cgit v1.2.3 From e6e702e7fdbc8b7475d3dbecc0f81a08304997ae Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sat, 12 Apr 2014 14:58:46 +0200 Subject: Added complete Enchanting System http://minecraft.gamepedia.com/Enchantment_mechanics --- src/ClientHandle.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 01765cc85..4c88d79e2 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -18,6 +18,7 @@ #include "ByteBuffer.h" #include "Scoreboard.h" #include "Map.h" +#include "Enchantments.h" @@ -230,8 +231,10 @@ public: /** Called when the player moves into a different world; queues sreaming the new chunks */ void MoveToWorld(cWorld & a_World, bool a_SendRespawnPacket); - ///Handle item enchanting + /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); + cEnchantmentsVector AddEnchantmentWeight(cEnchantmentsVector a_Map, int a_Weight, cEnchantments a_Enchantment); + cEnchantmentsVector CheckEnchantmentConflicts(cEnchantmentsVector a_Map, cEnchantments a_FirstEnchantment); private: -- cgit v1.2.3 From b506a7407661c0527255466cf8b315824b0003c0 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sun, 13 Apr 2014 13:04:56 +0200 Subject: Added Yggdrasil Authentication System Code by Howaner. Fixes/Changes by me. --- src/ClientHandle.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 0c367ec7d..0f07c980b 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -62,8 +62,11 @@ public: cPlayer* GetPlayer() { return m_Player; } // tolua_export + const AString & GetUUID(void) const { return m_UUID; } // tolua_export + void setUUID(const AString & a_UUID) { m_UUID = a_UUID; } + void Kick(const AString & a_Reason); // tolua_export - void Authenticate(void); // Called by cAuthenticator when the user passes authentication + void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication void StreamChunks(void); @@ -326,6 +329,7 @@ private: static int s_ClientCount; int m_UniqueID; + AString m_UUID; /** Set to true when the chunk where the player is is sent to the client. Used for spawning the player */ bool m_HasSentPlayerChunk; -- cgit v1.2.3 From fce9ea65c35ab7f94c23bb361386b5ce223279eb Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Sun, 13 Apr 2014 22:15:10 +0200 Subject: Fixed invisibility enchantments --- 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 4c88d79e2..b4b1d0da3 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -19,6 +19,7 @@ #include "Scoreboard.h" #include "Map.h" #include "Enchantments.h" +#include "UI/SlotArea.h" -- cgit v1.2.3 From d505ffc704d85cc1b31ae87647ba979fda84f46f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 14 Apr 2014 20:21:00 +0200 Subject: A client UUID is generated when the server is in offline mode. 1.7.9 client works with these changes in offline mode. --- src/ClientHandle.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 0f07c980b..90b971e16 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -63,7 +63,12 @@ public: cPlayer* GetPlayer() { return m_Player; } // tolua_export const AString & GetUUID(void) const { return m_UUID; } // tolua_export - void setUUID(const AString & a_UUID) { m_UUID = a_UUID; } + void SetUUID(const AString & a_UUID) { m_UUID = a_UUID; } + + /** Generates an UUID based on the player name provided. + This is used for the offline (non-auth) mode, when there's no UUID source. + Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. */ + void GenerateOfflineUUID(void); void Kick(const AString & a_Reason); // tolua_export void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication -- cgit v1.2.3 From d12d7b671523f79f760403f3f4c0ef4efb497c79 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 14 Apr 2014 22:52:59 +0200 Subject: Implemented the 1.7.6 protocol and authenticator. Server works both in online and offline modes with 1.7.9. --- src/ClientHandle.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 90b971e16..12e0256de 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -65,10 +65,16 @@ public: const AString & GetUUID(void) const { return m_UUID; } // tolua_export void SetUUID(const AString & a_UUID) { m_UUID = a_UUID; } + /** Generates an UUID based on the username stored for this client, and stores it in the m_UUID member. + This is used for the offline (non-auth) mode, when there's no UUID source. + Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. + Internally calls the GenerateOfflineUUID static function. */ + void GenerateOfflineUUID(void); + /** Generates an UUID based on the player name provided. This is used for the offline (non-auth) mode, when there's no UUID source. Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. */ - void GenerateOfflineUUID(void); + static AString GenerateOfflineUUID(const AString & a_Username); // tolua_export void Kick(const AString & a_Reason); // tolua_export void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication -- cgit v1.2.3 From fb3c755c0a6d1ccaae8e990375229afee4827e0c Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Tue, 15 Apr 2014 20:55:37 +0200 Subject: Modified names --- 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 b4b1d0da3..b9e470653 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -234,8 +234,8 @@ public: /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); - cEnchantmentsVector AddEnchantmentWeight(cEnchantmentsVector a_Map, int a_Weight, cEnchantments a_Enchantment); - cEnchantmentsVector CheckEnchantmentConflicts(cEnchantmentsVector a_Map, cEnchantments a_FirstEnchantment); + cEnchantmentsVector AddEnchantmentWeight(cEnchantmentsVector a_Enchantments, int a_Weight, cEnchantments a_Enchantment); + cEnchantmentsVector CheckEnchantmentConflicts(cEnchantmentsVector a_Enchantments, cEnchantments a_FirstEnchantment); private: -- cgit v1.2.3 From 2cb8538e2e60309bc9d1f13dc90dd5cbface8967 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Tue, 15 Apr 2014 22:03:15 +0200 Subject: Code Optimization --- src/ClientHandle.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index b9e470653..f6d0af3b4 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -234,8 +234,9 @@ public: /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); - cEnchantmentsVector AddEnchantmentWeight(cEnchantmentsVector a_Enchantments, int a_Weight, cEnchantments a_Enchantment); - cEnchantmentsVector CheckEnchantmentConflicts(cEnchantmentsVector a_Enchantments, cEnchantments a_FirstEnchantment); + void AddEnchantmentWeight(cEnchantmentsVector & a_Enchantments, int a_Weight, cEnchantments a_Enchantment); + void RemoveEnchantmentFromVector(cEnchantmentsVector & a_Enchantments, int a_EnchantmentID); + void CheckEnchantmentConflicts(cEnchantmentsVector & a_Enchantments, cEnchantments a_FirstEnchantment); private: -- cgit v1.2.3 From a0725747af9581744577be7ed06c07ec9c9fe3f2 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Wed, 16 Apr 2014 14:52:09 +0200 Subject: Fixed conflicting enchantments checking --- 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 8bba0d27c..1829e3b4d 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -249,7 +249,7 @@ public: /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); void AddEnchantmentWeight(cEnchantmentsVector & a_Enchantments, int a_Weight, cEnchantments a_Enchantment); - void RemoveEnchantmentFromVector(cEnchantmentsVector & a_Enchantments, int a_EnchantmentID); + void RemoveEnchantmentFromVector(cEnchantmentsVector * a_Enchantments, int a_EnchantmentID); void CheckEnchantmentConflicts(cEnchantmentsVector & a_Enchantments, cEnchantments a_FirstEnchantment); private: -- cgit v1.2.3 From f9343a8490b50cb28a62c7327c0013da48ca2745 Mon Sep 17 00:00:00 2001 From: daniel0916 Date: Thu, 17 Apr 2014 13:15:35 +0200 Subject: Modified many things --- src/ClientHandle.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 1829e3b4d..3d01d8034 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -248,9 +248,6 @@ public: /** Called when the player will enchant a Item */ void HandleEnchantItem(Byte & WindowID, Byte & Enchantment); - void AddEnchantmentWeight(cEnchantmentsVector & a_Enchantments, int a_Weight, cEnchantments a_Enchantment); - void RemoveEnchantmentFromVector(cEnchantmentsVector * a_Enchantments, int a_EnchantmentID); - void CheckEnchantmentConflicts(cEnchantmentsVector & a_Enchantments, cEnchantments a_FirstEnchantment); private: -- cgit v1.2.3 From b008ba5d982542d8a2857544af1aa88a41cf7b13 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 24 Apr 2014 17:24:39 -0700 Subject: Refactored SendChat(), placing the message-type formatting into its own function. Removed default case warning in the process. --- src/ClientHandle.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 3d01d8034..e2b44ce8a 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -77,6 +77,9 @@ public: This is used for the offline (non-auth) mode, when there's no UUID source. Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. */ static AString GenerateOfflineUUID(const AString & a_Username); // tolua_export + + // Formats the type of message with the proper color and prefix for sending to the client. + AString FormatMessageType(bool ShouldAppendChatPrefixes, eMessageType a_ChatPrefix, const AString & a_AdditionalData); void Kick(const AString & a_Reason); // tolua_export void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication -- cgit v1.2.3 From aef2c8ec628aa2522364da1333bc5158e55ac6a2 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 26 Apr 2014 09:21:49 -0700 Subject: Further refactored, Reverted Minecart change Other small changes. --- src/ClientHandle.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index e2b44ce8a..9f8d44129 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -78,8 +78,10 @@ public: Each username generates a unique and constant UUID, so that when the player reconnects with the same name, their UUID is the same. */ static AString GenerateOfflineUUID(const AString & a_Username); // tolua_export - // Formats the type of message with the proper color and prefix for sending to the client. + /** Formats the type of message with the proper color and prefix for sending to the client. **/ AString FormatMessageType(bool ShouldAppendChatPrefixes, eMessageType a_ChatPrefix, const AString & a_AdditionalData); + + AString FormatChatPrefix(bool ShouldAppendChatPrefixes, AString a_ChatPrefixS, AString m_Color1, AString m_Color2); void Kick(const AString & a_Reason); // tolua_export void Authenticate(const AString & a_Name, const AString & a_UUID); // Called by cAuthenticator when the user passes authentication -- cgit v1.2.3 From e24bdc9328278b676c7acf83fd9f31b430561b98 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 23:03:23 +0200 Subject: More ClientHandle fixes. --- 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 9f8d44129..9fd17ac00 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -384,7 +384,7 @@ private: void UnregisterPluginChannels(const AStringVector & a_ChannelList); /** Handles the "MC|AdvCdm" plugin message */ - void HandleCommandBlockMessage(const char * a_Data, unsigned int a_Length); + void HandleCommandBlockMessage(const char * a_Data, size_t a_Length); // cSocketThreads::cCallback overrides: virtual void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client -- cgit v1.2.3 From 6ac332cd0662f49e30f60ae0b5a3b7f85df8cfb3 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 1 May 2014 01:25:04 +0200 Subject: Add MC|ItemName plugin message. --- src/ClientHandle.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ClientHandle.h') diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 9fd17ac00..4dc6ab074 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -385,6 +385,9 @@ private: /** 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 void DataReceived (const char * a_Data, size_t a_Size) override; // Data is received from the client -- cgit v1.2.3