Make DC V2 EXP dispatcher rate-aware

This commit is contained in:
2026-05-20 09:46:25 -04:00
parent 7b0bdbd1ce
commit da8466c432
3 changed files with 10 additions and 2 deletions
+5 -2
View File
@@ -3656,11 +3656,14 @@ static asio::awaitable<void> dispatch_dc_v2_exp_patch(shared_ptr<Client> c) {
co_return;
}
string key = "PsoPeepsV2EXP_internal_10x_";
auto server_state = c->require_server_state();
string key = "PsoPeepsV2EXP_internal_";
key += std::to_string(server_state->psopeeps_dcv2_exp_multiplier);
key += "x_";
key += diff_str;
try {
auto server_state = c->require_server_state();
auto fn = server_state->client_functions->get(key, c->specific_version);
co_await send_function_call(c, fn);
} catch (const out_of_range&) {
+4
View File
@@ -878,6 +878,10 @@ void ServerState::load_config_early() {
this->client_ping_interval_usecs = this->config_json->get_int("ClientPingInterval", 30000000);
this->client_idle_timeout_usecs = this->config_json->get_int("ClientIdleTimeout", 60000000);
this->patch_client_idle_timeout_usecs = this->config_json->get_int("PatchClientIdleTimeout", 300000000);
this->psopeeps_dcv2_exp_multiplier = this->config_json->get_int("PsoPeepsDCV2EXPMultiplier", 5);
if ((this->psopeeps_dcv2_exp_multiplier != 5) && (this->psopeeps_dcv2_exp_multiplier != 10)) {
throw runtime_error("PsoPeepsDCV2EXPMultiplier must be 5 or 10");
}
this->ip_stack_debug = this->config_json->get_bool("IPStackDebug", false);
this->allow_unregistered_users = this->config_json->get_bool("AllowUnregisteredUsers", false);
+1
View File
@@ -123,6 +123,7 @@ struct ServerState : public std::enable_shared_from_this<ServerState> {
uint64_t client_ping_interval_usecs = 30000000;
uint64_t client_idle_timeout_usecs = 60000000;
uint64_t patch_client_idle_timeout_usecs = 300000000;
uint64_t psopeeps_dcv2_exp_multiplier = 5;
bool is_debug = false;
bool ip_stack_debug = false;
bool allow_unregistered_users = false;