Atrinik Server 2.5
Functions | Variables
server/ban.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static void add_ban_entry (char *name, char *ip)
static void remove_ban_entry (objectlink *ol)
void load_bans_file ()
void save_bans_file ()
int checkbanned (const char *name, char *ip)
int add_ban (char *input)
int remove_ban (char *input)
void list_bans (object *op)

Variables

static objectlinkban_list = NULL

Detailed Description

Banning related functions.

It is possible to use the /ban DM command or interactive server mode ban command to ban specified player or IP from the game.

Syntax for banning: Player:IP

Where Player is the player name and IP is the IP address. It is possible to use * for both IP and player, which means any match.

Definition in file ban.c.


Function Documentation

int add_ban ( char *  input)

Add a ban. Will take care of getting the right values from input string.

Parameters:
inputThe input string with both name and IP.
Returns:
1 on success, 0 on failure.

Definition at line 159 of file ban.c.

static void add_ban_entry ( char *  name,
char *  ip 
) [static]

Add a ban entry to ban_list.

Parameters:
nameName to ban.
ipIP to ban.

Definition at line 48 of file ban.c.

int checkbanned ( const char *  name,
char *  ip 
)

Check if this player or host is banned.

Parameters:
nameLogin name to check.
ipHost name to check.
Returns:
1 if banned, 0 if not.

Definition at line 137 of file ban.c.

void list_bans ( object op)

List all bans.

Parameters:
opPlayer object to print this information to, NULL to output it to the log.

Definition at line 211 of file ban.c.

void load_bans_file ( )

Load the ban file.

Definition at line 75 of file ban.c.

int remove_ban ( char *  input)

Remove a ban. Will take care of getting the right values from input string.

Parameters:
inputThe input string with both name and IP.
Returns:
1 on success, 0 on failure.

Definition at line 184 of file ban.c.

static void remove_ban_entry ( objectlink ol) [static]

Remove a ban entry from ban_list.

Parameters:
olPointer to the objectlink to remove.

Definition at line 64 of file ban.c.

void save_bans_file ( )

Save the bans file.

Definition at line 110 of file ban.c.


Variable Documentation

objectlink* ban_list = NULL [static]

The list of the bans.

Definition at line 42 of file ban.c.