Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
removed Old patches and some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GrafDimenzio committed Feb 11, 2023
1 parent d96ebe7 commit 9771bbd
Show file tree
Hide file tree
Showing 38 changed files with 191 additions and 5,405 deletions.
6 changes: 6 additions & 0 deletions Synapse3.Bootstrap/Synapse3.Bootstrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Patchless|AnyCPU' ">
<OutputPath>bin\Patchless\</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Custom Version|AnyCPU' ">
<OutputPath>bin\Custom Version\</OutputPath>
<Optimize>true</Optimize>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp">
<HintPath>..\Refs\Assembly-CSharp-Publicized.dll</HintPath>
Expand Down
1 change: 0 additions & 1 deletion Synapse3.ExamplePlugin/ExampleConfig.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Neuron.Core.Meta;
using Syml;
using Synapse3.SynapseModule.Role;

namespace Synapse3.ExamplePlugin;

Expand Down
1 change: 0 additions & 1 deletion Synapse3.ExamplePlugin/ExempleAbstractRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Synapse3.SynapseModule.Map.Rooms;
using Synapse3.SynapseModule.Player;
using Synapse3.SynapseModule.Role;
using System.Collections.Generic;
using UnityEngine;

namespace Synapse3.ExamplePlugin;
Expand Down
4 changes: 4 additions & 0 deletions Synapse3.Platform/Synapse3.Platform.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@
<Optimize Condition=" '$(Optimize)' == '' ">true</Optimize>
<DocumentationFile />
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Custom Version' ">
<Optimize>true</Optimize>
</PropertyGroup>

</Project>
3 changes: 0 additions & 3 deletions Synapse3.SynapseModule/Config/GamePlayConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ public class GamePlayConfiguration : IDocumentSection
[Description("If Enabled everyone can attack everyone after the Round ended")]
public bool AutoFriendlyFire { get; set; } = true;

[Description("If Enabled SCP-268 will hide you even for SCP-096 and SCP-079")]
public bool BetterScp268{ get; set; } = false;

[Description("If enabled a Player don't need to equip his keycard to use it")]
public bool RemoteKeyCard{ get; set; } = false;

Expand Down
2 changes: 1 addition & 1 deletion Synapse3.SynapseModule/Config/SynapseTranslation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class SynapseTranslation : Translations<SynapseTranslation>
public string DnT { get; set; } =
"You have enabled Do Not Track in your settings therefore can we not store your language";

public string DeathMessage { get; set; } = "You were killed by\n{0}\nas\n{1}";
public string DeathMessage { get; set; } = "You were killed by\\n{0}\\nas\\n{1}";

public string KeyBindCommandGetCommand { get; set; } = "Select a command whose bind you want to change, current bind:{0}";
public string KeyBindCommandSelectKey { get; set; } = "Please press the new key";
Expand Down
26 changes: 7 additions & 19 deletions Synapse3.SynapseModule/DebugService.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
using MEC;
using Neuron.Core.Events;
using Neuron.Core.Events;
using Neuron.Core.Meta;
using PlayerStatsSystem;
using PlayerRoles;
using Synapse3.SynapseModule.Command;
using Synapse3.SynapseModule.Dummy;
using Synapse3.SynapseModule.Events;
using Synapse3.SynapseModule.Teams;
using System;
using Respawning;
using Synapse3.SynapseModule.Item;
using Synapse3.SynapseModule.Map.Objects;
using Synapse3.SynapseModule.Map.Schematic;
using Synapse3.SynapseModule.Player;
using Synapse3.SynapseModule.Enums;
using UnityEngine;


Expand Down Expand Up @@ -49,23 +41,18 @@ public override void Enable()
foreach (var reactor in _event.Reactors)
{
if (reactor.Key == typeof(UpdateObjectEvent)) continue;
if (reactor.Key == typeof(UpdateEvent)) continue;
if (reactor.Key == typeof(EscapeEvent)) continue;
if (reactor.Key == typeof(Scp173ObserveEvent)) continue;
if (reactor.Key == typeof(KeyPressEvent)) continue;
if (reactor.Key == typeof(SpeakEvent)) continue;
if (reactor.Key == typeof(RoundCheckEndEvent)) continue;
if (reactor.Key == typeof(SendPlayerDataEvent)) continue;
if (reactor.Key.IsAbstract) continue;
reactor.Value.SubscribeUnsafe(this, method);
}
_player.KeyPress.Subscribe(OnKeyPress);
_round.SelectTeam.Subscribe(ev =>
{
ev.TeamId = 15;
});
_round.SpawnTeam.Subscribe(ev =>
{
ev.Allow = false;
});
_player.Pickup.Subscribe(ev => ev.Allow = false);
}

public void Event(IEvent ev)
Expand All @@ -78,7 +65,8 @@ private void OnKeyPress(KeyPressEvent ev)
switch (ev.KeyCode)
{
case KeyCode.Alpha1:
Logger.Warn(ev.Player.MaxHealth);
ev.Player.Invisible += 1;
if (ev.Player.Invisible > InvisibleMode.Full) ev.Player.Invisible = InvisibleMode.None;
break;

case KeyCode.Alpha2:
Expand Down
21 changes: 8 additions & 13 deletions Synapse3.SynapseModule/Events/EventHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public bool PlayerChangeItemHook(IPlayer player, ushort oldItem, ushort newItem)
}
}

