Skip to content

Commit

Permalink
Hotfixes for inventory and others
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjosif committed Nov 10, 2020
1 parent a5bf031 commit f088b50
Show file tree
Hide file tree
Showing 86 changed files with 52 additions and 52 deletions.
32 changes: 10 additions & 22 deletions UltimateAFK/AFKComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using PlayableScps;
using scp035.API;
using System.Reflection;
using Exiled.API.Enums;

namespace UltimateAFK
{
Expand Down Expand Up @@ -135,19 +136,16 @@ private void AFKChecker()

// Credit: DCReplace :)
// I mean at this point 90% of this has been rewritten lol...
Inventory.SyncListItemInfo items = this.ply.Inventory.items;
var inventory = this.ply.Inventory.items.Select(x => x.id).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.
Dictionary<Exiled.API.Enums.AmmoType, uint> ammo = new Dictionary<Exiled.API.Enums.AmmoType, uint>();
foreach (Exiled.API.Enums.AmmoType atype in (Exiled.API.Enums.AmmoType[])Enum.GetValues(typeof(Exiled.API.Enums.AmmoType)))
{
ammo.Add(atype, this.ply.Ammo[(int)atype]);
this.ply.Ammo[(int)atype] = 0; // We remove the ammo so the player doesn't drop it (duplicate ammo)
}
uint ammo1 = this.ply.Ammo[(int)AmmoType.Nato556];
uint ammo2 = this.ply.Ammo[(int)AmmoType.Nato762];
uint ammo3 = this.ply.Ammo[(int)AmmoType.Nato9];

// Stuff for 079
byte Level079 = 0;
Expand Down Expand Up @@ -183,25 +181,15 @@ private void AFKChecker()
}
}
PlayerToReplace.Position = pos;
PlayerToReplace.Inventory.Clear();

foreach (Inventory.SyncItemInfo item in items)
{
PlayerToReplace.Inventory.AddNewItem(item.id, item.durability, item.modSight, item.modBarrel, item.modOther);
}
PlayerToReplace.ClearInventory();
PlayerToReplace.ResetInventory(inventory);

PlayerToReplace.Health = health;

foreach (Exiled.API.Enums.AmmoType atype in (Exiled.API.Enums.AmmoType[])Enum.GetValues(typeof(Exiled.API.Enums.AmmoType)))
{
uint amount;
if (ammo.TryGetValue(atype, out amount))
{
PlayerToReplace.Ammo[(int)atype] = amount;
}
else
Log.Error($"[uAFK] ERROR: Tried to get a value from dict that did not exist! (Ammo)");
}
PlayerToReplace.Ammo[(int)AmmoType.Nato556] = ammo1;
PlayerToReplace.Ammo[(int)AmmoType.Nato762] = ammo2;
PlayerToReplace.Ammo[(int)AmmoType.Nato9] = ammo3;

