leonardo ramos
Veteran OT User
- Joined
- Dec 7, 2016
- Messages
- 190
- Reaction score
- 369
My server is having a problem with the following part of monster.cpp
So we changed this part to .lua, directly in the server libs (creature.lua), as follows:
We thought we had solved the problem, because for a long time the server had not crashed on it. But about 2 days ago we had the same problem again. Then we moved the server from windows to linux and realized that now, instead of crash, the server freezes indefinitely. Then we implemented a Delusion catchscript ([ANY TFS] Catch scripts that freeze server (https://otland.net/threads/any-tfs-catch-scripts-that-freeze-server.261466/)) and it returns that creature.lua It has a possible infinite loop in this part of the file.
Code:
void Monster::addStorageValue(const uint32_t key, const std::string value)
{
if (value != "-1") {
storageMap[key] = value;
} else {
storageMap.erase(key);
}
}
So we changed this part to .lua, directly in the server libs (creature.lua), as follows:
Code:
function Creature.getTemporaryValue(self, key)
local storageMap = CREATE_STORAGE_TEMPORARY[self:getId()]
if (storageMap) then
return storageMap[key] or -1
end
return -1
end
We thought we had solved the problem, because for a long time the server had not crashed on it. But about 2 days ago we had the same problem again. Then we moved the server from windows to linux and realized that now, instead of crash, the server freezes indefinitely. Then we implemented a Delusion catchscript ([ANY TFS] Catch scripts that freeze server (https://otland.net/threads/any-tfs-catch-scripts-that-freeze-server.261466/)) and it returns that creature.lua It has a possible infinite loop in this part of the file.