• 🎉 Hey there! I've just launched my brand new server voting platform — Metin2 P Servers 🚀

New Extended BattlePass System

Member
Sep
Threads
0
47
0
6
HubMoney
261
5v9Ret.gif


[Hidden content]
s
 
Developer
Member
Dec
Threads
0
67
0
6
HubMoney
282
Just to help you to not lose the progress sometimes when you restart the server.

C++:
In char.cpp, search for:

void CHARACTER::EndBattlePassMission(const BYTE idx) {
   
add after and before #endif:
   
void CHARACTER::CheckBattlePass()
{
    const auto& missions = CNewBattlePassManager::instance().GetAllMissions();
    const auto& progress = GetBattlePassVector();

    if (missions.empty() || progress.empty())
        return;

    if (missions.size() != progress.size())
    {
        sys_err("BattlePass mismatch for player [%s] (ID: %u): missions.size() = %zu, progress.size() = %zu",
            GetName(), GetPlayerID(), missions.size(), progress.size());
    }

    const size_t count = std::min(missions.size(), progress.size());

    for (size_t i = 0; i < count; ++i)
    {
        const auto& mission = missions[i];
        const auto& [currentValue, isCompleted] = progress[i];
    }
}
   
Now, move to input_login and search for void CInputLogin::Entergame(LPDESC d, const char* data), inside this add
   
#ifdef ENABLE_NEW_BATTLE_PASS
    sys_err("Checking battle pass for %s", ch->GetName());
    ch->CheckBattlePass();
#endif