Browse Source

- Modified party_send_movemap and guild_send_info_short to send the mini-dots to the player logging on.
- Added functions clif_party/guild_xy_single to send the xy dots to a single fd.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5359 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 năm trước cách đây
mục cha
commit
1d786d8491
5 tập tin đã thay đổi với 84 bổ sung24 xóa
  1. 3 0
      Changelog-Trunk.txt
  2. 47 13
      src/map/clif.c
  3. 2 0
      src/map/clif.h
  4. 17 10
      src/map/guild.c
  5. 15 1
      src/map/party.c

+ 3 - 0
Changelog-Trunk.txt

@@ -5,6 +5,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/02/21
+	* Now you should receive the party/guild mini-dots on map-load without the
+	  need of waiting for others to "move" for you to receive the update (fixes
+	  dead characters never showing up on the map) [Skotlex]
 	* Fix to prevent using main chat when it disabled in atcommand_athena. [LuzZza]
 	- Fixed message codes in duel functions.
 	- Small fix in log_refine, incorrect compare expression.

+ 47 - 13
src/map/clif.c

@@ -2972,17 +2972,33 @@ int clif_guildstorageequiplist(struct map_session_data *sd,struct guild_storage
 // Guild XY locators [Valaris]
 int clif_guild_xy(struct map_session_data *sd)
 {
-unsigned char buf[10];
+	unsigned char buf[10];
 
-nullpo_retr(0, sd);
+	nullpo_retr(0, sd);
 
-WBUFW(buf,0)=0x1eb;
-WBUFL(buf,2)=sd->status.account_id;
-WBUFW(buf,6)=sd->bl.x;
-WBUFW(buf,8)=sd->bl.y;
-clif_send(buf,packet_len_table[0x1eb],&sd->bl,GUILD_SAMEMAP_WOS);
+	WBUFW(buf,0)=0x1eb;
+	WBUFL(buf,2)=sd->status.account_id;
+	WBUFW(buf,6)=sd->bl.x;
+	WBUFW(buf,8)=sd->bl.y;
+	clif_send(buf,packet_len_table[0x1eb],&sd->bl,GUILD_SAMEMAP_WOS);
 
-return 0;
+	return 0;
+}
+
+/*==========================================
+ * Sends x/y dot to a single fd. [Skotlex]
+ *------------------------------------------
+ */
+
+int clif_guild_xy_single(int fd, struct map_session_data *sd)
+{
+	WFIFOHEAD(fd,packet_len_table[0x1eb]);
+	WFIFOW(fd,0)=0x1eb;
+	WFIFOL(fd,2)=sd->status.account_id;
+	WFIFOW(fd,6)=sd->bl.x;
+	WFIFOW(fd,8)=sd->bl.y;
+	WFIFOSET(fd,packet_len_table[0x1eb]);
+	return 0;
 }
 
 // Guild XY locators [Valaris]
@@ -6670,6 +6686,24 @@ int clif_party_xy(struct map_session_data *sd)
 	
 	return 0;
 }
