mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
now messages show on IRC (still a bit broken though)
This commit is contained in:
parent
b5e327eded
commit
046b478a93
@ -106,10 +106,8 @@ namespace MCGalaxy {
|
|||||||
|
|
||||||
public static void MessageAll(string msg) { Message(ChatScope.All, msg, null, null); }
|
public static void MessageAll(string msg) { Message(ChatScope.All, msg, null, null); }
|
||||||
public static void MessageGlobal(string msg) { Message(ChatScope.Global, msg, null, null); }
|
public static void MessageGlobal(string msg) { Message(ChatScope.Global, msg, null, null); }
|
||||||
public static void MessageOps(string msg) { MessageAboveOrSameRank(OpchatPerm, msg); }
|
public static void MessageOps(string msg) {
|
||||||
|
Message(ChatScope.AboveEqRank, msg, OpchatPerm, null);
|
||||||
public static void MessageAboveOrSameRank(LevelPermission rank, string msg) {
|
|
||||||
Message(ChatScope.AboveEqRank, msg, rank, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MessageGlobal(string message, object a0) {
|
public static void MessageGlobal(string message, object a0) {
|
||||||
|
@ -33,9 +33,9 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
if (args[1] == "loving" || args[1] == "creepy" || args[1] == "friendly" || args[1] == "deadly")
|
if (args[1] == "loving" || args[1] == "creepy" || args[1] == "friendly" || args[1] == "deadly")
|
||||||
hugType = args[1];
|
hugType = args[1];
|
||||||
}
|
}
|
||||||
if (hugType == null) { TryMessageAction(p, args[0], "{0} %Shugged {1}", false); return; }
|
if (hugType == null) { TryMessageAction(p, args[0], "λNICK %Shugged λTARGET", false); return; }
|
||||||
|
|
||||||
TryMessageAction(p, args[0], "{0} %Sgave {1} %Sa " + hugType + " hug", false);
|
TryMessageAction(p, args[0], "λNICK %Sgave λTARGET %Sa " + hugType + " hug", false);
|
||||||
if (hugType == "deadly") {
|
if (hugType == "deadly") {
|
||||||
if (!CheckExtraPerm(p, 1)) return;
|
if (!CheckExtraPerm(p, 1)) return;
|
||||||
Player target = PlayerInfo.FindMatches(p, args[0]);
|
Player target = PlayerInfo.FindMatches(p, args[0]);
|
||||||
|
@ -19,26 +19,25 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
public abstract class MessageCmd : Command {
|
public abstract class MessageCmd : Command {
|
||||||
public override string type { get { return CommandTypes.Chat; } }
|
public override string type { get { return CommandTypes.Chat; } }
|
||||||
|
|
||||||
protected bool TryMessageAction(Player p, string name, string message, bool messageWho) {
|
protected bool TryMessageAction(Player p, string name, string msg, bool messageWho) {
|
||||||
if (name.Length == 0) { Help(p); return false; }
|
if (name.Length == 0) { Help(p); return false; }
|
||||||
Player target = PlayerInfo.FindMatches(p, name);
|
Player target = PlayerInfo.FindMatches(p, name);
|
||||||
if (target == null) return false;
|
if (target == null) return false;
|
||||||
|
|
||||||
string giver = (p == null) ? "(console)" : p.ColoredName;
|
|
||||||
string reciever = p == target ? "themselves" : target.ColoredName;
|
string reciever = p == target ? "themselves" : target.ColoredName;
|
||||||
if (!TryMessage(p, string.Format(message, giver, reciever))) return false;
|
if (!TryMessage(p, msg.Replace("λTARGET", reciever))) return false;
|
||||||
|
|
||||||
if (messageWho && p != target && Chat.NotIgnoring(target, p)) {
|
if (messageWho && p != target && Chat.NotIgnoring(target, p)) {
|
||||||
Player.Message(target, string.Format(message, giver, "you"));
|
string giver = (p == null) ? "(console)" : p.ColoredName;
|
||||||
|
msg = msg.Replace("λNICK", giver);
|
||||||
|
Player.Message(target, msg.Replace("λTARGET", "you"));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool TryMessage(Player p, string message) { return TryMessage(p, message, name); }
|
protected bool TryMessage(Player p, string msg) {
|
||||||
|
if (!CanSpeak(p, name)) return false;
|
||||||
protected static bool TryMessage(Player p, string message, string cmd) {
|
Chat.MessageFrom(p, msg, null);
|
||||||
if (!CanSpeak(p, cmd)) return false;
|
|
||||||
Chat.MessageFrom(p, message, null);
|
|
||||||
|
|
||||||
p.CheckForMessageSpam();
|
p.CheckForMessageSpam();
|
||||||
return true;
|
return true;
|
||||||
@ -61,7 +60,7 @@ namespace MCGalaxy.Commands.Chatting {
|
|||||||
public override string name { get { return "High5"; } }
|
public override string name { get { return "High5"; } }
|
||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
TryMessageAction(p, message, "{0} %Sjust highfived {1}", true);
|
TryMessageAction(p, message, "λNICK %Sjust highfived λTARGET", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
|
@ -44,7 +44,7 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
perms.Allowed.Add(grp.Permission);
|
perms.Allowed.Add(grp.Permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePermissions(block, p, " can now be used by " + grp.ColoredName);
|
UpdatePermissions(block, p, " %Scan now be used by " + grp.ColoredName);
|
||||||
} else if (args.Length == 2 && args[1][0] == '-') {
|
} else if (args.Length == 2 && args[1][0] == '-') {
|
||||||
Group grp = GetGroup(p, args[1].Substring(1));
|
Group grp = GetGroup(p, args[1].Substring(1));
|
||||||
if (grp == null) return;
|
if (grp == null) return;
|
||||||
@ -60,14 +60,14 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
perms.Disallowed.Add(grp.Permission);
|
perms.Disallowed.Add(grp.Permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePermissions(block, p, " is no longer usable by " + grp.ColoredName);
|
UpdatePermissions(block, p, " %Sis no longer usable by " + grp.ColoredName);
|
||||||
} else if (args.Length == 2) {
|
} else if (args.Length == 2) {
|
||||||
Group grp = GetGroup(p, args[1]);
|
Group grp = GetGroup(p, args[1]);
|
||||||
if (grp == null) return;
|
if (grp == null) return;
|
||||||
BlockPerms perms = BlockPerms.List[block];
|
BlockPerms perms = BlockPerms.List[block];
|
||||||
|
|
||||||
perms.MinRank = grp.Permission;
|
perms.MinRank = grp.Permission;
|
||||||
UpdatePermissions(block, p, "'s permission was set to " + grp.ColoredName);
|
UpdatePermissions(block, p, "%S's permission was set to " + grp.ColoredName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string name = Block.GetName(p, block);
|
string name = Block.GetName(p, block);
|
||||||
Chat.MessageGlobal("&d{0}%S{1}", name, message);
|
Chat.MessageAll("&d" + name + message);
|
||||||
if (Player.IsSuper(p)) Player.Message(p, name + message);
|
if (Player.IsSuper(p)) Player.Message(p, name + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
perms.Allowed.Add(grp.Permission);
|
perms.Allowed.Add(grp.Permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePermissions(cmd, p, " can now be used by " + grp.ColoredName);
|
UpdatePermissions(cmd, p, " %Scan now be used by " + grp.ColoredName);
|
||||||
} else if (args.Length == 2 && args[1][0] == '-') {
|
} else if (args.Length == 2 && args[1][0] == '-') {
|
||||||
Group grp = GetGroup(p, args[1].Substring(1));
|
Group grp = GetGroup(p, args[1].Substring(1));
|
||||||
if (grp == null) return;
|
if (grp == null) return;
|
||||||
@ -61,14 +61,14 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
perms.Disallowed.Add(grp.Permission);
|
perms.Disallowed.Add(grp.Permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdatePermissions(cmd, p, " is no longer usable by " + grp.ColoredName);
|
UpdatePermissions(cmd, p, " %Sis no longer usable by " + grp.ColoredName);
|
||||||
} else if (args.Length == 2) {
|
} else if (args.Length == 2) {
|
||||||
Group grp = GetGroup(p, args[1]);
|
Group grp = GetGroup(p, args[1]);
|
||||||
if (grp == null) return;
|
if (grp == null) return;
|
||||||
CommandPerms perms = CommandPerms.Find(cmd.name);
|
CommandPerms perms = CommandPerms.Find(cmd.name);
|
||||||
|
|
||||||
perms.MinRank = grp.Permission;
|
perms.MinRank = grp.Permission;
|
||||||
UpdatePermissions(cmd, p, "'s permission was set to " + grp.ColoredName);
|
UpdatePermissions(cmd, p, "%S's permission was set to " + grp.ColoredName);
|
||||||
} else {
|
} else {
|
||||||
int otherPermIndex = 0;
|
int otherPermIndex = 0;
|
||||||
if (!CommandParser.GetInt(p, args[2], "Extra permission number", ref otherPermIndex)) return;
|
if (!CommandParser.GetInt(p, args[2], "Extra permission number", ref otherPermIndex)) return;
|
||||||
@ -86,10 +86,8 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
perms.MinRank = grp.Permission;
|
perms.MinRank = grp.Permission;
|
||||||
CommandExtraPerms.Save();
|
CommandExtraPerms.Save();
|
||||||
|
|
||||||
string permName = "extra permission " + otherPermIndex;
|
string msg = "extra permission " + otherPermIndex;
|
||||||
Chat.MessageGlobal("&d{0}%S's {1} was set to {2}", cmd.name, permName, grp.ColoredName);
|
Announce(p, cmd.name + "%S's " + msg + " was set to " + grp.ColoredName);
|
||||||
if (Player.IsSuper(p))
|
|
||||||
Player.Message(p, "{0}'s {1} was set to {2}", cmd.name, permName, grp.ColoredName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,13 +101,15 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
return grp;
|
return grp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UpdatePermissions(Command cmd, Player p, string message) {
|
static void UpdatePermissions(Command cmd, Player p, string msg) {
|
||||||
CommandPerms.Save();
|
CommandPerms.Save();
|
||||||
CommandPerms.Load();
|
CommandPerms.Load();
|
||||||
|
Announce(p, cmd.name + msg);
|
||||||
|
}
|
||||||
|
|
||||||
Chat.MessageGlobal("&d{0}%S{1}", cmd.name, message);
|
static void Announce(Player p, string msg) {
|
||||||
if (Player.IsSuper(p))
|
Chat.MessageAll("&d" + msg);
|
||||||
Player.Message(p, cmd.name + message);
|
if (Player.IsSuper(p)) Player.Message(p, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
|
@ -166,8 +166,9 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
File.WriteAllLines("extra/reported/" + target + ".txt", reports.ToArray());
|
File.WriteAllLines("extra/reported/" + target + ".txt", reports.ToArray());
|
||||||
Player.Message(p, "&aReport sent! It should be viewed when a {0}&a+ is online", checkRankName);
|
Player.Message(p, "&aReport sent! It should be viewed when a {0}&a+ is online", checkRankName);
|
||||||
|
|
||||||
string opsMsg = p.ColoredName + " %Smade a report, view it with %T/Report check " + target;
|
string opsMsg = "λNICK %Smade a report, view it with %T/Report check " + target;
|
||||||
Chat.MessageAboveOrSameRank(checkRank, opsMsg);
|
Chat.MessageFrom(ChatScope.AboveEqRank, p, opsMsg,
|
||||||
|
checkRank, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Written by BeMacized
|
Written by BeMacized
|
||||||
Assisted by RedNoodle
|
Assisted by RedNoodle
|
||||||
|
|
||||||
@ -72,22 +72,18 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Server.reviewlist.Add(p.name);
|
Server.reviewlist.Add(p.name);
|
||||||
int pos = Server.reviewlist.IndexOf(p.name);
|
int pos = Server.reviewlist.IndexOf(p.name) + 1;
|
||||||
if (pos > 1) { Player.Message(p, "You entered the &creview %Squeue. You have &c" + pos + " %Speople in front of you in the queue"); }
|
Player.Message(p, "You entered the &creview %Squeue at &aposition #" + pos);
|
||||||
if (pos == 1) { Player.Message(p, "You entered the &creview %Squeue. There is &c1 %Sperson in front of you in the queue"); }
|
|
||||||
if (pos == 0) { Player.Message(p, "You entered the &creview %Squeue. You are &cfirst %Sin line!"); }
|
|
||||||
|
|
||||||
string msg = opsOn ?
|
string msg = opsOn ?
|
||||||
"The Online staff have been notified. Someone should be with you shortly." :
|
"The online staff have been notified. Someone should be with you shortly." :
|
||||||
"There are currently no staff online. Staff will be notified when they join the server.";
|
"There are currently no staff online. Staff will be notified when they join the server.";
|
||||||
Player.Message(p, msg);
|
Player.Message(p, msg);
|
||||||
|
|
||||||
string start = pos > 0 ? "There are now &c" + (pos + 1) + " %Speople" : "There is now &c1 %Sperson";
|
Chat.MessageFrom(ChatScope.AboveEqRank, p,
|
||||||
Chat.MessageAboveOrSameRank(nextPerm, p.ColoredName + " %Sis requesting a review!");
|
"λNICK %Srequested a review! &c(Total " + pos + " waiting)", nextPerm, null, true);
|
||||||
Chat.MessageAboveOrSameRank(nextPerm, start + " waiting for a &creview!");
|
|
||||||
|
|
||||||
p.NextReviewTime = DateTime.UtcNow.AddSeconds(ServerConfig.ReviewCooldown);
|
p.NextReviewTime = DateTime.UtcNow.AddSeconds(ServerConfig.ReviewCooldown);
|
||||||
OnPlayerActionEvent.Call(p, PlayerAction.Review, null, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleView(Player p) {
|
void HandleView(Player p) {
|
||||||
@ -109,17 +105,12 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
void HandleLeave(Player p) {
|
void HandleLeave(Player p) {
|
||||||
if (p == null) { Player.Message(p, "Console cannot leave the review queue."); return; }
|
if (p == null) { Player.Message(p, "Console cannot leave the review queue."); return; }
|
||||||
|
|
||||||
bool inQueue = false;
|
if (Server.reviewlist.CaselessRemove(p.name)) {
|
||||||
foreach (string who in Server.reviewlist) {
|
AnnounceQueueChanged();
|
||||||
inQueue |= who.CaselessEq(p.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!inQueue) {
|
|
||||||
Player.Message(p, "You aren't in the review queue so you cannot leave it."); return;
|
|
||||||
}
|
|
||||||
Server.reviewlist.Remove(p.name);
|
|
||||||
MessageReviewPosChanged();
|
|
||||||
Player.Message(p, "You have left the review queue!");
|
Player.Message(p, "You have left the review queue!");
|
||||||
|
} else {
|
||||||
|
Player.Message(p, "You weren't in the review queue to begin with.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleNext(Player p) {
|
void HandleNext(Player p) {
|
||||||
@ -131,21 +122,17 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
|
|
||||||
string user = Server.reviewlist[0];
|
string user = Server.reviewlist[0];
|
||||||
Player who = PlayerInfo.FindExact(user);
|
Player who = PlayerInfo.FindExact(user);
|
||||||
|
Server.reviewlist.RemoveAt(0);
|
||||||
|
|
||||||
if (who == null) {
|
if (who == null) {
|
||||||
Player.Message(p, "Player " + user + " doesn't exist or is offline, and was removed from the review queue");
|
Player.Message(p, "Player " + user + " is offline, and was removed from the review queue");
|
||||||
Server.reviewlist.Remove(user);
|
|
||||||
return;
|
|
||||||
} else if (who == p) {
|
|
||||||
Player.Message(p, "Cannot teleport to yourself. You have been removed from the review queue.");
|
|
||||||
Server.reviewlist.Remove(user);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Server.reviewlist.Remove(user);
|
|
||||||
Command.Find("TP").Use(p, who.name);
|
Command.Find("TP").Use(p, who.name);
|
||||||
Player.Message(p, "You have been teleported to " + user);
|
Player.Message(p, "You have been teleported to " + user);
|
||||||
Player.Message(who, "Your review request has been answered by " + p.name + ".");
|
Player.Message(who, "Your review request has been answered by " + p.ColoredName + ".");
|
||||||
MessageReviewPosChanged();
|
AnnounceQueueChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleClear(Player p) {
|
void HandleClear(Player p) {
|
||||||
@ -154,13 +141,14 @@ namespace MCGalaxy.Commands.Moderation {
|
|||||||
Player.Message(p, "The review queue has been cleared");
|
Player.Message(p, "The review queue has been cleared");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MessageReviewPosChanged() {
|
static void AnnounceQueueChanged() {
|
||||||
int count = 0;
|
int pos = 1;
|
||||||
foreach (string name in Server.reviewlist) {
|
foreach (string name in Server.reviewlist) {
|
||||||
Player who = PlayerInfo.FindExact(name);
|
Player who = PlayerInfo.FindExact(name);
|
||||||
if (who == null) continue;
|
if (who == null) continue;
|
||||||
Player.Message(who, "The review queue has changed. You now have " + count + " players in front of you.");
|
|
||||||
count++;
|
Player.Message(who, "The review queue has changed. You are now at &aposition #" + pos);
|
||||||
|
pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ using System;
|
|||||||
using BlockID = System.UInt16;
|
using BlockID = System.UInt16;
|
||||||
|
|
||||||
namespace MCGalaxy.Events.PlayerEvents {
|
namespace MCGalaxy.Events.PlayerEvents {
|
||||||
public enum PlayerAction { Me, Review, Referee, UnReferee };
|
public enum PlayerAction { Me, Referee, UnReferee };
|
||||||
|
|
||||||
public delegate void OnPlayerChat(Player p, string message);
|
public delegate void OnPlayerChat(Player p, string message);
|
||||||
/// <summary> Called whenever a player chats on the server. </summary>
|
/// <summary> Called whenever a player chats on the server. </summary>
|
||||||
|
@ -50,10 +50,13 @@ namespace MCGalaxy.Network {
|
|||||||
if (hookedEvents) return;
|
if (hookedEvents) return;
|
||||||
hookedEvents = true;
|
hookedEvents = true;
|
||||||
|
|
||||||
OnPlayerChatEvent.Register(HandleChat, Priority.Low);
|
|
||||||
OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low);
|
OnPlayerActionEvent.Register(HandlePlayerAction, Priority.Low);
|
||||||
OnShuttingDownEvent.Register(HandleShutdown, Priority.Low);
|
OnShuttingDownEvent.Register(HandleShutdown, Priority.Low);
|
||||||
|
|
||||||
|
OnChatEvent.Register(HandleChat, Priority.Low);
|
||||||
|
OnChatSysEvent.Register(HandleChatSys, Priority.Low);
|
||||||
|
OnChatFromEvent.Register(HandleChatFrom, Priority.Low);
|
||||||
|
|
||||||
// Regster events for incoming
|
// Regster events for incoming
|
||||||
bot.connection.Listener.OnNick += Listener_OnNick;
|
bot.connection.Listener.OnNick += Listener_OnNick;
|
||||||
bot.connection.Listener.OnRegistered += Listener_OnRegistered;
|
bot.connection.Listener.OnRegistered += Listener_OnRegistered;
|
||||||
@ -78,10 +81,13 @@ namespace MCGalaxy.Network {
|
|||||||
hookedEvents = false;
|
hookedEvents = false;
|
||||||
userMap.Clear();
|
userMap.Clear();
|
||||||
|
|
||||||
OnPlayerChatEvent.Unregister(HandleChat);
|
|
||||||
OnPlayerActionEvent.Unregister(HandlePlayerAction);
|
OnPlayerActionEvent.Unregister(HandlePlayerAction);
|
||||||
OnShuttingDownEvent.Unregister(HandleShutdown);
|
OnShuttingDownEvent.Unregister(HandleShutdown);
|
||||||
|
|
||||||
|
OnChatEvent.Unregister(HandleChat);
|
||||||
|
OnChatSysEvent.Unregister(HandleChatSys);
|
||||||
|
OnChatFromEvent.Unregister(HandleChatFrom);
|
||||||
|
|
||||||
// Regster events for incoming
|
// Regster events for incoming
|
||||||
bot.connection.Listener.OnNick -= Listener_OnNick;
|
bot.connection.Listener.OnNick -= Listener_OnNick;
|
||||||
bot.connection.Listener.OnRegistered -= Listener_OnRegistered;
|
bot.connection.Listener.OnRegistered -= Listener_OnRegistered;
|
||||||
@ -102,25 +108,33 @@ namespace MCGalaxy.Network {
|
|||||||
|
|
||||||
|
|
||||||
void HandlePlayerAction(Player p, PlayerAction action, string message, bool stealth) {
|
void HandlePlayerAction(Player p, PlayerAction action, string message, bool stealth) {
|
||||||
if (!p.level.SeesServerWideChat) return;
|
if (!p.level.SeesServerWideChat || action != PlayerAction.Me) return;
|
||||||
string msg = null;
|
bot.Say("*" + p.DisplayName + " " + message, stealth);
|
||||||
if (p.muted || (Server.chatmod && !p.voice)) return;
|
|
||||||
|
|
||||||
if (action == PlayerAction.Me)
|
|
||||||
msg = "*" + p.DisplayName + " " + message;
|
|
||||||
else if (action == PlayerAction.Review)
|
|
||||||
msg = p.ColoredName + " %Sis requesting a review.";
|
|
||||||
|
|
||||||
if (msg != null) bot.Say(msg, stealth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static char[] trimChars = new char[] { ' ' };
|
void HandleChatSys(ChatScope scope, ref string msg, object arg,
|
||||||
void HandleChat(Player p, string message) {
|
ref ChatMessageFilter filter, bool irc) {
|
||||||
if (p.cancelchat || !p.level.SeesServerWideChat) return;
|
if (!irc) return;
|
||||||
if (message.Trim(trimChars).Length == 0) return;
|
// TODO: Check filter
|
||||||
|
bot.Say(msg);
|
||||||
|
}
|
||||||
|
|
||||||
string name = ServerConfig.IRCShowPlayerTitles ? p.FullName : p.group.Prefix + p.ColoredName;
|
void HandleChatFrom(ChatScope scope, Player source, ref string msg,
|
||||||
bot.Say(name + "%S: " + message, p.opchat);
|
object arg, ref ChatMessageFilter filter, bool irc) {
|
||||||
|
if (!irc) return;
|
||||||
|
// TODO: Check filter
|
||||||
|
string full = ServerConfig.IRCShowPlayerTitles ? source.FullName : source.group.Prefix + source.ColoredName;
|
||||||
|
msg = msg.Replace("λFULL", full).Replace("λNICK", source.ColoredName);
|
||||||
|
bot.Say(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HandleChat(ChatScope scope, Player source, ref string msg,
|
||||||
|
object arg, ref ChatMessageFilter filter, bool irc) {
|
||||||
|
if (!irc) return;
|
||||||
|
// TODO: Check filter
|
||||||
|
string full = ServerConfig.IRCShowPlayerTitles ? source.FullName : source.group.Prefix + source.ColoredName;
|
||||||
|
msg = msg.Replace("λFULL", full).Replace("λNICK", source.ColoredName);
|
||||||
|
bot.Say(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleShutdown(bool restarting, string message) {
|
void HandleShutdown(bool restarting, string message) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user