|
Author |
Topic: One-line fix to purge deleted chars' apartments and vehicles |
Title: Member
Posts: 301
Joined: 31 Mar 2007
|
Date Posted: Wed Oct 10, 2018 10:45 pm
Subject: One-line fix to purge deleted chars' apartments and vehicles
|
Hi all, there's a one-line bug fix that can be made to newdb.cpp that enables previously-written world cleanup features to function. This will free up apartment leases and get rid of the *** OVERFLOW *** in the newbie garage. I've outlined it below:
In the newdb.cpp function does_player_exist(long id):
Change
Code: | sprintf(buf, "SELECT idnum FROM pfiles WHERE idnum=%ld;", id); |
To
Code: | sprintf(buf, "SELECT idnum FROM pfiles WHERE idnum=%ld AND name != 'deleted';", id); |
This lets the code differentiate between active and deleted chars when looking up by ID, which in turn triggers the automatic purging of deleted characters' leases, vehicles etc.
-----signature----- I unfortunately can't check these forums very often. If you need to get in touch, you can best reach me at the AwakeMUD Discord server (open to the public!)
|
Post Reply | Quote | Private Message
|
Title: Member
Posts: 301
Joined: 31 Mar 2007
|
Date Posted: Mon Oct 15, 2018 6:17 am
Subject:
|
Looked into this further-- it will also remove deleted chars from guest lists and remove their old shop orders. I suspect that this change will result in significant disk space and save/load time savings due to all the things that will be cleared out here.
I've also analyzed the code for all usages of this function and outlined the impact here to demonstrate that there should be no adverse impact to this change.
This change will impact:
db.cpp's vehicle and order loading (deleted chars' vehs and orders won't load)
house.cpp's guest loading (deleted guests will be wiped) and apartment records (deleted owners will lose their lease)
limits.cpp's vehicle saving (deleted chars' vehs will not save)
This change will not impact:
act.wizard.cpp's do_stat and do_last (these use names instead of IDs)
interpreter's CON_GET_NAME loading (uses name instead of ID)
-----signature----- I unfortunately can't check these forums very often. If you need to get in touch, you can best reach me at the AwakeMUD Discord server (open to the public!)
|
Post Reply | Quote | Private Message
|
Title: Member
Posts: 301
Joined: 31 Mar 2007
|
Date Posted: Tue Oct 16, 2018 2:02 am
Subject:
|
This fix was implemented today-- thanks Che! Newbie garage went from ** OVERFLOW ** to 12 vehicles, and there are once again free apartments at the various complexes.
-----signature----- I unfortunately can't check these forums very often. If you need to get in touch, you can best reach me at the AwakeMUD Discord server (open to the public!)
|
Post Reply | Quote | Private Message
|
|
|
Awakened Worlds Forum Index » AwakeMUD Core Development |
|
All times are GMT
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
The time now is Tue Dec 10, 2019 11:43 pm
|
powered by hailBoards v.1.2.0 ©2006 SPIRE / [based on phpBB©]
|
| |