paddleball game

our last assignment was to “design a device that can connect to a server using a TCP socket connection to play a game.”

the game? “This is a multiplayer game in which players collaborate to keep a ball from hitting the ground. Each player has a paddle, and can bound the ball off her paddle. When the ball bounces off your paddle, you get a point. Only the first bounce counts, though; subsequent bounces don’t get you points. But if the ball bounces off another player’s paddle then back to yours, you score again. You can keep scoring forever by bouncing the ball back and forth.” you can learn more about it here.

in thinking about how to get the highest score, it’s helpful to have the server code available because it lets me know how the game works. tom gave us some examples of sanctioned ways to play: how to hook up a joystick or an arduino or whatever. but he also mentioned surya, allison burtch, and jon wasserman’s packet injection hack. i’m more interested in a hack than in making a controller, so i’ve been thinking about different options.

i think this part of the server code presents an interesting opportunity:

i imagined it would be possible for starting positions to look like this, in which case we would get a point for every new paddle the ball hit on the way down to the bottom:

sketch

i tested this by running the server on my computer and logging in from the game client and my phone:

this confirms to me that it’s possible to get a cascade thing happening if all clients log into the game in quick succession. so now i’m thinking about how to fill up the server’s buffer and only accept connections under certain conditions, like that there are 10 clients lined up to log into the game. i’m just starting to play with scapy, so we’ll see if i can execute this in time for tuesday.

update:

there’s something called a SYN flooding attack that might work for filling up the buffer. and i found a script by james woolley that works with scapy to do it. the problem is that i’m not sure how to control the length of time the buffer stays full. i don’t want to totally break the server; i just want to block connections for a certain amount of time. i hope i don’t have to do resort to doing math 😱

Leave a Reply