Selaa lähdekoodia

- Small update to the effects list (new exe's effects by Au{R}oN)
- No sending of the pet_equip packet when pet has no equip (thx to Skotlex)
- Added back exp gain limiting for old formula to stop exploits (see r8177)
- Now a message is printed when the packet_ver filter rejects someone
- Renamed two structs using same name as variables (MSVC debugger issue)

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

ultramage 18 vuotta sitten
vanhempi
commit
02e009bd8d
7 muutettua tiedostoa jossa 49 lisäystä ja 39 poistoa
  1. 6 0
      Changelog-Trunk.txt
  2. 13 9
      doc/effect_list.txt
  3. 2 2
      src/char/char.c
  4. 3 3
      src/common/mapindex.c
  5. 16 18
      src/map/clif.c
  6. 6 6
      src/map/clif.h
  7. 3 1
      src/map/mob.c

+ 6 - 0
Changelog-Trunk.txt

@@ -3,6 +3,12 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/07/18
+	* Small update to the effects list (new exe's effects by Au{R}oN)
+	* No sending of the pet_equip packet when pet has no equip (thx2Skotlex)
+	* Added back exp gain limiting for old formula to stop exploits (see r8177)
+	* Now a message is printed when the packet_ver filter rejects someone
+	* Renamed two structs using same name as variables (MSVC debugger issue)
 2007/07/13
 	* Fixed yet another script engine typo, this time in 'copyarray' [ultramage]
 2007/07/09

+ 13 - 9
doc/effect_list.txt

@@ -3,10 +3,11 @@
 //===== By ================================================
 //= Valaris, Spira, Au{R}oN, Tharis, HiddenDragon
 //===== Version ===========================================
-//= 1.1
+//= 1.2
 //=========================================================
 //= 1.0 - Formatted to the standard
-//= 1.1 - New effects, from 2007/05/07 Sakexe [Au{R}oN]
+//= 1.1 - New effects, up to 2007/05/07 Sakexe [Au{R}oN]
+//= 1.2 - New effects, up to 2007/07/12 Sakexe [Au{R}oN]
 //===== Description =======================================
 //= A list of client-side effects sorted by their ID
 //=========================================================
@@ -152,9 +153,9 @@ number	description
 130.	Two-Hand Quicken
 131.	Auto-Counter Hit
 132.	Grimtooth Hit
-133.	Probably the old Frost Diver Effect
-134.	Probably the old Frost Diver Effect Without the Blue Circle
-135.	Probably the old Frost Diver Effect with Explosion
+133.	Big Piece of Ice
+134.	Big Piece of Ice Without the Blue Circle
+135.	Big Piece of Ice Explosion
 136.	Slow Poison
 137.	Small pulsating green square (unused)
 138.	Fire pillar
@@ -687,14 +688,17 @@ number	description
 665.	Little Blue Ball Falling From the Sky
 666.	Mobs Skill (Earthquake)
 667.	(nothing)
-668.	Mobs Skill (Scream)
+668.	Mobs Skill (Dragonfear)
 669.	Mobs Skill (Critical Slash)
-670.	Mobs Skill (Scream Without Sound)
+670.	Mobs Skill (Dragonfear Without Sound)
 671.	The Japan Earth Symbol (Like 'Seven Wind LV 1' but is in the Ground)
 672.	The Japan Wind Symbol (Like 'Seven Wind LV 2' but is in the Ground)
 673.	(nothing)
 674.	Like Curse Effect
-675.	Like Parrying/Kyrie Eleison barrier but is Yellow with small Cross in every barrier piece
+675.	Like Parrying/Kyrie Eleison barrier but Yellow with small Cross in every barrier piece
 676.	Slow Poison (Clock Only)
 677.	Mobs Skill (Unamed)
-678+.	No More Effects in 2007/05/07 Sakexe
+678.	Another Aura Bubbles but White
+679.	Green Aura
+680.	Green Aura Area Ground
+681+.	No More effects from 2007/7/12 Sakexe

+ 2 - 2
src/char/char.c

@@ -3746,10 +3746,10 @@ int parse_char(int fd)
 		}
 		break;
 
-		case 0x187:	// Alive?
+		case 0x187:	// R 0187 <account ID>.l - client keep-alive packet (every 12 seconds)
 			if (RFIFOREST(fd) < 6)
 				return 0;
-			RFIFOSKIP(fd, 6);
+			RFIFOSKIP(fd,6);
 		break;
 
 		case 0x7530:	// Athena info get

+ 3 - 3
src/common/mapindex.c

@@ -12,9 +12,9 @@
 
 #define MAX_MAPINDEX 2000
 
-struct indexes {
+struct _indexes {
 	char name[MAP_NAME_LENGTH]; //Stores map name
-	char exists; //Set to 1 if index exists
+	bool exists; //Set to 1 if index exists
 } indexes[MAX_MAPINDEX];
 
 static unsigned short max_index = 0;
@@ -58,7 +58,7 @@ int mapindex_addmap(int index, const char *name)
 		ShowWarning("(mapindex_add) Overriding index %d: map \"%s\" -> \"%s\"\n", index, indexes[index].name, map_name);
 
 	snprintf(indexes[index].name, MAP_NAME_LENGTH, "%s", map_name);
-	indexes[index].exists = 1;
+	indexes[index].exists = true;
 	if (max_index <= index)
 		max_index = index+1;
 	return 1;

+ 16 - 18
src/map/clif.c

@@ -50,7 +50,7 @@ struct Clif_Config {
 	int connect_cmd[MAX_PACKET_VER + 1]; //Store the connect command for all versions. [Skotlex]
 } clif_config;
 
-struct packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
+struct packet_db_t packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
 
 //Converts item type in case of pet eggs.
 #define itemtype(a) (a == IT_PETEGG)?IT_WEAPON:a
@@ -1372,7 +1372,7 @@ int clif_spawn(struct block_list *bl)
 	case BL_PET:
 		{
 			TBL_PET* pd = (TBL_PET*)bl;
-			clif_pet_equip(pd); // needed to display pet equip properly
+			if (pd->vd.head_bottom) clif_pet_equip(pd); // needed to display pet equip properly
 			clif_send_petdata_area(pd, 5, battle_config.pet_hair_style); // removes the attack cursor
 		}
 		break;
@@ -3763,15 +3763,18 @@ void clif_getareachar_unit(struct map_session_data* sd,struct block_list *bl)
 	case BL_PET:
 		{
 			// needed to display pet equip properly
-			//TODO: adjust clif_pet_equip() to support a 'target', then rewrite this mess into a function call
 			TBL_PET* pd = (TBL_PET*)bl;
-			int fd = sd->fd;
-			WFIFOHEAD(fd,packet_len(0x1a4));
-			WFIFOW(fd,0) = 0x1a4;
-			WFIFOB(fd,2) = 3;
-			WFIFOL(fd,3) = pd->bl.id;
-			WFIFOL(fd,7) = pd->vd.head_bottom;
-			WFIFOSET(fd,packet_len(0x1a4));
+			if (pd->vd.head_bottom)
+			{
+				//TODO: adjust clif_pet_equip() to support a 'target', then rewrite this mess into a function call
+        			int fd = sd->fd;
+				WFIFOHEAD(fd,packet_len(0x1a4));
+				WFIFOW(fd,0) = 0x1a4;
+				WFIFOB(fd,2) = 3;
+				WFIFOL(fd,3) = pd->bl.id;
+				WFIFOL(fd,7) = pd->vd.head_bottom;
+				WFIFOSET(fd,packet_len(0x1a4));
+			}
 		}
 		break;
 	}
@@ -7924,6 +7927,7 @@ void clif_parse_WantToConnection(int fd, TBL_PC* sd)
 			(packet_ver <= 9 && (battle_config.packet_ver_flag & 1) == 0) || // older than 6sept04
 			(packet_ver > 9 && (battle_config.packet_ver_flag & 1<<(packet_ver-9)) == 0)) // version not allowed
 	{// packet version rejected
+		ShowInfo("Rejected connection attempt, wrong packet version (AID/CID: '"CL_WHITE"%d/%d"CL_RESET"', Packet Ver: '"CL_WHITE"%d"CL_RESET"', IP: '"CL_WHITE"%s"CL_RESET"').\n", account_id, char_id, packet_ver, ip2str(session[fd]->client_addr, NULL));
 		WFIFOHEAD(fd,packet_len(0x6a));
 		WFIFOW(fd,0) = 0x6a;
 		WFIFOB(fd,2) = 5; // Your Game's EXE file is not the latest version
@@ -11518,15 +11522,9 @@ int clif_parse(int fd)
 
 	cmd = RFIFOW(fd,0);
 
-	// get packet version before to parse
-	packet_ver = 0;
+	// identify client's packet version
 	if (sd) {
 		packet_ver = sd->packet_ver;
-		if (packet_ver < 0 || packet_ver > MAX_PACKET_VER) {	// This should never happen unless we have some corrupted memory issues :X [Skotlex]
-			ShowWarning("clif_parse: Disconnecting session #%d (AID:%d/CID:%d) for having invalid packet_ver=%d.", fd, sd->status.account_id, sd->status.char_id, packet_ver);
-			set_eof(fd);
-			return 0;
-		}
 	} else {
 		// check authentification packet to know packet version
 		packet_ver = clif_guess_PacketVer(fd, 0, &err);
@@ -12005,7 +12003,7 @@ static int packetdb_readdb(void)
 					for(i=0;i<=MAX_PACKET_DB;i++){
 						if (packet_db[packet_ver][i].func == clif_parse_func[j].func)
 						{	
-							memset(&packet_db[packet_ver][i], 0, sizeof(struct packet_db));
+							memset(&packet_db[packet_ver][i], 0, sizeof(struct packet_db_t));
 							break;
 						}
 					}

+ 6 - 6
src/map/clif.h

@@ -10,12 +10,17 @@
 #define MAX_PACKET_DB		0x300
 #define MAX_PACKET_VER		21
 
-struct packet_db {
+struct packet_db_t {
 	short len;
 	void (*func)(int, struct map_session_data *);
 	short pos[20];
 };
 
+// packet_db[SERVER] is reserved for server use
+#define SERVER 0
+#define packet_len(x) packet_db[SERVER][x].len
+extern struct packet_db_t packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
+
 // local define
 enum send_target {
 	ALL_CLIENT,
@@ -45,11 +50,6 @@ enum send_target {
 	SELF,
 };
 
-// packet_db[SERVER] is reserved for server use
-#define SERVER 0
-#define packet_len(x) packet_db[SERVER][x].len
-extern struct packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
-
 int clif_setip(const char* ip);
 void clif_setbindip(const char* ip);
 void clif_setport(uint16 port);

+ 3 - 1
src/map/mob.c

@@ -1824,9 +1824,11 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 		if (!battle_config.exp_calc_type && md->tdmg)
 			//jAthena's exp formula based on total damage.
 			per = (double)md->dmglog[i].dmg/(double)md->tdmg;
-		else
+		else {
 			//eAthena's exp formula based on max hp.
 			per = (double)md->dmglog[i].dmg/(double)status->max_hp;
+			if (per > 2) per = 2; // prevents unlimited exp gain
+		}
 	
 		if (count>1 && battle_config.exp_bonus_attacker) {
 			//Exp bonus per additional attacker.