[-] Fixed bug which didn't allow client to join into game

(note: I'm not highly knowledgable in network protocol programming, but looks like stratagus tries to connect on localhost instrad of address specified in join window)
This commit is contained in:
cybermind 2013-07-20 16:46:55 +06:00
parent 752c9f77b2
commit 637de00822
2 changed files with 3 additions and 2 deletions

View file

@ -398,7 +398,8 @@ void InitNetwork1()
// Our communication port
const int port = CNetworkParameter::Instance.localPort;
const CHost host(CNetworkParameter::Instance.localHost.c_str(), port);
const char *NetworkAddr = NULL; // FIXME : bad use
const CHost host(NetworkAddr, port);
NetworkFildes.Open(host);
if (NetworkFildes.IsValid() == false) {
fprintf(stderr, "NETWORK: No free port %d available, aborting\n", port);

View file

@ -46,7 +46,7 @@
CHost::CHost(const char *name, int port)
{
this->ip = NetResolveHost(name ? name : "127.0.0.1");
this->ip = name ? NetResolveHost(name) : INADDR_ANY;
this->port = htons(port);
}