- Minor changes
- Added `css_gravity` command
- Added `css_money` command
- Changed Utc time to LocalTime
- Updated translations (ChatGPT generated)
- Updated css version
This commit is contained in:
Dawid Bepierszcz
2024-03-07 13:34:31 +01:00
parent da6fb2fc22
commit 2ab2f9c4dc
27 changed files with 731 additions and 489 deletions

View File

@@ -37,7 +37,7 @@ public class PlayerPenaltyManager
{
//Console.WriteLine($"Found penalties for player with slot {slot} and penalty type {penaltyType}");
DateTime now = DateTime.UtcNow;
DateTime now = DateTime.UtcNow.ToLocalTime();
// Check if any active penalties exist
foreach (var penalty in penaltiesList.ToList())
@@ -115,7 +115,7 @@ public class PlayerPenaltyManager
// Remove all expired penalties for all players and penalty types
public void RemoveExpiredPenalties()
{
DateTime now = DateTime.UtcNow;
DateTime now = DateTime.UtcNow.ToLocalTime();
foreach (var kvp in penalties.ToList()) // Use ToList to avoid modification while iterating
{
var playerSlot = kvp.Key;
@@ -124,7 +124,7 @@ public class PlayerPenaltyManager
// Remove expired penalties for the player
foreach (var penaltiesList in penaltyDict.Values)
{
penaltiesList.RemoveAll(p => p.Duration > 0 && now >= p.EndDateTime.AddSeconds(p.Duration));
penaltiesList.RemoveAll(p => p.Duration > 0 && now >= p.EndDateTime.AddSeconds(p.Duration).ToLocalTime());
}
// Remove player slot if no penalties left