Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

Commit

Permalink
Minimal rework
Browse files Browse the repository at this point in the history
  • Loading branch information
fr34kyn01535 committed Apr 15, 2018
1 parent 383b504 commit 3c0c449
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 17 deletions.
5 changes: 5 additions & 0 deletions Rocket.Unturned.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/Environment/Hierarchy/PsiConfigurationSettingsKey/CustomLocation/@EntryValue">C:\Users\fr34kyn01535\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v11_de26377b\SolutionCaches</s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=4336D786FB68B645A41959420963CC29/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=4336D786FB68B645A41959420963CC29/AbsolutePath/@EntryValue">C:\Users\fr34kyn01535\GitHub\Rocket.Unturned\Rocket.Unturned.sln.DotSettings</s:String>
<s:String x:Key="/Default/Environment/InjectedLayers/FileInjectedLayer/=4336D786FB68B645A41959420963CC29/RelativePath/@EntryValue"></s:String>
<s:Boolean x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File4336D786FB68B645A41959420963CC29/@KeyIndexDefined">True</s:Boolean>
<s:Double x:Key="/Default/Environment/InjectedLayers/InjectedLayerCustomization/=File4336D786FB68B645A41959420963CC29/RelativePriority/@EntryValue">1</s:Double>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchBehaviour/=AutoRecoverer/@EntryIndexedValue">LIVE_MONITOR</s:String>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchBehaviour/=Format/@EntryIndexedValue">LIVE_MONITOR</s:String>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchBehaviour/=Roslyn_002Dswea/@EntryIndexedValue">DO_NOTHING</s:String>
Expand Down
9 changes: 4 additions & 5 deletions Rocket.Unturned/Chat/UnturnedChatManager.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using Rocket.Unturned.Events;
using SDG.Unturned;
using SDG.Unturned;
using System.Collections.Generic;
using Rocket.API;
using Rocket.API.Chat;
using Rocket.API.DependencyInjection;
using Rocket.API.Eventing;
using Rocket.API.I18N;
using Rocket.API.Player;
using Rocket.Unturned.Events.Player;
using Steamworks;
using UnityEngine;
using ILogger = Rocket.API.Logging.ILogger;
using Rocket.Unturned.Player.Events;

namespace Rocket.Unturned.Chat
{
Expand All @@ -30,7 +29,7 @@ public UnturnedChatManager(ILogger logger, IImplementation implementation, IEven
this.playerManager = playerManager;

ChatManager.onChatted += HandleChat;

CommandWindow.onCommandWindowOutputted += (text, color)
=> logger.LogInformation(text?.ToString());
}
Expand Down Expand Up @@ -71,7 +70,7 @@ private void HandleChat(SteamPlayer player, EChatMode mode, ref Color color, ref
UnturnedPlayerChatEvent @event = new UnturnedPlayerChatEvent(p, mode, color, isRich, message, !isVisible);
eventManager.Emit(implementation, @event);
color = @event.Color;
isRich = @event.IsRich;
isRich = @event.IsRichText;
isVisible = !@event.IsCancelled;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
using SDG.Unturned;
using UnityEngine;

namespace Rocket.Unturned.Events.Player
namespace Rocket.Unturned.Player.Events
{
public class UnturnedPlayerChatEvent : PlayerChatEvent
{
public EChatMode Mode { get; }
public Color Color { get; set; }
public bool IsRich { get; set; }
public bool IsRichText { get; set; }

public UnturnedPlayerChatEvent(IPlayer player, EChatMode mode, Color color, bool isRich, string message,
public UnturnedPlayerChatEvent(IPlayer player, EChatMode mode, Color color, bool isRichText, string message,
bool cancelled) : base(player, null, message, EventExecutionTargetContext.Sync)
{
Mode = mode;
Color = color;
IsRich = isRich;
IsRichText = isRichText;
IsCancelled = cancelled;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Rocket.Core.Events.Player;
using UnityEngine;

namespace Rocket.Unturned.Events.Player
namespace Rocket.Unturned.Player.Events
{
public class UnturnedPlayerDeadEvent : PlayerEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Rocket.Core.Events.Player;
using SDG.Unturned;

namespace Rocket.Unturned.Events.Player
namespace Rocket.Unturned.Player.Events
{
public class UnturnedPlayerDeathEvent : PlayerDeathEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using SDG.Unturned;
using Steamworks;

namespace Rocket.Unturned.Events.Player
namespace Rocket.Unturned.Player.Events
{
public class UnturnedPlayerPreConnectEvent : PlayerPreConnectEvent
{
Expand Down
8 changes: 4 additions & 4 deletions Rocket.Unturned/Rocket.Unturned.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@
<Compile Include="Commands\VanillaCommand.cs" />
<Compile Include="Commands\VanillaCommandProvider.cs" />
<Compile Include="Console\ConsoleCaller.cs" />
<Compile Include="Events\Player\UnturnedPlayerDeadEvent.cs" />
<Compile Include="Events\Player\UnturnedPlayerDeathEvent.cs" />
<Compile Include="Player\Events\UnturnedPlayerDeadEvent.cs" />
<Compile Include="Player\Events\UnturnedPlayerDeathEvent.cs" />
<Compile Include="Player\PreConnectUnturnedPlayer.cs" />
<Compile Include="Events\Player\UnturnedPlayerChatEvent.cs" />
<Compile Include="Events\Player\UnturnedPlayerPreConnectEvent.cs" />
<Compile Include="Player\Events\UnturnedPlayerChatEvent.cs" />
<Compile Include="Player\Events\UnturnedPlayerPreConnectEvent.cs" />
<Compile Include="Player\UnturnedPlayerManager.cs" />
<Compile Include="Properties\DependencyRegistrator.cs" />
<Compile Include="Console\UnturnedConsoleWriter.cs" />
Expand Down
2 changes: 1 addition & 1 deletion Rocket.Unturned/UnturnedImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
using Rocket.Core.Events.Implementation;
using Rocket.Core.Events.Player;
using Rocket.Unturned.Console;
using Rocket.Unturned.Events.Player;
using Rocket.Unturned.Player;
using Rocket.Unturned.Player.Events;
using Rocket.Unturned.Utils;
using SDG.Unturned;
using Steamworks;
Expand Down

0 comments on commit 3c0c449

Please sign in to comment.