|
@@ -5472,9 +5472,9 @@ void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, e
|
|
|
|
|
|
/*==========================================
|
|
|
* Displays a message on a 'bl' to all it's nearby clients
|
|
|
- * Used by npc_globalmessage
|
|
|
+ * 008d <PacketLength>.W <GID> L (ZC_NOTIFY_CHAT)
|
|
|
*------------------------------------------*/
|
|
|
-void clif_GlobalMessage(struct block_list* bl, const char* message) {
|
|
|
+void clif_GlobalMessage(struct block_list* bl, const char* message, enum send_target target) {
|
|
|
char buf[100];
|
|
|
int len;
|
|
|
nullpo_retv(bl);
|
|
@@ -5493,7 +5493,7 @@ void clif_GlobalMessage(struct block_list* bl, const char* message) {
|
|
|
WBUFW(buf,2)=len+8;
|
|
|
WBUFL(buf,4)=bl->id;
|
|
|
safestrncpy((char *) WBUFP(buf,8),message,len);
|
|
|
- clif_send((unsigned char *) buf,WBUFW(buf,2),bl,ALL_CLIENT);
|
|
|
+ clif_send((unsigned char *) buf,WBUFW(buf,2),bl,target);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -8211,14 +8211,14 @@ void clif_specialeffect_value(struct block_list* bl, int effect_id, int num, sen
|
|
|
}
|
|
|
// Modification of clif_messagecolor to send colored messages to players to chat log only (doesn't display overhead)
|
|
|
/// 02c1 <packet len>.W <id>.L <color>.L <message>.?B
|
|
|
-int clif_colormes(struct map_session_data * sd, enum clif_colors color, const char* msg) {
|
|
|
+int clif_colormes(struct map_session_data * sd, unsigned long color, const char* msg) {
|
|
|
unsigned short msg_len = strlen(msg) + 1;
|
|
|
|
|
|
WFIFOHEAD(sd->fd,msg_len + 12);
|
|
|
WFIFOW(sd->fd,0) = 0x2C1;
|
|
|
WFIFOW(sd->fd,2) = msg_len + 12;
|
|
|
WFIFOL(sd->fd,4) = 0;
|
|
|
- WFIFOL(sd->fd,8) = Channel_Config.colors[color];
|
|
|
+ WFIFOL(sd->fd,8) = color; //either color_table or channel_table
|
|
|
safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len);
|
|
|
WFIFOSET(sd->fd, msg_len + 12);
|
|
|
|
|
@@ -9681,13 +9681,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd)
|
|
|
textlen = strlen(fakename) + 1;
|
|
|
}
|
|
|
// send message to others (using the send buffer for temp. storage)
|
|
|
- WFIFOHEAD(fd, 8 + textlen);
|
|
|
- WFIFOW(fd,0) = 0x8d;
|
|
|
- WFIFOW(fd,2) = 8 + textlen;
|
|
|
- WFIFOL(fd,4) = sd->bl.id;
|
|
|
- safestrncpy((char*)WFIFOP(fd,8), is_fake ? fakename : text, textlen);
|
|
|
- //FIXME: chat has range of 9 only
|
|
|
- clif_send(WFIFOP(fd,0), WFIFOW(fd,2), &sd->bl, sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
|
|
|
+ clif_GlobalMessage(&sd->bl,is_fake ? fakename : text,sd->chatID ? CHAT_WOS : AREA_CHAT_WOC);
|
|
|
|
|
|
// send back message to the speaker
|
|
|
if( is_fake ) {
|
|
@@ -16382,6 +16376,31 @@ void clif_cashshop_result( struct map_session_data *sd, uint16 item_id, uint16 r
|
|
|
WFIFOSET( sd->fd, 16 );
|
|
|
}
|
|
|
|
|
|
+/// Ack world info (ZC_ACK_BEFORE_WORLD_INFO)
|
|
|
+/// 0979 <world name>.24B <char name>.24B
|
|
|
+void clif_ackworldinfo(struct map_session_data* sd) {
|
|
|
+ int fd;
|
|
|
+
|
|
|
+ nullpo_retv(sd);
|
|
|
+ fd = sd->fd;
|
|
|
+
|
|
|
+ WFIFOHEAD(fd,packet_len(0x979));
|
|
|
+ WFIFOW(fd,0)=0x979;
|
|
|
+ //AID -> world name ?
|
|
|
+ safestrncpy((char*)WFIFOP(fd,2), '\0' /* World name */, 24);
|
|
|
+ safestrncpy((char*)WFIFOP(fd,26), sd->status.name, NAME_LENGTH);
|
|
|
+ WFIFOSET(fd,packet_len(0x979));
|
|
|
+}
|
|
|
+
|
|
|
+/// req world info (CZ_REQ_BEFORE_WORLD_INFO)
|
|
|
+/// 0978 <AID>.L
|
|
|
+void clif_parse_reqworldinfo(int fd,struct map_session_data *sd){
|
|
|
+ //uint32 aid = RFIFOL(fd,2); //should we trust client ?
|
|
|
+ if(sd) clif_ackworldinfo(sd);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/*==========================================
|
|
|
* Main client packet processing function
|
|
|
*------------------------------------------*/
|
|
@@ -16782,7 +16801,7 @@ static int packetdb_readdb(void)
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
- 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
+ 0, 0, 0, 0, 0, 0, 0, 14, 6, 50, 0, 0, 0, 0, 0, 0,
|
|
|
//#0x0980
|
|
|
0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
31, 0, 0, 0, 0, 0, 0, -1, 8, 11, 9, 8, 0, 0, 0, 0,
|
|
@@ -16997,6 +17016,7 @@ static int packetdb_readdb(void)
|
|
|
/* */
|
|
|
{ clif_parse_MoveItem , "moveitem" },
|
|
|
{ clif_parse_GuildInvite2 , "guildinvite2" },
|
|
|
+ { clif_parse_reqworldinfo, "reqworldinfo"},
|
|
|
{NULL,NULL}
|
|
|
};
|
|
|
|