for ( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next())
for ( cUOSocket *mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next())
bool InputSpeech( cUOSocket *socket, P_PLAYER pChar, const QString &speech ){	if( pChar->inputMode() == cPlayer::enNone )		return false;	P_ITEM pItem = FindItemBySerial( pChar->inputItem() );	if( !pItem )		return false;	bool ok;	INT32 num = speech.toInt( &ok ); // Generally try to convert it	QString notification;	switch (pChar->inputMode())	{	// Pricing an item - PlayerVendors	case cPlayer::enPricing:		if (ok)		{//			pItem->setPrice( num );//			socket->sysMessage( tr( "This item's price has been set to %1." ).arg( num ) );			socket->sysMessage( "Ops, sorry not implemented" );		}		else			socket->sysMessage( tr( "You have to enter a numeric price" ) );		pChar->setInputMode(cPlayer::enDescription);		socket->sysMessage( tr( "Enter a description for this item." ) );		break;	// Describing an item	case cPlayer::enDescription:		socket->sysMessage( "Description is not used anywhere :( not implemented right now" );		socket->sysMessage( tr( "This item is now described as %1." ).arg( speech ) );		pChar->setInputMode(cPlayer::enNone);		pChar->setInputItem(INVALID_SERIAL);		break;	// Renaming ourself	case cPlayer::enNameDeed: 		pChar->setName( speech );		socket->sysMessage( tr( "Your new name is: %1" ).arg( speech ) );		pChar->setInputMode(cPlayer::enNone);		pChar->setInputItem(INVALID_SERIAL);		break;	// Renaming a house sign	case cPlayer::enHouseSign:		pItem->setName( speech ); 		socket->sysMessage( tr( "Your house has been renamed to: %1" ).arg( speech ) );		pChar->setInputMode(cPlayer::enNone);		pChar->setInputItem(INVALID_SERIAL);		break;	// Paging a GM	case cPlayer::enPageGM:		{			cPage* pPage = new cPage( pChar->serial(), PT_GM, speech, pChar->pos() );			cPagesManager::getInstance()->push_back( pPage );			notification = tr( "GM Page from %1: %2" ).arg( pChar->name() ).arg( speech );						for ( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next())				if( mSock->player() && mSock->player()->isGM() )					mSock->sysMessage( notification );								if( cNetwork::instance()->count() > 0 )					socket->sysMessage( tr( "Available Game Masters have been notified of your request." ) );				else					socket->sysMessage( tr( "There was no Game Master available, page queued." ) );								pChar->setInputMode(cPlayer::enNone);		}		break;			// Paging a Counselor	case cPlayer::enPageCouns:		{			cPage* pPage = new cPage( pChar->serial(), PT_COUNSELOR, speech, pChar->pos() );			cPagesManager::getInstance()->push_back( pPage );			notification = tr( "Counselor Page from %1: %2" ).arg( pChar->name() ).arg( speech );						for ( cUOSocket *mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next())				if( mSock->player() && (socket->player()->isCounselor() || socket->player()->isGM()) )					mSock->sysMessage( notification );								if( cNetwork::instance()->count() > 0 )					socket->sysMessage( tr( "Available Counselors have been notified of your request." ) );				else					socket->sysMessage( tr( "There was no Counselor available, page queued." ) );								pChar->setInputMode(cPlayer::enNone);		}		break;	default:		break;	// do nothing	}		return true;}