(banfil, authfil): Remove. Matching user is useless, because the
player can send whatever he wants. Banning IPs is better done with a packet filter. That leaves restricting deity IPs. (privip): New econfig key to restrict deity IPs. (may_play): Implement it. (match_user): Unused, remove.
This commit is contained in:
parent
342d7b33ce
commit
02ddee69fb
7 changed files with 10 additions and 59 deletions
|
@ -360,37 +360,6 @@ show_motd(void)
|
|||
return RET_OK;
|
||||
}
|
||||
|
||||
int
|
||||
match_user(char *file, struct player *p)
|
||||
{
|
||||
FILE *fp;
|
||||
int match = 0;
|
||||
char host[256];
|
||||
char user[256];
|
||||
|
||||
if ((fp = fopen(file, "r")) == NULL) {
|
||||
/*logerror("Cannot find file %s", file); */
|
||||
return 0;
|
||||
}
|
||||
match = 0;
|
||||
while (!feof(fp) && !match) {
|
||||
if (fgets(host, sizeof(host), fp) == NULL)
|
||||
break;
|
||||
if (host[0] == '#')
|
||||
continue;
|
||||
if (fgets(user, sizeof(user), fp) == NULL)
|
||||
break;
|
||||
host[strlen(host) - 1] = '\0';
|
||||
user[strlen(user) - 1] = '\0';
|
||||
if (strstr(p->userid, user) &&
|
||||
(strstr(p->hostaddr, host) ||
|
||||
strstr(p->hostname, host)))
|
||||
++match;
|
||||
}
|
||||
fclose(fp);
|
||||
return match;
|
||||
}
|
||||
|
||||
int
|
||||
quit(void)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue