cwmWorldState->savenewworld(1);
cwmWorldState->savenewworld();
void racProcessInput(int s){	char inp[1024];		int i, j = 0;	for (i = 0; i < inputptrs[s]; i++)	{		if (inputbufs[s][i] != '\x8') 			inp[j++] = inputbufs[s][i];		else 			j = max(0, j-1);	}		inp[j] = '\0';		string inputbuffer(inp);		inputptrs[s] = 0;		switch (status[s])	{	case RACST_CHECK_USR:		username[s] = inputbuffer;		racPrintf(s, "password : ");		status[s] = RACST_CHECK_PWD;		return;	case RACST_CHECK_PWD:		if (!Accounts->RemoteAdmin(Accounts->Authenticate(username[s], inputbuffer)))		{			racPrintf(s, "\r\nAccess Denied.");			status[s] = RACST_ACCESS_DENIED;			racDisconnect(s);			return;		}		else 		{			status[s] = RACST_STDIN;			racPrintf(s, "\r\n", SrvParams->serverList()[0].sServer.c_str());			racPrintf(s, "\r\n------------------------------------------------------------------------\n\r");			racPrintf(s, "Welcome to the %s administration console\n\r", SrvParams->serverList()[0].sServer.c_str());			racPrintf(s, "\r\nType HELP to receive help on commands.\r\n");			racPrintf(s, "\n\r");			return;		}		break;	case RACST_STDIN:		if (inputbuffer == "pdump")		{			racPrintf(s, "Performace Dump:\r\n");					sprintf((char*)temp, "Network code: %fmsec [%i]" _(float)((float)networkTime/(float)networkTimeCount) _ networkTimeCount);			racPrintf(s, "%s\r\n", (char*) temp);					sprintf((char*)temp, "Timer code: %fmsec [%i]" _(float)((float)timerTime/(float)timerTimeCount) _ timerTimeCount);			racPrintf(s, "%s\r\n", (char*) temp);					sprintf((char*)temp, "Auto code: %fmsec [%i]" _(float)((float)autoTime/(float)autoTimeCount) _ autoTimeCount);			racPrintf(s, "%s\r\n", (char*) temp);					sprintf((char*)temp, "Loop Time: %fmsec [%i]" _(float)((float)loopTime/(float)loopTimeCount) _ loopTimeCount);			racPrintf(s, "%s\r\n", (char*) temp);					sprintf((char*)temp, "Simulation Cycles/Sec: %f" _(1000.0*(1.0/(float)((float)loopTime/(float)loopTimeCount))));			racPrintf(s, "%s\r\n", (char*) temp);			return;		}		else if (inputbuffer == "who")		{			if (now == 0)			{				racPrintf(s, "There are no users connected.\n\r");				return;			}					int i, j = 0;			racPrintf(s, "Current Users in the World:\r\n");			for (i = 0; i < now; i++)			{				if (perm[i]) // Keeps NPC's from appearing on the list				{					j++;					sprintf((char*)temp, "    %i) %s [%8x]\r\n", (j - 1), currchar[i]->name.c_str(), currchar[i]->serial);					racPrintf(s, (char*)temp);				}			}				sprintf((char*)temp, "Total Users Online: %d\n\r", j);			racPrintf(s, (char*)temp);			racPrintf(s, "End of userlist\r\n");			return;		}			else if (inputbuffer == "quit" || inputbuffer == "exit")		{			racDisconnect(s);			return; 		}		else if (inputbuffer == "help" || inputbuffer == "?")		{			racPrintf(s, "! <msg>              - broadcasts <msg> to everyone\r\n");			racPrintf(s, "addacct <name>,<pwd> - creates a new account\r\n");			racPrintf(s, "broadcast <msg>      - broadcasts <msg> to everyone\r\n");			racPrintf(s, "exit                 - close the connection\r\n");			racPrintf(s, "pdump                - displays performance dump\r\n");			racPrintf(s, "quit                 - close the connection\r\n");			racPrintf(s, "save                 - saves the world\r\n");			racPrintf(s, "shutdown             - shuts the server\r\n");			racPrintf(s, "reload               - reloads server's scripts and ini file\r\n");			racPrintf(s, "who                  - displays logon players\r\n");			return;		}		else if (inputbuffer == "save")		{			if (!cwmWorldState->Saving())			{				clConsole.send("Saving worldfile...");				racPrintf(s, "Saving worldfile...");				cwmWorldState->savenewworld(1);				saveserverscript();				clConsole.send("Done!\n");				racPrintf(s, "[DONE]\r\n");			}				return;		}		else if (inputbuffer == "shutdown")		{			clConsole.send("WOLFPACK: Immediate Shutdown initialized from RAC!\n");			racPrintf(s, "Bye! :)\r\n\r\n");			keeprun = 0;			return;		}		else if (inputbuffer.find("broadcast") == 0 || inputbuffer.find("!") == 0 )		{			string param;			int pos = inputbuffer.find_first_of(" ")+1;			if (pos != 0)				param = inputbuffer.substr(pos);			if ((param.length() == 0))			{				racPrintf(s, "Syntax is : BROADCAST <message>\r\nExample : BROADCAST Warning restarting server!\r\n\n");				return;			}			sysbroadcast((char*)param.c_str()); // System broadcast in bold text		}		else if (inputbuffer.find("addacct") == 0)		{			string param1, param2;			int pos = inputbuffer.find_first_of(" ")+1;			if (pos != 0)				param1 = inputbuffer.substr(pos, inputbuffer.size()-inputbuffer.find_first_of(",")-1);			pos = inputbuffer.find_first_of(",")+1;			if (pos != 0)				param2 = inputbuffer.substr(pos);			if (param1.length() == 0 || param2.length() == 0)			{				racPrintf(s, "Syntax is : ADDACCT <name>,<password>\r\nExample : ADDACCT administrator,password\r\n");				return;			}			int acct = Accounts->CreateAccount(param1, param2);			racPrintf(s, "Account %d created\r\n  Name : %s\r\n  Pass : %s\r\n\n", acct, (char*)param1.c_str(), (char*)param2.c_str());			return;		}		else if (inputbuffer == "reload")		{			racPrintf(s, "WOLFPACK: Reloading accounts file...");			Accounts->LoadAccounts();			racPrintf(s, "Done!\r\n");			racPrintf(s, "WOLFPACK: Reloading Server.scp, Spawn.scp, and Regions.scp....");			loadspawnregions();			loadregions();			loadmetagm();			loadmenuprivs();			loadserverscript();			racPrintf(s, " Done!\r\n");			racPrintf(s, "WOLFPACK: Reloading IP Blocking rules...");			Network->LoadHosts_deny();			racPrintf(s, "Done\r\n");		}		else			racPrintf(s, "Command unknown. Please do not use spaces before/after the command.\r\n\n");		break;	default:		return;	}	}