Skip to content

Commit a4fc43f

Browse files
authored
Revert "Revert "bump (#8)" (#9)" (#10)
This reverts commit cfe506d.
1 parent cfe506d commit a4fc43f

File tree

9 files changed

+109
-404
lines changed

9 files changed

+109
-404
lines changed

EasyEvents/Commands/Door.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void Run(List<string> args, int i)
2222
else
2323
{
2424
List<Door2> targetDoors = new List<Door2>();
25-
foreach(Door2 door in Map.Doors)
25+
foreach(Door2 door in Door2.List)
2626
{
2727
if (door.Type == targetDoorType) targetDoors.Add(door);
2828
}

EasyEvents/CustomRole.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace EasyEvents
88
public class CustomRole
99
{
1010
public List<string> members = new List<string>();
11-
public string id = null;
11+
public string id;
1212
public int classId = -1;
13-
public bool isSubclass = false;
13+
public bool isSubclass;
1414

1515
public CustomRole(string id, int classId, bool isSubclass = false)
1616
{
@@ -21,7 +21,7 @@ public CustomRole(string id, int classId, bool isSubclass = false)
2121

2222
public List<Player> GetMembers()
2323
{
24-
return this.id == "all" ? Player.List.ToList() : this.isSubclass ? AdvancedSubclassing.GetPlayers(id.Substring(2)) : Player.List.Where(p => members.Contains(p.UserId)).ToList();
24+
return id == "all" ? Player.List.ToList() : isSubclass ? AdvancedSubclassing.GetPlayers(id.Substring(2)) : Player.List.Where(p => members.Contains(p.UserId)).ToList();
2525
}
2626
}
2727
}

EasyEvents/EasyEvents.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
4-
using Exiled.API.Enums;
53
using Exiled.API.Features;
6-
using Exiled.API.Interfaces;
7-
using Exiled.Loader;
84
using MEC;
9-
using EasyEvents.Handlers;
105
using EasyEvents.API.EventArgs;
116

127
namespace EasyEvents
138
{
149
public class EasyEvents : Plugin<Config>
1510
{
16-
public override string Name => "EasyEvents";
17-
public override string Author => "Johnodon";
18-
public override Version Version => new Version(3, 0, 0);
19-
public override Version RequiredExiledVersion { get; } = new Version(4, 2, 2);
11+
public override string Name { get; } = "EasyEvents";
12+
public override string Author { get; } = "Johnodon";
13+
public override Version Version { get; } = new Version(4, 0, 0);
14+
public override Version RequiredExiledVersion { get; } = new Version(5, 1, 3);
2015

2116
public static EasyEvents Singleton;
2217

2318
public override void OnEnabled()
2419
{
25-
base.OnEnabled();
2620
Singleton = this;
2721
ScriptStore.LoadScripts();
2822
ScriptActions.AddEvents();
2923
Exiled.Events.Handlers.Server.RestartingRound += ScriptActions.Reset;
3024
Exiled.Events.Handlers.Server.ReloadedConfigs += OnConfigUpdate;
3125
ScriptActions.Reset();
26+
base.OnEnabled();
3227
}
3328
public static void StartingEvent(StartingEventEventArgs ev)
3429
{
@@ -37,12 +32,12 @@ public static void StartingEvent(StartingEventEventArgs ev)
3732

3833
public override void OnDisabled()
3934
{
40-
base.OnDisabled();
41-
Singleton = null;
4235
ScriptStore.Scripts = new Dictionary<string, string>();
4336
ScriptActions.RemoveEvents();
4437
Exiled.Events.Handlers.Server.RestartingRound -= ScriptActions.Reset;
4538
Exiled.Events.Handlers.Server.ReloadedConfigs -= OnConfigUpdate;
39+
Singleton = null;
40+
base.OnDisabled();
4641
}
4742

4843
private static void OnConfigUpdate()

EasyEvents/EasyEvents.csproj

Lines changed: 63 additions & 348 deletions
Large diffs are not rendered by default.

EasyEvents/EventCommand.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using EasyEvents.Types;
77
using Exiled.Loader;
88
using EasyEvents.Handlers;
9-
using EasyEvents.API;
109

1110
namespace EasyEvents
1211
{
@@ -15,8 +14,8 @@ public class EventCommand : ICommand
1514
{
1615
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
1716
{
18-
var permission = false;
19-
var perPermission = false;
17+
bool permission;
18+
bool perPermission;
2019

2120
if (arguments.Array == null || arguments.Array.Length < 2)
2221
{
@@ -105,8 +104,8 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
105104
}
106105
}
107106

108-
public string Command => "event";
109-
public string[] Aliases => new string[] {"runevent", "eventrun", "events" };
110-
public string Description => "This is the command used to run custom events with EasyEvents.";
107+
public string Command { get; } = "event";
108+
public string[] Aliases { get; } = {"runevent", "eventrun", "events" };
109+
public string Description { get; } = "This is the command used to run custom events with EasyEvents.";
111110
}
112111
}

EasyEvents/Exceptions.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,67 @@
22

33
namespace EasyEvents
44
{
5-
[Serializable()]
6-
public class InvalidArgumentLengthException : System.Exception
5+
[Serializable]
6+
public class InvalidArgumentLengthException : Exception
77
{
8-
public InvalidArgumentLengthException() : base() { }
8+
public InvalidArgumentLengthException() { }
99
public InvalidArgumentLengthException(string message) : base(message) { }
10-
public InvalidArgumentLengthException(string message, System.Exception inner) : base(message, inner) { }
10+
public InvalidArgumentLengthException(string message, Exception inner) : base(message, inner) { }
1111

1212
protected InvalidArgumentLengthException(System.Runtime.Serialization.SerializationInfo info,
1313
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
1414
}
1515

16-
[Serializable()]
17-
public class InvalidArgumentException : System.Exception
16+
[Serializable]
17+
public class InvalidArgumentException : Exception
1818
{
19-
public InvalidArgumentException() : base() { }
19+
public InvalidArgumentException() { }
2020
public InvalidArgumentException(string message) : base(message) { }
21-
public InvalidArgumentException(string message, System.Exception inner) : base(message, inner) { }
21+
public InvalidArgumentException(string message, Exception inner) : base(message, inner) { }
2222

2323
protected InvalidArgumentException(System.Runtime.Serialization.SerializationInfo info,
2424
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
2525
}
2626

27-
[Serializable()]
28-
public class InvalidCommandException : System.Exception
27+
[Serializable]
28+
public class InvalidCommandException : Exception
2929
{
30-
public InvalidCommandException() : base() { }
30+
public InvalidCommandException() { }
3131
public InvalidCommandException(string message) : base(message) { }
32-
public InvalidCommandException(string message, System.Exception inner) : base(message, inner) { }
32+
public InvalidCommandException(string message, Exception inner) : base(message, inner) { }
3333

3434
protected InvalidCommandException(System.Runtime.Serialization.SerializationInfo info,
3535
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
3636
}
3737

38-
[Serializable()]
39-
public class CommandErrorException : System.Exception
38+
[Serializable]
39+
public class CommandErrorException : Exception
4040
{
41-
public CommandErrorException() : base() { }
41+
public CommandErrorException() { }
4242
public CommandErrorException(string message) : base(message) { }
43-
public CommandErrorException(string message, System.Exception inner) : base(message, inner) { }
43+
public CommandErrorException(string message, Exception inner) : base(message, inner) { }
4444

4545
protected CommandErrorException(System.Runtime.Serialization.SerializationInfo info,
4646
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
4747
}
4848

49-
[Serializable()]
50-
public class EventRunErrorException : System.Exception
49+
[Serializable]
50+
public class EventRunErrorException : Exception
5151
{
52-
public EventRunErrorException() : base() { }
52+
public EventRunErrorException() { }
5353
public EventRunErrorException(string message) : base(message) { }
54-
public EventRunErrorException(string message, System.Exception inner) : base(message, inner) { }
54+
public EventRunErrorException(string message, Exception inner) : base(message, inner) { }
5555

5656
protected EventRunErrorException(System.Runtime.Serialization.SerializationInfo info,
5757
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
5858
}
5959

60-
[Serializable()]
61-
public class EventNotFoundException : System.Exception
60+
[Serializable]
61+
public class EventNotFoundException : Exception
6262
{
63-
public EventNotFoundException() : base() { }
63+
public EventNotFoundException() { }
6464
public EventNotFoundException(string message) : base(message) { }
65-
public EventNotFoundException(string message, System.Exception inner) : base(message, inner) { }
65+
public EventNotFoundException(string message, Exception inner) : base(message, inner) { }
6666

6767
protected EventNotFoundException(System.Runtime.Serialization.SerializationInfo info,
6868
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }

EasyEvents/ScriptActions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,15 @@
66
using EasyEvents.Types;
77
using Exiled.API.Features;
88
using MEC;
9-
using UnityEngine;
10-
using Random = System.Random;
9+
using Random = UnityEngine.Random;
1110
using Exiled.Loader;
1211
using Exiled.API.Enums;
12+
using Vector3 = UnityEngine.Vector3;
1313

1414
namespace EasyEvents
1515
{
1616
public static class ScriptActions
1717
{
18-
private static Random random = new Random();
19-
2018
public static ScriptActionsStore scriptData = new ScriptActionsStore();
2119

2220
private static Dictionary<int, ScriptActionsStore> delays = new Dictionary<int, ScriptActionsStore>();
@@ -384,7 +382,7 @@ private static void SetRoles(ScriptActionsStore dataObj)
384382

385383
for (var i = 0; i < playersTemp.Count; i++)
386384
{
387-
if (random.Next(0, 101) > data.chance || num > data.min) continue;
385+
if (Random.Range(0, 101) > data.chance || num > data.min) continue;
388386

389387
playersTemp[i].SetRole(data.role.GetRole());
390388
CustomRoles.ChangeRole(playersTemp[i], data.role.GetCustomRole());

EasyEvents/ScriptStore.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.IO;
4-
using Exiled.API.Enums;
53
using Exiled.API.Features;
64

75
namespace EasyEvents

EasyEvents/Util.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
2+
using System.Collections.Generic;
33
using System.Linq;
44
using Exiled.API.Features;
55

@@ -22,7 +22,7 @@ public static RoleInfo GetRole(this Player p)
2222
return new RoleInfo(role.id, role.classId);
2323
}
2424

25-
return new RoleInfo(null, (int) p.Role);
25+
return new RoleInfo(null, (int) p.Role.Type);
2626
}
2727

2828
public static void pop<T>(this List<T> list)

0 commit comments

Comments
 (0)