FreeOrion

Forums for the FreeOrion project
It is currently Wed Oct 22, 2014 10:19 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Dec 28, 2007 11:20 am 
Offline
Space Krill

Joined: Fri Dec 28, 2007 10:51 am
Posts: 1
Hi,

I may have encountered a bug in ServerFSM::HandleNonLobbyDisconnection(). When an AI player is eliminated, the freeoriond process exits and the GUI client hangs at "downloading new state", after these console messages:
Code:
  HumanClientApp::HandleMessage(TURN_PROGRESS)
  HumanClientApp::HandleMessage(PLAYER_ELIMINATED)


I suspect the culprit the following code; disabling it fixes the problem:

Code:
void ServerFSM::HandleNonLobbyDisconnection(const Disconnection& d)
{
    //....
    //....

    if (m_server.m_networking.empty() || m_server.m_ai_clients.size() == m_server.m_networking.NumPlayers()) {
        Logger().debugStream() << "ServerFSM::HandleNonLobbyDisconnection : All human players disconnected; server terminating.";
        Sleep(2000); // HACK! Pause for a bit to let the player disconnected and end game messages propogate.
        m_server.Exit(1);
    }
}


With 1 human and 4 AI players (i.e. single-player), after player #4, an AI player, is eliminated, m_networking.NumPlayers() is 4 but m_ai_clients.size() is still 4, not 3. I don't see any items ever removed from m_ai_clients. So the problem may be an incorrect assumption by HandleNonLobbyDisconnection() regarding the contents of m_ai_clients, or m_ai_clients not being updated somewhere else.

A more robust check might be to count the number of non-AI players still connected (is that possible?). There's a similar check in MPLobby::react(). Also, a more visible error message would be nice for this exit condition (errorStream instead of debugStream?).

For now I just #ifdef-out the check above and the game runs fine.

Best, Karl


Top
 Profile  
 
PostPosted: Fri Dec 28, 2007 5:12 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 10194
Location: Munich
You've already posted a comment on this bug on sourceforge, so I don't need to point you to the tracker, but in case anyone else is wondering, this post should clarify things...


Top
 Profile  
 
PostPosted: Sun Jan 27, 2008 7:20 pm 
Offline
Krill Swarm

Joined: Sat Jan 12, 2008 9:23 pm
Posts: 13
is there any progress on solving this issue? The game is almost not playable :-(
It would be appricated if there is just a dirty hack as a work-around until this is fixed gracefully.


Top
 Profile  
 
PostPosted: Sun Feb 10, 2008 1:11 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 10194
Location: Munich
DoomWarrior wrote:
is there any progress on solving this issue? The game is almost not playable :-(
It would be appricated if there is just a dirty hack as a work-around until this is fixed gracefully.

It has been fixed in SVN. Yay for tzlaine.


Top
 Profile  
 
PostPosted: Sat Feb 16, 2008 8:41 pm 
Offline
Krill Swarm

Joined: Sat Jan 12, 2008 9:23 pm
Posts: 13
works fine :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group