diff options
author | Ibrahem Hossam <hemagx2@gmail.com> | 2016-04-24 13:13:19 +0200 |
---|---|---|
committer | Ibrahem Hossam <hemagx2@gmail.com> | 2016-04-24 13:13:19 +0200 |
commit | 31e27a130676e3e416b583bb947f9dd87efdce81 (patch) | |
tree | f91422fa8b0ecd93ccb15720bc15a9b9b839cfd2 /src/map/intif.c | |
parent | 3ccc681a4bebd5b91b96c1c7059fdec91f2b5d16 (diff) | |
parent | 9fdb4567ab8af97004d7c6dcd35f27f788b0bb15 (diff) | |
download | hercules-31e27a130676e3e416b583bb947f9dd87efdce81.tar.gz hercules-31e27a130676e3e416b583bb947f9dd87efdce81.tar.bz2 hercules-31e27a130676e3e416b583bb947f9dd87efdce81.tar.xz hercules-31e27a130676e3e416b583bb947f9dd87efdce81.zip |
Merge pull request #1264 from HerculesWS/vs2015
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index ec0251dad..05b1d7c29 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -150,7 +150,7 @@ int intif_rename(struct map_session_data *sd, int type, const char *name) } // GM Send a message -int intif_broadcast(const char* mes, size_t len, int type) +int intif_broadcast(const char *mes, int len, int type) { int lp = (type&BC_COLOR_MASK) ? 4 : 0; @@ -182,7 +182,7 @@ int intif_broadcast(const char* mes, size_t len, int type) return 0; } -int intif_broadcast2(const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) +int intif_broadcast2(const char *mes, int len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY) { nullpo_ret(mes); Assert_ret(len < 32000); @@ -222,7 +222,7 @@ int intif_main_message(struct map_session_data* sd, const char* message) snprintf( output, sizeof(output), msg_txt(386), sd->status.name, message ); // send the message using the inter-server broadcast service - intif->broadcast2( output, strlen(output) + 1, 0xFE000000, 0, 0, 0, 0 ); + intif->broadcast2(output, (int)strlen(output) + 1, 0xFE000000, 0, 0, 0, 0); // log the chat message logs->chat( LOG_CHAT_MAINCHAT, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message ); @@ -231,7 +231,7 @@ int intif_main_message(struct map_session_data* sd, const char* message) } // The transmission of Wisp/Page to inter-server (player not found on this server) -int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, size_t mes_len) +int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes, int mes_len) { if (intif->CheckForCharServer()) return 0; @@ -279,12 +279,14 @@ int intif_wis_replay(int id, int flag) // The transmission of GM only Wisp/Page from server to inter-server int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes) { - size_t mes_len; + int mes_len; if (intif->CheckForCharServer()) return 0; nullpo_ret(wisp_name); nullpo_ret(mes); - mes_len = strlen(mes) + 1; // + null + mes_len = (int)strlen(mes) + 1; // + null + Assert_ret(mes_len > 0 && mes_len <= INT16_MAX - 32); + WFIFOHEAD(inter_fd, mes_len + 32); WFIFOW(inter_fd,0) = 0x3003; WFIFOW(inter_fd,2) = mes_len + 32; @@ -658,7 +660,7 @@ int intif_guild_addmember(int guild_id,struct guild_member *m) } // Request a new leader for guild -int intif_guild_change_gm(int guild_id, const char* name, size_t len) +int intif_guild_change_gm(int guild_id, const char *name, int len) { if (intif->CheckForCharServer()) return 0; @@ -1654,7 +1656,7 @@ void intif_parse_MailInboxReceived(int fd) { else if( battle_config.mail_show_status && ( battle_config.mail_show_status == 1 || sd->mail.inbox.unread ) ) { char output[128]; sprintf(output, msg_sd(sd,510), sd->mail.inbox.unchecked, sd->mail.inbox.unread + sd->mail.inbox.unchecked); - clif_disp_onlyself(sd, output, strlen(output)); + clif_disp_onlyself(sd, output); } } /*------------------------------------------ |