clConsole.send( "%i) %s [%x]\n", ++i, mSock->player()->name(), mSock->player()->serial() );
clConsole.send( "%i) %s [%x]\n", ++i, mSock->player()->name().latin1(), mSock->player()->serial() );
void interpretCommand( const QString &command ){	cUOSocket *mSock;	int i;	char c = command.latin1()[0];	if (c != 0)	{		c = toupper(c);		if (c == 'S')		{			if (secure)			{				clConsole.send("WOLFPACK: Secure mode disabled. Press ? for a commands list.\n");				secure=0;				return;			}			else			{				clConsole.send("WOLFPACK: Secure mode re-enabled.\n");				secure=1;				return;			}		} else {			if (secure && c != '?')  //Allows help in secure mode.			{				clConsole.send("WOLFPACK: Secure mode prevents keyboard commands! Press 'S' to disable.\n");				return;			}			switch(c)			{			case '\x1B':				keeprun=0;				break;			case 'Q':			case 'q':				clConsole.send("WOLFPACK: Immediate Shutdown initialized!\n");				keeprun=0;				break;			case 'T':			case 't':				endtime=uiCurrentTime+(MY_CLOCKS_PER_SEC*600);				endmessage(0);				break;			case '#':				World::instance()->save();								SrvParams->flush();				break;			case 'D':	// Disconnect account 0 (useful when client crashes)			case 'd':						break;			case 'P':			case 'p':				// Display profiling information				clConsole.send("Performace Dump:\n");				clConsole.send("Network code: %fmsec [%i samples]\n" _ (float)((float)networkTime/(float)networkTimeCount) _ networkTimeCount);				clConsole.send("Timer code: %fmsec [%i samples]\n" _ (float)((float)timerTime/(float)timerTimeCount) _ timerTimeCount);				clConsole.send("Auto code: %fmsec [%i samples]\n" _ (float)((float)autoTime/(float)autoTimeCount) _ autoTimeCount);				clConsole.send("Loop Time: %fmsec [%i samples]\n" _ (float)((float)loopTime/(float)loopTimeCount) _ loopTimeCount);//				clConsole.send("Characters: %i/%i (Dynamic)		Items: %i/%i (Dynamic)\n" _ charcount _ cmem _ itemcount _ imem);				clConsole.send("Simulation Cycles: %f per sec\n" _ (1000.0*(1.0/(float)((float)loopTime/(float)loopTimeCount))));				break;			case 'W':			case 'w':				// Display logged in chars				clConsole.send( "Current Users in the World:\n" );				mSock = cNetwork::instance()->first();				i = 0;								for( mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )				{					if( mSock->player() )					{						clConsole.send( "%i) %s [%x]\n", ++i, mSock->player()->name(), mSock->player()->serial() );					}				}				clConsole.send( "Total Users Online: %d\n", cNetwork::instance()->count() );				break;			case 'A': //reload the accounts file			case 'a':				Accounts::instance()->reload();				break;			case 'r':			case 'R':				reloadScripts();				break;			case '?':				clConsole.send("Console commands:\n");				clConsole.send("	<Esc> or Q: Shutdown the server.\n");				clConsole.send("	T - System Message: The server is shutting down in 10 minutes.\n");				clConsole.send("	# - Save world\n");				clConsole.send("	D - Disconnect Account 0\n");				clConsole.send("	1 - Sysmessage: Attention Players Server being brought down!\n");				clConsole.send("	2 - Broadcast Message 2\n");				clConsole.send("	P - Preformance Dump\n");				clConsole.send("	W - Display logged in characters\n");				clConsole.send("	A - Reload accounts\n");				clConsole.send("	R - Reload scripts\n");				clConsole.send("	S - Toggle Secure mode ");				if (secure)					clConsole.send("[enabled]\n");				else					clConsole.send("[disabled]\n");				clConsole.send("	? - Commands list (this)\n");				clConsole.send("End of commands list.\n");				break;			default:				clConsole.send("WOLFPACK: Key %c [%x] does not preform a fucntion.\n",c,c);				break;			}		}	}}