From 73060a426d21fd5d68c9050407e9e92e3e9fcf1b Mon Sep 17 00:00:00 2001 From: xavo95 Date: Sun, 15 Sep 2024 20:30:46 +0000 Subject: [PATCH] Censorship fix, courtesy of @.novinity (#3) Reviewed-on: https://git.xeondev.com/Shorekeeper/Shorekeeper/pulls/3 Co-authored-by: xavo95 Co-committed-by: xavo95 --- game-server/censorshipfix.js | 12 ++++++++++++ game-server/src/logic/thread_mgr.rs | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 game-server/censorshipfix.js diff --git a/game-server/censorshipfix.js b/game-server/censorshipfix.js new file mode 100644 index 0000000..244afb1 --- /dev/null +++ b/game-server/censorshipfix.js @@ -0,0 +1,12 @@ +const UE = require("ue"); +const { CharacterDitherEffectController } = require("../NewWorld/Character/Common/Component/Effect/CharacterDitherEffectController"); + +CharacterDitherEffectController.prototype.SetDitherEffect = function(t, i = 3, s = true) { }; + +CharacterDitherEffectController.prototype.EnterAppearEffect = function(t = 1, i = 3, s = true) { + this.SetHiddenInGame(false, true); +}; + +CharacterDitherEffectController.prototype.EnterDisappearEffect = function(t = 1, i = 3, s = true) { + this.SetHiddenInGame(true, true); +}; \ No newline at end of file diff --git a/game-server/src/logic/thread_mgr.rs b/game-server/src/logic/thread_mgr.rs index e91667b..776c89e 100644 --- a/game-server/src/logic/thread_mgr.rs +++ b/game-server/src/logic/thread_mgr.rs @@ -24,6 +24,7 @@ use super::{ecs::world::World, player::Player, utils::world_util}; const WATER_MASK: &str = include_str!("../../watermask.js"); const UID_FIX: &str = include_str!("../../uidfix.js"); +const CENSORSHIP_FIX: &str = include_str!("../../censorshipfix.js"); pub enum LogicInput { AddPlayer { @@ -175,6 +176,9 @@ fn handle_logic_input(state: &mut LogicState, input: LogicInput) { .replace("{PLAYER_USERNAME}", &player.basic_info.name) .replace("{SELECTED_COLOR}", "50FC71"), }); + player.notify(JsPatchNotify { + content: CENSORSHIP_FIX.to_string() + }); player.respond(EnterGameResponse::default(), enter_rpc_id); player.notify(AfterJoinSceneNotify::default());