mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-02-06 14:29:17 +00:00
#54939 removed a part of individual logging code that used the length of the individual's logging list as part of the index for storing a given line of logging. The problem is, that number was important for avoiding collisions in the logging lists. Since the length of an atom's logging list can only ever increase by 1 every time a new line is logged, you were guaranteed to always have a unique index for each new line. Without the length in the index, if any logging event was triggered on the same atom multiple times in the same second (like if someone spoke once willingly and once by force from something like tourettes at the same time), two entries would be logged, but both of them would point to whichever one was processed last. This was most noticeable with wound logging, since the victim would log both the attack itself and the wound it caused at the same time in the same category (LOG_ATTACK), meaning that the wound log would just be turned into a copy of the attack entry, but I believe this is the cause behind most (if not all) of the issues logging has had with duplicating some events and losing others entirely. The fix is simple, just adding the length of the list to the end of the index. This still allows logs to be sorted by timestamp while ensuring that each log entry is unique.