Fix last commit

This commit is contained in:
UnknownShadow200 2023-12-27 06:28:50 +11:00
parent be7765797c
commit fd4fc7189e
6 changed files with 27 additions and 25 deletions

View File

@ -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) {

View File

@ -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",
};
}

View File

@ -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) {

View File

@ -44,7 +44,7 @@ namespace MCGalaxy.Network
/// <summary> Initialises state to begin asynchronously sending and receiving data </summary>
public abstract void Init();
/// <summary> Sends a block of data </summary>
public abstract void Send(byte[] buffer, SendFlags flags);
public abstract void Send(byte[] buffer, SendFlags flags);
/// <summary> Closes this network socket </summary>
public abstract void Close();

View File

@ -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;

View File

@ -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;