Re: Breaking matchmaking deadlocks

Blair Holloway <[email protected]> Fri, 9 Jul 2010 11:42:56 +1000
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
Having thought about it, each user *does* have a unique ID akin to a MAC
address. Perhaps all we need to break the deadlock is something like:

bool shouldAcceptIncomingConnectionFrom(USERID fromUser) {
  if (NotAttemptingConnectionTo(fromUser))
    return true;
  else if (this->localUserId < fromUser)
    return true;
  else
    return false;
}

I do worry about the implications of relying on a user's id, though -- I
sense it is one of those things that, handled incorrectly, could generate
one of those reproducible-once-in-a-thousand-times bugs. :/

- Blair

On Thu, Jul 8, 2010 at 8:45 PM, Peter Thierolf <[email protected]> wrote:

> Why not use the MAC address ? That is supposed to be unique anyway...
>
> Am 08.07.2010 12:26, schrieb Philip Taylor:
>
>  On Thu, Jul 8, 2010 at 10:41 AM, James Robertson<[email protected]>
>>  wrote:
>>
>>
>>> All you're looking for is
>>> a way to reject one connection and keep the other, with a fallback for
>>> the
>>> (extremely) rare instances that both times are identical.  The timestamps
>>> could be years apart and the mechanism would still give the required
>>> result.
>>>
>>>
>> If you just want a meaningless number with minimal chances of a
>> collision, timestamps sound like one of the worst possible choices -
>> people put a lot of effort into making clocks accurate and
>> synchronised, but you'll get more collisions as they get more
>> accurate. And once you get one collision, it's much more likely that
>> you'll get another collision when you try again a little later. An
>> n-bit random ID (seeded by more than just the timestamp) would have a
>> much lower chance of collision than an n-bit timestamp.
>>
>>
>>
>
> _______________________________________________
> Sweng-Gamedev mailing list
> [email protected]
> http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com
>

_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com