Dr Brain wrote: |
1 new account a day? Lol, hope you aren't setting up a lot of bots. |
Qndre wrote: |
I don't think that BOTs send a registration form. ![]() |
Code: Show/Hide --- /home/palm/cvs/asss/src/core.c 2004-05-08 00:22:09.000000000 +0000
+++ /home/palm/asss/src/core.c 2004-05-22 15:58:24.000000000 +0000 @@ -705,6 +705,10 @@ } else if (IS_STANDARD(p)) { + Player *i; + Link *link; + int count; + struct S2CLoginResponse lr = { S2C_LOGINRESPONSE, 0, 134, 0, {0, 0, 0}, 0, {0, 0, 0, 0, 0}, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0} }; @@ -738,6 +742,30 @@ lr.codechecksum = -1; } + /* limit multiple connections from the same machine */ + count = 0; + FOR_EACH_PLAYER(i) /* coming from a packet func, pd is already locked */ + { + if (i->macid == p->macid) + count++; + } + + if (count > 1 && capman && !capman->HasCapability(p, "multiplelogin")) + { + if (p->type == T_CONT) + { + lr.code = AUTH_CUSTOMTEXT; + strncpy(auth->customtext, + "You are already logged in", + sizeof(auth->customtext)); + } + else + lr.code = AUTH_NONEWCONN; + + lm->Log(L_DRIVEL, "<core> [pid=%d] login request denied: " + "multiple (%d) conn from same machine", p->pid, count); + } + if (lr.code == AUTH_CUSTOMTEXT) { if (p->type == T_CONT) |