bool CLuaEventPacket::Write(NetBitStreamInterface& BitStream) const { unsigned short usNameLength = static_cast<unsigned short>(m_strName.length()); BitStream.WriteCompressed(usNameLength); BitStream.WriteStringCharacters(m_strName, usNameLength); BitStream.Write(m_ElementID); m_pArguments->WriteToBitStream(BitStream); return true; }
bool CPlayerChangeNickPacket::Write ( NetBitStreamInterface& BitStream ) const { if ( m_pSourceElement ) { // Write the source player id ElementID ID = m_pSourceElement->GetID (); BitStream.Write ( ID ); // Write the nick BitStream.WriteStringCharacters ( m_strNewNick, m_strNewNick.length () ); return true; } return false; }