View Single Post
Old 07-25-2002, 05:11 PM   #4
Robbert
Member
 
Join Date: Apr 2002
Location: #### Paso, Tx
Posts: 89
Robbert is on a distinguished road
Send a message via ICQ to Robbert Send a message via AIM to Robbert
It's fairly easy to check multiplaying, simply iterate through the descriptor list a second time and look for matches. It's better to either disable the hostname lookup - gethossbyaddr() (which has problems of its own, when incompetent ISP techies set up their name lookups poorly) - or store the numeric IP address in a seperate field prior to resolving the name, as comparison of numerics is more efficient than string comparisons. So, store the octet IP and check for its presence on other descriptors. If you'd like, include the subnet mask as well, but if you check only against the domain and not the host, you'll get a lot of false matches (as two people from the same server cluster on AOL connect, for example). Do this in a snippet form, or even standalone prior to the descriptor being passed to the game loop,

As far as other templates.... I'm not sure that it'd be more trouble than it's worth. In my exerience, those who rely entirely on snippets will either a)install the template you use and not even give you the decency of a notification, or b)use it and gain absolutely no knowledge out of it. Call me cynical (I call it pragmatism), but I think that there'd be little or no knowledge gained from it by those who used it. And, apart from being very generic, it's difficult to account for everyone's changes they've made to their game. And the time saved from shoehorning a generic template into a game would be offset by the advantage it would provide.
Robbert is offline   Reply With Quote