From fd4fc7189e0581105c56099c5c8a32cd99e1992c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 27 Dec 2023 06:28:50 +1100 Subject: [PATCH] Fix last commit --- MCGalaxy/CorePlugin/ChatHandler.cs | 4 ++-- MCGalaxy/Database/ColumnDesc.cs | 6 +++--- MCGalaxy/Modules/Relay/RelayBot.cs | 12 ++++++------ MCGalaxy/Network/Sockets.cs | 2 +- MCGalaxy/util/NET_20.cs | 14 ++++++++------ MCGalaxy/util/Threading/IReaderWriterLock.cs | 14 +++++++------- 6 files changed, 27 insertions(+), 25 deletions(-) diff --git a/MCGalaxy/CorePlugin/ChatHandler.cs b/MCGalaxy/CorePlugin/ChatHandler.cs index 0da024ed6..3f1e1af2d 100644 --- a/MCGalaxy/CorePlugin/ChatHandler.cs +++ b/MCGalaxy/CorePlugin/ChatHandler.cs @@ -24,7 +24,7 @@ namespace MCGalaxy.Core { internal static void HandleOnChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool irc) { - msg = msg.Replace("λFULL", source.name).Replace("λNICK", source.name); + string text = msg.Replace("λFULL", source.name).Replace("λNICK", source.name); LogType logType = LogType.PlayerChat; if (scope == ChatScope.Perms) { @@ -35,7 +35,7 @@ namespace MCGalaxy.Core { logType = LogType.RankChat; } - if (scope != ChatScope.PM) Logger.Log(logType, msg); + if (scope != ChatScope.PM) Logger.Log(logType, text); } internal static void HandleCommand(Player p, string cmd, string args, CommandData data) { diff --git a/MCGalaxy/Database/ColumnDesc.cs b/MCGalaxy/Database/ColumnDesc.cs index d2d027fbd..a7a159856 100644 --- a/MCGalaxy/Database/ColumnDesc.cs +++ b/MCGalaxy/Database/ColumnDesc.cs @@ -52,9 +52,9 @@ namespace MCGalaxy.SQL } static string[] colTypes = new string[] { - "TINYINT UNSIGNED", "SMALLINT UNSIGNED", "MEDIUMINT UNSIGNED", - "INT UNSIGNED", "BIGINT UNSIGNED", "TINYINT", "SMALLINT", - "MEDIUMINT", "INT", "BIGINT", "INTEGER", "DATETIME", + "TINYINT UNSIGNED", "SMALLINT UNSIGNED", "MEDIUMINT UNSIGNED", "INT UNSIGNED", "BIGINT UNSIGNED", + "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT", + "INTEGER", "DATETIME", }; } diff --git a/MCGalaxy/Modules/Relay/RelayBot.cs b/MCGalaxy/Modules/Relay/RelayBot.cs index ce042ead5..c196962b3 100644 --- a/MCGalaxy/Modules/Relay/RelayBot.cs +++ b/MCGalaxy/Modules/Relay/RelayBot.cs @@ -325,24 +325,24 @@ namespace MCGalaxy.Modules.Relay ref ChatMessageFilter filter, bool relay) { if (!relay) return; - msg = PrepareMessage(msg); - MessageToRelay(scope, msg, arg, filter); + string text = PrepareMessage(msg); + MessageToRelay(scope, text, arg, filter); } void OnChatFrom(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool relay) { if (!relay) return; - msg = PrepareMessage(msg); - MessageToRelay(scope, Unescape(source, msg), arg, filter); + string text = PrepareMessage(msg); + MessageToRelay(scope, Unescape(source, text), arg, filter); } void OnChat(ChatScope scope, Player source, ref string msg, object arg, ref ChatMessageFilter filter, bool relay) { if (!relay) return; - msg = PrepareMessage(msg); - MessageToRelay(scope, Unescape(source, msg), arg, filter); + string text = PrepareMessage(msg); + MessageToRelay(scope, Unescape(source, text), arg, filter); } void OnShutdown(bool restarting, string message) { diff --git a/MCGalaxy/Network/Sockets.cs b/MCGalaxy/Network/Sockets.cs index e8d114ebf..c8e950172 100644 --- a/MCGalaxy/Network/Sockets.cs +++ b/MCGalaxy/Network/Sockets.cs @@ -44,7 +44,7 @@ namespace MCGalaxy.Network /// Initialises state to begin asynchronously sending and receiving data public abstract void Init(); /// Sends a block of data - public abstract void Send(byte[] buffer, SendFlags flags); + public abstract void Send(byte[] buffer, SendFlags flags); /// Closes this network socket public abstract void Close(); diff --git a/MCGalaxy/util/NET_20.cs b/MCGalaxy/util/NET_20.cs index 5aef8e117..363262c74 100644 --- a/MCGalaxy/util/NET_20.cs +++ b/MCGalaxy/util/NET_20.cs @@ -20,15 +20,16 @@ using System.Collections.Generic; using System.Threading; #if NET_20 -namespace System.Runtime.CompilerServices { +namespace System.Runtime.CompilerServices +{ [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)] public sealed class ExtensionAttribute : Attribute {} } -namespace MCGalaxy.Util { - - public sealed class IReaderWriterLock { - +namespace MCGalaxy.Util +{ + public sealed class IReaderWriterLock + { ReaderWriterLock locker = new ReaderWriterLock(); public IDisposable AccquireRead() { return AccquireRead(int.MaxValue); } @@ -53,7 +54,8 @@ namespace MCGalaxy.Util { } - class SlimLock : IDisposable { + class SlimLock : IDisposable + { ReaderWriterLock locker; bool writeMode; diff --git a/MCGalaxy/util/Threading/IReaderWriterLock.cs b/MCGalaxy/util/Threading/IReaderWriterLock.cs index 4ae322a62..dffe275fa 100644 --- a/MCGalaxy/util/Threading/IReaderWriterLock.cs +++ b/MCGalaxy/util/Threading/IReaderWriterLock.cs @@ -19,10 +19,10 @@ using System; using System.Threading; #if !NET_20 -namespace MCGalaxy.Util { - - public sealed class IReaderWriterLock { - +namespace MCGalaxy.Util +{ + public sealed class IReaderWriterLock + { ReaderWriterLockSlim locker = new ReaderWriterLockSlim(); public IDisposable AccquireRead() { return AccquireRead(-1); } @@ -37,9 +37,9 @@ namespace MCGalaxy.Util { if (!locker.TryEnterWriteLock(msTimeout)) return null; return new SlimLock(locker, true); } - - - class SlimLock : IDisposable { + + class SlimLock : IDisposable + { ReaderWriterLockSlim locker; bool writeMode;