I just finished re-writing the server status checker in a much better fashion, but still can’t come up with a good solution to a problem that I’ve always had, so I’m hoping one of you have good ideas.
As you know, people can put a hostname for their server address, each time I check the servers I resolve the hostname to an IP and save that as well. This allows me to stop new people from registering IP addresses that other servers already point to, which works fine. Here are some simplified examples:
[table]
[tr]
[td]id[/td][td]hostname[/td][td]resolvedIP[/td]
[/tr]
[tr]
[td]1[/td][td]bob.com[/td][td]5.5.5.5[/td]
[/tr]
[tr]
[td]2[/td][td]tom.com[/td][td]6.6.6.6[/td]
[/tr]
[/table]
Which of course is fine, and if someone tries to register ‘alan.com’ which resolves to ‘5.5.5.5’ I see that is already registered to bob.com so I don’t allow it.
The problem happens when I am checking if the currently registered servers are online, if domains are re-pointed they may look like this:
[table]
[tr]
[td]id[/td][td]hostname[/td][td]resolvedIP[/td]
[/tr]
[tr]
[td]1[/td][td]bob.com[/td][td]5.5.5.5[/td]
[/tr]
[tr]
[td]2[/td][td]tom.com[/td][td]5.5.5.5[/td]
[/tr]
[/table]
Now the naive approach is to say since bob.com was registered first, give it preference and say tom.com is offline even though it isn’t. That is the fair thing to do in this case, but then you come across a change like this instead:
[table]
[tr]
[td]id[/td][td]hostname[/td][td]resolvedIP[/td]
[/tr]
[tr]
[td]1[/td][td]bob.com[/td][td]6.6.6.6[/td]
[/tr]
[tr]
[td]2[/td][td]tom.com[/td][td]6.6.6.6[/td]
[/tr]
[/table]
Now bob.com gets to use tom.com’s uptime, while kicking them ‘offline’, so that isn’t fair.
I used to delete all servers that resolved to the same IP, which is fair if it’s one guy posting them all, but isn’t for competing servers posting a dual advertisement for an enemy and getting their server deleted.
So, can anyone come up with a GOOD or even a DECENT solution to this problem? If I don’t get a good discussion going on here, I may move this topic to the public, just a fair warning.