zio fork 1.8.2b-zio15: in-game gags/mutes/silences expire with TimeMode 0
Some checks are pending
Build and Publish / build (push) Waiting to run
Build and Publish / publish (push) Blocked by required conditions

The in-memory penalty was only cleared when its end time exactly matched the
database row's, which never happens for one given in game (sub-second vs
to-the-second), so it lasted until reconnect. Match by type within 5 seconds,
and stop applying a penalty as soon as it's marked passed.
This commit is contained in:
Astra 2026-10-03 00:15:03 +01:00
parent 7b3d0ed452
commit dc5ad30952
4 changed files with 39 additions and 5 deletions

View file

@ -212,7 +212,15 @@ internal class MuteManager(IDatabaseProvider? databaseProvider)
foreach (var muteRecord in muteRecords)
{
DateTime endDateTime = muteRecord.ends;
PlayerPenaltyManager.RemovePenaltiesByDateTime(slot, endDateTime);
// zio: match by type and approximate end time; see RemovePenaltiesByDateTime.
string muteType = muteRecord.type;
var penaltyType = muteType switch
{
"MUTE" => PenaltyType.Mute,
"SILENCE" => PenaltyType.Silence,
_ => PenaltyType.Gag
};
PlayerPenaltyManager.RemovePenaltiesByDateTime(slot, penaltyType, endDateTime);
}
}