summaryrefslogtreecommitdiff
path: root/src/echar
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-02 19:06:39 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-02 19:06:39 +0300
commit1fc6228436311da0d70f14176fe47f3e37f6faa6 (patch)
tree9434c90ab44ac55200daa199f524fa11f3168678 /src/echar
parent00d1b8bf9fc3648730904b6f86696417f4445037 (diff)
downloadevol-hercules-1fc6228436311da0d70f14176fe47f3e37f6faa6.tar.gz
evol-hercules-1fc6228436311da0d70f14176fe47f3e37f6faa6.tar.bz2
evol-hercules-1fc6228436311da0d70f14176fe47f3e37f6faa6.tar.xz
evol-hercules-1fc6228436311da0d70f14176fe47f3e37f6faa6.zip
Update function hook prototypes for support new hercules.
Diffstat (limited to 'src/echar')
-rw-r--r--src/echar/char.c23
-rw-r--r--src/echar/char.h13
-rw-r--r--src/echar/init.c14
3 files changed, 27 insertions, 23 deletions
diff --git a/src/echar/char.c b/src/echar/char.c
index b46ca62..1a75086 100644
--- a/src/echar/char.c
+++ b/src/echar/char.c
@@ -23,10 +23,11 @@
#include "echar/char.h"
#include "echar/config.h"
-void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd)
+void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data **sdPtr)
{
// ignore char creation disable option
const int fd = *fdPtr;
+ struct char_session_data *sd = *sdPtr;
uint16 race = 0;
uint16 look = 0;
uint8 sex = 0;
@@ -106,15 +107,17 @@ void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd)
static int tmpVersion = 0;
void echar_parse_char_connect_pre(int *fdPtr,
- struct char_session_data *sd __attribute__ ((unused)),
- uint32 *ipl __attribute__ ((unused)))
+ struct char_session_data **sd,
+ uint32 *ipl)
{
tmpVersion = RFIFOW(*fdPtr, 14);
}
-void echar_parse_char_connect_post(int *fdPtr, struct char_session_data *sd, uint32 *ipl __attribute__ ((unused)))
+void echar_parse_char_connect_post(int fd,
+ struct char_session_data *sd,
+ uint32 ipl __attribute__ ((unused)))
{
- sd = (struct char_session_data*)sockt->session[*fdPtr]->session_data;
+ sd = (struct char_session_data*)sockt->session[fd]->session_data;
if (sd)
sd->version = tmpVersion;
}
@@ -180,14 +183,16 @@ void echar_parse_login_password_change_ack(int charFd)
}
}
-void echar_mmo_char_send099d(int *fdPtr, struct char_session_data *sd)
+void echar_mmo_char_send099d_post(int fd, struct char_session_data *sd)
{
- send_additional_slots(*fdPtr, sd);
+ send_additional_slots(fd, sd);
}
-int echar_mmo_char_send_characters_post(int retVal, int *fdPtr, struct char_session_data* sd)
+int echar_mmo_char_send_characters_post(int retVal,
+ int fd,
+ struct char_session_data* sd)
{
- send_additional_slots(*fdPtr, sd);
+ send_additional_slots(fd, sd);
return retVal;
}
diff --git a/src/echar/char.h b/src/echar/char.h
index a4a29c8..726f2c2 100644
--- a/src/echar/char.h
+++ b/src/echar/char.h
@@ -4,7 +4,8 @@
#ifndef EVOL_CHAR_CHAR
#define EVOL_CHAR_CHAR
-void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data* sd);
+void echar_parse_char_create_new_char(int *fdPtr,
+ struct char_session_data **sdPtr);
void echar_creation_failed(int *fdPtr, int *result);
@@ -12,19 +13,17 @@ void echar_parse_change_paassword(int fd);
void echar_parse_login_password_change_ack(int charFd);
-void echar_mmo_char_send099d_post(int *fdPtr, struct char_session_data *sd);
+void echar_mmo_char_send099d_post(int fd, struct char_session_data *sd);
-int echar_mmo_char_send_characters_post(int retVal, int *fdPtr, struct char_session_data *sd);
+int echar_mmo_char_send_characters_post(int retVal, int fd, struct char_session_data *sd);
int echar_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf);
-void echar_mmo_char_send099d(int *fdPtr, struct char_session_data *sd);
-
void send_additional_slots(int fd, struct char_session_data* sd);
-void echar_parse_char_connect_pre(int *fdPtr, struct char_session_data *sd, uint32 *ipl);
+void echar_parse_char_connect_pre(int *fdPtr, struct char_session_data **sd, uint32 *ipl);
-void echar_parse_char_connect_post(int *fdPtr, struct char_session_data *sd, uint32 *ipl);
+void echar_parse_char_connect_post(int fd, struct char_session_data *sd, uint32 ipl);
void echar_parse_frommap_request_stats_report_pre(int *fdPtr);
diff --git a/src/echar/init.c b/src/echar/init.c
index e6f3eaa..e40395c 100644
--- a/src/echar/init.c
+++ b/src/echar/init.c
@@ -52,14 +52,14 @@ HPExport void plugin_init (void)
addPacket(0x0061, 50, echar_parse_change_paassword, hpParse_Char);
addPacket(0x5001, 7, echar_parse_login_password_change_ack, hpParse_FromLogin);
- addHookPre("chr->parse_char_create_new_char", echar_parse_char_create_new_char);
- addHookPre("chr->creation_failed", echar_creation_failed);
- addHookPre("chr->parse_char_connect", echar_parse_char_connect_pre);
- addHookPre("chr->parse_frommap_request_stats_report", echar_parse_frommap_request_stats_report_pre);
+ addHookPre(chr, parse_char_create_new_char, echar_parse_char_create_new_char);
+ addHookPre(chr, creation_failed, echar_creation_failed);
+ addHookPre(chr, parse_char_connect, echar_parse_char_connect_pre);
+ addHookPre(chr, parse_frommap_request_stats_report, echar_parse_frommap_request_stats_report_pre);
- addHookPost("chr->mmo_char_send099d", echar_mmo_char_send099d);
- addHookPost("chr->mmo_char_send_characters", echar_mmo_char_send_characters_post);
- addHookPost("chr->parse_char_connect", echar_parse_char_connect_post);
+ addHookPost(chr, mmo_char_send099d, echar_mmo_char_send099d_post);
+ addHookPost(chr, mmo_char_send_characters, echar_mmo_char_send_characters_post);
+ addHookPost(chr, parse_char_connect, echar_parse_char_connect_post);
}
HPExport void server_preinit (void)