Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / Automatic Host/Client

Years of Service
User Offline
Joined: 27th Feb 2003
Posted: 25th Mar 2017 13:13
I'm trying to implement a pretty simple concept: when the game starts it calls JoinNetwork() then spends two seconds looking for a host; if it doesn't find one it then declares itself the host with HostNetwork(). The problem I'm having is that this ends up with two clients on the network - so I suppose what is happening is the first attempt to join actually succeeds when that local host is created. Looking at the example code for JoinNetwork, I figured what I was missing was a CloseNetwork() command, which that code calls after a timeout. But trying this locked up my code. Wondering if I was doing something else wrong, I tried the example code, but it locks up too.

The snippet from my tier 2 code:

So what to do? This seems like an easy way to emulate something closer to peer-to-peer. Any help much appreciated!

Login to post a reply

Server time is: 2018-05-23 06:20:15
Your offset time is: 2018-05-23 06:20:15