meaglyn wrote...
FunkySwerve wrote...
The added checks are to prevent spamming of Exports. ForceDelayedSave is as follows, and does the same:
ForceSave presumably just does the ExportSingleCharacter?
Sorry, overlooked that. It has a few checks, like the polymorph issue Shad mentioned:
void ForceSave (object oPC, int bDelayed=FALSE) {
if (!GetIsPC(oPC) || GetIsDM(oPC))
return;
if (bDelayed) {
int nUptime = GetLocalInt(GetModule(), "uptime");
int nDelayedSave = GetLocalInt(oPC, "DelayedSave");
if (nDelayedSave == nUptime)
SetLocalInt(oPC, "DelayedSave", nUptime + 1);
}
if (GetLocalInt(oPC, "DebugForceSave")) {
int nUptime = GetLocalInt(GetModule(), "uptime");
SendMessageToPC(oPC, "<cþþþ>FORCE SAVE " + IntToString(nUptime) + "</c>");
}
RemoveEffectsOfType(EFFECT_TYPE_POLYMORPH, oPC);
ExportSingleCharacter(oPC);
}
[edit: added this one] Is that the item's area or the loser's area in the unacquire test?
Sorry, here are the declarations:
object oItem = GetModuleItemLost();
object oLoser = GetModuleItemLostBy();
object oArea = GetArea(oItem);
object oPCArea = GetArea(oLoser);
string sResRef = GetResRef(oItem);
int nItType = GetBaseItemType(oItem);
object oPossessor = GetItemPossessor(oItem);
That can get a bit tricky, as there may be times when you don't want to autosave, like when they're riffling through their bank items, and it autosaves when they close the chest (another potential ex+pl*oit there). Here are the other two spots where FDS is used in our mod, within a few lines of each other in onacquire:
This other one you mention here is along the same lines. If you take stuff out of or put stuff in the vault
and then cause a crash you get duplicates? Or is this something different?
That one is somewhat idiosyncratic to our vault system. We only allow saving at particular junctures during vault use - all by the bank vault system itself, to close du+ping loopholes. It all boils down to the code you're using. Some of the stuff, we only found due to heavy traffic which exposed vulnerabilities. Others are just common-sense coding measures to block easy du*ping tricks.
Funky