View Single Post
  #56  
Old 07-22-2004, 10:17 PM
cooter
Fire Beetle
 
Join Date: May 2004
Posts: 3
Default

Meeble, are there tons of open petitions in your database?

When a zone boots up, it loads all the petitions from the database into memory. If you have a lot of petitions, this process can take a little while, sometimes causing zoning clients to think they're disconnected.

If this is your problem, there are two ways to go about rectifying it. 1. You could log on more and answer/delete those petitions often (a pain), or 2. Modify the function to load fewer petitions into the memory (much easier).

If you want to go with (2), here's your fix. zone/petitions.cpp, line 288ish, replace the "if (RunQuery ...)" line with this:

Code:
if (RunQuery(query, MakeAnyLenString(&query, "SELECT petid, charname, accountname, lastgm, petitiontext, zone, urgency, charclass, charrace, charlevel, checkouts, unavailables, ischeckedout, senttime, gmtext FROM petitions ORDER BY senttime ASC LIMIT 0,15"), errbuf, &result))
This code will load the 15 oldest petitions at a time instead of all 4 million of them. The only real downside of doing this is you'll have to delete these old petitions to see the newer ones, but realistically you should be doing that anyways.

(note that I wrote this for a 5.6 server so it's possible, but doubtful, that this may not work if you use a different version)

Hope this helps.