mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-06 13:15:42 +12:00
Add muted player functions
This commit is contained in:
parent
61383e8b9f
commit
b15e6996fe
10 changed files with 272 additions and 20 deletions
|
@ -219,6 +219,21 @@
|
|||
"password_input":"<BR>^PLReply:|^PS14|ANSWER^R1",
|
||||
"last_poet":"^LLast Player Poet:%USERNAME% ^R1",
|
||||
"hammock":"You and all of your horses have fully rested.",
|
||||
"mute_command":{
|
||||
"player_ignoring_your_pm":"<FONT COLOR='#0000FF'><B>%USERNAME% does not receive your chats. (Don't take it personally, some players don't like to chat)</B></FONT>",
|
||||
"player_ignoring_your_br":"Player is ignoring you. You cannot add them as a buddy.",
|
||||
"player_ignoring_your_socials":"Player is ignoring you. They cannot receive your socials.",
|
||||
|
||||
"player_ignoring_all_pm":"<FONT COLOR='#0000FF'><B>%USERNAME% has disabled all Private Messages.</B></FONT>",
|
||||
"player_ignoring_all_br":"Player is ignoring Buddy requests from everyone.",
|
||||
"player_ignoring_all_socials":"Player is ignoring socials.",
|
||||
|
||||
"cant_send_in_muted_channel":"You cannot chat on a Muted Channel.",
|
||||
"cant_send_pm_muted":"You cannot send private chats because you have muted that channel. Try !UNMUTE PM",
|
||||
"cant_send_br_muted":"You cannot add buddies while muting your Buddy Request channel. Try !UNMUTE BR.",
|
||||
|
||||
"cant_send_pm_player_muted":"<FONT COLOR='#0000FF'><B>You cannot send a chat to %USERNAME% because you have muted them. Unmute them from the player list if you wish to chat.</B></FONT>",
|
||||
},
|
||||
"auto_sell":{
|
||||
"not_standing_sameplace":"You must be at the same place as the seller or at their ranch.",
|
||||
"success":"Horse %HORSENAME% Purchase Completed!",
|
||||
|
|
|
@ -92,8 +92,6 @@ namespace HISP.Game.Chat
|
|||
return Command.Mute(message, new string[] { "BUDDY" }, user);
|
||||
else if (message.StartsWith("!MUTEPM"))
|
||||
return Command.Mute(message, new string[] { "PM" }, user);
|
||||
else if (message.StartsWith("!MUTEPM"))
|
||||
return Command.Mute(message, new string[] { "PM" }, user);
|
||||
else if (message.StartsWith("!MUTEBR"))
|
||||
return Command.Mute(message, new string[] { "BR" }, user);
|
||||
else if (message.StartsWith("!MUTESOCIALS"))
|
||||
|
@ -200,7 +198,8 @@ namespace HISP.Game.Chat
|
|||
if (client.LoggedIn)
|
||||
if (!client.LoggedinUser.MuteGlobal && !client.LoggedinUser.MuteAll)
|
||||
if (client.LoggedinUser.Id != user.Id)
|
||||
recipiants.Add(client);
|
||||
if(!client.LoggedinUser.MutePlayer.IsUserMuted(user))
|
||||
recipiants.Add(client);
|
||||
}
|
||||
return recipiants.ToArray();
|
||||
}
|
||||
|
@ -213,7 +212,8 @@ namespace HISP.Game.Chat
|
|||
if (client.LoggedIn)
|
||||
if (!client.LoggedinUser.MuteAds && !client.LoggedinUser.MuteAll)
|
||||
if (client.LoggedinUser.Id != user.Id)
|
||||
recipiants.Add(client);
|
||||
if (!client.LoggedinUser.MutePlayer.IsUserMuted(user))
|
||||
recipiants.Add(client);
|
||||
}
|
||||
return recipiants.ToArray();
|
||||
}
|
||||
|
@ -226,8 +226,9 @@ namespace HISP.Game.Chat
|
|||
if (client.LoggedIn)
|
||||
if (!client.LoggedinUser.MuteBuddy && !client.LoggedinUser.MuteAll)
|
||||
if (client.LoggedinUser.Id != user.Id)
|
||||
if (client.LoggedinUser.Friends.List.Contains(user.Id))
|
||||
recipiants.Add(client);
|
||||
if (client.LoggedinUser.Friends.List.Contains(user.Id))
|
||||
if (!client.LoggedinUser.MutePlayer.IsUserMuted(user))
|
||||
recipiants.Add(client);
|
||||
}
|
||||
return recipiants.ToArray();
|
||||
}
|
||||
|
@ -241,8 +242,9 @@ namespace HISP.Game.Chat
|
|||
foreach (User userInIsle in usersInSile)
|
||||
{
|
||||
if (user.Id != userInIsle.Id)
|
||||
if(!user.MuteAll)
|
||||
recipiants.Add(userInIsle.LoggedinClient);
|
||||
if(!userInIsle.MuteAll && !userInIsle.MuteIsland)
|
||||
if(!userInIsle.MutePlayer.IsUserMuted(user))
|
||||
recipiants.Add(userInIsle.LoggedinClient);
|
||||
}
|
||||
return recipiants.ToArray();
|
||||
}
|
||||
|
@ -260,8 +262,9 @@ namespace HISP.Game.Chat
|
|||
foreach (User userHere in usersHere)
|
||||
{
|
||||
if (user.Id != userHere.Id)
|
||||
if (!user.MuteAll)
|
||||
recipiants.Add(userHere.LoggedinClient);
|
||||
if (!userHere.MuteAll && !userHere.MuteHere)
|
||||
if (!userHere.MutePlayer.IsUserMuted(user))
|
||||
recipiants.Add(userHere.LoggedinClient);
|
||||
}
|
||||
return recipiants.ToArray();
|
||||
}
|
||||
|
@ -273,8 +276,9 @@ namespace HISP.Game.Chat
|
|||
foreach (User nearbyUser in nearbyUsers)
|
||||
{
|
||||
if (user.Id != nearbyUser.Id)
|
||||
if (!user.MuteAll)
|
||||
recipiants.Add(nearbyUser.LoggedinClient);
|
||||
if (!nearbyUser.MuteAll && !nearbyUser.MuteNear)
|
||||
if (!nearbyUser.MutePlayer.IsUserMuted(user))
|
||||
recipiants.Add(nearbyUser.LoggedinClient);
|
||||
}
|
||||
return recipiants.ToArray();
|
||||
}
|
||||
|
|
|
@ -396,7 +396,17 @@ namespace HISP.Game.Chat
|
|||
else if (muteType == "ALL")
|
||||
{
|
||||
user.MuteAll = true;
|
||||
} else
|
||||
user.MuteGlobal = true;
|
||||
user.MuteIsland = true;
|
||||
user.MuteNear = true;
|
||||
user.MuteHere = true;
|
||||
user.MuteBuddy = true;
|
||||
user.MuteSocials = true;
|
||||
user.MutePrivateMessage = true;
|
||||
user.MuteBuddyRequests = true;
|
||||
user.MuteLogins = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
formattedmessage += Messages.MuteHelp;
|
||||
goto leave;
|
||||
|
|
|
@ -22,6 +22,21 @@ namespace HISP.Game
|
|||
public static string AddBuddyYourNowBuddiesFormat;
|
||||
public static string AddBuddyDeleteBuddyFormat;
|
||||
|
||||
// Mute Command
|
||||
public static string PlayerIgnoringYourPrivateMessagesFormat;
|
||||
public static string PlayerIgnoringYourBuddyRequests;
|
||||
public static string PlayerIgnoringYourSocials;
|
||||
|
||||
public static string PlayerIgnoringAllPrivateMessagesFormat;
|
||||
public static string PlayerIgnoringAllBuddyRequests;
|
||||
public static string PlayerIgnoringAllSocials;
|
||||
|
||||
public static string CantSendInMutedChannel;
|
||||
public static string CantSendPrivateMessageWhileMuted;
|
||||
public static string CantSendBuddyRequestWhileMuted;
|
||||
|
||||
public static string CantSendPrivateMessagePlayerMutedFormat;
|
||||
|
||||
// Auto Sell
|
||||
public static string AutoSellNotStandingInSamePlace;
|
||||
public static string AutoSellSuccessFormat;
|
||||
|
@ -1077,6 +1092,21 @@ namespace HISP.Game
|
|||
// Click
|
||||
public static string NothingInterestingHere;
|
||||
|
||||
// Mute Command
|
||||
|
||||
public static string FormatCantSendYourIgnoringPlayer(string username)
|
||||
{
|
||||
return CantSendPrivateMessagePlayerMutedFormat.Replace("%USERNAME%", username);
|
||||
}
|
||||
public static string FormatPlayerIgnoringAllPms(string username)
|
||||
{
|
||||
return PlayerIgnoringAllPrivateMessagesFormat.Replace("%USERNAME%", username);
|
||||
}
|
||||
public static string FormatPlayerIgnoringYourPms(string username)
|
||||
{
|
||||
return PlayerIgnoringYourPrivateMessagesFormat.Replace("%USERNAME%", username);
|
||||
}
|
||||
|
||||
// AUTO SELL
|
||||
|
||||
public static string FormatAutoSellSoldOffline(string horseName, int price, string toUsername)
|
||||
|
|
|
@ -57,6 +57,25 @@ namespace HISP.Player
|
|||
}
|
||||
public void AddFriend(User userToFriend)
|
||||
{
|
||||
if(baseUser.MuteBuddy)
|
||||
{
|
||||
byte[] cantFriend = PacketBuilder.CreateChat(Messages.CantSendBuddyRequestWhileMuted, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
baseUser.LoggedinClient.SendPacket(cantFriend);
|
||||
return;
|
||||
}
|
||||
else if(userToFriend.MuteBuddyRequests)
|
||||
{
|
||||
byte[] cantFriend = PacketBuilder.CreateChat(Messages.PlayerIgnoringAllBuddyRequests, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
baseUser.LoggedinClient.SendPacket(cantFriend);
|
||||
return;
|
||||
}
|
||||
else if(userToFriend.MutePlayer.IsUserMuted(userToFriend))
|
||||
{
|
||||
byte[] cantFriend = PacketBuilder.CreateChat(Messages.PlayerIgnoringYourBuddyRequests, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
baseUser.LoggedinClient.SendPacket(cantFriend);
|
||||
return;
|
||||
}
|
||||
|
||||
if (userToFriend.PendingBuddyRequestTo == baseUser)
|
||||
{
|
||||
Database.AddBuddy(baseUser.Id, userToFriend.Id);
|
||||
|
|
40
Horse Isle Server/HorseIsleServer/Player/MutedPlayers.cs
Normal file
40
Horse Isle Server/HorseIsleServer/Player/MutedPlayers.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using HISP.Server;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Player
|
||||
{
|
||||
public class MutedPlayers
|
||||
{
|
||||
private User baseUser;
|
||||
private List<int> userIds;
|
||||
public MutedPlayers(User BaseUser)
|
||||
{
|
||||
userIds = new List<int>();
|
||||
baseUser = BaseUser;
|
||||
int[] userids = Database.GetMutedPlayers(BaseUser.Id);
|
||||
|
||||
foreach (int userid in userids)
|
||||
userIds.Add(userid);
|
||||
|
||||
}
|
||||
|
||||
public bool IsUserMuted(User user)
|
||||
{
|
||||
return userIds.Contains(user.Id);
|
||||
}
|
||||
|
||||
public void MuteUser(User user)
|
||||
{
|
||||
userIds.Add(user.Id);
|
||||
Database.AddMutedPlayer(baseUser.Id, user.Id);
|
||||
}
|
||||
|
||||
public void UnmuteUser(User user)
|
||||
{
|
||||
userIds.Remove(user.Id);
|
||||
Database.DeleteMutedPlayer(baseUser.Id, user.Id);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -95,6 +95,7 @@ namespace HISP.Player
|
|||
public Ranch OwnedRanch = null;
|
||||
public PlayerQuests Quests;
|
||||
public Highscore Highscores;
|
||||
public MutedPlayers MutePlayer;
|
||||
public Riddler LastRiddle;
|
||||
public Award Awards;
|
||||
public User SocializingWith;
|
||||
|
@ -548,6 +549,7 @@ namespace HISP.Player
|
|||
MailBox = new Mailbox(this);
|
||||
Highscores = new Highscore(this);
|
||||
Awards = new Award(this);
|
||||
MutePlayer = new MutedPlayers(this);
|
||||
TrackedItems = new Tracking(this);
|
||||
HorseInventory = new HorseInventory(this);
|
||||
|
||||
|
|
|
@ -55,8 +55,21 @@ namespace HISP.Server
|
|||
string RiddlesComplete = "CREATE TABLE IF NOT EXISTS RiddlesComplete(playerId INT, riddleId INT, solved TEXT(1028))";
|
||||
string AuctionTable = "CREATE TABLE IF NOT EXISTS Auctions(roomId INT, randomId INT, horseRandomId INT, ownerId INT, timeRemaining INT, highestBid INT, highestBidder INT, Done TEXT(3))";
|
||||
string SolvedRealTimeRiddle = "CREATE TABLE IF NOT EXISTS SolvedRealTimeRiddles(playerId INT, riddleId INT)";
|
||||
string MutedPlayers = "CREATE TABLE IF NOT EXISTS MutedPlayers(playerId INT, mutePlayerId INT)";
|
||||
string DeleteOnlineUsers = "DELETE FROM OnlineUsers";
|
||||
|
||||
try
|
||||
{
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = MutedPlayers;
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.WarnPrint(e.Message);
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
|
@ -522,6 +535,53 @@ namespace HISP.Server
|
|||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
public static int[] GetMutedPlayers(int playerId)
|
||||
{
|
||||
List<int> MutedPlayerIds = new List<int>();
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "SELECT mutePlayerId FROM MutedPlayers WHERE playerId=@playerId";
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Prepare();
|
||||
MySqlDataReader reader = sqlCommand.ExecuteReader();
|
||||
while (reader.Read())
|
||||
MutedPlayerIds.Add(reader.GetInt32(0));
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
return MutedPlayerIds.ToArray();
|
||||
}
|
||||
public static void AddMutedPlayer(int playerId, int playerToMute)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "INSERT INTO MutedPlayers VALUES(@playerId, @mutedPlayerId)";
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Parameters.AddWithValue("@mutedPlayerId", playerToMute);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteMutedPlayer(int playerId, int playerToMute)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
{
|
||||
db.Open();
|
||||
MySqlCommand sqlCommand = db.CreateCommand();
|
||||
sqlCommand.CommandText = "DELETE FROM MutedPlayers WHERE playerId=@playerId AND mutePlayerId=@mutedPlayerId)";
|
||||
sqlCommand.Parameters.AddWithValue("@playerId", playerId);
|
||||
sqlCommand.Parameters.AddWithValue("@mutedPlayerId", playerToMute);
|
||||
sqlCommand.Prepare();
|
||||
sqlCommand.ExecuteNonQuery();
|
||||
sqlCommand.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsRanchOwned(int ranchId)
|
||||
{
|
||||
using (MySqlConnection db = new MySqlConnection(ConnectionString))
|
||||
|
|
|
@ -842,6 +842,21 @@ namespace HISP.Server
|
|||
Messages.AutoSellYouSoldHorseFormat = gameData.messages.meta.auto_sell.you_sold;
|
||||
Messages.AutoSellYouSoldHorseOfflineFormat = gameData.messages.meta.auto_sell.sold_offline;
|
||||
|
||||
// Mute Command
|
||||
Messages.PlayerIgnoringYourPrivateMessagesFormat = gameData.messages.meta.mute_command.player_ignoring_your_pm;
|
||||
Messages.PlayerIgnoringYourBuddyRequests = gameData.messages.meta.mute_command.player_ignoring_your_br;
|
||||
Messages.PlayerIgnoringYourSocials = gameData.messages.meta.mute_command.player_ignoring_your_socials;
|
||||
|
||||
Messages.PlayerIgnoringAllPrivateMessagesFormat = gameData.messages.meta.mute_command.player_ignoring_all_pm;
|
||||
Messages.PlayerIgnoringAllBuddyRequests = gameData.messages.meta.mute_command.player_ignoring_all_br;
|
||||
Messages.PlayerIgnoringAllSocials = gameData.messages.meta.mute_command.player_ignoring_all_socials;
|
||||
|
||||
Messages.CantSendInMutedChannel = gameData.messages.meta.mute_command.cant_send_in_muted_channel;
|
||||
Messages.CantSendBuddyRequestWhileMuted = gameData.messages.meta.mute_command.cant_send_br_muted;
|
||||
Messages.CantSendPrivateMessageWhileMuted = gameData.messages.meta.mute_command.cant_send_pm_muted;
|
||||
|
||||
Messages.CantSendPrivateMessagePlayerMutedFormat = gameData.messages.meta.mute_command.cant_send_pm_player_muted;
|
||||
|
||||
// Warp Command
|
||||
|
||||
Messages.SuccessfullyWarpedToPlayer = gameData.messages.commands.warp.player;
|
||||
|
|
|
@ -518,8 +518,22 @@ namespace HISP.Server
|
|||
int socialId = Convert.ToInt32(packet[2] - (byte)0x21);
|
||||
SocialType.Social social = SocialType.GetSocial(socialId);
|
||||
|
||||
if(sender.LoggedinUser.SocializingWith != null)
|
||||
if (sender.LoggedinUser.SocializingWith != null)
|
||||
{
|
||||
|
||||
if (!sender.LoggedinUser.SocializingWith.MuteAll && !sender.LoggedinUser.SocializingWith.MuteSocials)
|
||||
{
|
||||
byte[] cantSocialize = PacketBuilder.CreateChat(Messages.PlayerIgnoringAllSocials, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantSocialize);
|
||||
break;
|
||||
}
|
||||
else if (sender.LoggedinUser.SocializingWith.MutePlayer.IsUserMuted(sender.LoggedinUser))
|
||||
{
|
||||
byte[] cantSocialize = PacketBuilder.CreateChat(Messages.PlayerIgnoringYourSocials, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantSocialize);
|
||||
break;
|
||||
}
|
||||
|
||||
if(sender.LoggedinUser.SocializingWith.X != sender.LoggedinUser.X && sender.LoggedinUser.SocializingWith.Y != sender.LoggedinUser.Y)
|
||||
{
|
||||
byte[] playerNotNearby = PacketBuilder.CreateChat(Messages.SocialPlayerNoLongerNearby, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
|
@ -553,11 +567,8 @@ namespace HISP.Server
|
|||
{
|
||||
if (social.BaseSocialType.Type != "GROUP")
|
||||
{
|
||||
if (!sender.LoggedinUser.SocializingWith.MuteAll && !sender.LoggedinUser.SocializingWith.MuteSocials)
|
||||
{
|
||||
byte[] msgTarget = PacketBuilder.CreateChat(Messages.FormatSocialMessage(social.ForTarget, sender.LoggedinUser.SocializingWith.Username, sender.LoggedinUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.LoggedinUser.SocializingWith.LoggedinClient.SendPacket(msgTarget);
|
||||
}
|
||||
byte[] msgTarget = PacketBuilder.CreateChat(Messages.FormatSocialMessage(social.ForTarget, sender.LoggedinUser.SocializingWith.Username, sender.LoggedinUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.LoggedinUser.SocializingWith.LoggedinClient.SendPacket(msgTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2721,7 +2732,7 @@ namespace HISP.Server
|
|||
if(IsUserOnline(horseToSell.Owner))
|
||||
{
|
||||
User seller = GetUserById(horseToSell.Owner);
|
||||
seller.HorseInventory.DeleteHorse(horseToSell, false);
|
||||
sender.LoggedinUser.HorseInventory.DeleteHorse(horseToSell, false);
|
||||
|
||||
byte[] horseBrought = PacketBuilder.CreateChat(Messages.FormatAutoSellSold(horseToSell.Name, horseToSell.AutoSell, sender.LoggedinUser.Username), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
seller.LoggedinClient.SendPacket(horseBrought);
|
||||
|
@ -5320,6 +5331,22 @@ namespace HISP.Server
|
|||
if (message == "")
|
||||
return;
|
||||
|
||||
// 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))
|
||||
{
|
||||
byte[] cantSendMessage = PacketBuilder.CreateChat(Messages.CantSendInMutedChannel, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantSendMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
if(sender.LoggedinUser.MutePrivateMessage && channel == Chat.ChatChannel.Dm)
|
||||
{
|
||||
byte[] cantSendDmMessage = PacketBuilder.CreateChat(Messages.CantSendPrivateMessageWhileMuted, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
sender.SendPacket(cantSendDmMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
Object violationReason = Chat.FilterMessage(message);
|
||||
if (violationReason != null)
|
||||
{
|
||||
|
@ -5345,6 +5372,36 @@ namespace HISP.Server
|
|||
|
||||
GameClient[] recipiants = Chat.GetRecipiants(sender.LoggedinUser, channel, nameTo);
|
||||
|
||||
// Muted user checks
|
||||
if(channel == Chat.ChatChannel.Dm)
|
||||
{
|
||||
try
|
||||
{
|
||||
User userTo = GetUserByName(nameTo);
|
||||
if (sender.LoggedinUser.MutePlayer.IsUserMuted(userTo))
|
||||
{
|
||||
byte[] dmWasBlocked = PacketBuilder.CreateChat(Messages.FormatCantSendYourIgnoringPlayer(userTo.Username), PacketBuilder.CHAT_DM_RIGHT);
|
||||
sender.SendPacket(dmWasBlocked);
|
||||
return;
|
||||
}
|
||||
else if (userTo.MutePrivateMessage)
|
||||
{
|
||||
byte[] dmWasBlocked = PacketBuilder.CreateChat(Messages.FormatPlayerIgnoringAllPms(userTo.Username), PacketBuilder.CHAT_DM_RIGHT);
|
||||
sender.SendPacket(dmWasBlocked);
|
||||
return;
|
||||
}
|
||||
else if (userTo.MutePlayer.IsUserMuted(sender.LoggedinUser))
|
||||
{
|
||||
byte[] dmWasBlocked = PacketBuilder.CreateChat(Messages.FormatPlayerIgnoringYourPms(userTo.Username), PacketBuilder.CHAT_DM_RIGHT);
|
||||
sender.SendPacket(dmWasBlocked);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Finally send chat message.
|
||||
string formattedMessage = Chat.FormatChatForOthers(sender.LoggedinUser, channel, message);
|
||||
string formattedMessageSender = Chat.FormatChatForSender(sender.LoggedinUser, channel, message, nameTo);
|
||||
|
|
Loading…
Add table
Reference in a new issue