Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Your advice on Pre-Login

This topic is 6200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!