-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from nwesterhausen/dev
1.5.0 Switch to LiteDB
- Loading branch information
Showing
24 changed files
with
874 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace DiscordConnector.Leaderboards | ||
{ | ||
internal class BottomPlayers : Base | ||
{ | ||
public override void SendLeaderboard() | ||
{ | ||
List<Tuple<string, string>> leaderFields = new List<Tuple<string, string>>(); | ||
|
||
var deaths = Records.Helper.BottomNResultForCategory(Records.Categories.Death, Plugin.StaticConfig.IncludedNumberOfRankings); | ||
var sessions = Records.Helper.BottomNResultForCategory(Records.Categories.Join, Plugin.StaticConfig.IncludedNumberOfRankings); | ||
var shouts = Records.Helper.BottomNResultForCategory(Records.Categories.Shout, Plugin.StaticConfig.IncludedNumberOfRankings); | ||
var pings = Records.Helper.BottomNResultForCategory(Records.Categories.Ping, Plugin.StaticConfig.IncludedNumberOfRankings); | ||
|
||
|
||
|
||
if (Plugin.StaticConfig.RankedDeathLeaderboardEnabled && deaths.Count > 0) | ||
{ | ||
leaderFields.Add(Tuple.Create("Deaths", Leaderboard.RankedCountResultToString(deaths))); | ||
} | ||
if (Plugin.StaticConfig.RankedSessionLeaderboardEnabled && sessions.Count > 0) | ||
{ | ||
leaderFields.Add(Tuple.Create("Sessions", Leaderboard.RankedCountResultToString(sessions))); | ||
} | ||
if (Plugin.StaticConfig.RankedShoutLeaderboardEnabled && shouts.Count > 0) | ||
{ | ||
leaderFields.Add(Tuple.Create("Shouts", Leaderboard.RankedCountResultToString(shouts))); | ||
} | ||
if (Plugin.StaticConfig.RankedPingLeaderboardEnabled && pings.Count > 0) | ||
{ | ||
leaderFields.Add(Tuple.Create("Pings", Leaderboard.RankedCountResultToString(pings))); | ||
} | ||
if (leaderFields.Count > 0) | ||
{ | ||
string discordContent = MessageTransformer.FormatLeaderboardHeader(Plugin.StaticConfig.LeaderboardBottomPlayersHeading, Plugin.StaticConfig.IncludedNumberOfRankings); | ||
DiscordApi.SendMessageWithFields(discordContent, leaderFields); | ||
} | ||
else | ||
{ | ||
Plugin.StaticLogger.LogInfo("Not sending a leaderboard because theirs either no leaders, or nothing allowed."); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.