Skip to content

Commit

Permalink
2.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
terminator-97 committed Sep 3, 2020
1 parent 00ee4f0 commit 43e7ff4
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SCPUtils/Commands/Help.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
string text = "";
text = $"<color=#1BBC9B>User commands:</color> \n" +
"<color=#1BBC9B>.scputils_info, .scputils_change_nickname, .scputils_change_color, .scputils_show_badge, .scputils_hide_badge, .scputils_my_info</color>";
if (CommandExtensions.IsAllowed(((CommandSender)sender).SenderId, "scputils.help") && ((CommandSender)sender).FullPermissions) text += "\n<color=#FFD700>Administration commands (Remote Admin): </color>\n" +
if (CommandExtensions.IsAllowed(((CommandSender)sender).SenderId, "scputils.help") || ((CommandSender)sender).FullPermissions) text += "\n<color=#FFD700>Administration commands (Remote Admin): </color>\n" +
"<color=#FFD700>scputils_player_info, scputils_player_list, scputils_player_reset_preferences, scputils_player_reset, scputils_set_color, scputils_set_name, scputils_set_badge, scputils_revoke_badge, scputils_play_time, scputils_whitelist_asn, scputils_unwhitelist_asn, scputils_enable_suicide_warns, scputils_disable_suicide_warns, scputils_global_edit, scputils_player_edit, scputils_player_delete</color>";
response = text;
return true;
Expand Down
4 changes: 4 additions & 0 deletions SCPUtils/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ public class Configs : IConfig

public Dictionary<Team, List<ZoneType>> CuffedSafeZones { get; private set; } = new Dictionary<Team, List<ZoneType>>();

[Description("With which SCPs users are allowed to speak using V to humans without any badge (remove the disallowed SCPs)? (This will bypass permissions check so everyone will be able to speak with those SCPs regardless rank)")]

public List<RoleType> AllowedScps { get; private set; } = new List<RoleType>() { RoleType.Scp049, RoleType.Scp0492, RoleType.Scp079, RoleType.Scp096, RoleType.Scp106, RoleType.Scp173, RoleType.Scp93953, RoleType.Scp93989 };


public void ConfigValidator()
{
Expand Down
7 changes: 5 additions & 2 deletions SCPUtils/Functions/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ internal void OnPlayerDeath(DyingEventArgs ev)

internal void OnRoundEnded(RoundEndedEventArgs ev) => TemporarilyDisabledWarns = true;

internal void OnWaitingForPlayers() => TemporarilyDisabledWarns = false;
internal void OnWaitingForPlayers()
{
TemporarilyDisabledWarns = false;
}

internal void On079TeslaEvent(InteractingTeslaEventArgs ev) => lastTeslaEvent = DateTime.Now;

Expand Down Expand Up @@ -62,7 +65,7 @@ internal void OnPlayerJoin(JoinedEventArgs ev)
if (databasePlayer.FirstJoin == DateTime.MinValue) databasePlayer.FirstJoin = DateTime.Now;
if (pluginInstance.Config.WelcomeEnabled) ev.Player.Broadcast(pluginInstance.Config.WelcomeMessageDuration, pluginInstance.Config.WelcomeMessage, Broadcast.BroadcastFlags.Normal);
if (!string.IsNullOrEmpty(databasePlayer.CustomNickName) && databasePlayer.CustomNickName != "None") ev.Player.DisplayNickname = databasePlayer.CustomNickName;
if (pluginInstance.Config.ASNBlacklist.Contains(ev.Player.ReferenceHub.characterClassManager.Asn) && !databasePlayer.ASNWhitelisted) ev.Player.Kick($"Auto-Kick: {pluginInstance.Config.AsnKickMessage}", "SCPUtils");
if (pluginInstance.Functions.CheckAsnPlayer(ev.Player)) ev.Player.Kick($"Auto-Kick: {pluginInstance.Config.AsnKickMessage}", "SCPUtils");
else pluginInstance.Functions.PostLoadPlayer(ev.Player);
}

