From 4d65ffffc0b6f35ac84e310fd4bc9739ea7e0c0a Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 5 Mar 2012 16:41:57 +0000 Subject: ChunkSender: Chunks are now compressed and sent to clients from a separate threads, proper passive waiting between threads. Not much tested, just appears to work :) git-svn-id: http://mc-server.googlecode.com/svn/trunk@365 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cSignEntity.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'source/cSignEntity.cpp') diff --git a/source/cSignEntity.cpp b/source/cSignEntity.cpp index c181deae2..3f0befc3f 100644 --- a/source/cSignEntity.cpp +++ b/source/cSignEntity.cpp @@ -81,25 +81,17 @@ AString cSignEntity::GetLine( int a_Index ) const -void cSignEntity::SendTo( cClientHandle* a_Client ) +cPacket * cSignEntity::GetPacket(void) { - cPacket_UpdateSign Sign; - Sign.m_PosX = m_PosX; - Sign.m_PosY = (short)m_PosY; - Sign.m_PosZ = m_PosZ; - Sign.m_Line1 = m_Line[0]; - Sign.m_Line2 = m_Line[1]; - Sign.m_Line3 = m_Line[2]; - Sign.m_Line4 = m_Line[3]; - - if ( a_Client != NULL ) - { - a_Client->Send( Sign ); - } - else // broadcast of a_Client == 0 - { - m_World->BroadcastToChunkOfBlock(m_PosX, m_PosY, m_PosZ, &Sign ); - } + cPacket_UpdateSign * Sign = new cPacket_UpdateSign; + Sign->m_PosX = m_PosX; + Sign->m_PosY = (short)m_PosY; + Sign->m_PosZ = m_PosZ; + Sign->m_Line1 = m_Line[0]; + Sign->m_Line2 = m_Line[1]; + Sign->m_Line3 = m_Line[2]; + Sign->m_Line4 = m_Line[3]; + return Sign; } -- cgit v1.2.3