[1] | 1 | // Copyright (c) Athena Dev Teams - Licensed under GNU GPL |
---|
| 2 | // For more information, see LICENCE in the main folder |
---|
| 3 | |
---|
| 4 | #ifndef _CHRIF_H_ |
---|
| 5 | #define _CHRIF_H_ |
---|
| 6 | |
---|
| 7 | #include "../common/cbasetypes.h" |
---|
| 8 | #include <time.h> |
---|
| 9 | |
---|
| 10 | enum sd_state { ST_LOGIN, ST_LOGOUT, ST_MAPCHANGE }; |
---|
| 11 | struct auth_node { |
---|
| 12 | int account_id, char_id; |
---|
| 13 | int login_id1, login_id2, sex, fd; |
---|
| 14 | time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited) |
---|
| 15 | struct map_session_data *sd; //Data from logged on char. |
---|
| 16 | struct mmo_charstatus *char_dat; //Data from char server. |
---|
| 17 | unsigned int node_created; //timestamp for node timeouts |
---|
| 18 | enum sd_state state; //To track whether player was login in/out or changing maps. |
---|
| 19 | }; |
---|
| 20 | |
---|
| 21 | void chrif_setuserid(char* id); |
---|
| 22 | void chrif_setpasswd(char* pwd); |
---|
| 23 | void chrif_checkdefaultlogin(void); |
---|
| 24 | int chrif_setip(const char* ip); |
---|
| 25 | void chrif_setport(uint16 port); |
---|
| 26 | |
---|
| 27 | int chrif_isconnected(void); |
---|
| 28 | |
---|
| 29 | extern int chrif_connected; |
---|
| 30 | extern int other_mapserver_count; |
---|
| 31 | |
---|
| 32 | struct auth_node* chrif_search(int account_id); |
---|
| 33 | struct auth_node* chrif_auth_check(int account_id, int char_id, enum sd_state state); |
---|
| 34 | bool chrif_auth_delete(int account_id, int char_id, enum sd_state state); |
---|
| 35 | bool chrif_auth_finished(struct map_session_data* sd); |
---|
| 36 | |
---|
| 37 | void chrif_authreq(struct map_session_data* sd); |
---|
| 38 | void chrif_authok(int fd); |
---|
| 39 | int chrif_scdata_request(int account_id, int char_id); |
---|
| 40 | int chrif_save(struct map_session_data* sd, int flag); |
---|
| 41 | int chrif_charselectreq(struct map_session_data* sd, uint32 s_ip); |
---|
| 42 | int chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port); |
---|
| 43 | |
---|
| 44 | int chrif_searchcharid(int char_id); |
---|
| 45 | int chrif_changeemail(int id, const char *actual_email, const char *new_email); |
---|
| 46 | 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); |
---|
| 47 | int chrif_reloadGMdb(void); |
---|
| 48 | int chrif_updatefamelist(struct map_session_data *sd); |
---|
| 49 | int chrif_buildfamelist(void); |
---|
| 50 | int chrif_save_scdata(struct map_session_data *sd); |
---|
| 51 | int chrif_ragsrvinfo(int base_rate,int job_rate, int drop_rate); |
---|
| 52 | int chrif_char_offline(struct map_session_data *sd); |
---|
| 53 | int chrif_char_offline_nsd(int account_id, int char_id); |
---|
| 54 | int chrif_char_reset_offline(void); |
---|
| 55 | int send_users_tochar(void); |
---|
| 56 | int chrif_char_online(struct map_session_data *sd); |
---|
| 57 | int chrif_changesex(struct map_session_data *sd); |
---|
| 58 | int chrif_chardisconnect(struct map_session_data *sd); |
---|
| 59 | int check_connect_char_server(int tid, unsigned int tick, int id, intptr data); |
---|
| 60 | int chrif_divorce(int partner_id1, int partner_id2); |
---|
| 61 | |
---|
| 62 | int do_final_chrif(void); |
---|
| 63 | int do_init_chrif(void); |
---|
| 64 | |
---|
| 65 | int chrif_flush_fifo(void); |
---|
| 66 | |
---|
| 67 | #endif /* _CHRIF_H_ */ |
---|