| par.exe cpu usage FIX [message #128083] | 
			Tue, 21 December 2004 06:43   | 
		 
		
			
				
				
				  | 
					
						  
						zunnie
						 Messages: 2959 Registered: September 2003  Location: Netherlands
						
	Karma: 
 
					 | 
					General (2 Stars)  | 
					 
  | 
		 
		 
	 | 
 
	
		The primary reason that par.exe's cpu usage is so damn high sometimes 
is because it logs all kinds of stuff into the BRenBot.dat. 
Players that joined a half year ago are still in the brenbot.dat eventhough its not  
very important for them to be there after such a long time. 
 
The .dat database file doesnt optimize itself so you will have to optimize it yourself 
from time to time. 
 
BRenBot.dat holds the (most important) nickbans, ip-bans, renguard-bans(serial hashes), forcerg,  
recommendations and more so completely deleting it is not an  
option unless you dont care risking a cheater that you banned a century  
ago can rejoin. 
 
First of all you will need the SQLite Editor which you can download at: 
http://www.fanmaps.net/zunnie/brenbot/sqlmanager/SQLiteManagerSetup.exe 
 
So, how do we optimize the database if we cant just delete it? 
 
First close brenbot and make a backup copy of your current brenbot.dat so when you 
fuckup the dat you still have a working backup   
Now open SQLite Manager and open brenbot.dat in your brenbot directory. 
Goto File > Export > SQL 
  
 
Here you will see a list of all brenbots tables and stuff. 
Decide now which tables you want to keep, for the FanMaps servers i choose 
to keep: 
"banlist" 
"force_renguard" 
"ip_ban" 
"modules" 
"rg_ban" 
"rg_stats" 
"users" 
  
 
Select these and then click on "OK" and save it as brenbot_sql.sql for example: 
  
 
 
Now delete BRenBot.dat and restart BRenBot. It will now create a CLEAN new BRenBot.dat 
Wait for the bot to join on IRC, then close brenbot again. 
Now open the clean brenbot.dat with SQLite Manager. 
On the tab "Design" click on the [+] in front of "Tables" so it expands. 
 
Because the new clean brenbot.dat already contains the tables called "banlist", "force_renguard", 
"ip_ban", "modules", "rg_ban", "rg_stats" and "users" you cant 
import the brenbot_sql.sql you just saved just like that. 
In this new clean brenbot.dat you will have to remove these tables  
before you can import your saved brenbot_sql.sql 
Select each one of these tables one by one and "Drop" them via the  
Edit menu in SQLite Manager: 
  
 
Repeat this until you removed all the 'tables' that you previously choose to keep in the brenbot_sql.sql 
 
After doing all this you should see something simular to this: 
  
 
Now its time to import the brenbot_sql.sql with the saved bans, modules, users etc 
Goto File > Import > SQL and import the brenbot_sql.sql 
  
 
Now you have a clean brenbot.dat which will still have the bans and other important 
settings in it. 
 
Result: 
BEFORE 
  
 
AFTER 
  
 
 
  
 
[zunnie]
		
		
 
  
		
 |  
	| 
		
	 | 
 
 
 |