Dead Players

I have a piece of code that moves all dead chars from character_data to dead_characters every restart. Duplicate your character_data into a new table and rename it to dead_characters. Then truncate the table so all current data in it is removed (make sure you don't truncate character_data!). Put this code in whatever function you execute on restarts for your server maintenance. It's probably pCleanup for you unless you've been tweaking things.

Code:
INSERT INTO `dead_characters` SELECT * FROM `character_data` WHERE `Alive` != '1';
DELETE FROM `character_data` WHERE Alive = '0';

This will copy all dead people from character_data into dead_characters and then delete the dead characters from character_data. Essentially, it moves the dead characters into a new table.

It's completely non-essential. A standard mysql table can cope with several hundred thousand or even millions of entries before it encounters any performance issues, I just use it to keep things organised.
 
i like being more effective :D you dont need another table to store dead people :)

DELETE FROM `character_data` WHERE Alive = '0';
 
I store dead characters so I can track what has been happening. It's useful to know who died when a script kiddie has killed half your online players. My players seem to think the extra few MB of data is worth it anyhow :)
 
I am getting more desync on the server as the DB grows, will give this a shot.

Also, some people het shot now on the server, the kill message shows, but they are still running around for a few minutes after that, even with broken legs. Any idea what might be causing this?
 
Back
Top