summaryrefslogtreecommitdiff
path: root/src/char/mapif.h
blob: 4a61db3fd1f9e46bdff0197a513deb92a8536232 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
// Portions Copyright (c) Athena Dev Teams

#ifndef CHAR_MAPIF_H
#define CHAR_MAPIF_H

#include "char.h"

struct s_elemental;
struct s_homunculus;

/* mapif interface */
struct mapif_interface {
    void (*ban) (int id, unsigned int flag, int status);
    void (*server_init) (int id);
    void (*server_destroy) (int id);
    void (*server_reset) (int id);
    void (*on_disconnect) (int id);
    void (*on_parse_accinfo) (int account_id, int u_fd, int u_aid, int u_group, int map_fd);
    void (*char_ban) (int char_id, time_t timestamp);
    int (*sendall) (unsigned char *buf, unsigned int len);
    int (*sendallwos) (int sfd, unsigned char *buf, unsigned int len);
    int (*send) (int fd, unsigned char *buf, unsigned int len);
    void (*send_users_count) (int users);
    void (*auction_message) (int char_id, unsigned char result);
    void (*auction_sendlist) (int fd, int char_id, short count, short pages, unsigned char *buf);
    void (*parse_auction_requestlist) (int fd);
    void (*auction_register) (int fd, struct auction_data *auction);
    void (*parse_auction_register) (int fd);
    void (*auction_cancel) (int fd, int char_id, unsigned char result);
    void (*parse_auction_cancel) (int fd);
    void (*auction_close) (int fd, int char_id, unsigned char result);
    void (*parse_auction_close) (int fd);
    void (*auction_bid) (int fd, int char_id, int bid, unsigned char result);
    void (*parse_auction_bid) (int fd);
    bool (*elemental_save) (struct s_elemental* ele);
    bool (*elemental_load) (int ele_id, int char_id, struct s_elemental *ele);
    bool (*elemental_delete) (int ele_id);
    void (*elemental_send) (int fd, struct s_elemental *ele, unsigned char flag);
    void (*parse_elemental_create) (int fd, struct s_elemental* ele);
    void (*parse_elemental_load) (int fd, int ele_id, int char_id);
    void (*elemental_deleted) (int fd, unsigned char flag);
    void (*parse_elemental_delete) (int fd, int ele_id);
    void (*elemental_saved) (int fd, unsigned char flag);
    void (*parse_elemental_save) (int fd, struct s_elemental* ele);
    int (*guild_created) (int fd, int account_id, struct guild *g);
    int (*guild_noinfo) (int fd, int guild_id);
    int (*guild_info) (int fd, struct guild *g);
    int (*guild_memberadded) (int fd, int guild_id, int account_id, int char_id, int flag);
    int (*guild_withdraw) (int guild_id, int account_id, int char_id, int flag, const char *name, const char *mes);
    int (*guild_memberinfoshort) (struct guild *g, int idx);
    int (*guild_broken) (int guild_id, int flag);
    int (*guild_message) (int guild_id,int account_id,char *mes,int len, int sfd);
    int (*guild_basicinfochanged) (int guild_id, int type, const void *data, int len);
    int (*guild_memberinfochanged) (int guild_id, int account_id, int char_id, int type, const void *data, int len);
    int (*guild_skillupack) (int guild_id, uint16 skill_id, int account_id);
    int (*guild_alliance) (int guild_id1, int guild_id2, int account_id1, int account_id2, int flag, const char *name1, const char *name2);
    int (*guild_position) (struct guild *g, int idx);
    int (*guild_notice) (struct guild *g);
    int (*guild_emblem) (struct guild *g);
    int (*guild_master_changed) (struct guild *g, int aid, int cid);
    int (*guild_castle_dataload) (int fd, int sz, int *castle_ids);
    int (*parse_CreateGuild) (int fd,int account_id,char *name,struct guild_member *master);
    int (*parse_GuildInfo) (int fd, int guild_id);
    int (*parse_GuildAddMember) (int fd, int guild_id, struct guild_member *m);
    int (*parse_GuildLeave) (int fd, int guild_id, int account_id, int char_id, int flag, const char *mes);
    int (*parse_GuildChangeMemberInfoShort) (int fd, int guild_id, int account_id, int char_id, int online, int lv, int class_);
    int (*parse_BreakGuild) (int fd, int guild_id);
    int (*parse_GuildMessage) (int fd, int guild_id, int account_id, char *mes, int len);
    int (*parse_GuildBasicInfoChange) (int fd, int guild_id, int type, const void *data, int len);
    int (*parse_GuildMemberInfoChange) (int fd, int guild_id, int account_id, int char_id, int type, const char *data, int len);
    int (*parse_GuildPosition) (int fd, int guild_id, int idx, struct guild_position *p);
    int (*parse_GuildSkillUp) (int fd, int guild_id, uint16 skill_id, int account_id, int max);
    int (*parse_GuildDeleteAlliance) (struct guild *g, int guild_id, int account_id1, int account_id2, int flag);
    int (*parse_GuildAlliance) (int fd, int guild_id1, int guild_id2, int account_id1, int account_id2, int flag);
    int (*parse_GuildNotice) (int fd, int guild_id, const char *mes1, const char *mes2);
    int (*parse_GuildEmblem) (int fd, int len, int guild_id, int dummy, const char *data);
    int (*parse_GuildCastleDataLoad) (int fd, int len, int *castle_ids);
    int (*parse_GuildCastleDataSave) (int fd, int castle_id, int index, int value);
    int (*parse_GuildMasterChange) (int fd, int guild_id, const char* name, int len);
    void (*homunculus_created) (int fd, int account_id, struct s_homunculus *sh, unsigned char flag);
    void (*homunculus_deleted) (int fd, int flag);
    void (*homunculus_loaded) (int fd, int account_id, struct s_homunculus *hd);
    void (*homunculus_saved) (int fd, int account_id, bool flag);
    void (*homunculus_renamed) (int fd, int account_id, int char_id, unsigned char flag, char* name);
    bool (*homunculus_save) (struct s_homunculus* hd);
    bool (*homunculus_load) (int homun_id, struct s_homunculus* hd);
    bool (*homunculus_delete) (int homun_id);
    bool (*homunculus_rename) (char *name);
    void (*parse_homunculus_create) (int fd, int len, int account_id, struct s_homunculus* phd);
    void (*parse_homunculus_delete) (int fd, int homun_id);
    void (*parse_homunculus_load) (int fd, int account_id, int homun_id);
    void (*parse_homunculus_save) (int fd, int len, int account_id, struct s_homunculus* phd);
    void (*parse_homunculus_rename) (int fd, int account_id, int char_id, char* name);
} mapif_s;

struct mapif_interface *mapif;

void mapif_defaults(void);

#endif /* CHAR_MAPIF_H */