//TODO: Make this for all types of Damages not only damage by other player
[PluginEvent(ServerEventType.PlayerDamage)]
public bool PlayerDamageHook(IPlayer player, IPlayer target, DamageHandlerBase damageHandler)
{
Expand All @@ -62,19 +61,12 @@ public bool PlayerFreeHook(IPlayer player, IPlayer target)
FreePlayer.RaiseSafely(ev);
return ev.Allow;
}

[PluginEvent(ServerEventType.PlayerSearchPickup)]
public bool PlayerSearchedPickupHook(IPlayer player, ItemPickupBase item)
{
var ev = new PickupEvent(player.GetSynapsePlayer(), true, item.GetItem());
Pickup.RaiseSafely(ev);
return ev.Allow;
}
}

public partial class RoundEvents
{
private bool _firstTime = true;

[PluginEvent(ServerEventType.WaitingForPlayers)]
public void RoundWaitingHook()
{
Expand All @@ -87,7 +79,8 @@ public void RoundWaitingHook()
public void RoundStartHook() => Start.RaiseSafely(new RoundStartEvent());

[PluginEvent(ServerEventType.RoundEnd)]
public void RoundEndHook(RoundSummary.LeadingTeam leadingTeam) => End.RaiseSafely(new RoundEndEvent(RoundSummary.LeadingTeam.Draw));
public void RoundEndHook(RoundSummary.LeadingTeam leadingTeam) =>
End.RaiseSafely(new RoundEndEvent(RoundSummary.LeadingTeam.Draw));

[PluginEvent(ServerEventType.RoundRestart)]
public void RoundRestartHook() => Restart.RaiseSafely(new RoundRestartEvent());
Expand All @@ -102,9 +95,10 @@ public bool DecontaminationHook()
DecontaminationController.Singleton.NetworkDecontaminationOverride =
DecontaminationController.DecontaminationStatus.None;
}

return ev.Allow;
}

[PluginEvent(ServerEventType.WarheadStart)]
public bool WarheadStartHook(bool isAutomatic, IPlayer player, bool isResumed)
{
Expand Down Expand Up @@ -169,7 +163,8 @@ public bool PlayerCuffHook(IPlayer player, IPlayer target)
{
var synapsePlayer = player.GetSynapsePlayer();
var synapseTarget = target.GetSynapsePlayer();
var ev = new DisarmEvent(synapsePlayer.Inventory.ItemInHand, ItemInteractState.Finalize, synapsePlayer, synapseTarget);
var ev = new DisarmEvent(synapsePlayer.Inventory.ItemInHand, ItemInteractState.Finalize, synapsePlayer,
synapseTarget);
Disarm.RaiseSafely(ev);
return ev.Allow;
}
Expand Down Expand Up @@ -197,7 +192,7 @@ public bool DetonateWarheadHook()
DetonateWarhead.RaiseSafely(ev);
return ev.Allow;
}

[PluginEvent(ServerEventType.WarheadStop)]
public bool PlayerCancelWarhead(IPlayer player)
{
Expand Down
5 changes: 4 additions & 1 deletion Synapse3.SynapseModule/Events/MapEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,14 @@ public ElevatorMoveContentEvent(IElevator elevator)

public class TriggerTeslaEvent : PlayerInteractEvent
{
public TriggerTeslaEvent(SynapsePlayer player, bool allow, SynapseTesla tesla) : base(player, allow)
public TriggerTeslaEvent(SynapsePlayer player, bool allow, SynapseTesla tesla, bool idle) : base(player, allow)
{
Tesla = tesla;
Idle = idle;
}

public bool Idle { get; }

public SynapseTesla Tesla { get; }
}

Expand Down
5 changes: 4 additions & 1 deletion Synapse3.SynapseModule/Events/PlayerEvents.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Hazards;
using Interactables.Interobjects.DoorUtils;
using MEC;
using Neuron.Core.Events;
using Neuron.Core.Meta;
using PlayerRoles;
Expand Down Expand Up @@ -72,11 +71,13 @@ public override void Enable()
_eventManager.RegisterEvent(KeyPress);
_eventManager.RegisterEvent(HarmPermission);
_eventManager.RegisterEvent(SetClass);
_eventManager.RegisterEvent(Update);
_eventManager.RegisterEvent(StartWarhead);
_eventManager.RegisterEvent(DoorInteract);
_eventManager.RegisterEvent(LockerUse);
_eventManager.RegisterEvent(WarheadPanelInteract);
_eventManager.RegisterEvent(Ban);
_eventManager.RegisterEvent(Damage);
_eventManager.RegisterEvent(ChangeItem);
_eventManager.RegisterEvent(Death);
_eventManager.RegisterEvent(FreePlayer);
Expand Down Expand Up @@ -114,11 +115,13 @@ public override void Disable()
_eventManager.UnregisterEvent(KeyPress);
_eventManager.UnregisterEvent(HarmPermission);
_eventManager.UnregisterEvent(SetClass);
_eventManager.UnregisterEvent(Update);
_eventManager.UnregisterEvent(StartWarhead);
_eventManager.UnregisterEvent(DoorInteract);
_eventManager.UnregisterEvent(LockerUse);
_eventManager.UnregisterEvent(WarheadPanelInteract);
_eventManager.UnregisterEvent(Ban);
_eventManager.UnregisterEvent(Damage);
_eventManager.UnregisterEvent(ChangeItem);
_eventManager.UnregisterEvent(Death);
_eventManager.UnregisterEvent(FreePlayer);
Expand Down
141 changes: 0 additions & 141 deletions Synapse3.SynapseModule/OldPatches/CommandPatches.cs

This file was deleted.

Loading

0 comments on commit 9771bbd

Please sign in to comment.