unity-src
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Unity-irc3] Banning from the entire network, part two


From: Jan Krueger
Subject: Re: [Unity-irc3] Banning from the entire network, part two
Date: Wed, 09 Apr 2003 22:46:56 +0200

David Westley <address@hidden> wrote on 2003-04-09 20:56:
> Are you sure the levels should add together? If you add the levels together,
> suppose several servers add level 1 and level 2 bans for the same mask... 
> ummm... scratch that I see what you are doing... I'm being an idiot :)
No need for any further explanations then, or did I get you wrong this time?
;)

> Different note... I assume a higher level ban will over-rule a lower level
> ban, like... a level 1 server adds a ban... then a level 4 server adds the
> same ban as it wasn't from a trusted source originally but then the level 1
> server tries to remove it... that should fail shouldn't it?
After both servers have set the ban there will be two bans for the same mask.
Now if one of the servers withdraws their version of the ban, it gets removed
and the other one remains. What we get by this is:

- ban durations are preserved. If a low-level server adds a long-timed ban and
  a high-level server adds the same ban with a short duration, thus activating
  the ban on most servers, the higher-level ban will go away when it expires,
  leaving only the low-level ban. Most servers will now deactivate the ban
  locally since the level is too low now.
  Example (same groups as earlier):

  snoke adds a ban that lasts 7d, tiscali adds the same ban with a duration of
  2h. The ban will now most likely get active on most of the servers in the
  QuakeNet group. After two hours, the tiscali ban vanishes, leaving only the
  level 1 ban set by snoke. The ban won't be powerful enough now so it will be
  deactivated on most servers.

When I come to think about it, the "score" (i.e. sum of all the levels of all
bans on the same mask) is enough to let servers decide whether to pick up a
ban.

A little bit of pseudo code on the blacklist server:

int GetGlobalBanScore(char* mask, int groupid) {
  int i;
  int score = 0;
  GlobalBan bans[MAXBANSPERMASK] = FindBansByMask(mask);

  for (i=0; i < MAXBANSPERMASK; i++) {
    if (bans[i].mask == NULL) break;
    if (!IsGroupMember(bans[i].setby, groupid)) continue;
    score += bans[i].score;
  }

  return score;
}

void OnReceiveNewBan(Server* server, char* mask, int level) {
  int i;
  int groups[MAXGROUPS] = GetServerGroups(server);

  for (i=0; i < MAXGROUPS; i++) {
    int oldlevel = GetGlobalBanScore(mask, groups[i]);
    int newlevel = oldlevel + max(GetServerLevel(server, groups[i]), level);

    SendBanToGroup(groups[i], mask, newlevel);
  }
}

(and so on)

What do you think?

Jan

Attachment: pgpWZ7P7S7H7W.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]