Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
aec6506
fix: `Room::NearestRooms` fix (#417)
VALERA771 Jan 30, 2025
2c89b59
fix: Fixes Custom Weapon Reload (#418)
TtroubleTT Jan 30, 2025
cd7ba63
feat: UserTextInputSetting and SliderSetting (#416)
Someone-193 Jan 30, 2025
936b864
fix: Potential Error Fix With Custom Weapon Reloading (#421)
TtroubleTT Feb 2, 2025
61c1c23
fix: Fix Custom Roles Lagging Back When Spawning (#428)
TtroubleTT Feb 5, 2025
571f49e
feat: send to player specific settings (#432)
LumiFae Feb 13, 2025
a7d8d2b
fix: Npc cant get flashed (#429)
obvEve Feb 13, 2025
6eb4b1e
feat: remove sex (#395)
obvEve Feb 13, 2025
f52bab7
feat: Server.IsHeavilyModded is Obsolete (#419)
louis1706 Feb 13, 2025
dafca44
fix: Player Custom Firearm Reloading Exploit (#422)
TtroubleTT Feb 13, 2025
1912269
fix: Add SCP-1344 Effect to IsPositive Extension (#426)
TtroubleTT Feb 13, 2025
403f449
feat: added GameObject and Transform properties to AdminToy (#431)
Banalny-Banan Feb 13, 2025
c85a92d
fix: Fixing TriggeringTesla not detecting NPC (#424)
louis1706 Feb 13, 2025
02e2bf6
feat: Dynamic spawn location additions (#388)
SnivyFilms Feb 14, 2025
1c27f25
feat: Added ICommandSender to Kicking/Banning EventArgs (#436)
Banalny-Banan Feb 14, 2025
00ae5cd
fix: OnShooting target freeze (#438)
Banalny-Banan Feb 17, 2025
57d043f
fix: randomized firearm attachments (#430)
Banalny-Banan Feb 17, 2025
9be51ad
feat: Added method `Exiled.API.Features.Map.Clean` (#437)
Num10ck Feb 18, 2025
95d2d54
fix: Fix NW Hypothermia bug (#441)
louis1706 Feb 21, 2025
1f28777
feat: Have NPC In Player List (#445)
TtroubleTT Feb 25, 2025
f6cd7d6
feat: Spawning NPCs via RA adds them to the `Npc.List` (#440)
Num10ck Feb 25, 2025
8485d8f
fix: IntercomSpeaking event (#442)
R2kip Feb 25, 2025
6885df8
9.5.1
louis1706 Feb 26, 2025
7e326a0
feat: Added a list of players who are turned away from SCP-939 Amnest…
hatulaile Feb 27, 2025
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) == ''">9.5.0</Version>
<Version Condition="$(Version) == ''">9.5.1</Version>
<!-- Enables public beta warning via the PUBLIC_BETA constant -->
<PublicBeta>false</PublicBeta>

Expand Down
25 changes: 25 additions & 0 deletions EXILED/Exiled.API/Enums/SpawnLocationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,30 @@ public enum SpawnLocationType
/// Just inside the LCZ WC door.
/// </summary>
InsideLczWc,

/// <summary>
/// Inside the Glass Box in GR-18.
/// </summary>
InsideGr18Glass,

/// <summary>
/// Inside 106's Primary Door
/// </summary>
Inside106Primary,

/// <summary>
/// Inside 106's Secondary Door
/// </summary>
Inside106Secondary,

/// <summary>
/// Inside 939 Cryo Chamber
/// </summary>
Inside939Cryo,

/// <summary>
/// Inside SCP-079's Armory
/// </summary>
Inside079Armory,
}
}
2 changes: 1 addition & 1 deletion EXILED/Exiled.API/Extensions/EffectTypeExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ or EffectType.Disabled or EffectType.Ensnared or EffectType.Exhausted or EffectT
/// <seealso cref="IsHealing(EffectType)"/>
public static bool IsPositive(this EffectType effect) => effect is EffectType.BodyshotReduction or EffectType.DamageReduction
or EffectType.Invigorated or EffectType.Invisible or EffectType.MovementBoost or EffectType.RainbowTaste
or EffectType.Scp207 or EffectType.Scp1853 or EffectType.Vitality or EffectType.AntiScp207 or EffectType.Ghostly;
or EffectType.Scp207 or EffectType.Scp1853 or EffectType.Vitality or EffectType.AntiScp207 or EffectType.Ghostly or EffectType.Scp1344;

/// <summary>
/// Returns whether the provided <paramref name="effect"/> affects the player's movement speed.
Expand Down
6 changes: 6 additions & 0 deletions EXILED/Exiled.API/Extensions/SpawnExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static class SpawnExtensions
SpawnLocationType.Inside914,
SpawnLocationType.Inside049Armory,
SpawnLocationType.InsideLczCafe,
SpawnLocationType.Inside939Cryo,
};

/// <summary>
Expand Down Expand Up @@ -102,6 +103,11 @@ public static Vector3 GetPosition(this SpawnLocationType location)
SpawnLocationType.Inside173Connector => "173_CONNECTOR",
SpawnLocationType.InsideEscapePrimary => "ESCAPE_PRIMARY",
SpawnLocationType.InsideEscapeSecondary => "ESCAPE_SECONDARY",
SpawnLocationType.InsideGr18Glass => "GR18_INNER",
SpawnLocationType.Inside106Primary => "106_PRIMARY",
SpawnLocationType.Inside106Secondary => "106_SECONDARY",
SpawnLocationType.Inside939Cryo => "939_CRYO",
SpawnLocationType.Inside079Armory => "079_ARMORY",
_ => default,
};
}
Expand Down
10 changes: 10 additions & 0 deletions EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public static bool TryGetSetting<T>(Player player, int id, out T setting)
SSGroupHeader header => new HeaderSetting(header),
SSKeybindSetting keybindSetting => new KeybindSetting(keybindSetting),
SSTwoButtonsSetting twoButtonsSetting => new TwoButtonsSetting(twoButtonsSetting),
SSPlaintextSetting plainTextSetting => new UserTextInputSetting(plainTextSetting),
SSSliderSetting sliderSetting => new SliderSetting(sliderSetting),
_ => new SettingBase(settingBase)
};

Expand Down Expand Up @@ -216,6 +218,14 @@ public static void SendToAll(Func<Player, bool> predicate)
/// <param name="player">Target player.</param>
public static void SendToPlayer(Player player) => ServerSpecificSettingsSync.SendToPlayer(player.ReferenceHub);

/// <summary>
/// Syncs specific settings with the specified target.
/// </summary>
/// <param name="player">Target player.</param>
/// <param name="settings">Settings to send to the player.</param>
public static void SendToPlayer(Player player, IEnumerable<SettingBase> settings) =>
ServerSpecificSettingsSync.SendToPlayer(player.ReferenceHub, settings.Select(setting => setting.Base).ToArray());

/// <summary>
/// Registers all settings from the specified collection.
/// </summary>
Expand Down
124 changes: 124 additions & 0 deletions EXILED/Exiled.API/Features/Core/UserSettings/SliderSetting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
// -----------------------------------------------------------------------
// <copyright file="SliderSetting.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Features.Core.UserSettings
{
using System;

using Exiled.API.Interfaces;
using global::UserSettings.ServerSpecific;

/// <summary>
/// Represents a slider setting.
/// </summary>
public class SliderSetting : SettingBase, IWrapper<SSSliderSetting>
{
/// <summary>
/// Initializes a new instance of the <see cref="SliderSetting"/> class.
/// </summary>
/// <param name="id"><inheritdoc cref="SettingBase.Id"/></param>
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
/// <param name="minValue"><inheritdoc cref="MinimumValue"/></param>
/// <param name="maxValue"><inheritdoc cref="MaximumValue"/></param>
/// <param name="defaultValue"><inheritdoc cref="DefaultValue"/></param>
/// <param name="isInteger"><inheritdoc cref="IsInteger"/></param>
/// <param name="stringFormat"><inheritdoc cref="StringFormat"/></param>
/// <param name="displayFormat"><inheritdoc cref="DisplayFormat"/></param>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
public SliderSetting(int id, string label, float minValue, float maxValue, float defaultValue, bool isInteger = false, string stringFormat = "0.##", string displayFormat = "{0}", string hintDescription = null)
: this(new SSSliderSetting(id, label, minValue, maxValue, defaultValue, isInteger, stringFormat, displayFormat, hintDescription))
{
Base = (SSSliderSetting)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="SliderSetting"/> class.
/// </summary>
/// <param name="settingBase">A <see cref="SSSliderSetting"/> instance.</param>
internal SliderSetting(SSSliderSetting settingBase)
: base(settingBase)
{
Base = settingBase;
}

/// <summary>
/// Gets or sets the minimum value of the slider.
/// </summary>
public float MinimumValue
{
get => Base.MinValue;
set => Base.MinValue = value;
}

/// <summary>
/// Gets or sets the maximum value of the slider.
/// </summary>
public float MaximumValue
{
get => Base.MaxValue;
set => Base.MaxValue = value;
}

/// <summary>
/// Gets or sets the default value of the slider.
/// </summary>
public float DefaultValue
{
get => Base.DefaultValue;
set => Base.DefaultValue = value;
}

/// <summary>
/// Gets or sets a value indicating whether the slider displays integers.
/// </summary>
public bool IsInteger
{
get => Base.Integer;
set => Base.Integer = value;
}

/// <summary>
/// Gets a value indicating whether the slider is currently being dragged.
/// </summary>
public bool IsBeingDragged => Base.SyncDragging;

/// <summary>
/// Gets a float that represents the current value of the slider.
/// </summary>
public float SliderValue => Base.Integer ? Base.SyncIntValue : Base.SyncFloatValue;

/// <summary>
/// Gets or sets the formatting used for the number in the slider.
/// </summary>
public string StringFormat
{
get => Base.ValueToStringFormat;
set => Base.ValueToStringFormat = value;
}

/// <summary>
/// Gets or sets the formatting used for the final display of the value of the slider.
/// </summary>
public string DisplayFormat
{
get => Base.FinalDisplayFormat;
set => Base.FinalDisplayFormat = value;
}

/// <inheritdoc/>
public new SSSliderSetting Base { get; }

/// <summary>
/// Returns a representation of this <see cref="SliderSetting"/>.
/// </summary>
/// <returns>A string in human-readable format.</returns>
public override string ToString()
{
return base.ToString() + $" /{MinimumValue}/ *{MaximumValue}* +{DefaultValue}+ '{SliderValue}'";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// -----------------------------------------------------------------------
// <copyright file="UserTextInputSetting.cs" company="ExMod Team">
// Copyright (c) ExMod Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------

namespace Exiled.API.Features.Core.UserSettings
{
using System;

using Exiled.API.Interfaces;
using global::UserSettings.ServerSpecific;
using TMPro;

/// <summary>
/// Represents a user text input setting.
/// </summary>
public class UserTextInputSetting : SettingBase, IWrapper<SSPlaintextSetting>
{
/// <summary>
/// Initializes a new instance of the <see cref="UserTextInputSetting"/> class.
/// </summary>
/// <param name="id"><inheritdoc cref="SettingBase.Id"/></param>
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
/// <param name="placeHolder"><inheritdoc cref="PlaceHolder"/></param>
/// <param name="characterLimit"><inheritdoc cref="CharacterLimit"/></param>
/// <param name="contentType"><inheritdoc cref="ContentType"/></param>
/// /// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
public UserTextInputSetting(int id, string label, string placeHolder = "", int characterLimit = 64, TMP_InputField.ContentType contentType = TMP_InputField.ContentType.Standard, string hintDescription = null)
: this(new SSPlaintextSetting(id, label, placeHolder, characterLimit, contentType, hintDescription))
{
Base = (SSPlaintextSetting)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="UserTextInputSetting"/> class.
/// </summary>
/// <param name="settingBase">A <see cref="SSPlaintextSetting"/> instance.</param>
internal UserTextInputSetting(SSPlaintextSetting settingBase)
: base(settingBase)
{
Base = settingBase;
}

/// <inheritdoc/>
public new SSPlaintextSetting Base { get; }

/// <summary>
/// Gets the value of the text entered by a client.
/// </summary>
public string Text => Base.SyncInputText;

/// <summary>
/// Gets or sets a value indicating the placeholder shown within the PlainTextSetting.
/// </summary>
public string PlaceHolder
{
get => Base.Placeholder;
set => Base.Placeholder = value;
}

/// <summary>
/// Gets or sets a value indicating the type of content within the PlainTextSetting.
/// </summary>
public TMP_InputField.ContentType ContentType
{
get => Base.ContentType;
set => Base.ContentType = value;
}

/// <summary>
/// Gets or sets a value indicating the max number of characters in the PlainTextSetting.
/// </summary>
public int CharacterLimit
{
get => Base.CharacterLimit;
set => Base.CharacterLimit = value;
}

/// <summary>
/// Returns a representation of this <see cref="UserTextInputSetting"/>.
/// </summary>
/// <returns>A string in human-readable format.</returns>
public override string ToString()
{
return base.ToString() + $" /{Text}/ *{ContentType}* +{CharacterLimit}+";
}
}
}
27 changes: 13 additions & 14 deletions EXILED/Exiled.API/Features/Items/Firearm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,30 +364,29 @@ public static Firearm Create(FirearmType type)
/// <param name="identifier">The <see cref="AttachmentIdentifier"/> to add.</param>
public void AddAttachment(AttachmentIdentifier identifier)
{
uint toRemove = 0;
uint code = 1;
// Fallback addedCode onto AvailableAttachments' code in case it's 0
uint addedCode = identifier.Code == 0
? AvailableAttachments[FirearmType].FirstOrDefault(attId => attId.Name == identifier.Name).Code
: identifier.Code;

// Look for conflicting attachment (attachment that occupies the same slot)
uint conflicting = 0;
uint current = 1;

foreach (Attachment attachment in Base.Attachments)
{
if (attachment.Slot == identifier.Slot && attachment.IsEnabled)
{
toRemove = code;
conflicting = current;
break;
}

code *= 2;
current *= 2;
}

uint newCode = identifier.Code == 0
? AvailableAttachments[FirearmType].FirstOrDefault(
attId =>
attId.Name == identifier.Name).Code
: identifier.Code;

Base.ApplyAttachmentsCode((Base.GetCurrentAttachmentsCode() & ~toRemove) | newCode, true);

// TODO Not finish
// Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());
uint code = Base.ValidateAttachmentsCode((Base.GetCurrentAttachmentsCode() & ~conflicting) | addedCode);
Base.ApplyAttachmentsCode(code, false);
AttachmentCodeSync.ServerSetCode(Serial, code);
}

/// <summary>
Expand Down
16 changes: 16 additions & 0 deletions EXILED/Exiled.API/Features/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace Exiled.API.Features
using System.Collections.ObjectModel;
using System.Linq;

using CommandSystem.Commands.RemoteAdmin.Cleanup;
using Decals;
using Enums;
using Exiled.API.Extensions;
using Exiled.API.Features.Hazards;
Expand All @@ -27,6 +29,7 @@ namespace Exiled.API.Features
using PlayerRoles.Ragdolls;
using UnityEngine;
using Utils;
using Utils.Networking;

using Object = UnityEngine.Object;

Expand Down Expand Up @@ -271,6 +274,19 @@ public static void CleanAllRagdolls(IEnumerable<Ragdoll> ragDolls)
ragDoll.Destroy();
}

/// <summary>
/// Destroy specified amount of specified <see cref="DecalPoolType"/> object.
/// </summary>
/// <param name="decalType">Decal type to destroy.</param>
/// <param name="amount">Amount of decals to destroy.</param>
public static void Clean(DecalPoolType decalType, int amount) => new DecalCleanupMessage(decalType, amount).SendToAuthenticated();

/// <summary>
/// Destroy all specified <see cref="DecalPoolType"/> objects.
/// </summary>
/// <param name="decalType">Decal type to destroy.</param>
public static void Clean(DecalPoolType decalType) => Clean(decalType, int.MaxValue);

/// <summary>
/// Places a blood decal.
/// </summary>
Expand Down
Loading