WX: Somewhat fix lan link. Advance wars won't link properly whereas it is working with mem link.

This commit is contained in:
bgk 2012-09-02 14:26:22 +00:00
parent cf02712b34
commit 00791f6801
1 changed files with 28 additions and 18 deletions

View File

@ -121,15 +121,21 @@ public:
sig->Signal();
lock->Unlock();
}
} sid(&lock, &sig, &connmsg, &pmsg, &done);
if(!ls.Init(&sid)) {
};
sid_t* sid = new sid_t(&lock, &sig, &connmsg, &pmsg, &done);
if (!ls.Init(sid)) {
wxLogError(_("Error occurred.\nPlease try again."));
lock.Unlock();
delete sid;
return;
}
wxProgressDialog
pdlg(_("Waiting for clients..."), connmsg,
100, dlg, wxPD_APP_MODAL|wxPD_CAN_ABORT|wxPD_ELAPSED_TIME);
while(!done) {
if(!pdlg.Pulse(connmsg + pmsg))
done = true;
@ -175,17 +181,21 @@ public:
sig->Signal();
lock->Unlock();
}
} cid(&lock, &sig, &connmsg, &pmsg, &done);
int err;
if((err = lc.Init(sf::IPAddress(std::string(gopts.link_host.mb_str())),
&cid))) {
wxLogError(_("Error %d occurred.\nPlease try again."), err);
};
cid_t* cid = new cid_t(&lock, &sig, &connmsg, &pmsg, &done);
if (!lc.Init(sf::IPAddress(std::string(gopts.link_host.mb_str())), cid)) {
wxLogError(_("Error occurred.\nPlease try again."));
lock.Unlock();
delete cid;
return;
}
wxProgressDialog
pdlg(_("Waiting for connection..."), connmsg,
100, dlg, wxPD_APP_MODAL|wxPD_CAN_ABORT|wxPD_ELAPSED_TIME);
while(!done) {
if(!pdlg.Pulse(connmsg + pmsg))
done = true;