tags:

views:

132

answers:

1

Hi,

used this website for the long time to find answers, now need to ask on myself! :)

I have implemented multi player for my game using GKSession and client/server approach, not using peer picker (up to 4 player allowed).

I have one big problem which I can't find solution for.

If you disconnect/reconnect server peer quickly enough, client peer will "remember" that host and will show it in the list of all available peers permanently, only turning wifi/bluetooth off resets this.

So if I do this 5 times in a row, my client will show 5 available hosts with the same name!

Anyone had experience with this? Any idea of workarounds?

I should note that requirements for my game is iPhone SDK 3.0 for Bluetooth and 3.1 for Wifi as GKSession supports both now.

+1  A: 

I have a similar problem. In fact I event get peers listed who are not even currently playing the game. Even more so, peers who are not acting as server are listed. I am wondering if there is some behind the scenes caching going on.

I'm thinking about implementing some kind of timer with visual feedback to show the disconnect progress, ideally to prevent this situation. It seems like in general there is a bit of time delay involved with connecting/available and disconnecting/unavailable. It might be better to code the interface to take these time delays into consideration, though I'm not sure exactly how.

Greg
One solution is not to use server/client mode, but use peer mode which still can be made to act as a server/client. In this case there is no caching of peers problem.The way I sort of fixed it that when I load available server list if same name comes up again I replace existing one in the list. I've found that last name of same peer is always the "right" one.Of course it doesn't fix the problem if host is not available, but still comes up as available. I'm afraid there is no fix for this unless you use peer mode.
Ernest