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

Crash Server PRoblem

jareczekjsp

Member
Joined
Jan 30, 2023
Messages
264
Solutions
1
Reaction score
22
GitHub
Jarek123
Hello I use tfs 1.5 by nekiro and ?I have problem with crash server

errors is

LUA:
(gdb) break Monster::onCreatureLeave
Breakpoint 1 at 0x5555557b7294
(gdb)                  , Game*&, unsigned int&, Direction&) ()
Undefined command: "".  Try "help".
(gdb) (gdb) --Type <RET> for more, q to quit, c to continue without paging--
Undefined command: "".  Try "help".
(gdb) Undefined command: "--Type".  Try "help".
Undefined command: "Undefined".  Try "help".
(gdb) break Monster::onCreatureLeave
Breakpoint 1 at 0x5555557b7294
(gdb)
Note: breakpoint 1 also set at pc 0x5555557b7294.
Breakpoint 2 at 0x5555557b7294
(gdb) (gdb) break Monster::onCreatureLeave
Undefined command: "".  Try "help".
(gdb) Breakpoint 1 at 0x5555557b7294
Undefined command: "Breakpoint".  Try "help".


Code:
#0  0x0000555555633cdb in std::_Rb_tree<unsigned int, std::pair<unsigned int const, Creature::CountBlock_t>, std::_Select1st<std::pair<unsigned int const, Creature::CountBlock_t> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, Creature::CountBlock_t> > >::_S_right(std::_Rb_tree_node_base) ()
#1  0x0000555555631dfa in std::_Rb_tree<unsigned int, std::pair<unsigned int const, Creature::CountBlock_t>, std::_Select1st<std::pair<unsigned int const, Creature::CountBlock_t> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, Creature::CountBlock_t> > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned int const, Creature::CountBlock_t> >) ()
#2  0x0000555555631e0c in std::_Rb_tree<unsigned int, std::pair<unsigned int const, Creature::CountBlock_t>, std::_Select1st<std::pair<unsigned int const, Creature::CountBlock_t> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, Creature::CountBlock_t> > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned int const, Creature::CountBlock_t> >) ()
#3  0x0000555555632198 in std::_Rb_tree<unsigned int, std::pair<unsigned int const, Creature::CountBlock_t>, std::_Select1st<std::pair<unsigned int const, Creature::CountBlock_t> >, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, Creature::CountBlock_t> > >::clear() ()
#4  0x0000555555630956 in std::map<unsigned int, Creature::CountBlock_t, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, Creature::CountBlock_t> > >::clear() ()
#5  0x0000555555629ddd in Creature::onIdleStatus() ()
#6  0x00005555557b803f in Monster::setIdle(bool) ()
#7  0x00005555557b8151 in Monster::updateIdleStatus() ()
#8  0x00005555557b7326 in Monster::onCreatureLeave(Creature) ()
#9  0x00005555557b6208 in Monster::onCreatureMove(Creature, Tile const, Position const&, Tile const, Position const&, bool) ()
#10 0x00005555557acd17 in Map::moveCreature(Creature&, Tile&, bool) ()
#11 0x00005555556535a0 in Game::internalMoveCreature(Creature&, Tile&, unsigned int) ()
#12 0x00005555556534e3 in Game::internalMoveCreature(Creature, Direction, unsigned int) ()
#13 0x0000555555629e76 in Creature::onWalk() ()
#14 0x00005555556602aa in Game::checkCreatureWalk(unsigned int) ()
#15 0x000055555562a430 in Creature::addEventWalk(bool) ()
#16 0x000055555562a2aa in Creature::startAutoWalk(Direction) ()
#17 0x0000555555657c8b in Game::playerMove(unsigned int, Direction) ()
#18 0x000055555584d805 in void std::invoke_impl<void, void (Game::&)(unsigned int, Direction), Game&, unsigned int&, Direction&>(std::invoke_memfun_deref, void (Game::&)(unsigned int, Direction), Game&, unsigned int&, Direction&) ()
--Type <RET> for more, q to quit, c to continue without paging--


Can somebody Help me ?
 
Add debug logs to Monster::onCreatureLeave, onIdleStatus, and damageMap.clear() to track their call sequence.

In monster.cpp, around the Monster::onCreatureLeave(Creature* creature) function, ensure the creature is valid and not the monster itself
 
IS possible meybe somebody do it like that I have like this

creature.cpp

LUA:
bool Creature::setMaster(Creature* newMaster) {
    if (!newMaster && !master) {
        return false;
    }

    if (newMaster) {
        incrementReferenceCounter();
        newMaster->summons.push_back(this);
    }

    Creature* oldMaster = master;
    master = newMaster;

    if (oldMaster) {
        auto summon = std::find(oldMaster->summons.begin(), oldMaster->summons.end(), this);
        if (summon != oldMaster->summons.end()) {
            oldMaster->summons.erase(summon);
            decrementReferenceCounter();
        }
    }
    return true;
}




monster.cpp

Code:
void Monster::death(Creature*)
{
    setAttackedCreature(nullptr);

    for (Creature* summon : summons) {
        summon->changeHealth(-summon->getHealth());
        summon->removeMaster();
    }
    summons.clear();

    clearTargetList();
    clearFriendList();
    onIdleStatus();
}

what you thing?
 
Back
Top