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

[1.2] Crash question

Unknown Soldier

Mapping a map
Joined
Oct 30, 2010
Messages
293
Solutions
11
Reaction score
663
Hi everyone,

From time to time my server crashes (goes off, but TFS window is still opened), it always happens on relog, usually few hours from start. It's opened only for me, for testing, playing around... Today I've tried to crash it intentionally, and was playing with mounts, and I managed to do this in around 20 minutes (mainly taming different mobs, and often relogging). I've noticed error message in mount script (attached), so that's why I wanted to try it... The error happened some time before crash, was able to do some more relogs. From my perspective, crashes happened more often when I was playing with mounts. However I have no idea if this is related. I have also changed mount script to another, same result (well, no error appeard, but crash also happened).

What's more, when the server is already down, there website acc make doesn't respond at all until I close the TFS window. Also, i run it on hamachi, since I invite friends sometimes and have no hosting yet. I am suspicious if this is not the reason, but as far as I remember it used to crash even without it.

I want to start investigating what could be the problem...

So my first question is, how to get the crash log in this case? This would be the first step I guess. I ran Visual Studio and attached TFS process, but nothing happened there, maybe because that the TFS window is still opened, does not disappear, but server is simply off. This is even more annoying, cause simple .bat restarter isn't able to restart server ...

Maybe somebody is familiar with the problem?

Thank you guys for your time!

Lua:
    if ((not(v.ALLOW_SUMMON)) and (not(config.ALLOW_SUMMON_TO_ALL_MOUNTS))) or (config.BLOCK_ALLOW_SUMMON_TO_ALL_MONSTER) then
        if isSummon(itemEx.uid) then --this is the line 193 from the error message
            return doPlayerSendCancel(cid, "This mount can't be summon to catch him!")
        end
    end

Lua:
function isCreature(cid) return Creature(cid) ~= nil end
function isPlayer(cid) return Player(cid) ~= nil end
function isMonster(cid) return Monster(cid) ~= nil end
function isSummon(cid) return Creature(cid):getMaster() ~= nil end   --the line from error message
function isNpc(cid) return Npc(cid) ~= nil end
function isItem(uid) return Item(uid) ~= nil end
function isContainer(uid) return Container(uid) ~= nil end
 

Attachments

It's most likely because Creature(cid) is nil.
Try changing that line to
Lua:
function isSummon(cid) return (Creature(cid) ~= nil and Creature(cid):getMaster() ~= nil) end
 
actually it's just

Lua:
function isSummon(cid) return Creature(cid) and Creature(cid):getMaster() end

no need to compare to nil in lua
 
Last edited:
Changed, I'll keep an eye on it. However, what are the chances that this is causing crashes? Generating crash log would help
 
I'd like to, but I am done for today... just spent 1 hour cleaning errors in VS2015, never-ending story. For now:

Error LNK1104 cannot open file 'libboost_date_time-vc140-mt-x64-1_72.lib'
 
Those are mainly (if not only) 1.3 builds, right? Funny thing - I can compile 1.3, however somehow got the problems with 1.2... I'll try installing another version of boost, if this won't help maybe I will convince the lazy part of myself to move to 1.3 :)
 
Back
Top