HM-CODE / Haunted-Memories

A repository for Haunted Memories code.
http://www.haunted-memories.net/
BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

Damage and vitae logs showing wrong elapsed time #11

Closed Bradamante closed 13 years ago

Bradamante commented 13 years ago

+damage/log sometimes shows newer entries as having much longer elapsed times than older entries, and aberrant large elapsed times amidst more normal ones. +vitae/log also occasionally shows this problem, but apparently much more rarely.

Examples as of January 1: "See +damage/log on Theodore, Laibah, Yseulte, Ilyse, Annikah, or +vitae/log on Elsa (apr 23 entry) or +vitae/log #6785 "

Loki notes that this might be a good opportunity to change those logs to SQL.

hmmorpheus commented 13 years ago

Confirmed that this is an issue related to the use of singletime().

Singletime() doesn't acknowledge years (and that's why it shows the wrong time). Changing out singletime() for first(exptime()) (note: thank you Chime for showing me THAT one) should fix the display issue.

$+vitae:@pemit %#=header(%N's Vitae Log,ljust(Date - Time,15)[ljust(Elapsed,10)][ljust(Vitae,8)]Comments)[iter(default([pdb(%#,gm)]/log-vitae,No log entries available),%r[ljust(extract(extract(convsecs(setr(v,first(lit(##),:))),2,3),1,2,:),15)][ljust(center(singletime(sub(vsecs(),%qv)),7),10)][ljust(elements(lit(##),2,:),8)][wrap(last(lit(##),:),43,l,,,35)],|)]%r[tail()]

hmmorpheus commented 13 years ago

Staff side:

Original:

$+vitae/log *:@pemit %#=header(name(setr(u,pmatch(%0)))'s Vitae Log,ljust(Date - Time,15)[ljust(Elapsed,10)][ljust(Vitae,8)]Comments)[iter(default([pdb(%qu,gm)]/log-vitae,No log entries available),%r[ljust(extract(extract(convsecs(setr(v,first(lit(##),:))),2,3),1,2,:),15)][ljust(center(singletime(sub(vsecs(),%qv)),7),10)][ljust(elements(lit(##),2,:),8)][wrap(last(lit(##),:),43,l,,,35)],|)]%r[tail()]

&c.vitae.log #8=$+vitae/log *:@pemit %#=header(name(setr(u,pmatch(%0)))'s Vitae Log,ljust(Date - Time,15)[ljust(Elapsed,10)][ljust(Vitae,8)]Comments)[iter(default([pdb(%qu,gm)]/log-vitae,No log entries available),%r[ljust(extract(extract(convsecs(setr(v,first(lit(##),:))),2,3),1,2,:),15)][ljust(center(first(exptime(sub(vsecs(),%qv))),7),10)][ljust(elements(lit(##),2,:),8)][wrap(last(lit(##),:),43,l,,,35)],|)]%r[tail()]

Testing on dev port shows that the switch from singletime to first(exptime()) does have the requested result.

hmmorpheus commented 13 years ago

Follow-up: Every single kind of log is actually vulnerable to this issue, just that it hasn't been mentioned for the other kinds yet. The following objects/attrs need to be updated:

6/C.WILLPOWER.LOG

8/C.VITAE.LOG

8/C.HUNT.LOG

8/C.ESSENCE.LOG

8/C.WILLPOWER.LOG

8/C.+MANA.LOG

8/C.+GLAMOUR.LOG

12395/C.DAMAGELOG

3250/C.HUNT.LOG

3250/C.VITAE.LOG

3245/C.ESSENCE.LOG

6826/C.+MANA

11985/C.+GLAMOUR

All of these have been altered on the dev port side and I have a flatfile I will email to Loki with these items altered as proposed.

hmmorpheus commented 13 years ago

Editting this:

[ljust(center(singletime(sub(vsecs(),%qv)),7),10)]

to this:

[ljust(center(first(exptime(sub(vsecs(),%qv))),7),10)]

Will fix the staff-side versions of the above commands, which appear to be on the Immortal flagged #10423 rather than #8.

hmmorpheus commented 13 years ago

The attribute on #10423/c.damage.log has been updated to include the exptime() fix, thus making all logs now display properly.