diff options
author | Haru <haru@dotalux.com> | 2016-03-11 12:18:19 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-03-11 12:18:19 +0100 |
commit | 7574d51be691d78217dfeb0d81a2ae93e985e92d (patch) | |
tree | 0318c061a56cc3a7a938eeecfd1901720e40ec84 /src/map | |
parent | fa1459d521bab6c33a57bfa25a66855e3df521f0 (diff) | |
parent | ca5f133a7c57854e3f02acdb616d3c14e21bcf6b (diff) | |
download | hercules-7574d51be691d78217dfeb0d81a2ae93e985e92d.tar.gz hercules-7574d51be691d78217dfeb0d81a2ae93e985e92d.tar.bz2 hercules-7574d51be691d78217dfeb0d81a2ae93e985e92d.tar.xz hercules-7574d51be691d78217dfeb0d81a2ae93e985e92d.zip |
Merge pull request #1192 from 4144/extendlog
Add new logging types.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.c | 2 | ||||
-rw-r--r-- | src/map/chrif.c | 4 | ||||
-rw-r--r-- | src/map/clif.c | 6 | ||||
-rw-r--r-- | src/map/log.c | 10 | ||||
-rw-r--r-- | src/map/log.h | 51 | ||||
-rw-r--r-- | src/map/pc.c | 16 | ||||
-rw-r--r-- | src/map/pet.c | 8 | ||||
-rw-r--r-- | src/map/quest.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 12 |
9 files changed, 66 insertions, 45 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index f28c24dcb..94e629adb 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5262,7 +5262,7 @@ ACMD(clearcart) for( i = 0; i < MAX_CART; i++ ) if(sd->status.cart[i].nameid > 0) - pc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_OTHER); + pc->cart_delitem(sd, i, sd->status.cart[i].amount, 1, LOG_TYPE_COMMAND); clif->clearcart(fd); clif->updatestatus(sd,SP_CARTINFO); diff --git a/src/map/chrif.c b/src/map/chrif.c index 578942897..70339c378 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -933,14 +933,14 @@ bool chrif_divorceack(int char_id, int partner_id) { sd->status.partner_id = 0; for(i = 0; i < MAX_INVENTORY; i++) if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F) - pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE); } if( ( sd = map->charid2sd(partner_id) ) != NULL && sd->status.partner_id == char_id ) { sd->status.partner_id = 0; for(i = 0; i < MAX_INVENTORY; i++) if (sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F) - pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE); } return true; diff --git a/src/map/clif.c b/src/map/clif.c index 07b0b323b..71409fab4 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11521,7 +11521,7 @@ void clif_parse_OneClick_ItemIdentify(int fd, struct map_session_data *sd) return; if ((n = pc->have_magnifier(sd) ) != INDEX_NOT_FOUND && - pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER) == 0) + pc->delitem(sd, n, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME) == 0) skill->identify(sd, idx); } @@ -18404,7 +18404,7 @@ void clif_parse_RouletteGenerate(int fd, struct map_session_data* sd) { it.nameid = clif->rd.nameid[stage][0]; it.identify = 1; - pc->additem(sd, &it, clif->rd.qty[stage][0], LOG_TYPE_OTHER);/** TODO maybe a new log type for roulette items? **/ + pc->additem(sd, &it, clif->rd.qty[stage][0], LOG_TYPE_ROULETTE);/** TODO maybe a new log type for roulette items? **/ sd->roulette.stage = 0; result = GENERATE_ROULETTE_LOSING; @@ -18439,7 +18439,7 @@ void clif_parse_RouletteRecvItem(int fd, struct map_session_data* sd) { it.nameid = clif->rd.nameid[sd->roulette.prizeStage][sd->roulette.prizeIdx]; it.identify = 1; - switch (pc->additem(sd, &it, clif->rd.qty[sd->roulette.prizeStage][sd->roulette.prizeIdx], LOG_TYPE_OTHER)) { + switch (pc->additem(sd, &it, clif->rd.qty[sd->roulette.prizeStage][sd->roulette.prizeIdx], LOG_TYPE_ROULETTE)) { case 0: p.Result = RECV_ITEM_SUCCESS; sd->roulette.claimPrize = false; diff --git a/src/map/log.c b/src/map/log.c index f757faf43..072f7b6fd 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -62,6 +62,16 @@ char log_picktype2char(e_log_pick_type type) { case LOG_TYPE_BUYING_STORE: return 'B'; // (B)uying Store case LOG_TYPE_LOOT: return 'L'; // (L)oot (consumed monster pick/drop) case LOG_TYPE_BANK: return 'K'; // Ban(K) Transactions + case LOG_TYPE_DIVORCE: return 'Y'; // Divorce + case LOG_TYPE_ROULETTE: return 'Z'; // Roulette + case LOG_TYPE_RENTAL: return 'W'; // Rental + case LOG_TYPE_CARD: return 'Q'; // Card + case LOG_TYPE_INV_INVALID: return 'J'; // Invalid in inventory + case LOG_TYPE_CART_INVALID: return 'H'; // Invalid in cart + case LOG_TYPE_EGG: return '@'; // Egg + case LOG_TYPE_QUEST: return '0'; // Quest + case LOG_TYPE_SKILL: return '1'; // Skill + case LOG_TYPE_REFINE: return '2'; // Refine case LOG_TYPE_OTHER: return 'X'; // Other } diff --git a/src/map/log.h b/src/map/log.h index fbd0acc0e..69622adc6 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -57,29 +57,40 @@ typedef enum e_log_chat_type { } e_log_chat_type; typedef enum e_log_pick_type { - LOG_TYPE_NONE = 0, - LOG_TYPE_TRADE = 0x00001, - LOG_TYPE_VENDING = 0x00002, - LOG_TYPE_PICKDROP_PLAYER = 0x00004, - LOG_TYPE_PICKDROP_MONSTER = 0x00008, - LOG_TYPE_NPC = 0x00010, - LOG_TYPE_SCRIPT = 0x00020, - LOG_TYPE_STEAL = 0x00040, - LOG_TYPE_CONSUME = 0x00080, - LOG_TYPE_PRODUCE = 0x00100, - LOG_TYPE_MVP = 0x00200, - LOG_TYPE_COMMAND = 0x00400, - LOG_TYPE_STORAGE = 0x00800, - LOG_TYPE_GSTORAGE = 0x01000, - LOG_TYPE_MAIL = 0x02000, - LOG_TYPE_AUCTION = 0x04000, - LOG_TYPE_BUYING_STORE = 0x08000, - LOG_TYPE_OTHER = 0x10000, - LOG_TYPE_BANK = 0x20000, + LOG_TYPE_NONE = 0x00000000, + LOG_TYPE_TRADE = 0x00000001, + LOG_TYPE_VENDING = 0x00000002, + LOG_TYPE_PICKDROP_PLAYER = 0x00000004, + LOG_TYPE_PICKDROP_MONSTER = 0x00000008, + LOG_TYPE_NPC = 0x00000010, + LOG_TYPE_SCRIPT = 0x00000020, + LOG_TYPE_STEAL = 0x00000040, + LOG_TYPE_CONSUME = 0x00000080, + LOG_TYPE_PRODUCE = 0x00000100, + LOG_TYPE_MVP = 0x00000200, + LOG_TYPE_COMMAND = 0x00000400, + LOG_TYPE_STORAGE = 0x00000800, + LOG_TYPE_GSTORAGE = 0x00001000, + LOG_TYPE_MAIL = 0x00002000, + LOG_TYPE_AUCTION = 0x00004000, + LOG_TYPE_BUYING_STORE = 0x00008000, + LOG_TYPE_OTHER = 0x00010000, + LOG_TYPE_BANK = 0x00020000, + LOG_TYPE_DIVORCE = 0x00040000, + LOG_TYPE_ROULETTE = 0x00080000, + LOG_TYPE_RENTAL = 0x00100000, + LOG_TYPE_CARD = 0x00200000, + LOG_TYPE_INV_INVALID = 0x00400000, + LOG_TYPE_CART_INVALID = 0x00800000, + LOG_TYPE_EGG = 0x01000000, + LOG_TYPE_QUEST = 0x02000000, + LOG_TYPE_SKILL = 0x04000000, + LOG_TYPE_REFINE = 0x08000000, + // combinations LOG_TYPE_LOOT = LOG_TYPE_PICKDROP_MONSTER|LOG_TYPE_CONSUME, // all - LOG_TYPE_ALL = 0xFFFFF, + LOG_TYPE_ALL = 0xFFFFFFFF, } e_log_pick_type; /// filters for item logging diff --git a/src/map/pc.c b/src/map/pc.c index 7b4d47db2..e958f32b6 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -539,7 +539,7 @@ void pc_rental_expire(struct map_session_data *sd, int i) { } clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid); - pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_RENTAL); } void pc_inventory_rentals(struct map_session_data *sd) { @@ -4136,7 +4136,7 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) // remember the card id to insert nameid = sd->status.inventory[idx_card].nameid; - if( pc->delitem(sd, idx_card, 1, 1, DELITEM_NORMAL, LOG_TYPE_OTHER) == 1 ) + if( pc->delitem(sd, idx_card, 1, 1, DELITEM_NORMAL, LOG_TYPE_CARD) == 1 ) {// failed clif->insert_card(sd,idx_equip,idx_card,1); } @@ -4146,9 +4146,9 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) ARR_FIND( 0, sd->inventory_data[idx_equip]->slot, i, sd->status.inventory[idx_equip].card[i] == 0); if (i == sd->inventory_data[idx_equip]->slot) return 0; // no free slots - logs->pick_pc(sd, LOG_TYPE_OTHER, -1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]); + logs->pick_pc(sd, LOG_TYPE_CARD, -1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]); sd->status.inventory[idx_equip].card[i] = nameid; - logs->pick_pc(sd, LOG_TYPE_OTHER, 1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]); + logs->pick_pc(sd, LOG_TYPE_CARD, 1, &sd->status.inventory[idx_equip],sd->inventory_data[idx_equip]); clif->insert_card(sd,idx_equip,idx_card,0); return 1; } @@ -9905,7 +9905,7 @@ int pc_checkitem(struct map_session_data *sd) if (!itemdb_available(id)) { ShowWarning("Removed invalid/disabled item id %d from inventory (amount=%d, char_id=%d).\n", id, sd->status.inventory[i].amount, sd->status.char_id); - pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, i, sd->status.inventory[i].amount, 0, DELITEM_NORMAL, LOG_TYPE_INV_INVALID); continue; } @@ -9921,7 +9921,7 @@ int pc_checkitem(struct map_session_data *sd) if( !itemdb_available(id) ) { ShowWarning("Removed invalid/disabled item id %d from cart (amount=%d, char_id=%d).\n", id, sd->status.cart[i].amount, sd->status.char_id); - pc->cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_OTHER); + pc->cart_delitem(sd, i, sd->status.cart[i].amount, 0, LOG_TYPE_CART_INVALID); continue; } @@ -10139,9 +10139,9 @@ int pc_divorce(struct map_session_data *sd) for( i = 0; i < MAX_INVENTORY; i++ ) { if( sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F ) - pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE); if( p_sd->status.inventory[i].nameid == WEDDING_RING_M || p_sd->status.inventory[i].nameid == WEDDING_RING_F ) - pc->delitem(p_sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(p_sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_DIVORCE); } clif->divorced(sd, p_sd->status.name); diff --git a/src/map/pet.c b/src/map/pet.c index 256324d29..e2b257e10 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -317,7 +317,7 @@ int pet_return_egg(struct map_session_data *sd, struct pet_data *pd) tmp_item.card[1] = GetWord(pd->pet.pet_id,0); tmp_item.card[2] = GetWord(pd->pet.pet_id,1); tmp_item.card[3] = pd->pet.rename_flag; - if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) { + if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_EGG))) { clif->additem(sd,0,0,flag); map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0); } @@ -464,7 +464,7 @@ int pet_recv_petdata(int account_id,struct s_pet *p,int flag) { return 1; } if (!pet->birth_process(sd,p)) //Pet hatched. Delete egg. - pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_EGG); } else { pet->data_init(sd,p); if(sd->pd && sd->bl.prev != NULL) { @@ -703,7 +703,7 @@ int pet_equipitem(struct map_session_data *sd,int index) { return 1; } - pc->delitem(sd, index, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, index, 1, 0, DELITEM_NORMAL, LOG_TYPE_CONSUME); pd->pet.equip = nameid; status->set_viewdata(&pd->bl, pd->pet.class_); //Updates view_data. clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom); @@ -734,7 +734,7 @@ int pet_unequipitem(struct map_session_data *sd, struct pet_data *pd) { memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = nameid; tmp_item.identify = 1; - if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_OTHER))) { + if((flag = pc->additem(sd,&tmp_item,1,LOG_TYPE_CONSUME))) { clif->additem(sd,0,0,flag); map->addflooritem(&sd->bl, &tmp_item, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0); } diff --git a/src/map/quest.c b/src/map/quest.c index bf0a76b16..79328ae9d 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -316,7 +316,7 @@ void quest_update_objective(struct map_session_data *sd, int mob_id) item.nameid = dropitem->nameid; item.identify = itemdb->isidentified2(data); item.amount = 1; - if((temp = pc->additem(sd, &item, 1, LOG_TYPE_OTHER)) != 0) { // TODO: We might want a new log type here? + if((temp = pc->additem(sd, &item, 1, LOG_TYPE_QUEST)) != 0) { // TODO: We might want a new log type here? // Failed to obtain the item clif->additem(sd, 0, 0, temp); } diff --git a/src/map/skill.c b/src/map/skill.c index de5368cdf..8271991fe 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7505,7 +7505,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin memset(&item_tmp,0,sizeof(item_tmp)); item_tmp.nameid = skill->dbs->db[su->group->skill_id].itemid[i]; item_tmp.identify = 1; - if (item_tmp.nameid && (success=pc->additem(sd,&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],LOG_TYPE_OTHER)) != 0) { + if (item_tmp.nameid && (success=pc->additem(sd,&item_tmp,skill->dbs->db[su->group->skill_id].amount[i],LOG_TYPE_SKILL)) != 0) { clif->additem(sd,0,0,success); map->addflooritem(&sd->bl, &item_tmp, skill->dbs->db[su->group->skill_id].amount[i], sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0); } @@ -7517,7 +7517,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin memset(&item_tmp,0,sizeof(item_tmp)); item_tmp.nameid = su->group->item_id?su->group->item_id:ITEMID_TRAP; item_tmp.identify = 1; - if (item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_OTHER)) != 0) { + if (item_tmp.nameid && (flag=pc->additem(sd,&item_tmp,1,LOG_TYPE_SKILL)) != 0) { clif->additem(sd,0,0,flag); map->addflooritem(&sd->bl, &item_tmp, 1, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 0); } @@ -15313,12 +15313,12 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) else per += 5 * ((signed int)sd->status.job_level - 50); - pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); // FIXME: is this the correct reason flag? + pc->delitem(sd, i, 1, 0, DELITEM_NORMAL, LOG_TYPE_REFINE); // FIXME: is this the correct reason flag? if (per > rnd() % 1000) { int ep = 0; - logs->pick_pc(sd, LOG_TYPE_OTHER, -1, item, ditem); + logs->pick_pc(sd, LOG_TYPE_REFINE, -1, item, ditem); item->refine++; - logs->pick_pc(sd, LOG_TYPE_OTHER, 1, item, ditem); + logs->pick_pc(sd, LOG_TYPE_REFINE, 1, item, ditem); if(item->equip) { ep = item->equip; pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); @@ -15351,7 +15351,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) if(item->equip) pc->unequipitem(sd, idx, PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE); clif->refine(sd->fd,1,idx,item->refine); - pc->delitem(sd, idx, 1, 0, DELITEM_NORMAL, LOG_TYPE_OTHER); + pc->delitem(sd, idx, 1, 0, DELITEM_NORMAL, LOG_TYPE_REFINE); clif->misceffect(&sd->bl,2); clif->emotion(&sd->bl, E_OMG); } |