summaryrefslogtreecommitdiff
path: root/src/map/chrif.h
diff options
context:
space:
mode:
authorSusu <bruant.bastien@gmail.com>2013-06-25 14:12:21 +0200
committerSusu <bruant.bastien@gmail.com>2013-06-25 14:12:21 +0200
commit71627e92fbe36c23993456486a308acd0428fd3d (patch)
tree11944c4fbab516994661ad56e9656d421b025c81 /src/map/chrif.h
parent5b40d0c2937c2fe4f8e133271d05602543d86277 (diff)
downloadhercules-71627e92fbe36c23993456486a308acd0428fd3d.tar.gz
hercules-71627e92fbe36c23993456486a308acd0428fd3d.tar.bz2
hercules-71627e92fbe36c23993456486a308acd0428fd3d.tar.xz
hercules-71627e92fbe36c23993456486a308acd0428fd3d.zip
- Added chrif interface
Diffstat (limited to 'src/map/chrif.h')
-rw-r--r--src/map/chrif.h104
1 files changed, 60 insertions, 44 deletions
diff --git a/src/map/chrif.h b/src/map/chrif.h
index 9c7142905..faabedeed 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -1,13 +1,10 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams
-
#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;
@@ -19,53 +16,72 @@ struct auth_node {
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);
-void chrif_check_shutdown(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);
+/*=====================================
+* Interface : chrif.h
+* Generated by HerculesInterfaceMaker
+* created by Susu
+*-------------------------------------*/
+struct chrif_interface {
-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 chrif_divorce(int partner_id1, int partner_id2);
+ /* vars */
+
+ int chrif_connected;
+ int other_mapserver_count; //Holds count of how many other map servers are online (apart of this instance) [Skotlex]
-int chrif_removefriend(int char_id, int friend_id);
-void chrif_send_report(char* buf, int len);
+ /* funcs */
+
+ void (*setuserid) (char* id);
+ void (*setpasswd) (char* pwd);
+ void (*checkdefaultlogin) (void);
+ int (*setip) (const char* ip);
+ void (*setport) (uint16 port);
+
+ int (*isconnected) (void);
+ void (*check_shutdown) (void);
+
+ struct auth_node* (*search) (int account_id);
+ struct auth_node* (*auth_check) (int account_id, int char_id, enum sd_state state);
+ bool (*auth_delete) (int account_id, int char_id, enum sd_state state);
+ bool (*auth_finished) (struct map_session_data* sd);
+
+ void (*authreq) (struct map_session_data* sd);
+ void (*authok) (int fd);
+ int (*scdata_request) (int account_id, int char_id);
+ int (*save) (struct map_session_data* sd, int flag);
+ int (*charselectreq) (struct map_session_data* sd, uint32 s_ip);
+ int (*changemapserver) (struct map_session_data* sd, uint32 ip, uint16 port);
+
+ int (*searchcharid) (int char_id);
+ int (*changeemail) (int id, const char *actual_email, const char *new_email);
+ int (*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 (*updatefamelist) (struct map_session_data *sd);
+ int (*buildfamelist) (void);
+ int (*save_scdata) (struct map_session_data *sd);
+ int (*ragsrvinfo) (int base_rate,int job_rate, int drop_rate);
+ int (*char_offline) (struct map_session_data *sd);
+ int (*char_offline_nsd) (int account_id, int char_id);
+ int (*char_reset_offline) (void);
+ int (*send_users_tochar) (void);
+ int (*char_online) (struct map_session_data *sd);
+ int (*changesex) (struct map_session_data *sd);
+ int (*chardisconnect) (struct map_session_data *sd);
+ int (*divorce) (int partner_id1, int partner_id2);
+
+ int (*removefriend) (int char_id, int friend_id);
+ void (*send_report) (char* buf, int len);
+
+ int (*do_final_chrif) (void);
+ int (*do_init_chrif) (void);
+
+ int (*flush_fifo) (void);
+ void (*skillid2idx) (int fd);
+} chrif_s;
-int do_final_chrif(void);
-int do_init_chrif(void);
+struct chrif_interface *chrif;
-int chrif_flush_fifo(void);
-void chrif_skillid2idx(int fd);
+void chrif_defaults(void);
#endif /* _CHRIF_H_ */