• 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!

TFS 1.X+ problem with a function while updating server

Jpstafe

Well-Known Member
Joined
Aug 8, 2011
Messages
507
Reaction score
68
Lua:
1>protocolgame.cpp
1>C:\Users\jpstafe\Documents\GitHub\Nekiro-2.0\src\protocolgame.cpp(1291,120): error C2664: 'void Dispatcher::addTask(Task *)': cannot convert argument 1 from 'ProtocolGame::parseSeekInContainer::<lambda_71ac29dbf4b2991fc4f7e0663329a467>' to 'Task *'
1>C:\Users\jpstafe\Documents\GitHub\Nekiro-2.0\src\protocolgame.cpp(1291,119): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>C:\Users\jpstafe\Documents\GitHub\Nekiro-2.0\src\tasks.h(69,8): message : see declaration of 'Dispatcher::addTask'
1>Done building project "theforgottenserver.vcxproj" -- FAILED.

Code:
Severity    Code    Description    Project    File    Line    Suppression State
Error    C2664    'void Dispatcher::addTask(Task *)': cannot convert argument 1 from 'ProtocolGame::parseSeekInContainer::<lambda_71ac29dbf4b2991fc4f7e0663329a467>' to 'Task *'    theforgottenserver    C:\Users\jpstafe\Documents\GitHub\Nekiro-2.0\src\protocolgame.cpp    1291
Code:
void ProtocolGame::parseSeekInContainer(NetworkMessage& msg)
{
    uint8_t containerId = msg.getByte();
    uint16_t index = msg.get<uint16_t>();
    g_dispatcher.addTask([=, playerID = player->getID()]() { g_game.playerSeekInContainer(playerID, containerId, index); });
}
other updated function ain't giving problem like this

help pls
 
You copied some code that’s from newer TFS where method addTask accepts Lambdas but yours does not and it expects it to be a Task instead. Check other invocation of addTask and adjust accordingly.

C++:
g_dispatcher.addTask(createTask(std::bind(&Game::playerSeekInContainer, &g_game, player->getID(), containerId, index)));
or even utilize existing helper for that:
Lua:
addGameTask(&Game::playerSeekInContainer, player->getID(), containerId, index);
 
Last edited:
hello felipe93, what client version are you planning to use? I saw the "nekiro 2.0" so I'm guessing its a downgrade? if so, this parseSeekInContainer should not exist at all, it is a function for new clients only 11+
 
Back
Top