Skip to content

Commit

Permalink
Update to Exiled 3.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
PixeLInc committed Oct 18, 2021
1 parent b40cb3c commit 58424ac
Show file tree
Hide file tree
Showing 16 changed files with 75 additions and 9,630 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ UltimateAFK/obj/

UltimateAFK/bin/Debug/


UltimateAFK/bin/Release/
UltimateAFK/bin/*

Expand All @@ -93,3 +94,5 @@ packages/EXILED.2.1.29/EXILED.2.1.29.nupkg
packages/EXILED.2.1.15/.signature.p7s

packages/EXILED.2.1.29/images/Exiled_Icon.jpg

packages/*
15 changes: 15 additions & 0 deletions UltimateAFK.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31612.314
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UltimateAFK", "UltimateAFK\UltimateAFK.csproj", "{9280B8BA-6290-4FC8-A58F-BC24E43AA486}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Debug|x64.ActiveCfg = Debug|x64
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Debug|x64.Build.0 = Debug|x64
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Release|Any CPU.Build.0 = Release|Any CPU
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Release|x64.ActiveCfg = Release|x64
{9280B8BA-6290-4FC8-A58F-BC24E43AA486}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1EC8E4CF-2F04-4391-8F1E-D4F70EE8E852}
EndGlobalSection
EndGlobal
25 changes: 11 additions & 14 deletions UltimateAFK/AFKComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Exiled.API.Features;
using Exiled.Loader;
using PlayableScps;
using scp035.API;
using System.Reflection;
using Exiled.API.Enums;

Expand All @@ -29,9 +28,6 @@ public class AFKComponent : MonoBehaviour
// Do not change this delay. It will screw up the detection
public float delay = 1.0f;

private Player TryGet035() => Scp035Data.GetScp035();
private void TrySpawn035(Player player) => Scp035Data.Spawn035(player);

// Expose replacing player for plugin support
public Player PlayerToReplace;

Expand Down Expand Up @@ -126,7 +122,8 @@ private void AFKChecker()
bool is035 = false;
try
{
is035 = this.ply.Id == TryGet035()?.Id;

is035 = Scp035.API.IsScp035(this.ply);
}
catch (Exception e)
{
Expand All @@ -135,16 +132,16 @@ private void AFKChecker()

// Credit: DCReplace :)
// I mean at this point 90% of this has been rewritten lol...
var inventory = this.ply.Inventory.items.Select(x => x.id).ToList();
var inventory = this.ply.Inventory.UserInventory.Items.Select(x => x.Value.ItemTypeId).ToList();

RoleType role = this.ply.Role;
Vector3 pos = this.ply.Position;
float health = this.ply.Health;

// New strange ammo system because the old one was fucked.
uint ammo1 = this.ply.Ammo[(int)AmmoType.Nato556];
uint ammo2 = this.ply.Ammo[(int)AmmoType.Nato762];
uint ammo3 = this.ply.Ammo[(int)AmmoType.Nato9];
ushort ammo1 = this.ply.Ammo[ItemType.Ammo556x45];
ushort ammo2 = this.ply.Ammo[ItemType.Ammo762x39];
ushort ammo3 = this.ply.Ammo[ItemType.Ammo9x19];

// Stuff for 079
byte Level079 = 0;
Expand All @@ -160,7 +157,7 @@ private void AFKChecker()
if (PlayerToReplace != null)
{
// Make the player a spectator first so other plugins can do things on player changing role with uAFK.
this.ply.Inventory.Clear(); // Clear their items to prevent dupes.
this.ply.ClearInventory(); // Clear their items to prevent dupes.
this.ply.SetRole(RoleType.Spectator);
this.ply.Broadcast(30, $"{plugin.Config.MsgPrefix} {plugin.Config.MsgFspec}");

Expand All @@ -172,7 +169,7 @@ private void AFKChecker()
{
try
{
TrySpawn035(PlayerToReplace);
Scp035.API.Spawn035(PlayerToReplace);
}
catch (Exception e)
{
Expand All @@ -186,9 +183,9 @@ private void AFKChecker()

PlayerToReplace.Health = health;

PlayerToReplace.Ammo[(int)AmmoType.Nato556] = ammo1;
PlayerToReplace.Ammo[(int)AmmoType.Nato762] = ammo2;
PlayerToReplace.Ammo[(int)AmmoType.Nato9] = ammo3;
PlayerToReplace.Ammo[ItemType.Ammo556x45] = ammo1;
PlayerToReplace.Ammo[ItemType.Ammo762x39] = ammo2;
PlayerToReplace.Ammo[ItemType.Ammo9x19] = ammo3;

if (isScp079)
{
Expand Down
4 changes: 2 additions & 2 deletions UltimateAFK/MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public override void OnEnabled()
Handlers.Scp914.Activating += PlayerEvents.On914Activate;
Handlers.Scp914.ChangingKnobSetting += PlayerEvents.On914Change;
Handlers.Player.InteractingLocker += PlayerEvents.OnLockerInteract;
Handlers.Player.ItemDropped += PlayerEvents.OnDropItem;
Handlers.Player.DroppingItem += PlayerEvents.OnDropItem;
Handlers.Scp079.GainingExperience += PlayerEvents.OnSCP079Exp;

Log.Info($"UltimateAFK plugin loaded.\n Written by Thomasjosif for King's Playground");
Expand All @@ -92,7 +92,7 @@ public override void OnDisabled()
Handlers.Scp914.Activating -= PlayerEvents.On914Activate;
Handlers.Scp914.ChangingKnobSetting -= PlayerEvents.On914Change;
Handlers.Player.InteractingLocker -= PlayerEvents.OnLockerInteract;
Handlers.Player.ItemDropped -= PlayerEvents.OnDropItem;
Handlers.Player.DroppingItem -= PlayerEvents.OnDropItem;
Handlers.Scp079.GainingExperience -= PlayerEvents.OnSCP079Exp;

PlayerEvents = null;
Expand Down
2 changes: 1 addition & 1 deletion UltimateAFK/PlayerEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void OnLockerInteract(InteractingLockerEventArgs ev)
Log.Error($"ERROR In OnLockerInteract(): {e}");
}
}
public void OnDropItem(ItemDroppedEventArgs ev)
public void OnDropItem(DroppingItemEventArgs ev)
{
try
{
Expand Down
64 changes: 42 additions & 22 deletions UltimateAFK/UltimateAFK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="PlayerEvents.cs" />
Expand All @@ -48,53 +66,55 @@
<ItemGroup>
<Reference Include="0Harmony, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\0Harmony.dll</HintPath>
<HintPath>..\..\References\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\Assembly-CSharp-firstpass.dll</HintPath>
<HintPath>..\..\References\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-Publicized">
<HintPath>..\..\..\EXILED_REFERENCES\Assembly-CSharp-Publicized.dll</HintPath>
<HintPath>..\..\References\Assembly-CSharp-Publicized.dll</HintPath>
</Reference>
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\CommandSystem.Core.dll</HintPath>
<HintPath>..\..\References\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API">
<HintPath>..\..\..\Exiled\EXILED\Plugins\dependencies\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=2.2.4.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.2.4\lib\net472\Exiled.API.dll</HintPath>
<Reference Include="Exiled.CreditTags, Version=3.0.5.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.3.0.5\lib\net472\Exiled.CreditTags.dll</HintPath>
</Reference>
<Reference Include="Exiled.Bootstrap, Version=2.2.4.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.2.4\lib\net472\Exiled.Bootstrap.dll</HintPath>
<Reference Include="Exiled.CustomItems, Version=3.0.5.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.3.0.5\lib\net472\Exiled.CustomItems.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=2.2.4.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.2.4\lib\net472\Exiled.Events.dll</HintPath>
<Reference Include="Exiled.CustomRoles, Version=3.0.5.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.3.0.5\lib\net472\Exiled.CustomRoles.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=2.2.4.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.2.4\lib\net472\Exiled.Loader.dll</HintPath>
<Reference Include="Exiled.Events">
<HintPath>..\..\..\Exiled\EXILED\Plugins\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=2.2.4.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.2.4\lib\net472\Exiled.Permissions.dll</HintPath>
<Reference Include="Exiled.Loader">
<HintPath>..\..\..\Exiled\EXILED\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.1.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.2.4\lib\net472\Exiled.Updater.dll</HintPath>
<Reference Include="Exiled.Permissions">
<HintPath>..\..\..\Exiled\EXILED\Plugins\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\Mirror.dll</HintPath>
<HintPath>..\..\References\Mirror.dll</HintPath>
</Reference>
<Reference Include="scp035, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\scp035.dll</HintPath>
<Reference Include="Scp035">
<HintPath>..\..\scp035\Scp035\bin\x64\Release\Scp035.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\UnityEngine.dll</HintPath>
<HintPath>..\..\References\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\EXILED_REFERENCES\UnityEngine.CoreModule.dll</HintPath>
<HintPath>..\..\References\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion UltimateAFK/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EXILED" version="2.2.4" targetFramework="net472" />
<package id="EXILED" version="3.0.5" targetFramework="net472" />
</packages>
Binary file removed packages/EXILED.2.2.4/.signature.p7s
Binary file not shown.
Binary file removed packages/EXILED.2.2.4/EXILED.2.2.4.nupkg
Binary file not shown.
Binary file removed packages/EXILED.2.2.4/images/Exiled_Icon.jpg
Binary file not shown.
Loading

0 comments on commit 58424ac

Please sign in to comment.