• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

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

Jpstafe

Member
Joined
Aug 8, 2011
Messages
227
Reaction score
24
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
 

lursky

Well-Known Member
Joined
Feb 8, 2015
Messages
146
Solutions
1
Reaction score
65
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:

Evil Puncker

I know nothing
TFS Developer
Joined
May 30, 2009
Messages
8,538
Solutions
260
Reaction score
4,526
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+
 
Top