🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Your advice on Pre-Login

Started by
0 comments, last by Galileo430 22 years, 11 months ago
On my UDP server. In order to login you need to complete a somewhat complex exchange.. I need someway to keep track of who is trying to login and what stage they are in.. Anyone have a idea? My idea was to assign each user a Number and check the IP every time I get a message.
------------------------------------------------------------I wrote the best video game ever, then I woke up...
Advertisement
Personally, I would use TCP for logging in. The sockets make life a lot easier.
If you MUST use UDP, I would keep an array of structs that kept client ID, client ip, client state, and perhaps some client data in it. Whenever the server receives a message it runs through a command list:
1) Check to see if source IP is in the array
2) If not, add it, process data.
3) If so, process data.
4) If array is full, tell client that the server is too busy.
(Not that complex actually).
When the server and client have finished their exchange, you clear the client from the login array to free up the spot.
This does lend itself to problems though. Spoofed IP''s will easily cause your server to stop responding to others. Of course, you will need to add a timer routine to clear the array of stale logins.

I honestly can''t think of a method that is pretty good against spoofed IP DOS attacks though. Anyone else have a nice way in UDP?

This topic is closed to new replies.

Advertisement