if (isScp079)
{
Expand Down
2 changes: 1 addition & 1 deletion UltimateAFK/MainClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class MainClass : Plugin<Config>
public override string Author { get; } = "Thomasjosif";
public override string Name { get; } = "Ultimate AFK";
public override string Prefix { get; } = "uAFK";
public override Version Version { get; } = new Version(3, 1, 0);
public override Version Version { get; } = new Version(3, 1, 1);
public override Version RequiredExiledVersion { get; } = new Version(2, 0, 0);
public PlayerEvents PlayerEvents;

Expand Down
10 changes: 5 additions & 5 deletions UltimateAFK/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SamplePlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("UltimateAFK")]
[assembly: AssemblyDescription("Ultimate AFK Checker")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SamplePlugin")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyCompany("KingsPlayground")]
[assembly: AssemblyProduct("UltimateAFK")]
[assembly: AssemblyCopyright("Copyright © 2020 Thomas Dick")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
42 changes: 21 additions & 21 deletions UltimateAFK/UltimateAFK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,61 +48,61 @@
<ItemGroup>
<Reference Include="0Harmony, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EXILED_REFERENCES\0Harmony.dll</HintPath>
<HintPath>..\..\..\EXILED_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>..\..\..\EXILED_REFERENCES\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-Publicized">
<HintPath>..\..\EXILED_REFERENCES\Assembly-CSharp-Publicized.dll</HintPath>
<HintPath>..\..\..\EXILED_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>..\..\..\EXILED_REFERENCES\CommandSystem.Core.dll</HintPath>
</Reference>
<Reference Include="Exiled.API, Version=2.1.14.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.14\lib\net472\Exiled.API.dll</HintPath>
<Reference Include="Exiled.API, Version=2.1.15.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.15\lib\net472\Exiled.API.dll</HintPath>
</Reference>
<Reference Include="Exiled.Bootstrap, Version=2.1.14.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.14\lib\net472\Exiled.Bootstrap.dll</HintPath>
<Reference Include="Exiled.Bootstrap, Version=2.1.15.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.15\lib\net472\Exiled.Bootstrap.dll</HintPath>
</Reference>
<Reference Include="Exiled.Events, Version=2.1.14.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.14\lib\net472\Exiled.Events.dll</HintPath>
<Reference Include="Exiled.Events, Version=2.1.15.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.15\lib\net472\Exiled.Events.dll</HintPath>
</Reference>
<Reference Include="Exiled.Loader, Version=2.1.14.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.14\lib\net472\Exiled.Loader.dll</HintPath>
<Reference Include="Exiled.Loader, Version=2.1.15.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.15\lib\net472\Exiled.Loader.dll</HintPath>
</Reference>
<Reference Include="Exiled.Permissions, Version=2.1.14.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.14\lib\net472\Exiled.Permissions.dll</HintPath>
<Reference Include="Exiled.Permissions, Version=2.1.15.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.15\lib\net472\Exiled.Permissions.dll</HintPath>
</Reference>
<Reference Include="Exiled.Updater, Version=3.0.3.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>..\packages\EXILED.2.1.14\lib\net472\Exiled.Updater.dll</HintPath>
<HintPath>..\packages\EXILED.2.1.15\lib\net472\Exiled.Updater.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>..\..\..\EXILED_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>
<HintPath>..\..\..\EXILED_REFERENCES\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>..\..\..\EXILED_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>..\..\..\EXILED_REFERENCES\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=8.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EXILED_REFERENCES\YamlDotNet.dll</HintPath>
<HintPath>..\..\..\EXILED_REFERENCES\YamlDotNet.dll</HintPath>
</Reference>
<Reference Include="zxing.unity, Version=0.16.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\EXILED_REFERENCES\zxing.unity.dll</HintPath>
<HintPath>..\..\..\EXILED_REFERENCES\zxing.unity.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
Binary file modified UltimateAFK/bin/Release/Assembly-CSharp-Publicized.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/CommandSystem.Core.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/Exiled.API.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/Exiled.Bootstrap.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/Exiled.Events.dll
Binary file not shown.
8 changes: 7 additions & 1 deletion UltimateAFK/bin/Release/Exiled.Events.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified UltimateAFK/bin/Release/Exiled.Loader.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/Exiled.Permissions.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/Exiled.Updater.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/Mirror.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UltimateAFK.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UltimateAFK.pdb
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.AIModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.AccessibilityModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.AndroidJNIModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.AnimationModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.AssetBundleModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.AudioModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.ClothModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.ClusterInputModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.ClusterRendererModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.CoreModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.CrashReportingModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.DSPGraphModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.DirectorModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.GameCenterModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.GridModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.IMGUIModule.dll
Binary file not shown.
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.InputLegacyModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.InputModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.JSONSerializeModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.LocalizationModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.ParticleSystemModule.dll
Binary file not shown.
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.Physics2DModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.PhysicsModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.ScreenCaptureModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.SharedInternalsModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.SpriteMaskModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.SpriteShapeModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.StreamingModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.SubsystemsModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.TerrainModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.TerrainPhysicsModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.TextCoreModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.TextRenderingModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.TilemapModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UIElementsModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UIModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UNETModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UnityAnalyticsModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UnityConnectModule.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UnityWebRequestModule.dll
Binary file not shown.
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.UnityWebRequestWWWModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.VFXModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.VRModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.VehiclesModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.VideoModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.WindModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.XRModule.dll
Binary file not shown.
Binary file modified UltimateAFK/bin/Release/UnityEngine.dll
Binary file not shown.
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.1.14" targetFramework="net472" />
<package id="EXILED" version="2.1.15" targetFramework="net472" />
</packages>
Binary file removed packages/EXILED.2.1.14/EXILED.2.1.14.nupkg
Binary file not shown.
Binary file removed packages/EXILED.2.1.14/lib/net472/Exiled.API.dll
Binary file not shown.
Binary file not shown.
Binary file removed packages/EXILED.2.1.14/lib/net472/Exiled.Events.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added packages/EXILED.2.1.15/EXILED.2.1.15.nupkg
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f088b50

Please sign in to comment.