From 47b0d1c5c22714622a528d1de0d7ab8bcc5dfec7 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 8 Mar 2007 16:27:06 +0000 Subject: - 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9976 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 9 +++++++++ conf-tmpl/log_athena.conf | 22 ++++++++++++---------- sql-files/logs.sql | 2 +- sql-files/upgrade_svn9976.sql | 1 + src/map/script.c | 4 ++++ src/map/storage.c | 13 +++++++++++++ 6 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 sql-files/upgrade_svn9976.sql diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 9db638096..d7864a106 100644 --- a/Changelog-Trunk.txt +++ b/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. diff --git a/conf-tmpl/log_athena.conf b/conf-tmpl/log_athena.conf index f55394cc5..67f145718 100644 --- a/conf-tmpl/log_athena.conf +++ b/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 diff --git a/sql-files/logs.sql b/sql-files/logs.sql index 597e9e0ed..aa0ead7d8 100644 --- a/sql-files/logs.sql +++ b/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', diff --git a/sql-files/upgrade_svn9976.sql b/sql-files/upgrade_svn9976.sql new file mode 100644 index 000000000..82902bff6 --- /dev/null +++ b/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'; diff --git a/src/map/script.c b/src/map/script.c index 259ab7073..55771c6e3 100644 --- a/src/map/script.c +++ b/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;imap_name)==0){ diff --git a/src/map/storage.c b/src/map/storage.c index 529f2acde..4d652903b 100644 --- a/src/map/storage.c +++ b/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--; -- cgit v1.2.3-70-g09d2