Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
Patch v4.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
K4ryuu committed May 11, 2024
1 parent e9a4b11 commit c5dd9c2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-- 2023.05.11 - V4.2.1

- fix: Toplist placements is now fetched every 5 minutes instead of the mistake 5 seconds
- fix: Do not try to fetch placements if noone is online to do for
- fix: Removed a duplicated save
- fix: Removed a debug message leftover

-- 2023.05.09 - V4.2.0

- feat: Toplist placement for ranks can now be displayed on scoreboard with new settings
Expand Down
9 changes: 5 additions & 4 deletions K4-System/src/Module/ModuleRank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,21 @@ public void Initialize(bool hotReload)

if (Config.RankSettings.DisplayToplistPlacement)
{
reservePlacementTimer = plugin.AddTimer(5, () =>
reservePlacementTimer = plugin.AddTimer(300, () =>
{
string query = $@"SELECT steam_id,
(SELECT COUNT(*) FROM `{Config.DatabaseSettings.TablePrefix}k4ranks`
WHERE `points` > (SELECT `points` FROM `{Config.DatabaseSettings.TablePrefix}k4ranks` WHERE `steam_id` = t.steam_id)) AS playerPlace
FROM `{Config.DatabaseSettings.TablePrefix}k4ranks` t
WHERE steam_id IN @SteamIds";
var steamIds = plugin.K4Players.Where(p => p.IsValid && p.IsPlayer && p.rankData != null)
var steamIds = plugin.K4Players.Where(p => p.IsValid && p.IsPlayer && p.rankData != null && p.SteamID.ToString().Length == 17)
.Select(p => p.SteamID)
.ToArray();
if (steamIds.Length == 0)
return;
Task.Run(async () =>
{
try
Expand Down Expand Up @@ -96,7 +98,6 @@ public void Initialize(bool hotReload)
});
}, TimerFlags.REPEAT);
}

}

public void Release(bool hotReload)
Expand Down
7 changes: 1 addition & 6 deletions K4-System/src/Plugin/PluginBasics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,7 @@ public void Initialize_Events()
RegisterListener<Listeners.OnMapEnd>(() =>
{
GameRules = null;
Task.Run(async () =>
{
await SaveAllPlayersDataAsync();
await PurgeTableRowsAsync();
Logger.LogCritical("Map ended, all player data saved and table rows purged");
});
Task.Run(async () => await PurgeTableRowsAsync());
});
}

Expand Down
2 changes: 1 addition & 1 deletion K4-System/src/Plugin/PluginManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed partial class Plugin : BasePlugin

public override string ModuleAuthor => "K4ryuu";

public override string ModuleVersion => "4.2.0 " +
public override string ModuleVersion => "4.2.1 " +
#if RELEASE
"(release)";
#else
Expand Down

0 comments on commit c5dd9c2

Please sign in to comment.