mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 13:15:42 +12:00
Allow bbcode in chat for admins
This commit is contained in:
parent
db9c973477
commit
87b3c8b0a0
4 changed files with 14 additions and 2 deletions
|
@ -492,7 +492,7 @@ namespace HISP.Game.Chat
|
|||
}
|
||||
public static string EscapeMessage(string message)
|
||||
{
|
||||
return message.Replace("<", "<");
|
||||
return message.Replace("&", "&").Replace("<", "<");
|
||||
}
|
||||
|
||||
public static string FormatChatForOthers(User user, ChatChannel channel, string message, bool autoReply=false)
|
||||
|
|
|
@ -54,6 +54,11 @@ enable_spam_filter=true
|
|||
# but of course you can make it whatever you want
|
||||
intrest_rate=3333
|
||||
|
||||
# Allows all users to use BBCODE in chat
|
||||
# BBCode is the [b] [blue] etc colors
|
||||
# If false, this only works for admins and moderators.
|
||||
allow_bbcode_in_chat=false
|
||||
|
||||
# Should print extra debug logs
|
||||
# 0 - no logs
|
||||
# 1 - errors only
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace HISP.Server
|
|||
public static int LogLevel = 0;
|
||||
public static bool EnableSpamFilter = true;
|
||||
public static bool AllUsersSubbed = false;
|
||||
public static bool AllowBbcode = false;
|
||||
public static bool BadWords = true;
|
||||
public static bool DoCorrections = true;
|
||||
public static bool DoNonViolations = true;
|
||||
|
@ -107,6 +108,9 @@ namespace HISP.Server
|
|||
case "enable_spam_filter":
|
||||
EnableSpamFilter = data == "true";
|
||||
break;
|
||||
case "allow_bbcode_in_chat":
|
||||
AllowBbcode = data == "true";
|
||||
break;
|
||||
case "enable_word_filter":
|
||||
BadWords = data == "true";
|
||||
break;
|
||||
|
|
|
@ -5856,6 +5856,7 @@ namespace HISP.Server
|
|||
RiddleEvent.Win(sender.LoggedinUser);
|
||||
|
||||
|
||||
|
||||
// Check if player is muting channel
|
||||
|
||||
if( (sender.LoggedinUser.MuteGlobal && channel == Chat.ChatChannel.All) || (sender.LoggedinUser.MuteAds && channel == Chat.ChatChannel.Ads) || (sender.LoggedinUser.MuteHere && channel == Chat.ChatChannel.Here) && (sender.LoggedinUser.MuteBuddy && channel == Chat.ChatChannel.Buddies) && (sender.LoggedinUser.MuteNear && channel == Chat.ChatChannel.Near) && (sender.LoggedinUser.MuteIsland && channel == Chat.ChatChannel.Isle))
|
||||
|
@ -5885,7 +5886,9 @@ namespace HISP.Server
|
|||
byte chatSide = Chat.GetSide(channel);
|
||||
message = Chat.DoCorrections(message);
|
||||
message = Chat.EscapeMessage(message);
|
||||
|
||||
// Encode bbcode message.
|
||||
if(ConfigReader.AllowBbcode || (sender.LoggedinUser.Moderator || sender.LoggedinUser.Administrator))
|
||||
message = BBCode.EncodeBBCodeToMeta(message);
|
||||
|
||||
string failedReason = Chat.NonViolationChecks(sender.LoggedinUser, message);
|
||||
if (failedReason != null)
|
||||
|
|
Loading…
Add table
Reference in a new issue