• Vote in September Mapping Competition to select a winner!
  • 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!

Character List Showing Online/Offline Characters. TFS 1.3

Ennokas

Member
Joined
Feb 13, 2009
Messages
435
Best answers
0
Reaction score
8
Location
unknown
Is there possible to change
example:
Player (Online) if he is online
Player (Offline) if he is offline.

Right now its showing
Player (Forgotten)

Using TFS 1.3
 

Infernum

Support Team
Joined
Feb 14, 2015
Messages
5,582
Best answers
556
Reaction score
3,493


Configurable via config.lua:
Lua:
showOnlineStatusInCharlist = true
True: will show online/offline status in place of the server name
False: will show server name rather than online/offline status
 
OP
Ennokas

Ennokas

Member
Joined
Feb 13, 2009
Messages
435
Best answers
0
Reaction score
8
Location
unknown
Got such error with this

C++:
 C++ argument of type "ConfigManager::integer_config_t" is incompatible with parameter of type "ConfigManager::string_config_t"
Those 2 are making this error
C++:
output->addString(g_config.getString(ConfigManager::IP));
 

Infernum

Support Team
Joined
Feb 14, 2015
Messages
5,582
Best answers
556
Reaction score
3,493
Got such error with this

C++:
 C++ argument of type "ConfigManager::integer_config_t" is incompatible with parameter of type "ConfigManager::string_config_t"
Those 2 are making this error
C++:
output->addString(g_config.getString(ConfigManager::IP));
Either you're not actually using TFS 1.3 or you've edited something incorrectly, show us your sources.
 
OP
Ennokas

Ennokas

Member
Joined
Feb 13, 2009
Messages
435
Best answers
0
Reaction score
8
Location
unknown

using this one, havent edited anything else than that right now
 

Infernum

Support Team
Joined
Feb 14, 2015
Messages
5,582
Best answers
556
Reaction score
3,493
Change:
C++:
output->addString(g_config.getString(ConfigManager::IP));
To:
C++:
output->add<uint32_t>(g_config.getNumber(ConfigManager::IP));
And to note, this is why you're supposed to give your TFS version AND client version, this downgrade is not exactly equal to 1.3.
 
OP
Ennokas

Ennokas

Member
Joined
Feb 13, 2009
Messages
435
Best answers
0
Reaction score
8
Location
unknown
Now client is crashing before i can even see charlist.

 

Infernum

Support Team
Joined
Feb 14, 2015
Messages
5,582
Best answers
556
Reaction score
3,493
Replace your entire ProtocolLogin::getCharacterList function with this:
C++:
void ProtocolLogin::getCharacterList(const std::string& accountName, const std::string& password)
{
    Account account;
    if (!IOLoginData::loginserverAuthentication(accountName, password, account)) {
        disconnectClient("Account name or password is not correct.");
        return;
    }

    auto output = OutputMessagePool::getOutputMessage();
    //Update premium days
    Game::updatePremium(account);

    const std::string& motd = g_config.getString(ConfigManager::MOTD);
    if (!motd.empty()) {
        //Add MOTD
        output->addByte(0x14);

        std::ostringstream ss;
        ss << g_game.getMotdNum() << "\n" << motd;
        output->addString(ss.str());
    }

    //Add char list
    output->addByte(0x64);

    uint8_t size = std::min<size_t>(std::numeric_limits<uint8_t>::max(), account.characters.size());
    output->addByte(size);
    for (uint8_t i = 0; i < size; i++) {
        const std::string& character = account.characters[i];
        output->addString(character);
        if (g_config.getBoolean(ConfigManager::ONLINE_OFFLINE_CHARLIST)) {
            output->addString(g_game.getPlayerByName(character) ? "Online" : "Offline");
        } else {
            output->addString(g_config.getString(ConfigManager::SERVER_NAME));
        }
        output->add<uint32_t>(g_config.getNumber(ConfigManager::IP));
        output->add<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
    }

    //Add premium days
    if (g_config.getBoolean(ConfigManager::FREE_PREMIUM)) {
        output->add<uint16_t>(0xFFFF); //client displays free premium
    } else {
        output->add<uint16_t>(account.premiumDays);
    }

    send(output);

    disconnect();
}
 
OP
Ennokas

Ennokas

Member
Joined
Feb 13, 2009
Messages
435
Best answers
0
Reaction score
8
Location
unknown
Replace your entire ProtocolLogin::getCharacterList function with this:
C++:
void ProtocolLogin::getCharacterList(const std::string& accountName, const std::string& password)
{
    Account account;
    if (!IOLoginData::loginserverAuthentication(accountName, password, account)) {
        disconnectClient("Account name or password is not correct.");
        return;
    }

    auto output = OutputMessagePool::getOutputMessage();
    //Update premium days
    Game::updatePremium(account);

    const std::string& motd = g_config.getString(ConfigManager::MOTD);
    if (!motd.empty()) {
        //Add MOTD
        output->addByte(0x14);

        std::ostringstream ss;
        ss << g_game.getMotdNum() << "\n" << motd;
        output->addString(ss.str());
    }

    //Add char list
    output->addByte(0x64);

    uint8_t size = std::min<size_t>(std::numeric_limits<uint8_t>::max(), account.characters.size());
    output->addByte(size);
    for (uint8_t i = 0; i < size; i++) {
        const std::string& character = account.characters[i];
        output->addString(character);
        if (g_config.getBoolean(ConfigManager::ONLINE_OFFLINE_CHARLIST)) {
            output->addString(g_game.getPlayerByName(character) ? "Online" : "Offline");
        } else {
            output->addString(g_config.getString(ConfigManager::SERVER_NAME));
        }
        output->add<uint32_t>(g_config.getNumber(ConfigManager::IP));
        output->add<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
    }

    //Add premium days
    if (g_config.getBoolean(ConfigManager::FREE_PREMIUM)) {
        output->add<uint16_t>(0xFFFF); //client displays free premium
    } else {
        output->add<uint16_t>(account.premiumDays);
    }

    send(output);

    disconnect();
}
Works fine now, thanks ;)
 
Top