Forum Feedback double connecting from same swf

Problem with the website? Confused about something? Or maybe you just have something you'd like to suggest. This is the place to do it.

double connecting from same swf

Postby playstation3Dood » March 16th, 2010, 9:36 am

Hey, I stumbled on this small bug by chance really, when i forgot to disable keyboard shortcuts when testing my FLA. I pressed enter, and the movie shot through the frames then stopped at the first, which contains my connect button. i pressed it and it connected, but the old connection was still active and my dev server showed 2 players logged into the room. about 5-10 seconds later one of the conections was kicked from the server, but in that time i managed to get every message from the server twice. maybe you should only allow one connection per IP address, or somehow send only one copy of each message to each client regardless of connections?
playstation3Dood
 
Posts: 49
Joined: February 23rd, 2010, 7:39 am

Re: double connecting from same swf

Postby Oliver » March 16th, 2010, 2:53 pm

Hey,

This is by design. You have to keep track of which connections you have open to which rooms.

You're allowed to have as many connections open to same/different rooms and across different servertypes and games as you want to (and flash allows) inside the same flash file.

The disconnect you saw was probably just the garbage collection deleting the old connection.

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

Re: double connecting from same swf

Postby Toby » March 16th, 2010, 3:44 pm

If you're interested, yourself, in stopping a player joining the same room twice, I imagine it can be easily achieved on the serverside portion of the game. Just add the IP address as a property of the player class and then check when a player joins if someone with that address isn't already playing. Bear in mind, it would drastically affect school play and siblings playing against each-other. :)
User avatar
Toby
 
Posts: 86
Joined: January 14th, 2010, 4:01 pm

Re: double connecting from same swf

Postby playstation3Dood » March 17th, 2010, 5:49 am

thanks guys, i was thinking i would need to implement this myself serverside.

@Toby:
why would that influence school play/siblings? they wouldn't be using the same computer so their IPs wouldn't be the same.
playstation3Dood
 
Posts: 49
Joined: February 23rd, 2010, 7:39 am

Re: double connecting from same swf

Postby Toby » March 17th, 2010, 10:48 am

playstation3dood, their local IPs would be different, yeah, but the IP address you see will see is their global one - which is the one assigned to the router or whathaveyou.
User avatar
Toby
 
Posts: 86
Joined: January 14th, 2010, 4:01 pm

Re: double connecting from same swf

Postby playstation3Dood » March 17th, 2010, 11:01 am

I dunno, maybe its because i'm using the dev server, or something but when i use two different computers to connect, IPs detected are different. yes, they connect through the same wireless router.
playstation3Dood
 
Posts: 49
Joined: February 23rd, 2010, 7:39 am

Re: double connecting from same swf

Postby NPSF3000 » March 17th, 2010, 11:32 am

Ahh... IP Addresses.

I'll give you a very quick overview.

IP's go from 0.0.0.0 to 255.255.255.255. (Not all of these are usable however)

256^4 = 4 294 967 296

This is a very small number of addresses when you consider how many Network devices people have. Especially when you start to deal with data-centre’s with tens of thousands of servers (and a server *can* have more than one IP).

A novel way of solving this problem is to reserve certain ranges for private networks - this means that the address works like normal, but cannot be accessed through the internet.

The private IP ranges are 10.0.0.0-10.255.255.255, 172.16.0.0 – 172.31.255.255 and 192.168.0.0-192.168.255.255.

This is what you should be seeing, in your private network you have a server and a couple pc's - all are assigned (either manually or via DCHP) private IP's.

The problem occurs when you try to connect to a server outside you local network. What happens is that your router is assigned only 1 public IP from the ISP. This is an address that any computer on the internet can contact. The router performs something called NAT (or PAT), to hide your many private address into this one public address.

So if you were to prevent an IP address from having more than one connection, unknowingly you could be preventing millions of hidden IP addresses to access the game at once. For example my school has 500, going on 1000+ computers, all running off a single IP address.
NPSF3000
 
Posts: 41
Joined: March 17th, 2010, 11:14 am

Re: double connecting from same swf

Postby playstation3Dood » March 17th, 2010, 11:38 am

:shock: OOOh so thats how it is. thanks a bunch NPSF3000. Great explanation.

so i suppose limiting it to 1 connection per computer would currently be impossible without simultaneously blocking off potentially thousands of players?
playstation3Dood
 
Posts: 49
Joined: February 23rd, 2010, 7:39 am

Re: double connecting from same swf

Postby NPSF3000 » March 17th, 2010, 11:43 am

There probably are ways, but I think you would be better off with trying to solve the actual problem.

"but in that time i managed to get every message from the server twice."

Its a simple connection management problem from the sounds.
Last edited by NPSF3000 on March 17th, 2010, 11:48 am, edited 2 times in total.
NPSF3000
 
Posts: 41
Joined: March 17th, 2010, 11:14 am

Re: double connecting from same swf

Postby playstation3Dood » March 17th, 2010, 11:44 am

yeah, probably. well thanks again
playstation3Dood
 
Posts: 49
Joined: February 23rd, 2010, 7:39 am


Return to Feedback



cron