From 1e90dad2456f383c2624acc85ab62445440e1156 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 19 Mar 2012 09:37:10 +0000 Subject: Basic cWindow thread-safety git-svn-id: http://mc-server.googlecode.com/svn/trunk@420 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWindow.h | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'source/cWindow.h') diff --git a/source/cWindow.h b/source/cWindow.h index a6885a7cc..d9f4226a6 100644 --- a/source/cWindow.h +++ b/source/cWindow.h @@ -6,6 +6,14 @@ class cPlayer; class cItem; class cWindowOwner; class cClientHandle; +class cPacket; + +typedef std::list cPlayerList; + + + + + class cWindow { public: @@ -49,25 +57,30 @@ public: void SetOwner( cWindowOwner* a_Owner ) { m_Owner = a_Owner; } void SendWholeWindow( cClientHandle* a_Client ); + void BroadcastWholeWindow(void); + void Broadcast(const cPacket & a_Packet); - const std::string & GetWindowTitle() const { return m_WindowTitle; } + const AString & GetWindowTitle() const { return m_WindowTitle; } void SetWindowTitle( const std::string & a_WindowTitle ) { m_WindowTitle = a_WindowTitle; } - const std::list & GetOpenedBy() const { return m_OpenedBy; } - void OwnerDestroyed(); + private: + void Destroy(); int m_WindowID; int m_WindowType; - std::string m_WindowTitle; + AString m_WindowTitle; - cWindowOwner* m_Owner; + cWindowOwner * m_Owner; - std::list m_OpenedBy; - bool m_bInventoryVisible; - int m_NumSlots; - cItem* m_Slots; - cItem* m_DraggingItem; + cCriticalSection m_CS; + cPlayerList m_OpenedBy; + + bool m_bInventoryVisible; + int m_NumSlots; + cItem * m_Slots; + cItem * m_DraggingItem; + bool m_IsDestroyed; }; \ No newline at end of file -- cgit v1.2.3