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

Author
Message
Rasta
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location:
Posted: 25th Mar 2017 13:13
Hello,
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 https://www.appgamekit.com/documentation/Reference/Multiplayer/JoinNetwork.htm, 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: 2024-04-26 08:00:08
Your offset time is: 2024-04-26 08:00:08