• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to allowClone / disableKickOnLogin for specific players?

Togu

Advanced OT User
Joined
Jun 22, 2018
Messages
308
Solutions
1
Reaction score
178
Location
Brazil
Is there an easy way to do that?
Any suggestion?
 
C++:
void ProtocolGame::login(const std::string& name, uint32_t accountId, OperatingSystem_t operatingSystem)
{
    //dispatcher thread
    static const std::vector<std::string> allowed_players = {"Mike", "John", "GM Stupid"};

    Player* foundPlayer = g_game.getPlayerByName(name);
    if (!foundPlayer || g_config.getBoolean(ConfigManager::ALLOW_CLONES) || std::find(allowed_players.begin(), allowed_players.end(), name) != allowed_players.end()) {
        // poop

Logic:
  • If the player is not found online, they should be able to log in.
  • If clones are globally allowed, they should be able to log in.
  • If clones are not globally allowed but their name is found in the vector, they should be allowed to log in.
 
Last edited:
Back
Top