mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-07-23 23:21:00 +00:00
Remove restricted region
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright (C) 2024 BeamMP Ltd., BeamMP team and contributors.
|
||||
Licensed under AGPL-3.0 (or later), see <https://www.gnu.org/licenses/>.
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <array>
|
||||
|
||||
class RegionHandler final {
|
||||
public:
|
||||
RegionHandler() = delete;
|
||||
static void TopLevelDomainFailed(bool failed);
|
||||
static std::string RegionToTopLevelDomain(const std::string region);
|
||||
private:
|
||||
static inline unsigned int mRegionIndex { 0 };
|
||||
const static inline std::array<std::string, 2> mValidTLDs {"beammp.com", "beammp.ru"};
|
||||
};
|
||||
@@ -336,14 +336,4 @@ namespace Utils {
|
||||
throw std::runtime_error("Game disconnected");
|
||||
}
|
||||
}
|
||||
|
||||
inline std::string RegionToTopLevelDomain(const std::string region) {
|
||||
if (region == "Restricted") {
|
||||
return "beammp.ru";
|
||||
}
|
||||
else if (region == "Developer") {
|
||||
return "beammp.dev";
|
||||
}
|
||||
return "beammp.com"; // Global
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user