Forum Multiplayer Server Sending Messages Twice

Discussion and help relating to the PlayerIO Multiplayer API.

Server Sending Messages Twice

Postby mulatto401 » August 9th, 2010, 10:29 pm

Hi All,

I have been debugging my game figuring that it must be my own code that is making the client receive 2 of every message sent to it..but I cannot figure it out.

I was wondering if there was anyone else that has had this issue?

My game starts off by connecting to a Lobby Server Type, or creates a room if there are none available. Once 2 ppl have selected to play the game it makes 1 of the players create another room using the Main Game Server Type and once the other player joins that room the game starts. But everything it sends is sent twice and I checked all my code server and client side and there is no reason for it to send twice, I was wondering if maybe there is some type of setting I could have on that I shouldn't with PlayerIO?

Thanks
mulatto401
Paid Member
 
Posts: 34
Joined: June 13th, 2010, 11:13 pm

Re: Server Sending Messages Twice

Postby Oliver » August 10th, 2010, 12:09 pm

Hi,

This mostly sounds like your clients might be connected multiple times. Are you using the local development server? This will let you see the currently active connections.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Server Sending Messages Twice

Postby mulatto401 » August 10th, 2010, 7:16 pm

Hi Oliver,

I am using the Live Server, uploaded the DLL file.

What I did was test the game on 2 different machines on the same network (thinking it would be because requests are going to the same IP, but then again colleges and public places will use the same IPs) and still had the issue, then I tested on 2 separates networks on different IPs and still had the issue.

My game connects to a Lobby DLL and then once 2 players decide to play they connect to the Main Game DLL and disconnect to the Lobby DLL. The Lobby DLL does not send duplicate messages, but the Main Game DLL does.
mulatto401
Paid Member
 
Posts: 34
Joined: June 13th, 2010, 11:13 pm

Re: Server Sending Messages Twice

Postby Benjaminsen » August 10th, 2010, 8:08 pm

I would really like to see the source code of of the project where this behavior happens. If you hare worried about sharing your code, I am all fine by you just sending me an example where this behavior happens.

You can email me your source at chris at player.io or just upload it here on the forum.

Did you check that you do not attach the event handler twice? You can listen to a message type as many times as you wish which could result in the behavior you describe. Likewise if you have a wildcard listener and a normal listener you could get this behavior.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Server Sending Messages Twice

Postby mulatto401 » August 10th, 2010, 10:15 pm

oh shoot, I feel like a fool. I have a setupListeners() function and it was called twice, man I didn't even think anything of it.

Thanks for helping :D
mulatto401
Paid Member
 
Posts: 34
Joined: June 13th, 2010, 11:13 pm


Return to Multiplayer