Skip to content
This repository has been archived by the owner on May 6, 2023. It is now read-only.

Commit

Permalink
Updated to match release candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
KarlOfDuty committed May 24, 2020
1 parent a071a8b commit c812f37
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 98 deletions.
2 changes: 1 addition & 1 deletion SCPDiscordPlugin/BotListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public BotListener(SCPDiscord plugin)
var message = "```md\n# Players online (" + (plugin.Server.NumPlayers - 1) + "):\n";
foreach (Player player in plugin.Server.GetPlayers())
{
message += player.Name.PadRight(35) + "<" + player.SteamId + ">" + "\n";
message += player.Name.PadRight(35) + "<" + player.UserId + ">" + "\n";
}
message += "```";
NetworkSystem.QueueMessage(channel + message);
Expand Down
2 changes: 1 addition & 1 deletion SCPDiscordPlugin/Commands/GrantReservedSlotCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public string[] OnCall(ICommandSender sender, string[] args)
try
{
Player player = SCPDiscord.plugin.Server.GetPlayers(args[0]).First();
new ReservedSlot(player.IpAddress, player.SteamId, player.Name + ", added via SCPDiscord " + DateTime.Now).AppendToFile();
new ReservedSlot(player.IpAddress, player.UserId, player.Name + ", added via SCPDiscord " + DateTime.Now).AppendToFile();
}
catch (InvalidOperationException)
{
Expand Down
8 changes: 1 addition & 7 deletions SCPDiscordPlugin/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class Config
{
{ "settings.playercount", true },
{ "settings.verbose", true },
{ "settings.debug", false },
{ "settings.debug", true },
{ "settings.metrics", true },
{ "settings.configvalidation", true },
{ "settings.rolesync", false }
Expand Down Expand Up @@ -195,7 +195,6 @@ internal static void Reload(SCPDiscord plugin)
{
try
{
plugin.Verbose("Reading " + node.Key);
configStrings[node.Key] = json.SelectToken(node.Key).Value<string>();
}
catch (ArgumentNullException)
Expand All @@ -212,7 +211,6 @@ internal static void Reload(SCPDiscord plugin)
{
try
{
plugin.Verbose("Reading " + node.Key);
configInts[node.Key] = json.SelectToken(node.Key).Value<int>();
}
catch (ArgumentNullException)
Expand All @@ -229,7 +227,6 @@ internal static void Reload(SCPDiscord plugin)
{
try
{
plugin.Verbose("Reading " + node.Key);
configBools[node.Key] = json.SelectToken(node.Key).Value<bool>();
}
catch (ArgumentNullException)
Expand All @@ -246,7 +243,6 @@ internal static void Reload(SCPDiscord plugin)
{
try
{
plugin.Verbose("Reading " + node.Key);
configArrays[node.Key] = json.SelectToken(node.Key).Value<JArray>().Values<string>().ToArray();
}
catch (ArgumentNullException)
Expand All @@ -263,7 +259,6 @@ internal static void Reload(SCPDiscord plugin)
{
try
{
plugin.Verbose("Reading " + node.Key);
configDicts[node.Key] = json.SelectToken(node.Key).Value<JArray>().ToDictionary(k => ((JObject)k).Properties().First().Name, v => v.Values().First().Value<string>());
}
catch (ArgumentNullException)
Expand All @@ -278,7 +273,6 @@ internal static void Reload(SCPDiscord plugin)
// Read rolesync system
try
{
plugin.Verbose("Reading rolesync");
plugin.roleSync.roleDictionary = json.SelectToken("rolesync").Value<JArray>().ToDictionary(k => ((JObject)k).Properties().First().Name, v => v.Values().First().Value<JArray>().Values<string>().ToArray());
}
catch (ArgumentNullException)
Expand Down
8 changes: 4 additions & 4 deletions SCPDiscordPlugin/EventListeners/AdminEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void OnAdminQuery(AdminQueryEvent ev)
{ "ipaddress", ev.Admin.IpAddress },
{ "name", ev.Admin.Name },
{ "playerid", ev.Admin.PlayerId.ToString() },
{ "steamid", ev.Admin.SteamId },
{ "steamid", ev.Admin.GetParsedUserID() },
{ "class", ev.Admin.TeamRole.Role.ToString() },
{ "team", ev.Admin.TeamRole.Team.ToString() },
{ "handled", ev.Handled.ToString() },
Expand All @@ -49,7 +49,7 @@ public void OnAuthCheck(AuthCheckEvent ev)
{ "ipaddress", ev.Requester.IpAddress },
{ "name", ev.Requester.Name },
{ "playerid", ev.Requester.PlayerId.ToString() },
{ "steamid", ev.Requester.SteamId },
{ "steamid", ev.Requester.GetParsedUserID() },
{ "class", ev.Requester.TeamRole.Role.ToString() },
{ "team", ev.Requester.TeamRole.Team.ToString() }
};
Expand All @@ -69,7 +69,7 @@ public void OnBan(BanEvent ev)
{ "playeripaddress", ev.Player.IpAddress },
{ "playername", ev.Player.Name },
{ "playerplayerid", ev.Player.PlayerId.ToString() },
{ "playersteamid", ev.Player.SteamId },
{ "playersteamid", ev.Player.GetParsedUserID() },
{ "playerclass", ev.Player.TeamRole.Role.ToString() },
{ "playerteam", ev.Player.TeamRole.Team.ToString() },
{ "issuer", ev.Issuer }
Expand All @@ -94,7 +94,7 @@ public void OnBan(BanEvent ev)
{ "playeripaddress", ev.Player.IpAddress },
{ "playername", ev.Player.Name },
{ "playerplayerid", ev.Player.PlayerId.ToString() },
{ "playersteamid", ev.Player.SteamId },
{ "playersteamid", ev.Player.GetParsedUserID() },
{ "playerclass", ev.Player.TeamRole.Role.ToString() },
{ "playerteam", ev.Player.TeamRole.Team.ToString() }
};
Expand Down
4 changes: 2 additions & 2 deletions SCPDiscordPlugin/EventListeners/EnvironmentEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void OnStartCountdown(WarheadStartEvent ev)
{ "ipaddress", ev.Activator.IpAddress },
{ "name", ev.Activator.Name },
{ "playerid", ev.Activator.PlayerId.ToString() },
{ "steamid", ev.Activator.SteamId },
{ "steamid", ev.Activator.GetParsedUserID() },
{ "class", ev.Activator.TeamRole.Role.ToString() },
{ "team", ev.Activator.TeamRole.Team.ToString() }
};
Expand Down Expand Up @@ -88,7 +88,7 @@ public void OnStopCountdown(WarheadStopEvent ev)
{ "ipaddress", ev.Activator.IpAddress },
{ "name", ev.Activator.Name },
{ "playerid", ev.Activator.PlayerId.ToString() },
{ "steamid", ev.Activator.SteamId },
{ "steamid", ev.Activator.GetParsedUserID() },
{ "class", ev.Activator.TeamRole.Role.ToString() },
{ "team", ev.Activator.TeamRole.Team.ToString() }
};
Expand Down
Loading

0 comments on commit c812f37

Please sign in to comment.