zio fork 1.8.2b-zio15: in-game gags/mutes/silences expire with TimeMode 0
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:
parent
7b3d0ed452
commit
dc5ad30952
4 changed files with 39 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue