Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.12 #107

Merged
merged 72 commits into from
Sep 23, 2024
Merged

8.12 #107

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
7262f06
Merge pull request #23 from ExMod-Team/master
Jesus-QC Aug 1, 2024
c9654ee
uwu (#5)
VALERA771 Aug 1, 2024
6ebeac5
Merge pull request #26 from ExMod-Team/master
louis1706 Aug 2, 2024
5653733
AdminToy.List (#18)
louis1706 Aug 2, 2024
5a519a4
Fix `Jailbird::WearState` (#12)
louis1706 Aug 2, 2024
81c3652
Porting EXILED9 RespawnedTeam event. by.VALERA771 (#27)
YongAn404 Aug 2, 2024
1f2d209
Fix not returning null (#22)
louis1706 Aug 4, 2024
4e50826
RecontainedEventArgs more feature (#20)
louis1706 Aug 6, 2024
3ffe156
InteractingScp330.cs: Reduction of bloat code from original design. (…
Undid-Iridium Aug 6, 2024
e39238e
IScp330Event (#11)
louis1706 Aug 6, 2024
f1cc6f4
PR than i made (#9)
louis1706 Aug 6, 2024
eb046ac
[Events] Fix null reference (#15)
louis1706 Aug 6, 2024
a7354b7
Offline mode support (#19)
x3rt Aug 6, 2024
259cabb
Fix NW bugs (#32)
skyfr0676 Aug 6, 2024
26d1fcc
Useless Event (939 Placed Amnestic Cloud) (#40)
x3rt Aug 7, 2024
03d6bd7
Fix custom role classes giving custom ammo when they are not suppose …
TtroubleTT Aug 7, 2024
06cf2d7
`Item::<T>Get()` and `Pickup::<T>Get()` (#17)
louis1706 Aug 9, 2024
09de18b
FixNpcNoclip (#34)
louis1706 Aug 9, 2024
a1ae554
Implements more patches for RemovingHandcuffs event and adding Remove…
Misaka-ZeroTwo Aug 9, 2024
2c41d7d
Interacting scp330 compile fix (#43)
Undid-Iridium Aug 10, 2024
08a5deb
Trello is no more & more NW Fix & Fix IL Code on dev (#28)
louis1706 Aug 10, 2024
a3595e1
Additions (#29)
Misfiy Aug 11, 2024
fada367
`[EXILED::API]` Pickup::Category (#46)
NotZer0Two Aug 11, 2024
2ee9f46
Fix (#50)
NotZer0Two Aug 11, 2024
0e2bea5
Merge branch 'master' into dev
Misaka-ZeroTwo Aug 11, 2024
ee317e7
`[Exiled::API]` Removing breaking changes (#54)
VALERA771 Aug 12, 2024
e80c81c
Merge branch 'master' into dev
Misaka-ZeroTwo Aug 12, 2024
b66b2fd
`Scp330` sound fix (#55)
IRacle1 Aug 12, 2024
0ab9037
Fix Npc (#58)
Misfiy Aug 12, 2024
f7b28f4
Merge branch 'master' into dev
Misaka-ZeroTwo Aug 13, 2024
119f930
Fix breaking change (#61)
Misaka-ZeroTwo Aug 13, 2024
afdb0b2
Version bump
Misaka-ZeroTwo Aug 13, 2024
904865e
💀💀💀
IRacle1 Aug 14, 2024
bcb78e7
`SendStaffMessage` fix
IRacle1 Aug 15, 2024
53ce718
Added the SCP-079 Recontaining event (#21)
FoxWorn3365 Aug 15, 2024
bc0b179
`[EXILED::API]` Adding SpawnMice (#47)
NotZer0Two Aug 15, 2024
7a6df16
`[EXILED::API]` Adding ScaleNetworkIdentityObject (#49)
NotZer0Two Aug 15, 2024
c819ba5
Merge pull request #67 from ExMod-Team/master
louis1706 Aug 16, 2024
7befb7a
Revert "💀💀💀"
IRacle1 Aug 16, 2024
92016cc
Merge branch 'dev' into fixes
louis1706 Aug 17, 2024
0c9cfff
`[EXILED::API]` Adding SendFakeSceneLoading (#45)
NotZer0Two Aug 20, 2024
f1c58ff
Merge pull request #64 from IRacle1/fixes
IRacle1 Aug 21, 2024
5fc1b14
scp018projectile (#73)
IRacle1 Aug 24, 2024
327801e
😱😎🙂💀😈 (#51)
IRacle1 Aug 27, 2024
880fde0
`KeycardPickup.Permissions` now is not joke (#70)
IRacle1 Aug 27, 2024
acd1b29
`[Exiled::Events]` `Unbanning` and `Unbanned` events (#68)
VALERA771 Aug 27, 2024
5aa8754
`[EXILED::API]` Adding StaminaRegenMultiplier (BodyArmor) (#71)
NotZer0Two Aug 27, 2024
af3da2d
`[EXILED::API]` Adding MoveNetworkIdentityObject (#48)
NotZer0Two Aug 27, 2024
532fdfb
`[EXILED::EVENTS]` Adding PlayingAudioLog 69 PR (#69)
NotZer0Two Aug 27, 2024
96ecc24
`RecontainedWhenNoScps` feature (#16)
louis1706 Aug 28, 2024
83ff82e
`[EXILED::EVENTS]` Fixing bug report n.396 (#59)
NotZer0Two Aug 30, 2024
daecbb9
feat: Added IsDecontaminationEnabled property (#82)
alexomur Aug 30, 2024
cb8fbbe
Multiple change (UwU) (#79)
Misfiy Aug 30, 2024
6f5cd2f
``[Exiled::CustomRoles]`` ``[Exiled::CustomItems]`` QoL in List comma…
SrLicht Sep 1, 2024
d08b002
DroppingScp330 Event Fix. (#83)
Undid-Iridium Sep 2, 2024
96ccf32
``[Exiled::CustomItems]`` ``[Exiled::API]`` ``[Exiled::CustomRoles]``…
SrLicht Sep 2, 2024
c9a1b9a
`[Exiled::API]` Adding new properties for `FpcRole` (#65)
VALERA771 Sep 2, 2024
41a37ce
Update programs.yml
Misaka-ZeroTwo Sep 10, 2024
fb40d83
Scp0492 change apperance fix (#87)
Undid-Iridium Sep 12, 2024
4d5d142
Add plugin website
louis1706 Sep 14, 2024
e1d726f
fix (#95)
VALERA771 Sep 15, 2024
04faf98
Replace with exiled wrapper class (#94)
VALERA771 Sep 23, 2024
2da2c1f
Fix Role NRE (#66)
louis1706 Sep 23, 2024
25fd825
`[Exiled::API]` New way to register parent commands (#74)
VALERA771 Sep 23, 2024
56b4098
Allow `ID_Dedicated`/`null` for `Npc.UserId` Parameter (#75)
NotZer0Two Sep 23, 2024
25cedad
Update Exiled.Loader.csproj (#80)
SrLicht Sep 23, 2024
e533dd6
[Events] Fix crash (#96)
IRacle1 Sep 23, 2024
954387a
Random fixes (#103)
IRacle1 Sep 23, 2024
e5d640e
Adding Turning On All Lights (#105)
Josephfallen Sep 23, 2024
c91a606
`[EXILED::Events]` Introduce `hub install` command (#101)
bladuk Sep 23, 2024
6464c46
version bump
Jesus-QC Sep 23, 2024
2433d14
Merge branch 'master' into dev
Jesus-QC Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EXILED/EXILED.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<PropertyGroup>
<!-- This is the global version and is used for all projects that don't have a version -->
<Version Condition="$(Version) == ''">8.12.0-rc.3</Version>
<Version Condition="$(Version) == ''">8.12.0</Version>
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
<PublicBeta>false</PublicBeta>

Expand Down
50 changes: 50 additions & 0 deletions EXILED/Exiled.API/Enums/LockerType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// -----------------------------------------------------------------------
// <copyright file="LockerType.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
/// <summary>
/// Unique identifier for different types of <see cref="Features.Lockers.Locker"/>s.
/// </summary>
public enum LockerType
{
/// <summary>
/// The pedestal used by SCP items.
/// </summary>
Pedestal,

/// <summary>
/// Large weapon locker.
/// </summary>
LargeGun,

/// <summary>
/// Locker for rifles, known as a rifle rack.
/// </summary>
RifleRack,

/// <summary>
/// Miscellaneous locker for various items.
/// </summary>
Misc,

/// <summary>
/// Locker that contains medkits.
/// </summary>
Medkit,

/// <summary>
/// Locker that contains adrenaline.
/// </summary>
Adrenaline,

/// <summary>
/// Unknow type of locker.
/// </summary>
Unknow,
}
}
47 changes: 47 additions & 0 deletions EXILED/Exiled.API/Enums/ScenesType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// -----------------------------------------------------------------------
// <copyright file="ScenesType.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
/// <summary>
/// Unique identifier for the different types of Scenes the client and server can load.
/// </summary>
public enum ScenesType
{
/// <summary>
/// The facility itself.
/// </summary>
Facility,

/// <summary>
/// The current main menu.
/// ! Will cause crash when trying joining servers !
/// </summary>
NewMainMenu,

/// <summary>
/// The old main menu.
/// </summary>
MainMenuRemastered,

/// <summary>
/// The old server list.
/// </summary>
FastMenu,

/// <summary>
/// The loading Screen.
/// ! Will cause crash when trying joining servers !
/// </summary>
PreLoader,

/// <summary>
/// A black menu before loading the <see cref="NewMainMenu"/>.
/// </summary>
Loader,
}
}
4 changes: 3 additions & 1 deletion EXILED/Exiled.API/Enums/SpawnLocationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Enums
{
using System;

/// <summary>
/// All of the valid spawn location types.
/// </summary>
Expand Down Expand Up @@ -150,6 +151,7 @@ public enum SpawnLocationType
/// <summary>
/// Inside a random locker on the map.
/// </summary>
[Obsolete("Use LockerSpawnPoint instead")]
InsideLocker,
}
}
43 changes: 43 additions & 0 deletions EXILED/Exiled.API/Extensions/LockerExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// -----------------------------------------------------------------------
// <copyright file="LockerExtensions.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Extensions
{
using System;

using Exiled.API.Enums;
using MapGeneration.Distributors;

/// <summary>
/// A set of extensions for <see cref="Enums.LockerType"/>.
/// </summary>
public static class LockerExtensions
{
/// <summary>
/// Gets the <see cref="LockerType"/> from the given <see cref="Locker"/> object.
/// </summary>
/// <param name="locker">The <see cref="Locker"/> to check.</param>
/// <returns>The corresponding <see cref="LockerType"/>.</returns>
public static LockerType GetLockerType(this Locker locker) => locker.name.GetLockerTypeByName();

/// <summary>
/// Gets the <see cref="LockerType"/> by name.
/// </summary>
/// <param name="name">The name to check.</param>
/// <returns>The corresponding <see cref="LockerType"/>.</returns>
public static LockerType GetLockerTypeByName(this string name) => name.Replace("(Clone)", string.Empty) switch
{
"Scp500PedestalStructure Variant" => LockerType.Pedestal,
"LargeGunLockerStructure" => LockerType.LargeGun,
"RifleRackStructure" => LockerType.RifleRack,
"MiscLocker" => LockerType.Misc,
"RegularMedkitStructure" => LockerType.Medkit,
"AdrenalineMedkitStructure" => LockerType.Adrenaline,
_ => LockerType.Unknow,
};
}
}
156 changes: 148 additions & 8 deletions EXILED/Exiled.API/Extensions/MirrorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Exiled.API.Extensions
using System.Reflection.Emit;
using System.Text;

using Exiled.API.Enums;
using Features;
using Features.Pools;

Expand Down Expand Up @@ -270,6 +271,15 @@ public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumer
writer.WriteByte(unitId);
}

if (roleBase is ZombieRole)
{
if (player.Role.Base is not ZombieRole)
isRisky = true;

writer.WriteUShort((ushort)Mathf.Clamp(Mathf.CeilToInt(player.MaxHealth), ushort.MinValue, ushort.MaxValue));
writer.WriteBool(true);
}

if (roleBase is FpcStandardRoleBase fpc)
{
if (player.Role.Base is not FpcStandardRoleBase playerfpc)
Expand All @@ -283,14 +293,6 @@ public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumer
writer.WriteUShort(value);
}

if (roleBase is ZombieRole)
{
if (player.Role.Base is not ZombieRole)
isRisky = true;

writer.WriteUShort((ushort)Mathf.Clamp(Mathf.CeilToInt(player.MaxHealth), ushort.MinValue, ushort.MaxValue));
}

foreach (Player target in playersToAffect)
{
if (target != player || !isRisky)
Expand Down Expand Up @@ -355,6 +357,111 @@ public static void MessageTranslated(this Player player, string words, string tr
}
}

/// <summary>
/// Moves object for the player.
/// </summary>
/// <param name="player">Target to send.</param>
/// <param name="identity">The <see cref="Mirror.NetworkIdentity"/> to move.</param>
/// <param name="pos">The position to change.</param>
public static void MoveNetworkIdentityObject(this Player player, NetworkIdentity identity, Vector3 pos)
{
identity.gameObject.transform.position = pos;
ObjectDestroyMessage objectDestroyMessage = new()
{
netId = identity.netId,
};

player.Connection.Send(objectDestroyMessage, 0);
SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, player.Connection });
}

/// <summary>
/// Sends to the player a Fake Change Scene.
/// </summary>
/// <param name="player">The player to send the Scene.</param>
/// <param name="newSceneName">The new Scene the client will load.</param>
public static void SendFakeSceneLoading(this Player player, ScenesType newSceneName)
{
SceneMessage message = new()
{
sceneName = newSceneName.ToString(),
};

player.Connection.Send(message);
}

/// <summary>
/// Emulation of the method SCP:SL uses to change scene.
/// </summary>
/// <param name="scene">The new Scene the client will load.</param>
public static void ChangeSceneToAllClients(ScenesType scene)
{
SceneMessage message = new()
{
sceneName = scene.ToString(),
};

NetworkServer.SendToAll(message);
}

/// <summary>
/// Scales an object for the specified player.
/// </summary>
/// <param name="player">Target to send.</param>
/// <param name="identity">The <see cref="Mirror.NetworkIdentity"/> to scale.</param>
/// <param name="scale">The scale the object needs to be set to.</param>
public static void ScaleNetworkIdentityObject(this Player player, NetworkIdentity identity, Vector3 scale)
{
identity.gameObject.transform.localScale = scale;
ObjectDestroyMessage objectDestroyMessage = new()
{
netId = identity.netId,
};

player.Connection.Send(objectDestroyMessage, 0);
SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, player.Connection });
}

/// <summary>
/// Moves object for all the players.
/// </summary>
/// <param name="identity">The <see cref="NetworkIdentity"/> to move.</param>
/// <param name="pos">The position to change.</param>
public static void MoveNetworkIdentityObject(this NetworkIdentity identity, Vector3 pos)
{
identity.gameObject.transform.position = pos;
ObjectDestroyMessage objectDestroyMessage = new()
{
netId = identity.netId,
};

foreach (Player ply in Player.List)
{
ply.Connection.Send(objectDestroyMessage, 0);
SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, ply.Connection });
}
}

/// <summary>
/// Scales an object for all players.
/// </summary>
/// <param name="identity">The <see cref="Mirror.NetworkIdentity"/> to scale.</param>
/// <param name="scale">The scale the object needs to be set to.</param>
public static void ScaleNetworkIdentityObject(this NetworkIdentity identity, Vector3 scale)
{
identity.gameObject.transform.localScale = scale;
ObjectDestroyMessage objectDestroyMessage = new()
{
netId = identity.netId,
};

foreach (Player ply in Player.List)
{
ply.Connection.Send(objectDestroyMessage, 0);
SendSpawnMessageMethodInfo?.Invoke(null, new object[] { identity, ply.Connection });
}
}

/// <summary>
/// Send fake values to client's <see cref="SyncVarAttribute"/>.
/// </summary>
Expand All @@ -363,6 +470,7 @@ public static void MessageTranslated(this Player player, string words, string tr
/// <param name="targetType"><see cref="NetworkBehaviour"/>'s type.</param>
/// <param name="propertyName">Property name starting with Network.</param>
/// <param name="value">Value of send to target.</param>
[Obsolete("Use overload with type-template instead.")]
public static void SendFakeSyncVar(this Player target, NetworkIdentity behaviorOwner, Type targetType, string propertyName, object value)
{
if (!target.IsConnected)
Expand All @@ -386,6 +494,38 @@ void CustomSyncVarGenerator(NetworkWriter targetWriter)
}
}

/// <summary>
/// Send fake values to client's <see cref="SyncVarAttribute"/>.
/// </summary>
/// <typeparam name="T">Target SyncVar property type.</typeparam>
/// <param name="target">Target to send.</param>
/// <param name="behaviorOwner"><see cref="NetworkIdentity"/> of object that owns <see cref="NetworkBehaviour"/>.</param>
/// <param name="targetType"><see cref="NetworkBehaviour"/>'s type.</param>
/// <param name="propertyName">Property name starting with Network.</param>
/// <param name="value">Value of send to target.</param>
public static void SendFakeSyncVar<T>(this Player target, NetworkIdentity behaviorOwner, Type targetType, string propertyName, T value)
{
if (!target.IsConnected)
return;

NetworkWriterPooled writer = NetworkWriterPool.Get();
NetworkWriterPooled writer2 = NetworkWriterPool.Get();
MakeCustomSyncWriter(behaviorOwner, targetType, null, CustomSyncVarGenerator, writer, writer2);
target.Connection.Send(new EntityStateMessage
{
netId = behaviorOwner.netId,
payload = writer.ToArraySegment(),
});

NetworkWriterPool.Return(writer);
NetworkWriterPool.Return(writer2);
void CustomSyncVarGenerator(NetworkWriter targetWriter)
{
targetWriter.WriteULong(SyncVarDirtyBits[$"{targetType.Name}.{propertyName}"]);
WriterExtensions[typeof(T)]?.Invoke(null, new object[2] { targetWriter, value });
}
}

/// <summary>
/// Force resync to client's <see cref="SyncVarAttribute"/>.
/// </summary>
Expand Down
Loading
Loading