Add muted player functions

This commit is contained in:
SilicaAndPina 2021-03-23 17:36:55 +13:00
parent 61383e8b9f
commit b15e6996fe
10 changed files with 272 additions and 20 deletions

View file

@ -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();
}

View file

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

View file

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