if( !Commands::instance()->getACL( value ) )
if( !Commands::instance()->getACL( value.latin1() ) )
void commandAccount( cUOSocket *socket, const QString &command, const QStringList &args ) throw(){	Q_UNUSED(command);	// Account Create User Pass	// Account Remove User	// Account Set User Pass	// Account Show User Pass	if( args.count() == 0 )	{		socket->sysMessage( tr( "Usage: account <create|remove|set|show>" ) );		return;	}	QString subCommand = args[0].lower();	// Create Accounts	if( subCommand == "create" )	{		// Create a new account		if( args.count() < 3 )		{			socket->sysMessage( tr( "Usage: account create <username> <password>" ) );		} 		else if( Accounts::instance()->getRecord( args[1].left( 30 ) ) )		{			socket->sysMessage( tr( "Account '%1' already exists" ).arg( args[1].left( 30 ) ) );		}		else		{			Accounts::instance()->createAccount( args[1].left( 30 ), args[2].left( 30 ) );			socket->sysMessage( tr( "Account '%1' with password '%2' has been created" ).arg( args[1].left( 30 ) ).arg( args[2].left( 30 ) ) );		}	}	// Remove an Account and all associated characters	else if( subCommand == "remove" )	{		if( args.count() < 2 )		{			socket->sysMessage( tr( "Usage: account remove <username>" ) );		} 		else if( !Accounts::instance()->getRecord( args[1].left( 30 ) ) )		{			socket->sysMessage( tr( "Account '%1' does not exist" ).arg( args[1].left( 30 ) ) );		}		else		{			cAccount *account = Accounts::instance()->getRecord( args[1].left( 30 ) );			QValueVector<P_PLAYER> characters = account->caracterList();			Accounts::instance()->remove( account );			UINT32 i = 0;			for(; i < characters.size(); ++i )				if( characters[i] )					cCharStuff::DeleteChar( characters[i] );						socket->sysMessage( tr( "Account '%1' and %2 characters have been removed" ).arg( args[1].left( 30 ) ).arg( i+1 ) );		}	}	// Set properties of accounts	else if( subCommand == "set" )	{		if( args.count() < 4 )		{			socket->sysMessage( tr( "Usage: account set <username> <key> <value>" ) );		}		else if( !Accounts::instance()->getRecord( args[1].left( 30 ) ) )		{				socket->sysMessage( tr( "Account '%1' does not exist" ).arg( args[1].left( 30 ) ) ); 		}		else		{			cAccount *account = Accounts::instance()->getRecord( args[1].left( 30 ) );			QString key = args[2];			QString value = args[3];			if( key == "password" )			{				account->setPassword( value.left( 30 ) ); // Maximum of 30 Chars allowed				socket->sysMessage( tr( "The password of account '%1' has been set to '%2'" ).arg( account->login() ).arg( value.left( 30 ) ) );			}			else if( key == "block" )			{				if( value.lower() == "on" )				{					account->setBlocked( true );					socket->sysMessage( tr( "Account '%1' has been blocked" ).arg( account->login() ) );				}				else if( value.lower() == "off" )				{					account->setBlocked( false );					socket->sysMessage( tr( "Account '%1' has been unblocked" ).arg( account->login() ) );				}				else				{					bool ok = false;					UINT32 blockTime = hex2dec( value ).toUInt( &ok );					if( ok )					{						account->block( blockTime );						socket->sysMessage( tr( "Account '%1' will be blocked for %2 seconds" ).arg( account->login() ).arg( blockTime ) );					}					else					{						socket->sysMessage( tr( "Usage: account set <username> block <on|off>" ) );					}				}			}			else if( key == "acl" )			{				if( !Commands::instance()->getACL( value ) )				{					socket->sysMessage( tr( "You tried to specify an unknown acl '%1'" ).arg( value ) );				}				else				{					account->setAcl( value );					account->refreshAcl();				}			}			else			{				socket->sysMessage( tr( "Unknown field '%1' for account '%2'" ).arg( args[2] ).arg( account->login() ) );			}		}	}	// Show properties of accounts	else if( subCommand == "show" )	{		if( args.count() < 3 )		{			socket->sysMessage( tr( "Usage: account show <username> <key>" ) );		}		else if( !Accounts::instance()->getRecord( args[1].left( 30 ) ) )		{			socket->sysMessage( tr( "Account '%1' does not exist" ).arg( args[1].left( 30 ) ) );		}		else		{			cAccount *account = Accounts::instance()->getRecord( args[1].left( 30 ) );			QString key = args[2];			if( key == "password" )			{				socket->sysMessage( tr( "The password of account '%1' is '%2'" ).arg( account->login() ).arg( account->password() ) );			}			else if( key == "block" )			{				if( account->isBlocked() )					socket->sysMessage( tr( "Account '%1' is currently blocked" ).arg( account->login() ) );				else if( account->secsToUnblock() )					socket->sysMessage( tr( "Account '%1' will be unblocked in %2 seconds" ).arg( account->login() ).arg( account->secsToUnblock() ) );				else					socket->sysMessage( tr( "Account '%1' is currently not blocked" ).arg( account->login() ) );			}			else if( key == "loginattempts" )			{				socket->sysMessage( tr( "There were %1 unsuccesul login attempts for account '%2'" ).arg( account->loginAttempts() ).arg( account->login() ) );			}			else if( key == "lastlogin" )			{				socket->sysMessage( tr( "The last login of account '%1' was on %2" ).arg( account->login() ).arg( account->lastLogin().toString( Qt::ISODate ) ) );			}			else if( key == "acl" )			{				socket->sysMessage( tr( "The acl of account '%1' is %2" ).arg( account->login() ).arg( account->acl() ) );			}			else if( key == "chars" )			{				QStringList sCharList;				QValueVector< P_PLAYER > pCharList = account->caracterList();				for( UINT32 i = 0; i < pCharList.size(); ++i )					if( pCharList[i] )						sCharList.push_back( QString( "0x%1" ).arg( pCharList[i]->serial(), 8, 16 ) );				socket->sysMessage( tr( "Account '%1' has the following characters: %2" ).arg( account->login() ).arg( sCharList.join( ", " ) ) );			}			else			{				socket->sysMessage( tr( "Unknown field '%1' for account '%2'" ).arg( args[2] ).arg( account->login() ) );			}		}	}}