Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Account Server Core Functions
[Account Server Routines]


Data Structures

struct  mmo_char_server
 A Char Server. More...
struct  mmo_account
 An Account. More...
struct  auth_dat
 Authorization data. More...

Defines

#define MAX_SERVERS   30
 Maximum number of Character Servers Valid values: 0 to MAX-1.
#define LOGIN_CONF_NAME   "conf/login_athena.conf"
 Default configuration file.
#define START_ACCOUNT_NUM   2000001
 Start of account id counter.
#define END_ACCOUNT_NUM   100000000
#define AUTH_FIFO_SIZE   ((FD_SETSIZE > 1024) ? FD_SETSIZE : 1024)
 Max possible connections.

Functions

int password_check (const char *password_db, const char *pass, const char *key)
 Checks user password.
int check_existing_account_name_for_creation (const char *name)
 Search for a name in account database.
int search_account_index (const char *account_name)
 Search an account index by name of account If exact account name is not found, the function checks without case sensitive and returns index if only 1 account is found and similar to the searched name.
int search_account_index2 (const int account_id)
 Search an account index by id of account.
unsigned char check_online_player (const int account_id)
 Check if a account is already online.
void accounts_speed_sorting (int tableau[], int premier, int dernier)
 Quicksort implementation.
void save_account (int idx, unsigned char forced)
 Save the account.
void delete_account (const char *account_name)
 Delete an account.
void send_GM_account (const int account_id, const unsigned char level)
 Send a GM account to all char-server.
void add_text_in_memo (int account, const char *text)
 Adds text into memo.
void charif_sendall (unsigned int len)
 Sends packet into all Char Servers.
void account_to_str (char *str, struct auth_dat *p)
 Convert account into text.
int add_account (struct auth_dat *account, const char *memo)
 Adds a new account.
void init_new_account (struct auth_dat *account)
 Init default values of an account.

Variables

struct {
   int   account_id
 The account ID.
   int   char_id
   int   login_id1
   int   login_id2
   int   ip
   int   char_pos
   unsigned char   delflag
   unsigned char   sex
   time_t   connect_until_time
   int   map_auth
   unsigned int   ip
 IP address.
   unsigned   sex: 3
 0/1, 2: server
   unsigned   delflag: 1
 0: accepted, 1: not valid/not init
   char   str [128]
   int *   val
   map_cache_head   head
   map_cache_info *   map
   FILE *   fp
   int   dirty
auth_fifo [AUTH_FIFO_SIZE]
 The login queue.
auth_datauth_dat
 Authorization data.
char date_format [32]
 String representation of date format.
int login_port
 Login server listen port.
int account_id_count
int auth_num
int add_to_unlimited_account
 Give possibility or not to adjust (ladmin command: timeadd) the time of an unlimited account.
unsigned char use_md5_passwds
 Enable or disable md5 passwords.
unsigned char unique_case_account_name_creation
 Enable/disable case-sensitive accounts.
char login_log_unknown_packets_filename [512]
 Filename to dump unknown packets.
mmo_char_server server [MAX_SERVERS]
 max number of char-servers (and account_id values: 0 to max-1)
int server_fd [MAX_SERVERS]
 Map Server Sockets.

Define Documentation

#define MAX_SERVERS   30
 

Maximum number of Character Servers Valid values: 0 to MAX-1.

(Has something to do with account_id?)


Function Documentation

void account_to_str char *  str,
struct auth_dat p
 

Convert account into text.

This is used when saving into plaintext. Also works as SQL to TXT converter (needs confirmation).

void accounts_speed_sorting int  tableau[],
int  premier,
int  dernier
 

Quicksort implementation.

Someone forgot stdlib's qsort...

Parameters:
tableau Array of integer to be sorted.
premier Start index.
dernier End index.

int add_account struct auth_dat account,
const char *  memo
 

Adds a new account.

Parameters:
account An account data.
memo The memo text.

void add_text_in_memo int  account,
const char *  text
 

Adds text into memo.

Maximum memo length is 60000.

Parameters:
account Account ID
text Text to be added.

void charif_sendall unsigned int  len  ) 
 

Sends packet into all Char Servers.

Parameters:
len Packet length.

int check_existing_account_name_for_creation const char *  name  ) 
 

Search for a name in account database.

This is only useful to find out whether a name already exists.

Returns:
1 if name is found, 0 otherwise.
Parameters:
name The name to be found.

unsigned char check_online_player const int  account_id  ) 
 

Check if a account is already online.

Parameters:
account_id Account ID.
Returns:
1 if account is online, 0 otherwise.

void delete_account const char *  account_name  ) 
 

Delete an account.

Parameters:
account_name Account name.

void init_new_account struct auth_dat account  ) 
 

Init default values of an account.

Init all values, except: name, password and sex.

int password_check const char *  password_db,
const char *  pass,
const char *  key
 

Checks user password.

This function will first compare passwords as plaintext, then compare it as md5 hashes. For a password to be accepted, it has to match as plaintext, as md5 binary, or as md5 string. The parameter key is optional, but may not be NULL.

Returns:
1 if correct, 0 otherwise.
Parameters:
password_db The stored password.
pass User supplied password.
key A key concatenated into password_db before matching (optional).

void save_account int  idx,
unsigned char  forced
 

Save the account.

Parameters:
idx Account index (what index? need confirmation)
forced 1 = must be save, 0 = information is not important

int search_account_index const char *  account_name  ) 
 

Search an account index by name of account If exact account name is not found, the function checks without case sensitive and returns index if only 1 account is found and similar to the searched name.

Parameters:
account_name Account name to search.
Returns:
account index or -1 (if not found))

int search_account_index2 const int  account_id  ) 
 

Search an account index by id of account.

Parameters:
account_name Account name to search.
Returns:
account index or -1 (if not found.

void send_GM_account const int  account_id,
const unsigned char  level
 

Send a GM account to all char-server.

Parameters:
account_id Account ID
level GM Level


Variable Documentation

char date_format[32]
 

String representation of date format.

Todo:
Should use locale.

int server_fd[MAX_SERVERS]
 

Map Server Sockets.

Connection to each Map Servers.

unsigned char unique_case_account_name_creation
 

Enable/disable case-sensitive accounts.

Authorize or not different account names in database if there are different case. NOTE (SQL version): if you change default setting of `login_db_userid` in login_db SQL table to BINARY, this option can not work proprely.


Generated on Fri Apr 28 10:20:06 2006 for OpenAthena by  doxygen 1.4.4