mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-04 00:23:27 +08:00
chore: Add "Timeout" as a reaction (#1837)
This commit is contained in:
parent
17e79dbaaa
commit
f593d85af6
@ -14,7 +14,7 @@ namespace big
|
|||||||
bool m_blockable;
|
bool m_blockable;
|
||||||
bool m_karmaable;
|
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);
|
virtual void process(player_ptr attacker, player_ptr victim);
|
||||||
};
|
};
|
||||||
|
@ -48,6 +48,14 @@ namespace big
|
|||||||
NETWORK::NETWORK_SESSION_KICK_PLAYER(player->id());
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,12 +17,13 @@ namespace big
|
|||||||
bool add_to_player_db = false;
|
bool add_to_player_db = false;
|
||||||
bool block_joins = false;
|
bool block_joins = false;
|
||||||
bool kick = false;
|
bool kick = false;
|
||||||
|
bool timeout = false;
|
||||||
|
|
||||||
const char* m_event_name;
|
const char* m_event_name;
|
||||||
const char* m_notify_message;
|
const char* m_notify_message;
|
||||||
const char* m_announce_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);
|
reaction(const char* event_name, const char* notify_message, const char* announce_message);
|
||||||
virtual void process(player_ptr player);
|
virtual void process(player_ptr player);
|
||||||
|
@ -24,6 +24,7 @@ namespace big
|
|||||||
if (reaction.add_to_player_db)
|
if (reaction.add_to_player_db)
|
||||||
ImGui::Checkbox("REACTION_BLOCK_JOINS"_T.data(), &reaction.block_joins);
|
ImGui::Checkbox("REACTION_BLOCK_JOINS"_T.data(), &reaction.block_joins);
|
||||||
ImGui::Checkbox("REACTION_KICK_PLAYER"_T.data(), &reaction.kick);
|
ImGui::Checkbox("REACTION_KICK_PLAYER"_T.data(), &reaction.kick);
|
||||||
|
ImGui::Checkbox("Timeout", &reaction.timeout);
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user