X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/5fcfdfaf6d4c57d398d011fd100f2f12b7b6859d..7370ec4d9c429d3c71c24d4e2c5c8296b751ae12:/projects/stargazer/user_impl.cpp?ds=inline diff --git a/projects/stargazer/user_impl.cpp b/projects/stargazer/user_impl.cpp index 4cb4467e..e8d326d2 100644 --- a/projects/stargazer/user_impl.cpp +++ b/projects/stargazer/user_impl.cpp @@ -46,6 +46,7 @@ #include "stg/admin.h" #include "user_impl.h" #include "settings_impl.h" +#include "stg_timer.h" #ifdef USE_ABSTRACT_SETTINGS USER_IMPL::USER_IMPL(const SETTINGS * s, @@ -1423,10 +1424,12 @@ if (newPassive && !oldPassive && user->tariff != NULL) void CHG_TARIFF_NOTIFIER::Notify(const string &, const string & newTariff) { if (user->settings->GetReconnectOnTariffChange() && user->connected) - user->Disconnect(true, "Change tariff"); + user->Disconnect(false, "Change tariff"); user->tariff = user->tariffs->FindByName(newTariff); -if (user->settings->GetReconnectOnTariffChange() && user->IsInetable()) - user->Connect(true); +if (user->settings->GetReconnectOnTariffChange() && + !user->authorizedBy.empty() && + user->IsInetable()) + user->Connect(false); } //----------------------------------------------------------------------------- void CHG_CASH_NOTIFIER::Notify(const double & oldCash, const double & newCash) @@ -1439,8 +1442,8 @@ void CHG_IPS_NOTIFIER::Notify(const USER_IPS & from, const USER_IPS & to) { printfd(__FILE__, "Change IP from '%s' to '%s'\n", from.GetIpStr().c_str(), to.GetIpStr().c_str()); if (user->connected) - user->Disconnect(true, "Change IP"); - if (user->IsInetable()) - user->Connect(true); + user->Disconnect(false, "Change IP"); + if (!user->authorizedBy.empty() && user->IsInetable()) + user->Connect(false); } //-----------------------------------------------------------------------------