rathena/src/map/chrif.h
ultramage 106b44c1e7 Merged the /loginmerge branch (topic:192754)
* the login server storage, ipban and logging systems have been abstracted and now provide a common interface; the rest has been merged into a single login server core (no more login/login_sql duplicity)
 * storage systems are now added via compiler options (WITH_SQL / WITH_TXT)
 * multiple storage engines can be compiled in at the same time, and the config option account.engine defines which one will be used.
 * due to MySQL autoincrement limitations, accounts with id '0' will not be supported; account IDs from this point on should start from '1'.
 * login_log() functions now again record IP addresses in dotted format, not as 4-byte integers (undo from r6868).
 * removed config options that defined column names in the login table
 * removed `memo` and `error message` columns from login db/savefile
 * moved `loginlog` table to the logs database
 * added sql files upgrade_svn12975.sql and upgrade_svn12975_log.sql
 * due to changes to the login table layout, I added an !optional! sql file (upgrade_svn12975_view.sql) that will provide a certain degree of backwards compatibility with existing software; read the instructions inside carefully!
 * moved third-party includes/libs to a separate directory
 * updated project files / makefiles

Changed the way GM levels are handled
 * removed conf/gm_account.txt
 * added the gm level column to the txt savefile (after 'email' column)
 * gm level information is now transferred along with account data
 
For open problems see bugreport:1889.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13000 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-07-26 20:45:57 +00:00

67 lines
2.6 KiB
C

// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
// For more information, see LICENCE in the main folder
#ifndef _CHRIF_H_
#define _CHRIF_H_
#include "../common/cbasetypes.h"
#include <time.h>
enum sd_state { ST_LOGIN, ST_LOGOUT, ST_MAPCHANGE };
struct auth_node {
int account_id, char_id;
int login_id1, login_id2, sex, fd;
time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited)
struct map_session_data *sd; //Data from logged on char.
struct mmo_charstatus *char_dat; //Data from char server.
unsigned int node_created; //timestamp for node timeouts
enum sd_state state; //To track whether player was login in/out or changing maps.
};
void chrif_setuserid(char* id);
void chrif_setpasswd(char* pwd);
void chrif_checkdefaultlogin(void);
int chrif_setip(const char* ip);
void chrif_setport(uint16 port);
int chrif_isconnected(void);
extern int chrif_connected;
extern int other_mapserver_count;
struct auth_node* chrif_search(int account_id);
struct auth_node* chrif_auth_check(int account_id, int char_id, enum sd_state state);
bool chrif_auth_delete(int account_id, int char_id, enum sd_state state);
bool chrif_auth_finished(struct map_session_data* sd);
void chrif_authreq(struct map_session_data* sd);
void chrif_authok(int fd);
int chrif_scdata_request(int account_id, int char_id);
int chrif_save(struct map_session_data* sd, int flag);
int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip);
int chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port);
int chrif_searchcharid(int char_id);
int chrif_changeemail(int id, const char *actual_email, const char *new_email);
int chrif_char_ask_name(int acc, const char* character_name, unsigned short operation_type, int year, int month, int day, int hour, int minute, int second);
int chrif_updatefamelist(struct map_session_data *sd);
int chrif_buildfamelist(void);
int chrif_save_scdata(struct map_session_data *sd);
int chrif_ragsrvinfo(int base_rate,int job_rate, int drop_rate);
int chrif_char_offline(struct map_session_data *sd);
int chrif_char_offline_nsd(int account_id, int char_id);
int chrif_char_reset_offline(void);
int send_users_tochar(void);
int chrif_char_online(struct map_session_data *sd);
int chrif_changesex(struct map_session_data *sd);
int chrif_chardisconnect(struct map_session_data *sd);
int check_connect_char_server(int tid, unsigned int tick, int id, intptr data);
int chrif_divorce(int partner_id1, int partner_id2);
int do_final_chrif(void);
int do_init_chrif(void);
int chrif_flush_fifo(void);
#endif /* _CHRIF_H_ */