+
+/*==========================================
+ * Sends x/y dot to a single fd. [Skotlex]
+ *------------------------------------------
+ */
+
+int clif_party_xy_single(int fd, struct map_session_data *sd)
+{
+	WFIFOHEAD(fd,packet_len_table[0x107]);
+	WFIFOW(fd,0)=0x107;
+	WFIFOL(fd,2)=sd->status.account_id;
+	WFIFOW(fd,6)=sd->bl.x;
+	WFIFOW(fd,8)=sd->bl.y;
+	WFIFOSET(fd,packet_len_table[0x107]);
+	return 0;
+}
+
+
 /*==========================================
  * パーティHP通知
  *------------------------------------------
@@ -8702,11 +8736,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	}
 	// param all
 	clif_initialstatus(sd);
-	// party
-	party_send_movemap(sd);
-	// guild
-	guild_send_memberinfoshort(sd,1);
-
 	if(battle_config.pc_invincible_time > 0) {
 		if(map_flag_gvg(sd->bl.m))
 			pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1);
@@ -8717,6 +8746,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	map_addblock(&sd->bl);	// ブロック登録
 	clif_spawnpc(sd);	// spawn
 
+	// party
+	party_send_movemap(sd);
+	// guild
+	guild_send_memberinfoshort(sd,1);
+
 	// weight max , now
 	clif_updatestatus(sd,SP_MAXWEIGHT);
 	clif_updatestatus(sd,SP_WEIGHT);

+ 2 - 0
src/map/clif.h

@@ -254,6 +254,7 @@ int clif_party_leaved(struct party *p,struct map_session_data *sd,int account_id
 int clif_party_message(struct party *p,int account_id,char *mes,int len);
 int clif_party_move(struct party *p,struct map_session_data *sd,int online);
 int clif_party_xy(struct map_session_data *sd);
+int clif_party_xy_single(int fd, struct map_session_data *sd);
 int clif_party_hp(struct map_session_data *sd);
 int clif_hpmeter(struct map_session_data *sd);
 
@@ -282,6 +283,7 @@ int clif_guild_delalliance(struct map_session_data *sd,int guild_id,int flag);
 int clif_guild_oppositionack(struct map_session_data *sd,int flag);
 int clif_guild_broken(struct map_session_data *sd,int flag);
 int clif_guild_xy(struct map_session_data *sd);
+int clif_guild_xy_single(int fd, struct map_session_data *sd);
 int clif_guild_xy_remove(struct map_session_data *sd);
 
 

+ 17 - 10
src/map/guild.c

@@ -880,7 +880,8 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag,
 int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 {
 	struct guild *g;
-
+	int  i;
+	
 	nullpo_retr(0, sd);
 
 	if(sd->status.guild_id<=0)
@@ -893,10 +894,18 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 		sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class_);
 
 	if( !online ){	// ログアウトするならsdをクリアして終了
-		int i=guild_getindex(g,sd->status.account_id,sd->status.char_id);
+		i=guild_getindex(g,sd->status.account_id,sd->status.char_id);
 		if(i>=0)
 			g->member[i].sd=NULL;
 		return 0;
+	} else if (sd->fd) {
+		//Send XY dot updates. [Skotlex]
+		for(i=0; i < MAX_GUILD; i++) {
+			if (!g->member[i].sd || g->member[i].sd == sd ||
+				g->member[i].sd->bl.m != sd->bl.m)
+				continue;
+			clif_guild_xy_single(sd->fd, g->member[i].sd);
+		}
 	}
 
 	if( sd->state.guild_sent!=0 )	// ギルド初期送信データは送信済み
@@ -906,14 +915,12 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
 	guild_check_conflict(sd);
 
 	// あるならギルド初期送信データ送信
-	if( (g=guild_search(sd->status.guild_id))!=NULL ){
-		guild_check_member(g);	// 所属を確認する
-		if(sd->status.guild_id==g->guild_id){
-			clif_guild_belonginfo(sd,g);
-			clif_guild_notice(sd,g);
-			sd->state.guild_sent=1;
-			sd->guild_emblem_id=g->emblem_id;
-		}
+	guild_check_member(g);	// 所属を確認する
+	if(sd->status.guild_id==g->guild_id){
+		clif_guild_belonginfo(sd,g);
+		clif_guild_notice(sd,g);
+		sd->state.guild_sent=1;
+		sd->guild_emblem_id=g->emblem_id;
 	}
 	return 0;
 }

+ 15 - 1
src/map/party.c

@@ -470,6 +470,7 @@ int party_recv_movemap(int party_id,int account_id,int char_id, unsigned short m
 // パーティメンバの移動
 int party_send_movemap(struct map_session_data *sd)
 {
+	int i;
 	struct party *p;
 
 	nullpo_retr(0, sd);
@@ -478,6 +479,19 @@ int party_send_movemap(struct map_session_data *sd)
 		return 0;
 	intif_party_changemap(sd,1);
 
+	
+	p=party_search(sd->status.party_id);
+	if (p && sd->fd) {
+		//Send dots of other party members to this char. [Skotlex]
+		for(i=0; i < MAX_PARTY; i++) {
+			if (!p->member[i].sd	|| p->member[i].sd == sd ||
+				p->member[i].sd->bl.m != sd->bl.m)
+				continue;
+			clif_party_xy_single(sd->fd, p->member[i].sd);
+		}
+		
+	}
+	
 	if( sd->state.party_sent )	// もうパーティデータは送信済み
 		return 0;
 
@@ -485,7 +499,7 @@ int party_send_movemap(struct map_session_data *sd)
 	party_check_conflict(sd);
 	
 	// あるならパーティ情報送信
-	if( (p=party_search(sd->status.party_id))!=NULL ){
+	if(p){
 		party_check_member(p);	// 所属を確認する
 		if(sd->status.party_id==p->party_id){
 			clif_party_main_info(p,sd->fd);