diff --git a/src/backend/reactions/interloper_reaction.hpp b/src/backend/reactions/interloper_reaction.hpp index 1f47a849..431eee1f 100644 --- a/src/backend/reactions/interloper_reaction.hpp +++ b/src/backend/reactions/interloper_reaction.hpp @@ -14,7 +14,7 @@ namespace big bool m_blockable; bool m_karmaable; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(interloper_reaction, announce_in_chat, notify, log, add_to_player_db, block_joins, kick, block, karma)// json doesn't serialize parent fields automatically + NLOHMANN_DEFINE_TYPE_INTRUSIVE(interloper_reaction, announce_in_chat, notify, log, add_to_player_db, block_joins, kick, block, karma, timeout)// json doesn't serialize parent fields automatically virtual void process(player_ptr attacker, player_ptr victim); }; diff --git a/src/backend/reactions/reaction.cpp b/src/backend/reactions/reaction.cpp index a8f6d60c..0b4916d5 100644 --- a/src/backend/reactions/reaction.cpp +++ b/src/backend/reactions/reaction.cpp @@ -48,6 +48,14 @@ namespace big NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id()); }); } + + if (timeout) + { + player->block_net_events = true; + player->block_clone_sync = true; + player->block_clone_create = true; + LOG(WARNING) << std::format("{} has been timed out", player->get_name()); + } } diff --git a/src/backend/reactions/reaction.hpp b/src/backend/reactions/reaction.hpp index 7add6e99..64b24cc7 100644 --- a/src/backend/reactions/reaction.hpp +++ b/src/backend/reactions/reaction.hpp @@ -17,12 +17,13 @@ namespace big bool add_to_player_db = false; bool block_joins = false; bool kick = false; + bool timeout = false; const char* m_event_name; const char* m_notify_message; const char* m_announce_message; - NLOHMANN_DEFINE_TYPE_INTRUSIVE(reaction, announce_in_chat, notify, log, add_to_player_db, block_joins, kick) + NLOHMANN_DEFINE_TYPE_INTRUSIVE(reaction, announce_in_chat, notify, log, add_to_player_db, block_joins, kick, timeout) reaction(const char* event_name, const char* notify_message, const char* announce_message); virtual void process(player_ptr player); diff --git a/src/views/settings/view_reaction_settings.cpp b/src/views/settings/view_reaction_settings.cpp index 7c77a6a5..2ba0c911 100644 --- a/src/views/settings/view_reaction_settings.cpp +++ b/src/views/settings/view_reaction_settings.cpp @@ -24,6 +24,7 @@ namespace big if (reaction.add_to_player_db) ImGui::Checkbox("REACTION_BLOCK_JOINS"_T.data(), &reaction.block_joins); ImGui::Checkbox("REACTION_KICK_PLAYER"_T.data(), &reaction.kick); + ImGui::Checkbox("Timeout", &reaction.timeout); ImGui::TreePop(); } ImGui::PopID();