diff --git a/DataCollection/gamedata.json b/DataCollection/gamedata.json index 04bc6a3..0278290 100755 --- a/DataCollection/gamedata.json +++ b/DataCollection/gamedata.json @@ -54,10 +54,6 @@ "too_long":"Profile TOO LONG, 4,000 char max!", "blocked":"Profile NOT SAVED, Chat Violations Present! (%REASON%)", }, - "prof_reasons":{ - "profanity":"Profanity detected.", - "personal_info":"No giving out personal info/websites.", - }, "private_notes_save":"Saved Private Notes.", "buddy_request":"Attempting to Add Buddy. The other player must click ADD BUDDY as well. (Many players reserve this for just a couple players so don't feel insulted if they do not).", "click_nothing_message":"Nothing interesting here...", diff --git a/Horse Isle Server/HorseIsleServer/Game/Messages.cs b/Horse Isle Server/HorseIsleServer/Game/Messages.cs index ce51e6d..c995112 100755 --- a/Horse Isle Server/HorseIsleServer/Game/Messages.cs +++ b/Horse Isle Server/HorseIsleServer/Game/Messages.cs @@ -607,10 +607,9 @@ namespace HISP.Game public static string ProfileSavedMessage; public static string ProfileTooLongMessage; + public static string ProfileSaveBlockedFormat; public static string ProfileViolationFormat; - public static string ProfileViolationPersonalInfo; - public static string ProfileViolationProfanity; // Hay Pile public static string HasPitchforkMeta; @@ -1103,6 +1102,8 @@ namespace HISP.Game public static string PlayerListIconFormat; public static string PlayerListIconInformation; + + // Meta public static string IsleFormat; public static string TownFormat; @@ -1206,8 +1207,19 @@ namespace HISP.Game // Click public static string NothingInterestingHere; - - + // Violations + public static string FormatProfileSavedBlocked(string reasons) + { + return ProfileViolationFormat.Replace("%REASON%", reasons); + } + public static string FormatRanchDesriptionBlocked(string reasons) + { + return RanchSavedDescrptionViolationsErrorFormat.Replace("%REASON%", reasons); + } + public static string FormatHorseProfileBlocked(string reasons) + { + return HorseProfileMessageProfileError.Replace("%REASON%", reasons); + } // Throwables public static string FormatModSplatterBallAwardedOther(string username) diff --git a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs index b66e52d..a273f97 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameDataJson.cs @@ -1384,9 +1384,6 @@ namespace HISP.Server Messages.ProfileTooLongMessage = gameData.messages.profile.too_long; Messages.ProfileViolationFormat = gameData.messages.profile.blocked; - Messages.ProfileViolationProfanity = gameData.messages.profile.profanity; - Messages.ProfileViolationPersonalInfo = gameData.messages.profile.personal_info; - // Announcements Messages.WelcomeFormat = gameData.messages.welcome_format; @@ -1963,6 +1960,7 @@ namespace HISP.Server Messages.PlayerListAllHeader = gameData.messages.meta.player_list.all_players_header; Messages.PlayerListIconFormat = gameData.messages.meta.player_list.icon_format; Messages.PlayerListIconInformation = gameData.messages.meta.player_list.icon_info; + // Consume Messages.ConsumeItemFormat = gameData.messages.consume.consumed_item_format; diff --git a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs index e972ee5..31a7903 100755 --- a/Horse Isle Server/HorseIsleServer/Server/GameServer.cs +++ b/Horse Isle Server/HorseIsleServer/Server/GameServer.cs @@ -2448,11 +2448,28 @@ namespace HISP.Server break; } + object filterReason = Chat.FilterMessage(name); + if (filterReason != null) + { + byte[] msg = PacketBuilder.CreateChat(Messages.HorseNameViolationsError, PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(msg); + return; + } + + filterReason = Chat.FilterMessage(desc); + if (filterReason != null) + { + Chat.Reason reason = (Chat.Reason)filterReason; + byte[] msg = PacketBuilder.CreateChat(Messages.FormatHorseProfileBlocked(reason.Message), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(msg); + return; + } + sender.LoggedinUser.MetaPriority = true; sender.LoggedinUser.LastViewedHorse.Name = dynamicInput[1]; sender.LoggedinUser.LastViewedHorse.Description = dynamicInput[2]; - byte[] horseNameSavedPacket = PacketBuilder.CreateChat(Messages.FormatHorseSavedProfileMessage(sender.LoggedinUser.LastViewedHorse.Name), PacketBuilder.CHAT_BOTTOM_RIGHT); - sender.SendPacket(horseNameSavedPacket); + byte[] horseProfileSavedPacket = PacketBuilder.CreateChat(Messages.FormatHorseSavedProfileMessage(sender.LoggedinUser.LastViewedHorse.Name), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(horseProfileSavedPacket); UpdateHorseMenu(sender, sender.LoggedinUser.LastViewedHorse); } break; @@ -2546,6 +2563,25 @@ namespace HISP.Server sender.SendPacket(tooLongPacket); break; } + + object filterReason = Chat.FilterMessage(title); + if (filterReason != null) + { + byte[] msg = PacketBuilder.CreateChat(Messages.RanchSavedTitleViolationsError, PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(msg); + return; + } + + filterReason = Chat.FilterMessage(desc); + if (filterReason != null) + { + Chat.Reason reason = (Chat.Reason)filterReason; + byte[] msg = PacketBuilder.CreateChat(Messages.FormatRanchDesriptionBlocked(reason.Message), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(msg); + return; + } + + sender.LoggedinUser.OwnedRanch.Title = title; sender.LoggedinUser.OwnedRanch.Description = desc; } @@ -4353,6 +4389,15 @@ namespace HISP.Server return; } + object filterReason = Chat.FilterMessage(profilePage); + if(filterReason != null) + { + Chat.Reason reason = (Chat.Reason)filterReason; + byte[] msg = PacketBuilder.CreateChat(Messages.FormatProfileSavedBlocked(reason.Message), PacketBuilder.CHAT_BOTTOM_RIGHT); + sender.SendPacket(msg); + return; + } + sender.LoggedinUser.ProfilePage = profilePage; Logger.DebugPrint(sender.LoggedinUser.Username + " Changed to character id: " + characterId + " and set there Profile Description to '" + profilePage + "'");