Small Bug Fix
This commit is contained in:
parent
71e660575f
commit
955c2b9b3d
@ -514,7 +514,10 @@ sign->lines[i] = api_get_input(line_##i); \
|
|||||||
return CommandServer::NullString;
|
return CommandServer::NullString;
|
||||||
} else {
|
} else {
|
||||||
// Call Original Method
|
// Call Original Method
|
||||||
return old(server, client, command);
|
api_suppress_chat_events = client.sock >= 0; // Suppress If Real API Client
|
||||||
|
std::string ret = old(server, client, command);
|
||||||
|
api_suppress_chat_events = false;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,9 +235,19 @@ static void Gui_addMessage_injection(Gui_addMessage_t original, Gui *gui, const
|
|||||||
recursing = false;
|
recursing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool api_suppress_chat_events = false;
|
||||||
static bool enabled = false;
|
static bool enabled = false;
|
||||||
void api_add_chat_event(const Player *sender, const std::string &message) {
|
void api_add_chat_event(const Player *sender, const std::string &message) {
|
||||||
if (!enabled || (!sender && api_compat_mode)) {
|
if (!enabled) {
|
||||||
|
// Extended API Is Disabled
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!sender && api_compat_mode) {
|
||||||
|
// Non-Chat Message Are Only Supported In Non-Compatability Mode
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (api_suppress_chat_events) {
|
||||||
|
// Do Not Record Messages Sent By The API
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
push_event(&ExtraClientData::chat_events, {
|
push_event(&ExtraClientData::chat_events, {
|
||||||
|
@ -27,3 +27,5 @@ __attribute__((visibility("internal"))) void api_clear_events(const ConnectedCli
|
|||||||
__attribute__((visibility("internal"))) std::string api_get_projectile_events(CommandServer *server, const ConnectedClient &client, std::optional<int> id);
|
__attribute__((visibility("internal"))) std::string api_get_projectile_events(CommandServer *server, const ConnectedClient &client, std::optional<int> id);
|
||||||
__attribute__((visibility("internal"))) std::string api_get_chat_events(CommandServer *server, const ConnectedClient &client, std::optional<int> id);
|
__attribute__((visibility("internal"))) std::string api_get_chat_events(CommandServer *server, const ConnectedClient &client, std::optional<int> id);
|
||||||
__attribute__((visibility("internal"))) std::string api_get_block_hit_events(CommandServer *server, const ConnectedClient &client, std::optional<int> id);
|
__attribute__((visibility("internal"))) std::string api_get_block_hit_events(CommandServer *server, const ConnectedClient &client, std::optional<int> id);
|
||||||
|
|
||||||
|
__attribute__((visibility("internal"))) extern bool api_suppress_chat_events;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
size 0xc;
|
size 0xc;
|
||||||
|
|
||||||
property uint sock = 0x0;
|
property int sock = 0x0;
|
||||||
property std::string str = 0x4;
|
property std::string str = 0x4;
|
||||||
property int lastBlockHitPoll = 0x8;
|
property int lastBlockHitPoll = 0x8;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user