Closed yamaken93 closed 1 year ago
Maybe it won't crash thanks to OutputMessagePool::getInstance().addProtocolToAutosend(shared_from_this()); being called by dispatcher thread 100% of times after the call to writeToOutputBuffer i thought could crash TFS.
The link doesn't seem to match with the file. Was it fixed? If not, any ideas of situations in which it could crash?
https://github.com/otland/forgottenserver/blob/master/src/protocolgame.cpp#L268 As far i understand, ProtocolGame::writeToOutputBuffer and Protocol::getOutputBuffer should be only called by dispatcher thread. As far i can tell, that line i pointed earlier is the only place where this rule is violated(its being called by the ASIO thread).
My suggestion is to move it to ProtocolGame::login(which is called by the dispatcher thread).