* Confirmed packet 0x291 (ZC_MSG) to be general-purpose msgstringtable.txt packet and updated all functions using it (related r12245 and r13126).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14538 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ai4rei 2010-12-01 23:59:10 +00:00
parent 5c84df6a15
commit ca36918486
4 changed files with 17 additions and 14 deletions

View File

@ -1,6 +1,7 @@
Date Added Date Added
2010/12/01 2010/12/01
* Confirmed packet 0x291 (ZC_MSG) to be general-purpose msgstringtable.txt packet and updated all functions using it (related r12245 and r13126). [Ai4rei]
* Fixed using main chat nick longer than 15 characters would cause a buffer overflow (bugreport:2671, since r5013). [Ai4rei] * Fixed using main chat nick longer than 15 characters would cause a buffer overflow (bugreport:2671, since r5013). [Ai4rei]
* Fixed bAutoSpellOnSkill bonuses could not be chained (bugreport:4421, since r13596). [Ai4rei] * Fixed bAutoSpellOnSkill bonuses could not be chained (bugreport:4421, since r13596). [Ai4rei]
* Fixed NPC_TALK message being displayed with EOL character attached (bugreport:4596, since r14270). [Ai4rei] * Fixed NPC_TALK message being displayed with EOL character attached (bugreport:4596, since r14270). [Ai4rei]

View File

@ -8175,12 +8175,9 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
WFIFOSET(fd, WFIFOW(fd, 2)); WFIFOSET(fd, WFIFOW(fd, 2));
} }
/*========================================== /// Display msgstringtable.txt string (ZC_MSG)
* View player equip request denied /// R 0291 <message>.W
* R 0291 <message>.W void clif_msg(struct map_session_data* sd, unsigned short id)
* TODO: this looks like a general-purpose packet to print msgstringtable entries.
*------------------------------------------*/
void clif_viewequip_fail(struct map_session_data* sd)
{ {
int fd; int fd;
nullpo_retv(sd); nullpo_retv(sd);
@ -8188,10 +8185,16 @@ void clif_viewequip_fail(struct map_session_data* sd)
WFIFOHEAD(fd, packet_len(0x291)); WFIFOHEAD(fd, packet_len(0x291));
WFIFOW(fd, 0) = 0x291; WFIFOW(fd, 0) = 0x291;
WFIFOW(fd, 2) = 0x54d; // This controls which message is displayed. 0x54d is the correct one. Maybe it's used for something else too? WFIFOW(fd, 2) = id; // zero-based msgstringtable.txt index
WFIFOSET(fd, packet_len(0x291)); WFIFOSET(fd, packet_len(0x291));
} }
/// View player equip request denied
void clif_viewequip_fail(struct map_session_data* sd)
{
clif_msg(sd, 0x54d);
}
/// Validates one global/guild/party/whisper message packet and tries to recognize its components. /// Validates one global/guild/party/whisper message packet and tries to recognize its components.
/// Returns true if the packet was parsed successfully. /// Returns true if the packet was parsed successfully.
/// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00 /// Formats: 0 - <packet id>.w <packet len>.w (<name> : <message>).?B 00
@ -13593,12 +13596,9 @@ void clif_parse_mercenary_action(int fd, struct map_session_data* sd)
* 2 = Your mercenary soldier has been fired. * 2 = Your mercenary soldier has been fired.
* 3 = Your mercenary soldier has ran away. * 3 = Your mercenary soldier has ran away.
*------------------------------------------*/ *------------------------------------------*/
void clif_mercenary_message(int fd, int message) void clif_mercenary_message(struct map_session_data* sd, int message)
{ {
WFIFOHEAD(fd,4); clif_msg(sd, 1266 + message);
WFIFOW(fd,0) = 0x0291;
WFIFOW(fd,2) = 1266 + message;
WFIFOSET(fd,4);
} }
/*------------------------------------------ /*------------------------------------------

View File

@ -504,6 +504,8 @@ void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* ts
void clif_viewequip_fail(struct map_session_data* sd); void clif_viewequip_fail(struct map_session_data* sd);
void clif_equipcheckbox(struct map_session_data* sd); void clif_equipcheckbox(struct map_session_data* sd);
void clif_msg(struct map_session_data* sd, unsigned short id);
//quest system [Kevin] [Inkfish] //quest system [Kevin] [Inkfish]
void clif_quest_send_list(struct map_session_data * sd); void clif_quest_send_list(struct map_session_data * sd);
void clif_quest_send_mission(struct map_session_data * sd); void clif_quest_send_mission(struct map_session_data * sd);
@ -545,7 +547,7 @@ void clif_Adopt_reply(struct map_session_data *sd, int type);
// MERCENARIES // MERCENARIES
void clif_mercenary_info(struct map_session_data *sd); void clif_mercenary_info(struct map_session_data *sd);
void clif_mercenary_skillblock(struct map_session_data *sd); void clif_mercenary_skillblock(struct map_session_data *sd);
void clif_mercenary_message(int fd, int message); void clif_mercenary_message(struct map_session_data* sd, int message);
void clif_mercenary_updatestatus(struct map_session_data *sd, int type); void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
// RENTAL SYSTEM // RENTAL SYSTEM

View File

@ -258,7 +258,7 @@ int merc_delete(struct mercenary_data *md, int reply)
case 1: mercenary_set_faith(md, -1); break; // -1 Loyalty on Mercenary killed case 1: mercenary_set_faith(md, -1); break; // -1 Loyalty on Mercenary killed
} }
clif_mercenary_message(sd->fd, reply); clif_mercenary_message(sd, reply);
return unit_remove_map(&md->bl, CLR_OUTSIGHT); return unit_remove_map(&md->bl, CLR_OUTSIGHT);
} }