// Resend the char to all sockets in range
void cNPC::resend( bool clean)
{
	// We are stabled and therefore we arent visible to others
	if( stablemasterSerial() != INVALID_SERIAL )
		return;

	cUOTxRemoveObject remove;
	remove.setSerial(serial_);

	for (cUOSocket *socket = Network::instance()->first(); socket; socket = Network::instance()->next()) {
		if (socket->canSee(this)) {
			cUOTxDrawChar drawChar;
			drawChar.fromChar(this);
			drawChar.setHighlight(notoriety(socket->player()));
			socket->send(&drawChar);

			sendTooltip(socket);

			for (ItemContainer::const_iterator it = content_.begin(); it != content_.end(); ++it) {
				it.data()->sendTooltip(socket);
			}
		} else if (clean) {
			socket->send(&remove);
		}
	}
}
Exemple #2
0
// Resend the char to all sockets in range
void cPlayer::resend( bool clean )
{
	cUOTxRemoveObject remove;
	remove.setSerial( serial() );

	QList<cUOSocket*> sockets = Network::instance()->sockets();
	foreach ( cUOSocket* socket, sockets )
	{
		// Don't send such a packet to ourself
		if ( socket->canSee( this ) )
		{
			if ( socket == socket_ )
			{
				socket_->updatePlayer();
			}

			if ( socket != socket_ || clean )
			{
				cUOTxDrawChar drawChar;
				drawChar.fromChar( this );
				drawChar.setHighlight( notoriety( socket->player() ) );
				socket->send( &drawChar );
				sendTooltip( socket );

				// Send equipment tooltips to other players as well
				for ( ItemContainer::const_iterator it( content_.begin() ); it != content_.end(); ++it )
				{
					it.value()->sendTooltip( socket );
				}
			}
		}
		else if ( socket != socket_ && clean )
		{
			socket->send( &remove );
		}
	}
}