MantisBT - VCMI
View Issue Details
0001245VCMIGUI - Adventure Mappublic2013-03-18 12:492014-05-30 17:43
cirdan 
Ivan 
normalcrashalways
closedfixed 
x86linux
0.92 
0.93 
0001245: Client freeze when visiting hut of the magi
The client freezes when a hero visits a hut of the magi. It does not crash; the UI is simply frozen (unresponsive).

This is what I have been able to gather: CGMagi:onHeroVisit (in lib/CObjectHandler.cpp) sends a CenterView packet for each eye of the magi, with a timeout of 2000, and lastly another CenterView packet to restore the view on the hero, but without a timeout, and this seems to confuse the client. Indeed, by tracing through CPlayerInterface::centerView (in client/CPlayerInterface.cpp), the focusTime for this last packet is completely bogus (in the order of the millions), so the client hangs in SDL_delay (I guess it would recover if I left it running for a couple of hours...).

The attached patch fixes the bug for me.

I am running self-compiled vcmi with gcc-4.7.2 and boost-1.51.
Visit hut of the magi
No tags attached.
diff hutofmagi.diff (308) 2013-03-18 12:49
https://bugs.vcmi.eu/file_download.php?file_id=1239&type=bug
Issue History
2013-03-18 12:49cirdanNew Issue
2013-03-18 12:49cirdanFile Added: hutofmagi.diff
2013-03-29 17:19WarmongerNote Added: 0003472
2013-03-29 17:20WarmongerNote Edited: 0003472bug_revision_view_page.php?bugnote_id=3472#r2162
2013-03-29 17:21WarmongerAssigned To => Warmonger
2013-03-29 17:21WarmongerStatusnew => feedback
2013-03-29 17:41IvanNote Added: 0003473
2013-03-29 19:16IvanNote Added: 0003475
2013-03-29 19:16IvanStatusfeedback => resolved
2013-03-29 19:16IvanFixed in Version => 0.93
2013-03-29 19:16IvanResolutionopen => fixed
2013-03-29 19:16IvanAssigned ToWarmonger => Ivan
2013-04-01 18:53cirdanNote Added: 0003485
2014-05-30 17:43beegeeStatusresolved => closed

Notes
(0003472)
Warmonger   
2013-03-29 17:19   
(edited on: 2013-03-29 17:20)
I couldn't reproduce freeze. Also, cv object stores focus time outside the loop, so it should remain initialized. Any details on this issue?


        CenterView cv;
        FoWChange fw;
        cv.player = fw.player = h->tempOwner;

        showInfoDialog(h,61,soundBase::LIGHTHOUSE);

        fw.mode = 1;
        BOOST_FOREACH(auto it, eyelist[subID])
        {
            const CGObjectInstance *eye = cb->getObj(it);

            cb->getTilesInRange (fw.tiles, eye->pos, 10, h->tempOwner, 1);
            cb->sendAndApply(&fw);
            cv.pos = eye->pos;
            cv.focusTime = 2000;
            cb->sendAndApply(&cv);
        }
        cv.pos = h->getPosition(false);
        cb->sendAndApply(&cv);

(0003473)
Ivan   
2013-03-29 17:41   
Judging from code - if there 0 eyes focusTime won't be initialized. Maybe this is where freeze comes from?
(0003475)
Ivan   
2013-03-29 19:16   
Should be fixed, rev 3298
(0003485)
cirdan   
2013-04-01 18:53   
I agree with your analysis. I was playing Titan's winter, which doesn't have any eye of the magi.

Thanks for fixing this.