From ac042a2d1960ae0dc77f5f0fe9d0a275b49bbe77 Mon Sep 17 00:00:00 2001
From: Terminator_97 <50580453+francesco132@users.noreply.github.com>
Date: Sat, 4 Sep 2021 16:54:45 +0200
Subject: [PATCH] 3.2.0
---
README.md | 10 +++--
SCPUtils/Commands/Broadcast.cs | 27 ++++++++++---
SCPUtils/Commands/BroadcastList.cs | 39 +++++++++++++++++++
SCPUtils/Commands/CreateBroadcast.cs | 57 ++++++++++++++++++++++++++++
SCPUtils/Commands/DeleteBroadcast.cs | 47 +++++++++++++++++++++++
SCPUtils/Commands/PlayerBroadcast.cs | 30 ++++++++++++---
SCPUtils/Commands/SetRoundBan.cs | 11 +++---
SCPUtils/Commands/Unwarn.cs | 6 +--
SCPUtils/Database/BroadcastDb.cs | 10 +++++
SCPUtils/Database/Database.cs | 30 ++++++++++++++-
SCPUtils/Database/GetBroadcast.cs | 8 ++++
SCPUtils/Functions/EventHandlers.cs | 14 +++----
SCPUtils/Functions/Functions.cs | 24 ++++++------
SCPUtils/Plugin.cs | 2 +-
SCPUtils/Properties/AssemblyInfo.cs | 6 +--
SCPUtils/SCPUtils.csproj | 24 ++++++------
SCPUtils/packages.config | 2 +-
17 files changed, 286 insertions(+), 61 deletions(-)
create mode 100644 SCPUtils/Commands/BroadcastList.cs
create mode 100644 SCPUtils/Commands/CreateBroadcast.cs
create mode 100644 SCPUtils/Commands/DeleteBroadcast.cs
create mode 100644 SCPUtils/Database/BroadcastDb.cs
create mode 100644 SCPUtils/Database/GetBroadcast.cs
diff --git a/README.md b/README.md
index 8df8eb5..ab20d92 100644
--- a/README.md
+++ b/README.md
@@ -21,11 +21,12 @@ This is the list of SCPUtils features with a brief description, i recomend to re
- **Team protection:** Editing configs you can set protection to the teams you want against the teams you want on specific zones or entire map.
- **SCP-096 Target:** Players gets notified via hint when they become a SCP-096 Target.
- **Last Player:** Players gets notified via hint when they are the last player of the Team.
+- **Custom Hints / Broadcast:** You can save hints / broadcasts in the database and use them easily by the ID.
**Database will get created inside Exiled/SCPUtils folder.**
**Each server must have it's own database, you cannot use one database on multiple servers!**
**You must add LiteDB.dll into Plugins/dependencies folder or plugin won't work**
-**Minimum requirements: Exiled version: 3.0.0.alpha77 and LiteDB 5.0.9**
+**Minimum requirements: Exiled version: 3.0.0.alpha80 and LiteDB 5.0.9**
### Configs:
@@ -65,10 +66,13 @@ You can see settings and edit them inside Exiled/port-config.yml file(example Ex
| scputils_player_warnings | | scputils.showwarns | Show all scputils warnings of a specific player |
| scputils_player_warning | | scputils.showwarns | Show last scputils warning of a specific player |
| scputils_player_unwarn | | scputils.unwarn | Removes a specific warning from a user |
-| scputils_player_broadcast | | scputils.broadcast | Send an hint or broadcast to a specific player |
-| scputils_broadcast | | scputils.broadcast | Send an hint or broadcast to all players |
+| scputils_player_broadcast | | scputils.broadcast | Send an hint or broadcast to a specific player |
+| scputils_broadcast | | scputils.broadcast | Send an hint or broadcast to all players |
| scputils_set_round_ban | | scputils.roundban | Sets the number of round ban to one player |
| scputils_dupeip | < id / userid > | scputils.dupeip | Check if player has another account on same IP |
+| scputils_broadcast_create | | scputils.broadcastcreate | Create a custom broadcast |
+| scputils_broadcast_delete | | scputils.broadcastdelete | Delete a custom broadcast |
+| scputils_broadcast_list | none | scputils.broadcastlist | List all created broadcast |
**Console commands**
diff --git a/SCPUtils/Commands/Broadcast.cs b/SCPUtils/Commands/Broadcast.cs
index 2eea075..e72b780 100644
--- a/SCPUtils/Commands/Broadcast.cs
+++ b/SCPUtils/Commands/Broadcast.cs
@@ -11,13 +11,12 @@ internal class Broadcast : ICommand
{
public string Command { get; } = "scputils_broadcast";
- public string[] Aliases { get; } = new[] { "sbc", "gbc", "su_bc", "scpu_bc" };
+ public string[] Aliases { get; } = new[] { "sbc", "su_bc", "scpu_bc" };
public string Description { get; } = "Allows to send custom broadcastes";
public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
{
- string broadcast;
if (!sender.CheckPermission("scputils.broadcast"))
{
response = " You need a higher administration level to use this command!";
@@ -26,23 +25,39 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
else if (arguments.Count < 2)
{
- response = $"Usage: {Command} ";
+ response = $"Usage: {Command} ";
return false;
}
else
{
- broadcast = string.Join(" ", arguments.Array, 2, arguments.Array.Length - 2);
+ var databaseBroadcast = GetBroadcast.FindBroadcast(arguments.Array[2]);
+
+ if (databaseBroadcast == null)
+ {
+ response = "Invalid broadcast ID!";
+ return false;
+ }
+ int duration = databaseBroadcast.Seconds;
+ if (arguments.Count == 3)
+ {
+ if (int.TryParse(arguments.Array[3].ToString(), out duration)) { }
+ else
+ {
+ response = "Broadcast duration must be an integer";
+ return false;
+ }
+ }
switch (arguments.Array[1].ToString())
{
case "broadcast":
case "bc":
- Map.Broadcast(ScpUtils.StaticInstance.Config.BroadcastDuration, broadcast);
+ Map.Broadcast((ushort)duration, databaseBroadcast.Text);
response = "Sending broadcast to all the players!";
break;
case "hint":
case "h":
- Map.ShowHint(broadcast, ScpUtils.StaticInstance.Config.BroadcastDuration);
+ Map.ShowHint(databaseBroadcast.Text, duration);
response = "Sending hint to all the players!";
break;
default:
diff --git a/SCPUtils/Commands/BroadcastList.cs b/SCPUtils/Commands/BroadcastList.cs
new file mode 100644
index 0000000..b9a9bfc
--- /dev/null
+++ b/SCPUtils/Commands/BroadcastList.cs
@@ -0,0 +1,39 @@
+using CommandSystem;
+using Exiled.Permissions.Extensions;
+using System;
+using System.Text;
+
+namespace SCPUtils.Commands
+{
+ [CommandHandler(typeof(RemoteAdminCommandHandler))]
+ [CommandHandler(typeof(GameConsoleCommandHandler))]
+ internal class BroadcastList : ICommand
+ {
+ public string Command { get; } = "scputils_broadcast_list";
+
+ public string[] Aliases { get; } = new[] { "sbcl", "bcl", "su_bcl", "scpu_bcl" };
+
+ public string Description { get; } = "List of all registred broadcast";
+
+ public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
+ {
+ if (!sender.CheckPermission("scputils.broadcastlist"))
+ {
+ response = " You need a higher administration level to use this command!";
+ return false;
+ }
+ StringBuilder broadcastList = new StringBuilder("[Broadcast List]");
+ broadcastList.AppendLine();
+ foreach (BroadcastDb databaseBroadcast in Database.LiteDatabase.GetCollection().FindAll())
+ {
+ broadcastList.AppendLine($"ID: {databaseBroadcast.Id}");
+ broadcastList.AppendLine($"Created by: {databaseBroadcast.CreatedBy}");
+ broadcastList.AppendLine($"Default duration: {databaseBroadcast.Seconds}");
+ broadcastList.AppendLine($"Text: {databaseBroadcast.Text}");
+ broadcastList.AppendLine("---------");
+ }
+ response = $"{broadcastList}";
+ return true;
+ }
+ }
+}
diff --git a/SCPUtils/Commands/CreateBroadcast.cs b/SCPUtils/Commands/CreateBroadcast.cs
new file mode 100644
index 0000000..54a5a1c
--- /dev/null
+++ b/SCPUtils/Commands/CreateBroadcast.cs
@@ -0,0 +1,57 @@
+using CommandSystem;
+using Exiled.Permissions.Extensions;
+using System;
+
+namespace SCPUtils.Commands
+{
+ [CommandHandler(typeof(RemoteAdminCommandHandler))]
+ [CommandHandler(typeof(GameConsoleCommandHandler))]
+ internal class CreateBroadcast : ICommand
+ {
+ public string Command { get; } = "scputils_broadcast_create";
+
+ public string[] Aliases { get; } = new[] { "cbc", "su_cbc", "scpu_cbc" };
+
+ public string Description { get; } = "Allows to create custom broadcasts";
+
+ public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
+ {
+ if (!sender.CheckPermission("scputils.broadcastcreate"))
+ {
+ response = " You need a higher administration level to use this command!";
+ return false;
+ }
+
+ else if (arguments.Count < 3)
+ {
+ response = $"Usage: {Command} ";
+ return false;
+ }
+ else
+ {
+ if (int.TryParse(arguments.Array[2].ToString(), out int duration))
+ {
+ if (Database.LiteDatabase.GetCollection().Exists(broadcast => broadcast.Id == arguments.Array[1].ToString()))
+ {
+ response = "Id already exist!";
+ return false;
+ }
+ else
+ {
+ var broadcast = string.Join(" ", arguments.Array, 3, arguments.Array.Length - 3);
+ ScpUtils.StaticInstance.DatabasePlayerData.AddBroadcast(arguments.Array[1].ToString(), sender.LogName, duration, broadcast.ToString());
+ response = "Success!";
+ return true;
+ }
+ }
+ else
+ {
+ response = "Broadcast duration must be an integer";
+ return false;
+ }
+ }
+
+
+ }
+ }
+}
diff --git a/SCPUtils/Commands/DeleteBroadcast.cs b/SCPUtils/Commands/DeleteBroadcast.cs
new file mode 100644
index 0000000..d294105
--- /dev/null
+++ b/SCPUtils/Commands/DeleteBroadcast.cs
@@ -0,0 +1,47 @@
+using CommandSystem;
+using Exiled.Permissions.Extensions;
+using System;
+
+namespace SCPUtils.Commands
+{
+ [CommandHandler(typeof(RemoteAdminCommandHandler))]
+ [CommandHandler(typeof(GameConsoleCommandHandler))]
+ internal class DeleteBroadcast : ICommand
+ {
+ public string Command { get; } = "scputils_broadcast_delete";
+
+ public string[] Aliases { get; } = new[] { "dbc", "su_dbc", "scpu_dbc" };
+
+ public string Description { get; } = "Allows to delete custom broadcastes";
+
+ public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
+ {
+ if (!sender.CheckPermission("scputils.broadcastdelete"))
+ {
+ response = " You need a higher administration level to use this command!";
+ return false;
+ }
+
+ else if (arguments.Count < 1)
+ {
+ response = $"Usage: {Command} ";
+ return false;
+ }
+ else
+ {
+
+ if (Database.LiteDatabase.GetCollection().Exists(broadcast => broadcast.Id == arguments.Array[1].ToString()))
+ {
+ Database.LiteDatabase.GetCollection().Delete(arguments.Array[1].ToString());
+ response = "Success!";
+ return true;
+ }
+ else
+ {
+ response = "Id does not exist!";
+ return false;
+ }
+ }
+ }
+ }
+}
diff --git a/SCPUtils/Commands/PlayerBroadcast.cs b/SCPUtils/Commands/PlayerBroadcast.cs
index eead347..ab9976f 100644
--- a/SCPUtils/Commands/PlayerBroadcast.cs
+++ b/SCPUtils/Commands/PlayerBroadcast.cs
@@ -15,8 +15,7 @@ internal class PlayerBroadcast : ICommand
public string Description { get; } = "Allows to send custom broadcaste";
public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
- {
- string broadcast;
+ {
if (!sender.CheckPermission("scputils.broadcast"))
{
response = " You need a higher administration level to use this command!";
@@ -25,28 +24,47 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
else if (arguments.Count < 3)
{
- response = $"Usage: {Command} ";
+ response = $"Usage: {Command} ";
return false;
}
else
{
- broadcast = string.Join(" ", arguments.Array, 3, arguments.Array.Length - 3);
+ var databaseBroadcast = GetBroadcast.FindBroadcast(arguments.Array[3]);
+
+ if (databaseBroadcast == null)
+ {
+ response = "Invalid broadcast ID!";
+ return false;
+ }
+
Exiled.API.Features.Player player = Exiled.API.Features.Player.Get(arguments.Array[1].ToString());
if (player == null)
{
response = "Invalid player!";
return false;
}
+
+ int duration = databaseBroadcast.Seconds;
+ if (arguments.Count == 4)
+ {
+ if (int.TryParse(arguments.Array[4].ToString(), out duration)) { }
+ else
+ {
+ response = "Broadcast duration must be an integer";
+ return false;
+ }
+ }
+
switch (arguments.Array[2].ToString())
{
case "broadcast":
case "bc":
- player.Broadcast(ScpUtils.StaticInstance.Config.BroadcastDuration, broadcast, global::Broadcast.BroadcastFlags.Normal, false);
+ player.Broadcast((ushort)duration, databaseBroadcast.Text, global::Broadcast.BroadcastFlags.Normal, false);
response = "Success!";
break;
case "hint":
case "h":
- player.ShowHint(broadcast, ScpUtils.StaticInstance.Config.BroadcastDuration);
+ player.ShowHint(databaseBroadcast.Text, duration);
response = "Success!";
break;
default:
diff --git a/SCPUtils/Commands/SetRoundBan.cs b/SCPUtils/Commands/SetRoundBan.cs
index 6c881af..9eb2d28 100644
--- a/SCPUtils/Commands/SetRoundBan.cs
+++ b/SCPUtils/Commands/SetRoundBan.cs
@@ -1,14 +1,13 @@
using CommandSystem;
using Exiled.Permissions.Extensions;
using System;
-using System.Collections.Generic;
namespace SCPUtils.Commands
{
[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
internal class SetRoundBan : ICommand
- {
+ {
public string Command { get; } = "scputils_set_round_ban";
public string[] Aliases { get; } = new[] { "srb", "roundban", "su_srb", "su_roundban" };
@@ -18,13 +17,13 @@ internal class SetRoundBan : ICommand
public bool Execute(ArraySegment arguments, ICommandSender sender, out string response)
{
string target;
-
+
if (!sender.CheckPermission("scputils.roundban"))
{
response = " You need a higher administration level to use this command!";
return false;
-
+
}
if (arguments.Count < 2)
@@ -32,8 +31,8 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
response = $"Usage: {Command} ";
return false;
}
- else target = arguments.Array[1].ToString();
-
+ else target = arguments.Array[1].ToString();
+
Player databasePlayer = target.GetDatabasePlayer();
diff --git a/SCPUtils/Commands/Unwarn.cs b/SCPUtils/Commands/Unwarn.cs
index 5bc7bff..8eb3a02 100644
--- a/SCPUtils/Commands/Unwarn.cs
+++ b/SCPUtils/Commands/Unwarn.cs
@@ -86,7 +86,7 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
BanHandler.RemoveBan(databasePlayer.Ip, BanHandler.BanType.IP);
}
break;
- case "Round-Ban":
+ case "Round-Ban":
databasePlayer.ScpSuicideCount--;
databasePlayer.TotalScpSuicideBans--;
databasePlayer.SuicidePunishment[id] = "REMOVED";
@@ -95,10 +95,10 @@ public bool Execute(ArraySegment arguments, ICommandSender sender, out s
databasePlayer.RoundBanLeft -= databasePlayer.RoundsBan[id];
if (databasePlayer.RoundBanLeft < 0) databasePlayer.RoundBanLeft = 0;
-
+
Database.LiteDatabase.GetCollection().Update(databasePlayer);
-
+
break;
case "REMOVED":
message = "This sanction has already been removed!";
diff --git a/SCPUtils/Database/BroadcastDb.cs b/SCPUtils/Database/BroadcastDb.cs
new file mode 100644
index 0000000..39c2720
--- /dev/null
+++ b/SCPUtils/Database/BroadcastDb.cs
@@ -0,0 +1,10 @@
+namespace SCPUtils
+{
+ public class BroadcastDb
+ {
+ public string Id { get; set; }
+ public string CreatedBy { get; set; }
+ public int Seconds { get; set; }
+ public string Text { get; set; }
+ }
+}
diff --git a/SCPUtils/Database/Database.cs b/SCPUtils/Database/Database.cs
index cc4f101..e123928 100644
--- a/SCPUtils/Database/Database.cs
+++ b/SCPUtils/Database/Database.cs
@@ -19,7 +19,7 @@ public Database(ScpUtils pluginInstance)
public string DatabaseDirectory => Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), pluginInstance.Config.DatabaseFolder), pluginInstance.Config.DatabaseName);
public string DatabaseFullPath => Path.Combine(DatabaseDirectory, $"{pluginInstance.Config.DatabaseName}.db");
public static Dictionary PlayerData = new Dictionary();
-
+ public static Dictionary Broadcast = new Dictionary();
public void CreateDatabase()
{
@@ -46,14 +46,40 @@ public void OpenDatabase()
LiteDatabase = new LiteDatabase(DatabaseFullPath);
LiteDatabase.GetCollection().EnsureIndex(x => x.Id);
LiteDatabase.GetCollection().EnsureIndex(x => x.Name);
+ LiteDatabase.GetCollection().EnsureIndex(x => x.Id);
Log.Info("DB Loaded!");
}
catch (Exception ex)
{
- Log.Error($"Failed to open DB!\nPlease make sure that there is only 1 server open on same database, check that there are no ghost proccess, if the error still occurrs check LITEDB version and if there are the proper permissions. Bellow you can see the error. \n \n {ex.ToString()}");
+ Log.Error($"Failed to open DB!\nPlease make sure that there is only 1 server open on same database, check that there are no ghost proccess, if the error still occurrs check LITEDB version and if there are the proper permissions. Bellow you can see the error. \n \n {ex.ToString()}");
+ }
+ }
+
+ public void AddBroadcast(string id, string nickname, int seconds, string text)
+ {
+ try
+ {
+ if (LiteDatabase.GetCollection().Exists(x => x.Id == id))
+ {
+ return;
+ }
+
+
+ LiteDatabase.GetCollection().Insert(new BroadcastDb()
+ {
+ Id = id,
+ CreatedBy = nickname,
+ Seconds = seconds,
+ Text = text
+ });
+ }
+ catch (Exception ex)
+ {
+ Log.Error($"Cannot create the broadcast!\n{ex.ToString()}");
}
}
+
public void AddPlayer(Exiled.API.Features.Player player)
{
try
diff --git a/SCPUtils/Database/GetBroadcast.cs b/SCPUtils/Database/GetBroadcast.cs
new file mode 100644
index 0000000..c4bc4e0
--- /dev/null
+++ b/SCPUtils/Database/GetBroadcast.cs
@@ -0,0 +1,8 @@
+namespace SCPUtils
+{
+ public static class GetBroadcast
+ {
+ public static BroadcastDb FindBroadcast(string id) => Database.LiteDatabase.GetCollection().FindOne(queryBc => queryBc.Id == id);
+
+ }
+}
diff --git a/SCPUtils/Functions/EventHandlers.cs b/SCPUtils/Functions/EventHandlers.cs
index dc49792..50c5921 100644
--- a/SCPUtils/Functions/EventHandlers.cs
+++ b/SCPUtils/Functions/EventHandlers.cs
@@ -1,11 +1,11 @@
using Exiled.API.Features;
using Exiled.Events.EventArgs;
+using MEC;
using System;
using System.Collections.Generic;
using System.Linq;
using Features = Exiled.API.Features;
using Round = Exiled.API.Features.Round;
-using MEC;
namespace SCPUtils
{
@@ -39,10 +39,10 @@ internal void OnPlayerDeath(DyingEventArgs ev)
if ((DateTime.Now - lastTeslaEvent).Seconds >= pluginInstance.Config.Scp079TeslaEventWait)
{
- if (ev.HitInformation.Tool == DamageTypes.Tesla || (ev.HitInformation.Tool == DamageTypes.Wall && ev.HitInformation.Amount >= 50000) || (ev.HitInformation.Tool== DamageTypes.Grenade && ev.Killer == ev.Target))
- {
- pluginInstance.Functions.LogWarn(ev.Target, ev.HitInformation.Tool.Name);
- pluginInstance.Functions.OnQuitOrSuicide(ev.Target);
+ if (ev.HitInformation.Tool == DamageTypes.Tesla || (ev.HitInformation.Tool == DamageTypes.Wall && ev.HitInformation.Amount >= 50000) || (ev.HitInformation.Tool == DamageTypes.Grenade && ev.Killer == ev.Target))
+ {
+ pluginInstance.Functions.LogWarn(ev.Target, ev.HitInformation.Tool.Name);
+ pluginInstance.Functions.OnQuitOrSuicide(ev.Target);
}
else if ((ev.HitInformation.Tool == DamageTypes.Wall && ev.HitInformation.Amount == -1f) && ev.Killer == ev.Target && pluginInstance.Config.QuitEqualsSuicide)
{
@@ -191,7 +191,7 @@ internal void OnPlayerVerify(VerifiedEventArgs ev)
databasePlayer.LastSeen = PreauthTime[ev.Player.UserId];
PreauthTime.Remove(ev.Player.UserId);
}
- else databasePlayer.LastSeen = DateTime.Now;
+ else databasePlayer.LastSeen = DateTime.Now;
databasePlayer.Name = ev.Player.Nickname;
var sameIP = Database.LiteDatabase.GetCollection().FindAll().Where(x => x.Ip == databasePlayer.Ip).ToList();
if (databasePlayer.Ip != ev.Player.IPAddress)
@@ -234,7 +234,7 @@ internal void OnPlayerSpawn(SpawningEventArgs ev)
}
else ev.Player.GetDatabasePlayer().TotalScpGamesPlayed++;
-
+
}
}
diff --git a/SCPUtils/Functions/Functions.cs b/SCPUtils/Functions/Functions.cs
index e5bbae5..e7f46ea 100644
--- a/SCPUtils/Functions/Functions.cs
+++ b/SCPUtils/Functions/Functions.cs
@@ -49,24 +49,24 @@ public void AutoRoundBanPlayer(Exiled.API.Features.Player player)
{
int rounds;
Player databasePlayer = player.GetDatabasePlayer();
- databasePlayer.TotalScpSuicideBans++;
- databasePlayer.SuicidePunishment[databasePlayer.SuicidePunishment.Count() - 1] = "Round-Ban";
+ databasePlayer.TotalScpSuicideBans++;
+ databasePlayer.SuicidePunishment[databasePlayer.SuicidePunishment.Count() - 1] = "Round-Ban";
if (pluginInstance.Config.MultiplyBanDurationEachBan == true)
{
- rounds = databasePlayer.TotalScpSuicideBans * pluginInstance.Config.AutoBanRoundsCount;
+ rounds = databasePlayer.TotalScpSuicideBans * pluginInstance.Config.AutoBanRoundsCount;
}
else
{
rounds = pluginInstance.Config.AutoBanDuration;
-
- }
+
+ }
if (pluginInstance.Config.BroadcastSanctions)
- {
+ {
BroadcastSuicideQuitAction($" {player.Nickname} ({player.Role}) has been BANNED from playing SCP for exceeding Quits / Suicides (as SCP) limit for {rounds} rounds.");
if (databasePlayer.RoundBanLeft >= 1) BroadcastSuicideQuitAction($" {player.Nickname} has suicided while having an active ban!");
- }
+ }
databasePlayer.RoundsBan[databasePlayer.RoundsBan.Count() - 1] = rounds;
- databasePlayer.RoundBanLeft += rounds;
+ databasePlayer.RoundBanLeft += rounds;
if (pluginInstance.Config.RoundBanNotification.Show)
{
player.ClearBroadcasts();
@@ -78,7 +78,7 @@ public void AutoRoundBanPlayer(Exiled.API.Features.Player player)
}
public void AutoBanPlayer(Exiled.API.Features.Player player)
- {
+ {
int duration;
Player databasePlayer = player.GetDatabasePlayer();
databasePlayer.TotalScpSuicideBans++;
@@ -562,14 +562,14 @@ public void ReplacePlayer(Exiled.API.Features.Player player)
return;
}
var id = UnityEngine.Random.Range(0, list.Count - 1);
- var role = player.Role;
+ var role = player.Role;
ReplacePlayerEvent args = new ReplacePlayerEvent();
args.BannedPlayer = player;
args.ReplacedPlayer = list[id];
args.ScpRole = player.Role;
- args.NormalRole = list[id].Role;
+ args.NormalRole = list[id].Role;
player.SetRole(list[id].Role);
- list[id].SetRole(role);
+ list[id].SetRole(role);
pluginInstance.Events.OnReplacePlayerEvent(args);
diff --git a/SCPUtils/Plugin.cs b/SCPUtils/Plugin.cs
index 0b66e8b..de8dcfb 100644
--- a/SCPUtils/Plugin.cs
+++ b/SCPUtils/Plugin.cs
@@ -14,7 +14,7 @@ public class ScpUtils : Features.Plugin
{
public override string Author { get; } = "Terminator_97#0507";
public override string Name { get; } = "SCPUtils";
- public override Version Version { get; } = new Version(3, 1, 0);
+ public override Version Version { get; } = new Version(3, 2, 0);
public override Version RequiredExiledVersion { get; } = new Version(3, 0, 0);
public EventHandlers EventHandlers { get; private set; }
public Functions Functions { get; private set; }
diff --git a/SCPUtils/Properties/AssemblyInfo.cs b/SCPUtils/Properties/AssemblyInfo.cs
index 357871c..dfd36a0 100644
--- a/SCPUtils/Properties/AssemblyInfo.cs
+++ b/SCPUtils/Properties/AssemblyInfo.cs
@@ -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 3.1.0 - https://github.com/terminator-97/SCPUtils")]
+[assembly: AssemblyDescription("SCPUtils 3.2.0 - https://github.com/terminator-97/SCPUtils")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SCPUtils")]
@@ -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("3.1.0.0")]
-[assembly: AssemblyFileVersion("3.1.0.0")]
\ No newline at end of file
+[assembly: AssemblyVersion("3.2.0.0")]
+[assembly: AssemblyFileVersion("3.2.0.0")]
\ No newline at end of file
diff --git a/SCPUtils/SCPUtils.csproj b/SCPUtils/SCPUtils.csproj
index 75dbdb4..d084654 100644
--- a/SCPUtils/SCPUtils.csproj
+++ b/SCPUtils/SCPUtils.csproj
@@ -50,31 +50,28 @@
..\..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\CommandSystem.Core.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.API.dll
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.API.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.Bootstrap.dll
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.Bootstrap.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.CreditTags.dll
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.CreditTags.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.CustomItems.dll
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.CustomItems.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.Events.dll
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.Events.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.Loader.dll
- True
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.Loader.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.Permissions.dll
- True
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.Permissions.dll
- ..\packages\EXILED.3.0.0-alpha.77\lib\net472\Exiled.Updater.dll
- True
+ ..\packages\EXILED.3.0.0-alpha.80\lib\net472\Exiled.Updater.dll
..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll
@@ -105,7 +102,10 @@
+
+
+
@@ -136,6 +136,8 @@
+
+
diff --git a/SCPUtils/packages.config b/SCPUtils/packages.config
index 104b85b..3134fed 100644
--- a/SCPUtils/packages.config
+++ b/SCPUtils/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file