diff options
Diffstat (limited to 'src/char/inter.c')
-rw-r--r-- | src/char/inter.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/char/inter.c b/src/char/inter.c index 4ef94efdf..d277abec9 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -42,6 +42,7 @@ #include "common/nullpo.h" #include "common/showmsg.h" #include "common/socket.h" +#include "common/sql.h" #include "common/strlib.h" #include "common/timer.h" @@ -82,7 +83,7 @@ struct WisData { int64 tick; unsigned char src[24], dst[24], msg[512]; }; -static DBMap* wis_db = NULL; // int wis_id -> struct WisData* +static struct DBMap *wis_db = NULL; // int wis_id -> struct WisData* static int wis_dellist[WISDELLIST_MAX], wis_delnum; #define MAX_JOB_NAMES 150 @@ -967,8 +968,8 @@ int mapif_wis_message(struct WisData *wd) //if (wd->len > 2047-56) wd->len = 2047-56; //Force it to fit to avoid crashes. [Skotlex] if (wd->len < 0) wd->len = 0; - if (wd->len >= sizeof(wd->msg) - 1) - wd->len = sizeof(wd->msg) - 1; + if (wd->len >= (int)sizeof(wd->msg) - 1) + wd->len = (int)sizeof(wd->msg) - 1; WBUFW(buf, 0) = 0x3801; WBUFW(buf, 2) = 56 +wd->len; @@ -1037,7 +1038,7 @@ int mapif_disconnectplayer(int fd, int account_id, int char_id, int reason) * Existence check of WISP data * @see DBApply */ -int inter_check_ttl_wisdata_sub(DBKey key, DBData *data, va_list ap) +int inter_check_ttl_wisdata_sub(union DBKey key, struct DBData *data, va_list ap) { int64 tick; struct WisData *wd = DB->data2ptr(data); @@ -1084,7 +1085,6 @@ int mapif_parse_broadcast(int fd) int mapif_parse_WisRequest(int fd) { struct WisData* wd; - static int wisid = 0; char name[NAME_LENGTH]; char esc_name[NAME_LENGTH*2+1];// escaped name char* data; @@ -1124,6 +1124,7 @@ int mapif_parse_WisRequest(int fd) } else { + static int wisid = 0; CREATE(wd, struct WisData, 1); // Whether the failure of previous wisp/page transmission (timeout) @@ -1171,7 +1172,7 @@ int mapif_parse_WisToGM(int fd) { unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B - memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); + memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); // Message contains the NUL terminator (see intif_wis_message_to_gm()) WBUFW(buf, 0) = 0x3803; mapif->sendall(buf, RFIFOW(fd,2)); |