summaryrefslogtreecommitdiffstats
path: root/source/Protocol
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-04 13:47:31 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-04 13:47:31 +0200
commit4aed49a70fe2e4fa3600b31525766c52bff52e3d (patch)
treed17c4a960f4fea8c4020c0b5b6eba1d951fe25da /source/Protocol
parentFixed CreateHexDump() filling the string with garbage (diff)
downloadcuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.gz
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.bz2
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.lz
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.xz
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.tar.zst
cuberite-4aed49a70fe2e4fa3600b31525766c52bff52e3d.zip
Diffstat (limited to 'source/Protocol')
-rw-r--r--source/Protocol/Protocol.h2
-rw-r--r--source/Protocol/Protocol125.cpp10
-rw-r--r--source/Protocol/Protocol125.h2
-rw-r--r--source/Protocol/ProtocolRecognizer.cpp4
-rw-r--r--source/Protocol/ProtocolRecognizer.h2
5 files changed, 13 insertions, 7 deletions
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h
index 97c80ce35..4cf041cdf 100644
--- a/source/Protocol/Protocol.h
+++ b/source/Protocol/Protocol.h
@@ -96,7 +96,7 @@ public:
virtual void SendWeather (eWeather a_Weather) = 0;
virtual void SendWholeInventory (const cInventory & a_Inventory) = 0;
virtual void SendWholeInventory (const cWindow & a_Window) = 0;
- virtual void SendWindowClose (char a_WindowID) = 0;
+ virtual void SendWindowClose (const cWindow & a_Window) = 0;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) = 0;
/// Returns the ServerID used for authentication through session.minecraft.net
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index f09cf7178..8d212a4a2 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -863,11 +863,17 @@ void cProtocol125::SendWholeInventory(const cWindow & a_Window)
-void cProtocol125::SendWindowClose(char a_WindowID)
+void cProtocol125::SendWindowClose(const cWindow & a_Window)
{
+ if (a_Window.GetWindowType() == cWindow::Inventory)
+ {
+ // Do not send inventory-window-close
+ return;
+ }
+
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_WINDOW_CLOSE);
- WriteByte(a_WindowID);
+ WriteByte(a_Window.GetWindowID());
Flush();
}
diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h
index 8b724e036..4191d0793 100644
--- a/source/Protocol/Protocol125.h
+++ b/source/Protocol/Protocol125.h
@@ -73,7 +73,7 @@ public:
virtual void SendWeather (eWeather a_Weather) override;
virtual void SendWholeInventory (const cInventory & a_Inventory) override;
virtual void SendWholeInventory (const cWindow & a_Window) override;
- virtual void SendWindowClose (char a_WindowID) override;
+ virtual void SendWindowClose (const cWindow & a_Window) override;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) override;
virtual AString GetAuthServerID(void) override;
diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp
index 787672286..ad99839e4 100644
--- a/source/Protocol/ProtocolRecognizer.cpp
+++ b/source/Protocol/ProtocolRecognizer.cpp
@@ -556,10 +556,10 @@ void cProtocolRecognizer::SendWholeInventory(const cWindow & a_Window)
-void cProtocolRecognizer::SendWindowClose(char a_WindowID)
+void cProtocolRecognizer::SendWindowClose(const cWindow & a_Window)
{
ASSERT(m_Protocol != NULL);
- m_Protocol->SendWindowClose(a_WindowID);
+ m_Protocol->SendWindowClose(a_Window);
}
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h
index 866a84eb0..8218dbcaa 100644
--- a/source/Protocol/ProtocolRecognizer.h
+++ b/source/Protocol/ProtocolRecognizer.h
@@ -100,7 +100,7 @@ public:
virtual void SendWeather (eWeather a_Weather) override;
virtual void SendWholeInventory (const cInventory & a_Inventory) override;
virtual void SendWholeInventory (const cWindow & a_Window) override;
- virtual void SendWindowClose (char a_WindowID) override;
+ virtual void SendWindowClose (const cWindow & a_Window) override;
virtual void SendWindowOpen (char a_WindowID, char a_WindowType, const AString & a_WindowTitle, char a_NumSlots) override;
virtual AString GetAuthServerID(void) override;