Browse Source

* Merged changes up to eAthena 15084.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15818 54d463be-8e91-2dee-dedb-b68131a5f0ec
eathenabot 13 years ago
parent
commit
ea46e779c0
4 changed files with 21 additions and 4 deletions
  1. 1 1
      sql-files/logs.sql
  2. 3 0
      sql-files/upgrade_svn15818_log.sql
  3. 7 2
      src/map/clif.c
  4. 10 1
      src/map/intif.c

+ 1 - 1
sql-files/logs.sql

@@ -31,7 +31,7 @@ CREATE TABLE `zenylog` (
   `time` datetime NOT NULL default '0000-00-00 00:00:00',
   `time` datetime NOT NULL default '0000-00-00 00:00:00',
   `char_id` int(11) NOT NULL default '0',
   `char_id` int(11) NOT NULL default '0',
   `src_id` int(11) NOT NULL default '0',
   `src_id` int(11) NOT NULL default '0',
-  `type` enum('M','T','V','S','N','A','E','B') NOT NULL default 'S',
+  `type` enum('M','T','V','S','N','A','E','B','I') NOT NULL default 'S',
   `amount` int(11) NOT NULL default '0',
   `amount` int(11) NOT NULL default '0',
   `map` varchar(11) NOT NULL default '',
   `map` varchar(11) NOT NULL default '',
   PRIMARY KEY  (`id`),
   PRIMARY KEY  (`id`),

+ 3 - 0
sql-files/upgrade_svn15818_log.sql

@@ -0,0 +1,3 @@
+-- Adds 'I' to `type` in `picklog` and `zenylog`
+
+ALTER TABLE `zenylog` MODIFY `type` ENUM('M','T','V','S','N','A','E','B','I') NOT NULL DEFAULT 'S';

+ 7 - 2
src/map/clif.c

@@ -13805,7 +13805,7 @@ void clif_parse_Auction_setitem(int fd, struct map_session_data *sd)
 	}
 	}
 
 
 	if( (item = itemdb_exists(sd->status.inventory[idx].nameid)) != NULL && !(item->type == IT_ARMOR || item->type == IT_PETARMOR || item->type == IT_WEAPON || item->type == IT_CARD || item->type == IT_ETC) )
 	if( (item = itemdb_exists(sd->status.inventory[idx].nameid)) != NULL && !(item->type == IT_ARMOR || item->type == IT_PETARMOR || item->type == IT_WEAPON || item->type == IT_CARD || item->type == IT_ETC) )
-	{ // Consumible or pets are not allowed
+	{ // Consumable or pets are not allowed
 		clif_Auction_setitem(sd->fd, idx, true);
 		clif_Auction_setitem(sd->fd, idx, true);
 		return;
 		return;
 	}
 	}
@@ -13931,9 +13931,13 @@ void clif_parse_Auction_register(int fd, struct map_session_data *sd)
 		clif_Auction_message(fd, 4); // No Char Server? lets say something to the client
 		clif_Auction_message(fd, 4); // No Char Server? lets say something to the client
 	else
 	else
 	{
 	{
+		int zeny = auction.hours*battle_config.auction_feeperhour;
+
 		pc_delitem(sd, sd->auction.index, sd->auction.amount, 1, 6, LOG_TYPE_AUCTION);
 		pc_delitem(sd, sd->auction.index, sd->auction.amount, 1, 6, LOG_TYPE_AUCTION);
 		sd->auction.amount = 0;
 		sd->auction.amount = 0;
-		pc_payzeny(sd, auction.hours * battle_config.auction_feeperhour);
+
+		log_zeny(sd, LOG_TYPE_AUCTION, sd, -zeny);
+		pc_payzeny(sd, zeny);
 	}
 	}
 }
 }
 
 
@@ -13977,6 +13981,7 @@ void clif_parse_Auction_bid(int fd, struct map_session_data *sd)
 	else if ( CheckForCharServer() ) // char server is down (bugreport:1138)
 	else if ( CheckForCharServer() ) // char server is down (bugreport:1138)
 		clif_Auction_message(fd, 0); // You have failed to bid into the auction
 		clif_Auction_message(fd, 0); // You have failed to bid into the auction
 	else {
 	else {
+		log_zeny(sd, LOG_TYPE_AUCTION, sd, -bid);
 		pc_payzeny(sd, bid);
 		pc_payzeny(sd, bid);
 		intif_Auction_bid(sd->status.char_id, sd->status.name, auction_id, bid);
 		intif_Auction_bid(sd->status.char_id, sd->status.name, auction_id, bid);
 	}
 	}

+ 10 - 1
src/map/intif.c

@@ -13,6 +13,7 @@
 #include "clif.h"
 #include "clif.h"
 #include "pc.h"
 #include "pc.h"
 #include "intif.h"
 #include "intif.h"
+#include "log.h"
 #include "storage.h"
 #include "storage.h"
 #include "party.h"
 #include "party.h"
 #include "guild.h"
 #include "guild.h"
@@ -1774,9 +1775,13 @@ static void intif_parse_Auction_register(int fd)
 	}
 	}
 	else
 	else
 	{
 	{
+		int zeny = auction.hours*battle_config.auction_feeperhour;
+
 		clif_Auction_message(sd->fd, 4);
 		clif_Auction_message(sd->fd, 4);
 		pc_additem(sd, &auction.item, auction.item.amount, LOG_TYPE_AUCTION);
 		pc_additem(sd, &auction.item, auction.item.amount, LOG_TYPE_AUCTION);
-		pc_getzeny(sd, auction.hours * battle_config.auction_feeperhour);
+
+		log_zeny(sd, LOG_TYPE_AUCTION, sd, zeny);
+		pc_getzeny(sd, zeny);
 	}
 	}
 }
 }
 
 
@@ -1836,6 +1841,7 @@ static void intif_parse_Auction_close(int fd)
 	clif_Auction_close(sd->fd, result);
 	clif_Auction_close(sd->fd, result);
 	if( result == 0 )
 	if( result == 0 )
 	{
 	{
+		// FIXME: Leeching off a parse function
 		clif_parse_Auction_cancelreg(fd, sd);
 		clif_parse_Auction_cancelreg(fd, sd);
 		intif_Auction_requestlist(sd->status.char_id, 6, 0, "", 1);
 		intif_Auction_requestlist(sd->status.char_id, 6, 0, "", 1);
 	}
 	}
@@ -1871,7 +1877,10 @@ static void intif_parse_Auction_bid(int fd)
 
 
 	clif_Auction_message(sd->fd, result);
 	clif_Auction_message(sd->fd, result);
 	if( bid > 0 )
 	if( bid > 0 )
+	{
+		log_zeny(sd, LOG_TYPE_AUCTION, sd, bid);
 		pc_getzeny(sd, bid);
 		pc_getzeny(sd, bid);
+	}
 	if( result == 1 )
 	if( result == 1 )
 	{ // To update the list, display your buy list
 	{ // To update the list, display your buy list
 		clif_parse_Auction_cancelreg(fd, sd);
 		clif_parse_Auction_cancelreg(fd, sd);