Make GC EXP enable shim inert and dedupe dispatch
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "QuestScript.hh"
|
||||
#include "TeamIndex.hh"
|
||||
#include "Text.hh"
|
||||
#include <string>
|
||||
|
||||
extern const uint64_t CLIENT_CONFIG_MAGIC;
|
||||
|
||||
@@ -147,6 +148,8 @@ public:
|
||||
|
||||
// Basic state
|
||||
uint64_t enabled_flags = DEFAULT_FLAGS; // Client::Flag enum
|
||||
std::string last_psopeeps_gc_exp_key;
|
||||
void* last_psopeeps_gc_exp_lobby = nullptr;
|
||||
uint32_t specific_version = 0;
|
||||
uint8_t override_section_id = 0xFF; // FF = no override
|
||||
uint8_t override_lobby_event = 0xFF; // FF = no override
|
||||
|
||||
@@ -3710,9 +3710,17 @@ static asio::awaitable<void> dispatch_gc_v3_exp_patch(shared_ptr<Client> c) {
|
||||
key += "x_";
|
||||
key += episode_str;
|
||||
|
||||
void* lobby_token = l.get();
|
||||
if ((c->last_psopeeps_gc_exp_lobby == lobby_token) &&
|
||||
(c->last_psopeeps_gc_exp_key == key)) {
|
||||
co_return;
|
||||
}
|
||||
|
||||
try {
|
||||
auto fn = server_state->client_functions->get(key, c->specific_version);
|
||||
co_await send_function_call(c, fn);
|
||||
c->last_psopeeps_gc_exp_lobby = lobby_token;
|
||||
c->last_psopeeps_gc_exp_key = key;
|
||||
} catch (const out_of_range&) {
|
||||
c->log.warning_f("GC V3 EXP dispatcher could not find client function {}", key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user