Forráskód Böngészése

- Applied an experimental weather code that should lower bandwidth usage to near-none, which's only disadvantage should be the weather not clearing out until moving to another map (even when the mapflag is removed from the current map).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6639 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 éve
szülő
commit
0aed0eaa95
3 módosított fájl, 25 hozzáadás és 40 törlés
  1. 5 0
      Changelog-Trunk.txt
  2. 20 39
      src/map/clif.c
  3. 0 1
      src/map/clif.h

+ 5 - 0
Changelog-Trunk.txt

@@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/05/18
+	* Applied an experimental weather code that should lower bandwidth usage to
+	  near-none, which's only disadvantage should be the weather not clearing out
+	  until moving to another map (even when the mapflag is removed from the
+	  current map). Please test and report if there's any anomalies with it.
+	  [Skotlex]
 	* NPC_AGIUP will now give movement boost of 50% [Skotlex]
 	* Fixed WZ_WATERBALL number of hits when used by non-players. [Skotlex]
 	* MO_BODYRELOCATION will send the slide packet with the actual src's

+ 20 - 39
src/map/clif.c

@@ -1220,6 +1220,15 @@ static int clif_set0192(int fd, int m, int x, int y, int type) {
 	return 0;
 }
 
+// new and improved weather display [Valaris]
+static void clif_weather_sub(int fd, int id, int type) {
+	WFIFOHEAD(fd, packet_len_table[0x1f3]);
+	WFIFOW(fd,0) = 0x1f3;
+	WFIFOL(fd,2) = id;
+	WFIFOL(fd,6) = type;
+	WFIFOSET(fd,packet_len_table[0x1f3]);
+}
+
 /*==========================================
  *
  *------------------------------------------
@@ -1236,50 +1245,28 @@ static void clif_weather_check(struct map_session_data *sd) {
 		|| map[m].flag.rain
 		|| map[m].flag.clouds2)
 	{
-		WFIFOHEAD(fd, packet_len_table[0x7c]);
-		WFIFOW(fd,0)=0x7c;
-		WFIFOL(fd,2)=-10;
-		WFIFOW(fd,6)=0;
-		WFIFOW(fd,8)=0;
-		WFIFOW(fd,10)=0;
-		WFIFOW(fd,12)=OPTION_INVISIBLE;
-		WFIFOW(fd,20)=100;
-		WFIFOPOS(fd,36,sd->bl.x,sd->bl.y);
-		WFIFOSET(fd,packet_len_table[0x7c]);
-
 		if (map[m].flag.snow)
-			clif_weather_sub(fd, 162);
+			clif_weather_sub(fd, sd->bl.id, 162);
 		if (map[m].flag.clouds)
-			clif_weather_sub(fd, 233);
+			clif_weather_sub(fd, sd->bl.id, 233);
 		if (map[m].flag.clouds2)
-			clif_weather_sub(fd, 516);
+			clif_weather_sub(fd, sd->bl.id, 516);
 		if (map[m].flag.fog)
-			clif_weather_sub(fd, 515);
+			clif_weather_sub(fd, sd->bl.id, 515);
 		if (map[m].flag.fireworks) {
-			clif_weather_sub(fd, 297);
-			clif_weather_sub(fd, 299);
-			clif_weather_sub(fd, 301);
+			clif_weather_sub(fd, sd->bl.id, 297);
+			clif_weather_sub(fd, sd->bl.id, 299);
+			clif_weather_sub(fd, sd->bl.id, 301);
 		}
 		if (map[m].flag.sakura)
-			clif_weather_sub(fd, 163);
+			clif_weather_sub(fd, sd->bl.id, 163);
 		if (map[m].flag.leaves)
-			clif_weather_sub(fd, 333);
+			clif_weather_sub(fd, sd->bl.id, 333);
 		if (map[m].flag.rain)
-			clif_weather_sub(fd, 161);
+			clif_weather_sub(fd, sd->bl.id, 161);
 	}
 }
 
-// new and improved weather display [Valaris]
-int clif_weather_sub(int fd, int type) {
-	WFIFOHEAD(fd, packet_len_table[0x1f3]);
-	WFIFOW(fd,0) = 0x1f3;
-	WFIFOL(fd,2) = -10;
-	WFIFOL(fd,6) = type;
-	WFIFOSET(fd,packet_len_table[0x1f3]);
-
-	return 0;
-}
-
 int clif_weather(int m) {
 	int i;
 
@@ -1287,12 +1274,6 @@ int clif_weather(int m) {
 
 	for(i = 0; i < fd_max; i++) {
 		if (session[i] && (sd = session[i]->session_data) != NULL && sd->state.auth && sd->bl.m == m) {
-			WFIFOHEAD(sd->fd, packet_len_table[0x80]);
-			WFIFOW(sd->fd,0) = 0x80;
-			WFIFOL(sd->fd,2) = -10;
-			WFIFOB(sd->fd,6) = 0;
-			WFIFOSET(sd->fd,packet_len_table[0x80]);
-
 			clif_weather_check(sd);
 		}
 	}
@@ -1490,7 +1471,7 @@ int clif_move(struct block_list *bl) {
 	case BL_PC:
 		{
 			TBL_PC *sd = ((TBL_PC*)bl);
-			clif_movepc(sd);
+//			clif_movepc(sd);
 			if(sd->state.size==2) // tiny/big players [Valaris]
 				clif_specialeffect(&sd->bl,423,0);
 			else if(sd->state.size==1)

+ 0 - 1
src/map/clif.h

@@ -308,7 +308,6 @@ void clif_friendslist_reqack(struct map_session_data *sd, struct map_session_dat
 
 // [Valaris]
 int clif_mob_hp(struct mob_data *md);
-int clif_weather_sub(int fd, int type); // [Valaris]
 int clif_weather(int m); // [Valaris]
 int clif_specialeffect(struct block_list *bl,int type, int flag); // special effects [Valaris]
 int clif_message(struct block_list *bl, char* msg); // messages (from mobs/npcs) [Valaris]