Selaa lähdekoodia

- Normalized the mapname in guild get/set castle data, should fix guild flags.
- Added log options 0x800/0x1000 to log storage moves ('R') and guild storage moves ('G')
- Added upgrade_svn9976.sql to include 'R'/'G' on the picklog type column set.
- Updated the logs_athena description to include the letter of each type (512 - M, 32 - N, etc)


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

skotlex 18 vuotta sitten
vanhempi
commit
b10091246c
6 muutettua tiedostoa jossa 40 lisäystä ja 11 poistoa
  1. 9 0
      Changelog-Trunk.txt
  2. 12 10
      conf-tmpl/log_athena.conf
  3. 1 1
      sql-files/logs.sql
  4. 1 0
      sql-files/upgrade_svn9976.sql
  5. 4 0
      src/map/script.c
  6. 13 0
      src/map/storage.c

+ 9 - 0
Changelog-Trunk.txt

@@ -3,6 +3,15 @@ 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/03/09
+	* Normalized the mapname in guild get/set castle data, should fix guild
+	  flags.
+	* Added log options 0x800/0x1000 to log storage moves ('R') and guild
+	  storage moves ('G')
+	* Added upgrade_svn9976.sql to include 'R'/'G' on the picklog type column
+	  set.
+	* Updated the logs_athena description to include the letter of each type
+	  (512 - M, 32 - N, etc)
 2007/03/08
 	* Corrected the pet/homunc data not being free'd if the player logs out
 	  before being authed.

+ 12 - 10
conf-tmpl/log_athena.conf

@@ -3,16 +3,18 @@
 // Enable Logs?
 // 1 - Log all events.
 // Or, determine what to log by adding up the different events:
-// 0002 - Log trades
-// 0004 - Log vending transactions
-// 0008 - Log items drop/picked by players
-// 0016 - Log items drop/looted by monsters
-// 0032 - Log NPC transactions (buy/sell)
-// 0064 - Log Script generated transactions (items deleted/acquired through quests)
-// 0128 - Log items stolen from mobs (Steal/Gank)
-// 0256 - Log player-used items.
-// 0512 - Log MVP prize items
-// 1024 - Log player created/deleted items (through @/# commands)
+// 0002 - (T) Log trades
+// 0004 - (V) Log vending transactions
+// 0008 - (P) Log items drop/picked by players
+// 0016 - (L) Log items drop/looted by monsters
+// 0032 - (S) Log NPC transactions (buy/sell)
+// 0064 - (N) Log Script transactions (items deleted/acquired through quests)
+// 0128 - (M) Log items stolen from mobs (Steal/Gank)
+// 0256 - (C) Log player-used items.
+// 0512 - (M) Log MVP prize items
+// 1024 - (A) Log player created/deleted items (through @/# commands)
+// 2048 - (R) Log items placed/retrieved from storage.
+// 4096 - (G) Log items placed/retrieved from guild storage.
 // Example: Log trades+vending+script items+created items: 2+4+64+1024:
 // enable_logs: 1094
 enable_logs: 1

+ 1 - 1
sql-files/logs.sql