Expand Down
10 changes: 9 additions & 1 deletion SCPUtils/Functions/Functions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void AutoBanPlayer(Exiled.API.Features.Player player)
player.GetDatabasePlayer().TotalScpSuicideBans++;
if (pluginInstance.Config.MultiplyBanDurationEachBan == true) duration = player.GetDatabasePlayer().TotalScpSuicideBans * pluginInstance.Config.AutoBanDuration * 60;
else duration = pluginInstance.Config.AutoBanDuration * 60;
if (pluginInstance.Config.BroadcastSanctions) BroadcastSuicideQuitAction($"<color=blue><SCPUtils> {player.Nickname} ( {player.Role} ) has been <color=red>BANNED</color> from the server for exceeding Quits / Suicides (as SCP) limit. Duration: {duration} mitutes</color>");
if (pluginInstance.Config.BroadcastSanctions) BroadcastSuicideQuitAction($"<color=blue><SCPUtils> {player.Nickname} ( {player.Role} ) has been <color=red>BANNED</color> from the server for exceeding Quits / Suicides (as SCP) limit. Duration: {duration / 60} mitutes</color>");
player.Ban(duration, $"Auto-Ban: {string.Format(pluginInstance.Config.AutoBanMessage, duration)}", "SCPUtils");
}

Expand Down Expand Up @@ -185,5 +185,13 @@ public bool CheckSafeZones(Exiled.API.Features.Player player)

}

public bool CheckAsnPlayer(Exiled.API.Features.Player player)
{
var databasePlayer = player.GetDatabasePlayer();
if (pluginInstance.Config.ASNBlacklist == null) return false;
if (pluginInstance.Config.ASNBlacklist.Contains(player.ReferenceHub.characterClassManager.Asn) && !databasePlayer.ASNWhitelisted) return true;
else return false;
}

}
}
1 change: 1 addition & 0 deletions SCPUtils/Patches/SCPSpeak.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public static void Prefix(DissonanceUserSetup __instance, bool value)
{
var player = Exiled.API.Features.Player.Get(__instance.gameObject);
if (string.IsNullOrEmpty(player?.UserId) || player.Team != Team.SCP) return;
else if (ScpUtils.StaticInstance.Config.AllowedScps.Contains(player.Role)) { __instance.MimicAs939 = value; return; }
else if (string.IsNullOrEmpty(ServerStatic.GetPermissionsHandler()._groups.FirstOrDefault(g => g.Value == player.ReferenceHub.serverRoles.Group).Key) && !string.IsNullOrEmpty(player.ReferenceHub.serverRoles.MyText)) return;
else if (player.CheckPermission($"scputils_speak.{player.Role.ToString().ToLower()}"))
{
Expand Down
2 changes: 1 addition & 1 deletion SCPUtils/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ScpUtils : Features.Plugin<Configs>
public static string pluginVersion = "2.3.3";
public override string Author { get; } = "Terminator_9#0507";
public override string Name { get; } = "SCPUtils";
public override Version Version { get; } = new Version(2, 3, 3);
public override Version Version { get; } = new Version(2, 3, 4);
public override Version RequiredExiledVersion { get; } = new Version(2, 1, 2);
public EventHandlers EventHandlers { get; private set; }
public Functions Functions { get; private set; }
Expand Down
6 changes: 3 additions & 3 deletions SCPUtils/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SCPUtils")]
[assembly: AssemblyDescription("SCPUtils 2.3.3")]
[assembly: AssemblyDescription("SCPUtils 2.3.4")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SCPUtils")]
Expand All @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.3.0")]
[assembly: AssemblyFileVersion("2.3.3.0")]
[assembly: AssemblyVersion("2.3.4.0")]
[assembly: AssemblyFileVersion("2.3.4.0")]

0 comments on commit 43e7ff4

Please sign in to comment.