Issue information

Issue ID
#8467
Status
Unable to Reproduce
Severity
None
Started
Garr
Dec 12, 2014 23:25
Last Post
Garr
Jan 13, 2015 0:50
Confirmation
N/A

Garr - Dec 12, 2014 23:25

There's an option in conf files called at_limit, which is supposed to limit the vending time of @at vendors. And it works awesome... until server restarts for some reason (crash/planned reboot). After being reloaded from db, the vendor does not have that limit on them anymore.

I've checked around, and it seems that status is used for this:
[code=auto:0] ACMD(autotrade) { ... if( battle_config.at_timeout ) { int timeout = atoi(message); status->change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } ... } [/code]
And if there's no server restart, everything seems to work fine. But if it hits, that status is gone. I'll be looking further into the issue, but for now I'm clueless as to why it's gone and why that status is not reloaded, as it should be, especially since in sc_config it's mentioned as:[code=auto:0] SC_AUTOTRADE, 77 [/code]
So shouldn't disappear on relog/reload. Search in all files gave only 3 hits where that name is used directly: one shown above, one on end of status where it summons (map->quit), and one where it's named in enum.

GmOcean - Dec 13, 2014 0:50

Are SD.states stored upon server restart/crash/etc..
If so, why not just switch from a status effect, and go to a state?

Garr - Dec 13, 2014 22:56

Even if they are stored (not all, I believe), there would still be a problem with storing the timer. SC already has that feature there, aka storing the timer to SQL, as well as vals1-4. I've been checking in with the SQL db on test server, and SC_AUTOTRADE surely appears as saved there (It is SC number 270).
[img]http://i62.tinypic.com/15yewqs.jpg[/img]
Still lost why it's not loading.

malufett - Dec 14, 2014 10:41

I try [list=1]
[*]do @at
[*]restart server
[*]load server
[*]watch the autotrader
[*]poof the autotrader timeout and gone in its vending spot
[/list]
did I missed something?

:meow:

Garr - Dec 14, 2014 14:19

Hmm. I can't reproduce it on Windows compiling with MSVC2010, but it is still reproducable with fresh repo on my ubuntu machine. Hell if I understand anything anymore.

Garr - Jan 13, 2015 0:50

Welp, after some more testing, it seems that this behavious is following a server crash, since statuses are not saved properly if the server crashed. Well, they DO get saved, but the problem is on calling them out of SQL they get deleted, so if a char was online during crash (@at merchant per instance), all his status effects will be lost, resulting in an autotrader that won't get kicked, as they are counted online with lasting SC_EFFECT.

The reason I was able to reproduce the effect at first was because my map-server was restarting on it's own and trying to reconnect to other servers, so had to do killing manually via "pkill map-server", which incidentally reproduced crash behavior.