Skip to content

Commit

Permalink
Update to SL 12.0 / EXILED 6.0.0-beta.20
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-119 committed Jan 11, 2023
1 parent 5d1d0be commit 2785a76
Show file tree
Hide file tree
Showing 29 changed files with 173 additions and 483 deletions.
60 changes: 28 additions & 32 deletions AdminTools/AdminTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>AdminTools</RootNamespace>
<AssemblyName>AdminTools</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<LangVersion>9</LangVersion>
<LangVersion>default</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
Expand All @@ -36,65 +36,62 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\Assembly-CSharp-Publicized.dll</HintPath>
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.API.dll</HintPath>
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.Bootstrap, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.Bootstrap.dll</HintPath>
<Reference Include="Exiled.API, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.CreditTags, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.CreditTags.dll</HintPath>
<Reference Include="Exiled.CreditTags, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomItems, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.CustomItems.dll</HintPath>
<Reference Include="Exiled.CustomItems, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.CustomRoles, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.CustomRoles.dll</HintPath>
<Reference Include="Exiled.CustomRoles, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.Events.dll</HintPath>
<Reference Include="Exiled.Events, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.Loader.dll</HintPath>
<Reference Include="Exiled.Loader, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=5.2.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.Permissions.dll</HintPath>
<Reference Include="Exiled.Permissions, Version=6.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.1.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\Exiled.Updater.dll</HintPath>
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\Exiled.Updater.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\Mirror.dll</HintPath>
<HintPath>$(EXILED_REFERENCES)\Mirror.dll</HintPath>
</Reference>
<Reference Include="NorthwoodLib, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\EXILED.5.2.1\lib\net472\NorthwoodLib.dll</HintPath>
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\NorthwoodLib.dll</HintPath>
</Reference>
<Reference Include="PluginAPI, Version=12.0.0.0, Culture=neutral, processorArchitecture=Amd64">
<HintPath>..\packages\EXILED.6.0.0-beta.20\lib\net48\PluginAPI.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\UnityEngine.dll</HintPath>
<HintPath>$(EXILED_REFERENCES)\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\UnityEngine.AnimationModule.dll</HintPath>
<HintPath>$(EXILED_REFERENCES)\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\UnityEngine.CoreModule.dll</HintPath>
<HintPath>$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\References\UnityEngine.PhysicsModule.dll</HintPath>
<HintPath>$(EXILED_REFERENCES)\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand All @@ -106,7 +103,6 @@
<Compile Include="Commands\Configuration\Reload.cs" />
<Compile Include="Commands\DropItem\DropItem.cs" />
<Compile Include="Commands\DropSize\DropSize.cs" />
<Compile Include="Commands\Dummy\Dummy.cs" />
<Compile Include="Commands\Enums\Enums.cs" />
<Compile Include="Commands\Explode\Explode.cs" />
<Compile Include="Commands\Ghost\Ghost.cs" />
Expand Down
5 changes: 3 additions & 2 deletions AdminTools/Commands/Ball/Ball.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace AdminTools.Commands.Ball
{
using System.Collections.Generic;
using Exiled.API.Features.Items;
using PlayerRoles;

[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
Expand Down Expand Up @@ -43,7 +44,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
case "all":
foreach (Player pl in Player.List)
{
if (pl.Role == RoleType.Spectator || pl.Role == RoleType.None)
if (pl.Role == RoleTypeId.Spectator || pl.Role == RoleTypeId.None)
continue;

players.Add(pl);
Expand All @@ -58,7 +59,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
return false;
}

if (ply.Role == RoleType.Spectator || ply.Role == RoleType.None)
if (ply.Role == RoleTypeId.Spectator || ply.Role == RoleTypeId.None)
{
response = $"You cannot spawn a ball on that player right now";
return false;
Expand Down
22 changes: 12 additions & 10 deletions AdminTools/Commands/Broadcast/Message.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace AdminTools.Commands.Message
{
using PlayerRoles;

[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
public class Message : ParentCommand
Expand Down Expand Up @@ -38,8 +40,8 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
"\nbroadcast users (player id / name group (i.e.: 1,2,3 or hello,there,hehe)) (time) (message)" +
"\nbroadcast group (group name) (time) (message)" +
"\nbroadcast groups (list of groups (i.e.: owner,admin,moderator)) (time) (message)" +
"\nbroadcast role (RoleType) (time) (message)" +
"\nbroadcast roles (RoleType group (i.e.: ClassD,Scientist,NtfCadet)) (time) (message)" +
"\nbroadcast role (RoleTypeId) (time) (message)" +
"\nbroadcast roles (RoleTypeId group (i.e.: ClassD,Scientist,NtfCadet)) (time) (message)" +
"\nbroadcast (random / someone) (time) (message)" +
"\nbroadcast (staff / admin) (time) (message)" +
"\nbroadcast clearall";
Expand Down Expand Up @@ -181,13 +183,13 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
case "role":
if (arguments.Count < 4)
{
response = "Usage: broadcast role (RoleType) (time) (message)";
response = "Usage: broadcast role (RoleTypeId) (time) (message)";
return false;
}

if (!Enum.TryParse(arguments.At(1), true, out RoleType role))
if (!Enum.TryParse(arguments.At(1), true, out RoleTypeId role))
{
response = $"Invalid value for RoleType: {arguments.At(1)}";
response = $"Invalid value for RoleTypeId: {arguments.At(1)}";
return false;
}

Expand All @@ -208,15 +210,15 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
case "roles":
if (arguments.Count < 4)
{
response = "Usage: broadcast roles (RoleType group (i.e.: ClassD, Scientist, NtfCadet)) (time) (message)";
response = "Usage: broadcast roles (RoleTypeId group (i.e.: ClassD, Scientist, NtfCadet)) (time) (message)";
return false;
}

string[] roles = arguments.At(1).Split(',');
List<RoleType> roleList = new();
List<RoleTypeId> roleList = new();
foreach (string s in roles)
{
if (Enum.TryParse(s, true, out RoleType r))
if (Enum.TryParse(s, true, out RoleTypeId r))
roleList.Add(r);
}

Expand All @@ -231,7 +233,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
p.Broadcast(ti, EventHandlers.FormatArguments(arguments, 3));

StringBuilder build = StringBuilderPool.Shared.Rent("Message sent to roles: ");
foreach (RoleType ro in roleList)
foreach (RoleTypeId ro in roleList)
{
build.Append("\"");
build.Append(ro.ToString());
Expand Down Expand Up @@ -290,7 +292,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
return false;
}

PlayerManager.localPlayer.GetComponent<Broadcast>().RpcClearElements();
Map.ClearBroadcasts();
response = "All current broadcasts have been cleared";
return true;
default:
Expand Down
3 changes: 2 additions & 1 deletion AdminTools/Commands/Cleanup/Items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace AdminTools.Commands.Cleanup
{
using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.API.Features.Pickups;

class Items : ICommand
{
Expand All @@ -29,7 +30,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
return false;
}

foreach (Pickup item in Map.Pickups)
foreach (Pickup item in Pickup.List)
item.Destroy();

response = "Items have been cleaned up now";
Expand Down
6 changes: 4 additions & 2 deletions AdminTools/Commands/Cleanup/Ragdolls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

namespace AdminTools.Commands.Cleanup
{
using Exiled.API.Features;

class Ragdolls : ICommand
{
public string Command { get; } = "ragdolls";
Expand All @@ -27,8 +29,8 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
return false;
}

foreach (Ragdoll doll in UnityEngine.Object.FindObjectsOfType<Ragdoll>())
NetworkServer.Destroy(doll.gameObject);
foreach (Ragdoll doll in Ragdoll.List)
doll.Destroy();

response = "Ragdolls have been cleaned up now";
return true;
Expand Down
5 changes: 3 additions & 2 deletions AdminTools/Commands/DropItem/DropItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
namespace AdminTools.Commands.DropItem
{
using Exiled.API.Features.Items;
using Exiled.API.Features.Pickups;

[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
Expand Down Expand Up @@ -60,7 +61,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe

foreach (Player ply in Player.List)
for (int i = 0; i < amount; i++)
Item.Create(item).Spawn(ply.Position);
Pickup.CreateAndSpawn(item, ply.Position, default, ply);

response = $"{amount} of {item.ToString()} was spawned on everyone (\"Hehexd\" - Galaxy119)";
return true;
Expand Down Expand Up @@ -91,7 +92,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe
}

for (int i = 0; i < am; i++)
Item.Create(it).Spawn(pl.Position);
Pickup.CreateAndSpawn(it, pl.Position, default, pl);
response = $"{am} of {it.ToString()} was spawned on {pl.Nickname} (\"Hehexd\" - Galaxy119)";
return true;
}
Expand Down
14 changes: 8 additions & 6 deletions AdminTools/Commands/DropSize/DropSize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
namespace AdminTools.Commands.DropSize
{
using Exiled.API.Features.Items;
using Exiled.API.Features.Pickups;
using PlayerRoles;

[CommandHandler(typeof(RemoteAdminCommandHandler))]
[CommandHandler(typeof(GameConsoleCommandHandler))]
Expand Down Expand Up @@ -152,10 +154,10 @@ private void SpawnItem(ItemType type, float size, out string message)
{
foreach (Player ply in Player.List)
{
if (ply.Role == RoleType.Spectator || ply.Role == RoleType.None)
if (ply.Role == RoleTypeId.Spectator || ply.Role == RoleTypeId.None)
continue;

Item.Create(type).Spawn(ply.Position).Scale = Vector3.one * size;
Pickup.CreateAndSpawn(type, ply.Position, default, ply).Scale = Vector3.one * size;
}
message = $"Spawned in a {type.ToString()} that is a size of {size} at every player's position (\"Yay! Items with sizes!\" - Galaxy119)";
}
Expand All @@ -164,23 +166,23 @@ private void SpawnItem(ItemType type, float x, float y, float z, out string mess
{
foreach (Player ply in Player.List)
{
if (ply.Role == RoleType.Spectator || ply.Role == RoleType.None)
if (ply.Role == RoleTypeId.Spectator || ply.Role == RoleTypeId.None)
continue;

Item.Create(type).Spawn(ply.Position).Scale = new Vector3(x, y, z);
Pickup.CreateAndSpawn(type, ply.Position, default, ply).Scale = new(x, y, z);
}
message = $"Spawned in a {type.ToString()} that is {x}x{y}x{z} at every player's position (\"Yay! Items with sizes!\" - Galaxy119)";
}

private void SpawnItem(Player ply, ItemType type, float size, out string message)
{
Item.Create(type).Spawn(ply.Position).Scale = Vector3.one * size;
Pickup.CreateAndSpawn(type, ply.Position, default, ply).Scale = Vector3.one * size;
message = $"Spawned in a {type.ToString()} that is a size of {size} at {ply.Nickname}'s position (\"Yay! Items with sizes!\" - Galaxy119)";
}

private void SpawnItem(Player ply, ItemType type, float x, float y, float z, out string message)
{
Item.Create(type).Spawn(ply.Position).Scale = new Vector3(x, y, z);
Pickup.CreateAndSpawn(type, ply.Position, default, ply).Scale = new(x, y, z);
message = $"Spawned in a {type.ToString()} that is {x}x{y}x{z} at {ply.Nickname}'s position (\"Yay! Items with sizes!\" - Galaxy119)";
}
}
Expand Down
Loading

0 comments on commit 2785a76

Please sign in to comment.