@@ -8,7 +8,7 @@ CREATE TABLE `picklog` (
   `id` int(11) NOT NULL auto_increment,
   `time` datetime NOT NULL default '0000-00-00 00:00:00',
   `char_id` int(11) NOT NULL default '0',
-  `type` set('M','P','L','T','V','S','N','C','A') NOT NULL default 'P',
+  `type` set('M','P','L','T','V','S','N','C','A','R','G') NOT NULL default 'P',
   `nameid` int(11) NOT NULL default '0',
   `amount` int(11) NOT NULL default '1',
   `refine` tinyint(3) unsigned NOT NULL default '0',

+ 1 - 0
sql-files/upgrade_svn9976.sql

@@ -0,0 +1 @@
+ALTER TABLE `picklog` MODIFY `type` set('M','P','L','T','V','S','N','C','A','R','G') NOT NULL default 'P';

+ 4 - 0
src/map/script.c

@@ -9147,6 +9147,8 @@ BUILDIN_FUNC(getcastledata)
 	struct guild_castle *gc;
 	int i,j;
 
+	map_normalize_name(mapname);
+
 	if( st->end>st->start+4 && index==0){
 		for(i=0,j=-1;i<MAX_GUILDCASTLE;i++)
 			if( (gc=guild_castle_search(i)) != NULL &&
@@ -9210,6 +9212,8 @@ BUILDIN_FUNC(setcastledata)
 	struct guild_castle *gc;
 	int i;
 
+	map_normalize_name(mapname);
+
 	for(i=0;i<MAX_GUILDCASTLE;i++){
 		if( (gc=guild_castle_search(i)) != NULL ){
 			if(strcmp(mapname,gc->map_name)==0){

+ 13 - 0
src/map/storage.c

@@ -18,6 +18,7 @@
 #include "guild.h"
 #include "battle.h"
 #include "atcommand.h"
+#include "log.h"
 
 static struct dbt *storage_db;
 static struct dbt *guild_storage_db;
@@ -188,6 +189,8 @@ static int storage_additem(struct map_session_data *sd,struct storage *stor,stru
 				stor->storage_[i].amount+=amount;
 				clif_storageitemadded(sd,stor,i,amount);
 				stor->dirty = 1;
+				if(log_config.enable_logs&0x800)
+					log_pick_pc(sd, "R", item_data->nameid, -amount, item_data);
 				return 0;
 			}
 		}
@@ -204,6 +207,8 @@ static int storage_additem(struct map_session_data *sd,struct storage *stor,stru
 	clif_storageitemadded(sd,stor,i,amount);
 	clif_updatestorageamount(sd,stor);
 	stor->dirty = 1;
+	if(log_config.enable_logs&0x800)
+		log_pick_pc(sd, "R", item_data->nameid, -amount, item_data);
 	return 0;
 }
 /*==========================================
@@ -217,6 +222,8 @@ static int storage_delitem(struct map_session_data *sd,struct storage *stor,int
 		return 1;
 
 	stor->storage_[n].amount-=amount;
+	if(log_config.enable_logs&0x800)
+		log_pick_pc(sd, "R", stor->storage_[n].nameid, amount, &stor->storage_[n]);
 	if(stor->storage_[n].amount==0){
 		memset(&stor->storage_[n],0,sizeof(stor->storage_[0]));
 		stor->storage_amount--;
@@ -537,6 +544,8 @@ int guild_storage_additem(struct map_session_data *sd,struct guild_storage *stor
 				stor->storage_[i].amount+=amount;
 				clif_guildstorageitemadded(sd,stor,i,amount);
 				stor->dirty = 1;
+				if(log_config.enable_logs&0x1000)
+					log_pick_pc(sd, "G", item_data->nameid, -amount, item_data);
 				return 0;
 			}
 		}
@@ -553,6 +562,8 @@ int guild_storage_additem(struct map_session_data *sd,struct guild_storage *stor
 	clif_guildstorageitemadded(sd,stor,i,amount);
 	clif_updateguildstorageamount(sd,stor);
 	stor->dirty = 1;
+	if(log_config.enable_logs&0x1000)
+		log_pick_pc(sd, "G", item_data->nameid, -amount, item_data);
 	return 0;
 }
 
@@ -565,6 +576,8 @@ int guild_storage_delitem(struct map_session_data *sd,struct guild_storage *stor
 		return 1;
 
 	stor->storage_[n].amount-=amount;
+	if(log_config.enable_logs&0x1000)
+		log_pick_pc(sd, "G", stor->storage_[n].nameid, amount, &stor->storage_[n]);
 	if(stor->storage_[n].amount==0){
 		memset(&stor->storage_[n],0,sizeof(stor->storage_[0]));
 		stor->storage_amount--;