OK論壇

 找回密碼
 註冊
查看: 1357|回復: 4

請問如何添加交易記錄以及loginlog在logs中(SQL)

 關閉 [複製鏈接]
  • TA的每日心情
    擦汗
    2010-7-29 11:52 PM
  • 簽到天數: 6 天

    連續簽到: 0 天

    [LV.2]偶爾看看I

    發表於 2009-8-17 20:13:59 | 顯示全部樓層 |閱讀模式
    本帖最後由 shaiker 於 2009-8-17 08:25 PM 編輯

    EA 上抓來的 13436 跟 13957

    我從EA .svn 抓來的源碼版本(13436 AND 13957)
    sql的LOGS裡面都沒有可以記錄loginlog
    不能查登過的IP了
    請問是要增加哪段原始碼再編譯嗎?
    因為我翻了我的log.c跟log.h
    發現裡面沒有可以記錄IP的

    還有
    要怎麼增加交易記錄
    我在log_athena.conf
    裡面啟動日誌
    設定成enable_logs: 1
    可是我在picklog裡面還是沒看到有交易紀錄



    交易紀錄主要指 "char01" 給 "char02" "物品" "數量"





    我的重點還是放在logs裡面沒有loginlog很困擾

    如圖


    沒有loginlog可以看

    之前用神之的13436有loginlog可以看

    之前有在別的地方發問過
    這是別人的回答:
    // 是否使用MySQL記錄日誌麼 (僅限SQL版本)
    sql_logs: 1
    log_filter: 0
    log_athena.conf
    設定一下就好,不用改到原碼
    我對於他說的回答:  (不過他後來沒回 我貼出來只是怕別人回同樣的答案)
    你說的那些我本來就是這樣設定的
    atcommandlog 也會確實記錄到誰誰誰使用了甚麼指令
    我主要認為要從原碼改的原因是我的logs裡面根本就沒有loginlog
    而就算我在別人的資料庫裡面手動增加他也不會存取
    附帶一提 lofin_sql/裡面只有兩個黨login.c 跟 login.h





    在下面附上我的原碼(其實沒動過)

    請各位大大教我要怎麼加入loginlog吧!!!
    回復

    使用道具 舉報

  • TA的每日心情
    擦汗
    2010-7-29 11:52 PM
  • 簽到天數: 6 天

    連續簽到: 0 天

    [LV.2]偶爾看看I

     樓主| 發表於 2009-8-17 20:16:48 | 顯示全部樓層
    在這裡附上我的原碼(其實沒動過)

    1. log.c
    2. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
    3. // For more information, see LICENCE in the main folder
    4. #include "../common/strlib.h"
    5. #include "../common/nullpo.h"
    6. #include "../common/showmsg.h"
    7. #include "battle.h"
    8. #include "itemdb.h"
    9. #include "log.h"
    10. #include "map.h"
    11. #include "mob.h"
    12. #include "pc.h"
    13. #include <stdlib.h>
    14. #include <stdio.h>
    15. #include <string.h>

    16. struct Log_Config log_config;
    17. char timestring[255];
    18. time_t curtime;
    19. //FILTER OPTIONS
    20. //0 = Don't log
    21. //1 = Log any item
    22. //Bits: ||
    23. //2 - Healing items (0)
    24. //3 - Etc Items(3) + Arrows (10)
    25. //4 - Usable Items(2) + Scrolls,Lures(11)
    26. //5 - Weapon(4)
    27. //6 - Shields,Armor,Headgears,Accessories,etc(5)
    28. //7 - Cards(6)
    29. //8 - Pet Accessories(8) + Eggs(7) (well, monsters don't drop 'em but we'll use the same system for ALL logs)
    30. //9 - Log expensive items ( >= price_log)
    31. //10 - Log big amount of items ( >= amount_log)
    32. //11 - Log refined items (if their refine >= refine_log )
    33. //12 - Log rare items (if their drop chance <= rare_log )
    34. //check if this item should be logged according the settings
    35. int should_log_item(int filter, int nameid, int amount)
    36. {
    37.         struct item_data *item_data;
    38.         if ((item_data= itemdb_exists(nameid)) == NULL) return 0;
    39.         if ((filter&1) || // Filter = 1, we log any item
    40.                 (filter&2 && item_data->type == IT_HEALING ) ||
    41.                 (filter&4 && (item_data->type == IT_ETC || item_data->type == IT_AMMO) ) ||
    42.                 (filter&8 && item_data->type == IT_USABLE ) ||
    43.                 (filter&16 && item_data->type == IT_WEAPON ) ||
    44.                 (filter&32 && item_data->type == IT_ARMOR ) ||
    45.                 (filter&64 && item_data->type == IT_CARD ) ||
    46.                 (filter&128 && (item_data->type == IT_PETEGG || item_data->type == IT_PETARMOR) ) ||
    47.                 (filter&256 && item_data->value_buy >= log_config.price_items_log ) ||                //expensive items
    48.                 (filter&512 && abs(amount) >= log_config.amount_items_log ) ||                        //big amount of items
    49.                 (filter&2048 && ((item_data->maxchance <= log_config.rare_items_log) || item_data->nameid == 714) ) //Rare items or Emperium
    50.         ) return item_data->nameid;
    51.         return 0;
    52. }
    53. int log_branch(struct map_session_data *sd)
    54. {
    55.         if(!log_config.enable_logs)
    56.                 return 0;
    57.         nullpo_retr(0, sd);
    58. #ifndef TXT_ONLY
    59.         if( log_config.sql_logs )
    60.         {
    61.                 SqlStmt* stmt;
    62.                 stmt = SqlStmt_Malloc(logmysql_handle);
    63.                 if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "INSERT DELAYED INTO `%s` (`branch_date`, `account_id`, `char_id`, `char_name`, `map`) VALUES (NOW(), '%d', '%d', ?, '%s')", log_config.log_branch_db, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
    64.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
    65.                 ||  SQL_SUCCESS != SqlStmt_Execute(stmt) )
    66.                 {
    67.                         SqlStmt_ShowDebug(stmt);
    68.                         SqlStmt_Free(stmt);
    69.                         return 0;
    70.                 }
    71.                 SqlStmt_Free(stmt);
    72.         }
    73.         else
    74. #endif
    75.         {
    76.                 FILE* logfp;
    77.                 if((logfp = fopen(log_config.log_branch, "a+")) == NULL)
    78.                         return 0;
    79.                 time(&curtime);
    80.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    81.                 fprintf(logfp,"%s - %s[%d:%d]\t%s\n", timestring, sd->status.name, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex));
    82.                 fclose(logfp);
    83.         }
    84.         return 1;
    85. }

    86. int log_pick_pc(struct map_session_data *sd, const char *type, int nameid, int amount, struct item *itm)
    87. {
    88.         nullpo_retr(0, sd);
    89.         if (!should_log_item(log_config.filter, nameid, amount))
    90.                 return 0; //we skip logging this item set - it doesn't meet our logging conditions [Lupus]
    91. #ifndef TXT_ONLY
    92.         if( log_config.sql_logs )
    93.         {
    94.                 if( itm == NULL ) { //We log common item
    95.                         if (SQL_ERROR == Sql_Query(logmysql_handle, "INSERT DELAYED INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `map`) VALUES (NOW(), '%d', '%s', '%d', '%d', '%s')",
    96.                                 log_config.log_pick_db, sd->status.char_id, type, nameid, amount, mapindex_id2name(sd->mapindex)) )
    97.                         {
    98.                                 Sql_ShowDebug(logmysql_handle);
    99.                                 return 0;
    100.                         }
    101.                 } else { //We log Extended item
    102.                         if (SQL_ERROR == Sql_Query(logmysql_handle, "INSERT DELAYED INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`) VALUES (NOW(), '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s')",
    103.                                 log_config.log_pick_db, sd->status.char_id, type, itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], mapindex_id2name(sd->mapindex)) )
    104.                         {
    105.                                 Sql_ShowDebug(logmysql_handle);
    106.                                 return 0;
    107.                         }
    108.                 }
    109.         }
    110.         else
    111. #endif
    112.         {
    113.                 FILE* logfp;
    114.                 if((logfp = fopen(log_config.log_pick, "a+")) == NULL)
    115.                         return 0;
    116.                 time(&curtime);
    117.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    118.                 if( itm == NULL ) { //We log common item
    119.                         fprintf(logfp,"%s - %d\t%s\t%d,%d,%s\n", timestring, sd->status.char_id, type, nameid, amount, mapindex_id2name(sd->mapindex));
    120.                 } else { //We log Extended item
    121.                         fprintf(logfp,"%s - %d\t%s\t%d,%d,%d,%d,%d,%d,%d,%s\n", timestring, sd->status.char_id, type, itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], mapindex_id2name(sd->mapindex));
    122.                 }
    123.                 fclose(logfp);
    124.         }
    125.         
    126.         return 1; //Logged
    127. }
    128. //Mob picked item
    129. int log_pick_mob(struct mob_data *md, const char *type, int nameid, int amount, struct item *itm)
    130. {
    131.         char* mapname;
    132.         nullpo_retr(0, md);
    133.         if (!should_log_item(log_config.filter, nameid, amount))
    134.                 return 0; //we skip logging this item set - it doesn't meet our logging conditions [Lupus]
    135.         //either PLAYER or MOB (here we get map name and objects ID)
    136.         mapname = map[md->bl.m].name;
    137.         if(mapname==NULL)
    138.                 mapname="";
    139. #ifndef TXT_ONLY
    140.         if( log_config.sql_logs )
    141.         {
    142.                 if( itm == NULL ) { //We log common item
    143.                         if (SQL_ERROR == Sql_Query(logmysql_handle, "INSERT DELAYED INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `map`) VALUES (NOW(), '%d', '%s', '%d', '%d', '%s')",
    144.                                 log_config.log_pick_db, md->class_, type, nameid, amount, mapname) )
    145.                         {
    146.                                 Sql_ShowDebug(logmysql_handle);
    147.                                 return 0;
    148.                         }
    149.                 } else { //We log Extended item
    150.                         if (SQL_ERROR == Sql_Query(logmysql_handle, "INSERT DELAYED INTO `%s` (`time`, `char_id`, `type`, `nameid`, `amount`, `refine`, `card0`, `card1`, `card2`, `card3`, `map`) VALUES (NOW(), '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s')",
    151.                                 log_config.log_pick_db, md->class_, type, itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], mapname) )
    152.                         {
    153.                                 Sql_ShowDebug(logmysql_handle);
    154.                                 return 0;
    155.                         }
    156.                 }
    157.         }
    158.         else
    159. #endif
    160.         {
    161.                 FILE *logfp;
    162.                 if((logfp=fopen(log_config.log_pick,"a+")) == NULL)
    163.                         return 0;
    164.                 time(&curtime);
    165.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    166.                 if( itm == NULL ) { //We log common item
    167.                         fprintf(logfp,"%s - %d\t%s\t%d,%d,%s\n", timestring, md->class_, type, nameid, amount, mapname);
    168.                 } else { //We log Extended item
    169.                         fprintf(logfp,"%s - %d\t%s\t%d,%d,%d,%d,%d,%d,%d,%s\n", timestring, md->class_, type, itm->nameid, amount, itm->refine, itm->card[0], itm->card[1], itm->card[2], itm->card[3], mapname);
    170.                 }
    171.                 fclose(logfp);
    172.         }
    173.         
    174.         return 1; //Logged
    175. }
    複製代碼
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    擦汗
    2010-7-29 11:52 PM
  • 簽到天數: 6 天

    連續簽到: 0 天

    [LV.2]偶爾看看I

     樓主| 發表於 2009-8-17 20:19:17 | 顯示全部樓層
    1. int log_zeny(struct map_session_data *sd, char *type, struct map_session_data *src_sd, int amount)
    2. {
    3.         if(!log_config.enable_logs || (log_config.zeny != 1 && abs(amount) < log_config.zeny))
    4.                 return 0;

    5.         nullpo_retr(0, sd);

    6. #ifndef TXT_ONLY
    7.         if( log_config.sql_logs )
    8.         {
    9.                 if (SQL_ERROR == Sql_Query(logmysql_handle, "INSERT DELAYED INTO `%s` (`time`, `char_id`, `src_id`, `type`, `amount`, `map`) VALUES (NOW(), '%d', '%d', '%s', '%d', '%s')",
    10.                          log_config.log_zeny_db, sd->status.char_id, src_sd->status.char_id, type, amount, mapindex_id2name(sd->mapindex)) )
    11.                 {
    12.                         Sql_ShowDebug(logmysql_handle);
    13.                         return 0;
    14.                 }
    15.         }
    16.         else
    17. #endif
    18.         {
    19.                 FILE* logfp;
    20.                 if((logfp=fopen(log_config.log_zeny,"a+")) == NULL)
    21.                         return 0;
    22.                 time(&curtime);
    23.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    24.                 fprintf(logfp, "%s - %s[%d]\t%s[%d]\t%d\t\n", timestring, src_sd->status.name, src_sd->status.account_id, sd->status.name, sd->status.account_id, amount);
    25.                 fclose(logfp);
    26.         }

    27.         return 1;
    28. }

    29. int log_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp)
    30. {
    31.         if(!log_config.enable_logs)
    32.                 return 0;

    33.         nullpo_retr(0, sd);

    34. #ifndef TXT_ONLY
    35.         if( log_config.sql_logs )
    36.         {
    37.                 if (SQL_ERROR == Sql_Query(logmysql_handle, "INSERT DELAYED INTO `%s` (`mvp_date`, `kill_char_id`, `monster_id`, `prize`, `mvpexp`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%s') ",
    38.                         log_config.log_mvpdrop_db, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1], mapindex_id2name(sd->mapindex)) )
    39.                 {
    40.                         Sql_ShowDebug(logmysql_handle);
    41.                         return 0;
    42.                 }
    43.         }
    44.         else
    45. #endif
    46.         {
    47.                 FILE* logfp;
    48.                 if((logfp=fopen(log_config.log_mvpdrop,"a+")) == NULL)
    49.                         return 0;
    50.                 time(&curtime);
    51.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    52.                 fprintf(logfp,"%s - %s[%d:%d]\t%d\t%d,%d\n", timestring, sd->status.name, sd->status.account_id, sd->status.char_id, monster_id, log_mvp[0], log_mvp[1]);
    53.                 fclose(logfp);
    54.         }

    55.         return 1;
    56. }


    57. int log_atcommand(struct map_session_data* sd, const char* message)
    58. {
    59.         if(!log_config.enable_logs)
    60.                 return 0;

    61.         nullpo_retr(0, sd);

    62. #ifndef TXT_ONLY
    63.         if( log_config.sql_logs )
    64.         {
    65.                 SqlStmt* stmt;

    66.                 stmt = SqlStmt_Malloc(logmysql_handle);
    67.                 if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "INSERT DELAYED INTO `%s` (`atcommand_date`, `account_id`, `char_id`, `char_name`, `map`, `command`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", log_config.log_gm_db, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
    68.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
    69.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
    70.                 ||  SQL_SUCCESS != SqlStmt_Execute(stmt) )
    71.                 {
    72.                         SqlStmt_ShowDebug(stmt);
    73.                         SqlStmt_Free(stmt);
    74.                         return 0;
    75.                 }
    76.                 SqlStmt_Free(stmt);
    77.         }
    78.         else
    79. #endif
    80.         {
    81.                 FILE* logfp;
    82.                 if((logfp = fopen(log_config.log_gm, "a+")) == NULL)
    83.                         return 0;
    84.                 time(&curtime);
    85.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    86.                 fprintf(logfp, "%s - %s[%d]: %s\n", timestring, sd->status.name, sd->status.account_id, message);
    87.                 fclose(logfp);
    88.         }
    89.         
    90.         return 1;
    91. }

    92. int log_npc(struct map_session_data* sd, const char* message)
    93. {
    94.         if(!log_config.enable_logs)
    95.                 return 0;

    96.         nullpo_retr(0, sd);

    97. #ifndef TXT_ONLY
    98.         if( log_config.sql_logs )
    99.         {
    100.                 SqlStmt* stmt;
    101.                 stmt = SqlStmt_Malloc(logmysql_handle);
    102.                 if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "INSERT DELAYED INTO `%s` (`npc_date`, `account_id`, `char_id`, `char_name`, `map`, `mes`) VALUES (NOW(), '%d', '%d', ?, '%s', ?)", log_config.log_npc_db, sd->status.account_id, sd->status.char_id, mapindex_id2name(sd->mapindex) )
    103.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, sd->status.name, strnlen(sd->status.name, NAME_LENGTH))
    104.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, 255))
    105.                 ||  SQL_SUCCESS != SqlStmt_Execute(stmt) )
    106.                 {
    107.                         SqlStmt_ShowDebug(stmt);
    108.                         SqlStmt_Free(stmt);
    109.                         return 0;
    110.                 }
    111.                 SqlStmt_Free(stmt);
    112.         }
    113.         else
    114. #endif
    115.         {
    116.                 FILE* logfp;
    117.                 if((logfp = fopen(log_config.log_npc, "a+")) == NULL)
    118.                         return 0;
    119.                 time(&curtime);
    120.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    121.                 fprintf(logfp, "%s - %s[%d]: %s\n", timestring, sd->status.name, sd->status.account_id, message);
    122.                 fclose(logfp);
    123.         }

    124.         return 1;
    125. }

    126. int log_chat(const char* type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message)
    127. {
    128.         // Log CHAT (Global, Whisper, Party, Guild, Main chat)
    129.         // LOGGING FILTERS [Lupus]
    130.         // =============================================================
    131.         // 0 = Don't log at all
    132.         // 1 = Log EVERYTHING!
    133.         // Advanced Filter Bits: ||
    134.         // 02 - Log Global messages
    135.         // 04 - Log Whisper messages
    136.         // 08 - Log Party messages
    137.         // 16 - Log Guild messages
    138.         // 32 - Log Main chat messages
    139.         // 64 - Don't log anything when WOE is on

    140.         //Check ON/OFF
    141.         if(log_config.chat <= 0)
    142.                 return 0; //Deactivated

    143. #ifndef TXT_ONLY
    144.         if( log_config.sql_logs )
    145.         {
    146.                 SqlStmt* stmt;
    147.                
    148.                 stmt = SqlStmt_Malloc(logmysql_handle);
    149.                 if( SQL_SUCCESS != SqlStmt_Prepare(stmt, "INSERT DELAYED INTO `%s` (`time`, `type`, `type_id`, `src_charid`, `src_accountid`, `src_map`, `src_map_x`, `src_map_y`, `dst_charname`, `message`) VALUES (NOW(), '%s', '%d', '%d', '%d', '%s', '%d', '%d', ?, ?)", log_config.log_chat_db, type, type_id, src_charid, src_accid, map, x, y)
    150.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, (char*)dst_charname, safestrnlen(dst_charname, NAME_LENGTH))
    151.                 ||  SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, (char*)message, safestrnlen(message, CHAT_SIZE_MAX))
    152.                 ||  SQL_SUCCESS != SqlStmt_Execute(stmt) )
    153.                 {
    154.                         SqlStmt_ShowDebug(stmt);
    155.                         SqlStmt_Free(stmt);
    156.                         return 0;
    157.                 }
    158.                 SqlStmt_Free(stmt);
    159.         }
    160.         else
    161. #endif
    162.         {
    163.                 FILE* logfp;
    164.                 if((logfp = fopen(log_config.log_chat, "a+")) == NULL)
    165.                         return 0;
    166.                 time(&curtime);
    167.                 strftime(timestring, 254, "%m/%d/%Y %H:%M:%S", localtime(&curtime));
    168.                 fprintf(logfp, "%s - %s,%d,%d,%d,%s,%d,%d,%s,%s\n", timestring, type, type_id, src_charid, src_accid, map, x, y, dst_charname, message);
    169.                 fclose(logfp);
    170.         }

    171.         return 1;
    172. }


    173. void log_set_defaults(void)
    174. {
    175.         memset(&log_config, 0, sizeof(log_config));

    176.         //LOG FILTER Default values
    177.         log_config.refine_items_log = 5; //log refined items, with refine >= +7
    178.         log_config.rare_items_log = 100; //log rare items. drop chance <= 1%
    179.         log_config.price_items_log = 1000; //1000z
    180.         log_config.amount_items_log = 100;        
    181. }
    複製代碼
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    擦汗
    2010-7-29 11:52 PM
  • 簽到天數: 6 天

    連續簽到: 0 天

    [LV.2]偶爾看看I

     樓主| 發表於 2009-8-17 20:20:03 | 顯示全部樓層
    1. int log_config_read(char *cfgName)
    2. {
    3.         static int count = 0;
    4.         char line[1024], w1[1024], w2[1024];
    5.         FILE *fp;

    6.         if ((count++) == 0)
    7.                 log_set_defaults();               

    8.         if((fp = fopen(cfgName, "r")) == NULL)
    9.         {
    10.                 ShowError("Log configuration file not found at: %s\n", cfgName);
    11.                 return 1;
    12.         }        

    13.         while(fgets(line, sizeof(line), fp))
    14.         {
    15.                 if(line[0] == '/' && line[1] == '/')
    16.                         continue;

    17.                 if(sscanf(line, "%[^:]: %[^\r\n]", w1, w2) == 2)
    18.                 {
    19.                         if(strcmpi(w1,"enable_logs") == 0) {
    20.                                 log_config.enable_logs = (log_what)atoi(w2);
    21.                                 if (log_config.enable_logs&1) //Log everything.
    22.                                         log_config.enable_logs = LOG_ALL;
    23.                         } else if(strcmpi(w1,"sql_logs") == 0) {
    24.                                 log_config.sql_logs = (bool)atoi(w2);
    25. //start of common filter settings
    26.                         } else if(strcmpi(w1,"rare_items_log") == 0) {
    27.                                 log_config.rare_items_log = (atoi(w2));
    28.                         } else if(strcmpi(w1,"refine_items_log") == 0) {
    29.                                 log_config.refine_items_log = (atoi(w2));
    30.                         } else if(strcmpi(w1,"price_items_log") == 0) {
    31.                                 log_config.price_items_log = (atoi(w2));
    32.                         } else if(strcmpi(w1,"amount_items_log") == 0) {
    33.                                 log_config.amount_items_log = (atoi(w2));
    34. //end of common filter settings
    35.                         } else if(strcmpi(w1,"log_branch") == 0) {
    36.                                 log_config.branch = (atoi(w2));
    37.                         } else if(strcmpi(w1,"log_filter") == 0) {
    38.                                 log_config.filter = (atoi(w2));
    39.                         } else if(strcmpi(w1,"log_zeny") == 0) {
    40.                                 log_config.zeny = (atoi(w2));
    41.                         } else if(strcmpi(w1,"log_gm") == 0) {
    42.                                 log_config.gm = (atoi(w2));
    43.                         } else if(strcmpi(w1,"log_npc") == 0) {
    44.                                 log_config.npc = (atoi(w2));
    45.                         } else if(strcmpi(w1, "log_chat") == 0) {
    46.                                 log_config.chat = (atoi(w2));
    47.                         } else if(strcmpi(w1,"log_mvpdrop") == 0) {
    48.                                 log_config.mvpdrop = (atoi(w2));
    49.                         }

    50. #ifndef TXT_ONLY
    51.                         else if(strcmpi(w1, "log_branch_db") == 0) {
    52.                                 strcpy(log_config.log_branch_db, w2);
    53.                                 if(log_config.branch == 1)
    54.                                         ShowNotice("Logging Dead Branch Usage to table `%s`\n", w2);
    55.                         } else if(strcmpi(w1, "log_pick_db") == 0) {
    56.                                 strcpy(log_config.log_pick_db, w2);
    57.                                 if(log_config.filter)
    58.                                         ShowNotice("Logging Item Picks to table `%s`\n", w2);
    59.                         } else if(strcmpi(w1, "log_zeny_db") == 0) {
    60.                                 strcpy(log_config.log_zeny_db, w2);
    61.                                 if(log_config.zeny == 1)
    62.                                         ShowNotice("Logging Zeny to table `%s`\n", w2);
    63.                         } else if(strcmpi(w1, "log_mvpdrop_db") == 0) {
    64.                                 strcpy(log_config.log_mvpdrop_db, w2);
    65.                                 if(log_config.mvpdrop == 1)
    66.                                         ShowNotice("Logging MVP Drops to table `%s`\n", w2);
    67.                         } else if(strcmpi(w1, "log_gm_db") == 0) {
    68.                                 strcpy(log_config.log_gm_db, w2);
    69.                                 if(log_config.gm > 0)
    70.                                         ShowNotice("Logging GM Level %d Commands to table `%s`\n", log_config.gm, w2);
    71.                         } else if(strcmpi(w1, "log_npc_db") == 0) {
    72.                                 strcpy(log_config.log_npc_db, w2);
    73.                                 if(log_config.npc > 0)
    74.                                         ShowNotice("Logging NPC 'logmes' to table `%s`\n", w2);
    75.                         } else if(strcmpi(w1, "log_chat_db") == 0) {
    76.                                 strcpy(log_config.log_chat_db, w2);
    77.                                 if(log_config.chat > 0)
    78.                                         ShowNotice("Logging CHAT to table `%s`\n", w2);
    79.                         }
    80. #endif

    81.                         else if(strcmpi(w1, "log_branch_file") == 0) {
    82.                                 strcpy(log_config.log_branch, w2);
    83.                                 if(log_config.branch > 0 && !log_config.sql_logs)
    84.                                         ShowNotice("Logging Dead Branch Usage to file `%s`.txt\n", w2);
    85.                         } else if(strcmpi(w1, "log_pick_file") == 0) {
    86.                                 strcpy(log_config.log_pick, w2);
    87.                                 if(log_config.filter > 0 && !log_config.sql_logs)
    88.                                         ShowNotice("Logging Item Picks to file `%s`.txt\n", w2);
    89.                         } else if(strcmpi(w1, "log_zeny_file") == 0) {
    90.                                 strcpy(log_config.log_zeny, w2);
    91.                                 if(log_config.zeny > 0 && !log_config.sql_logs)
    92.                                         ShowNotice("Logging Zeny to file `%s`.txt\n", w2);
    93.                         } else if(strcmpi(w1, "log_mvpdrop_file") == 0) {
    94.                                 strcpy(log_config.log_mvpdrop, w2);
    95.                                 if(log_config.mvpdrop > 0 && !log_config.sql_logs)
    96.                                         ShowNotice("Logging MVP Drops to file `%s`.txt\n", w2);
    97.                         } else if(strcmpi(w1, "log_gm_file") == 0) {
    98.                                 strcpy(log_config.log_gm, w2);
    99.                                 if(log_config.gm > 0 && !log_config.sql_logs)
    100.                                         ShowNotice("Logging GM Level %d Commands to file `%s`.txt\n", log_config.gm, w2);
    101.                         } else if(strcmpi(w1, "log_npc_file") == 0) {
    102.                                 strcpy(log_config.log_npc, w2);
    103.                                 if(log_config.npc > 0 && !log_config.sql_logs)
    104.                                         ShowNotice("Logging NPC 'logmes' to file `%s`.txt\n", w2);
    105.                         } else if(strcmpi(w1, "log_chat_file") == 0) {
    106.                                 strcpy(log_config.log_chat, w2);
    107.                                 if(log_config.chat > 0 && !log_config.sql_logs)                                       
    108.                                         ShowNotice("Logging CHAT to file `%s`.txt\n", w2);
    109.                         //support the import command, just like any other config
    110.                         } else if(strcmpi(w1,"import") == 0) {
    111.                                 log_config_read(w2);
    112.                         }
    113.                 }
    114.         }

    115.         fclose(fp);
    116.         return 0;
    117. }
    複製代碼
    甚麼都有就是沒有loginlog
    [/code]
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    擦汗
    2010-7-29 11:52 PM
  • 簽到天數: 6 天

    連續簽到: 0 天

    [LV.2]偶爾看看I

     樓主| 發表於 2009-8-17 20:21:17 | 顯示全部樓層
    再來是 log.h 裡面一樣找不到 loginlog


    1. log.h
    2. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
    3. // For more information, see LICENCE in the main folder
    4. #ifndef _LOG_H_
    5. #define _LOG_H_
    6. //#include "map.h"
    7. struct map_session_data;
    8. struct mob_data;
    9. struct item;
    10. //New logs
    11. int log_pick_pc(struct map_session_data *sd, const char *type, int nameid, int amount, struct item *itm);
    12. int log_pick_mob(struct mob_data *md, const char *type, int nameid, int amount, struct item *itm);
    13. int log_zeny(struct map_session_data *sd, char *type, struct map_session_data *src_sd, int amount);
    14. int log_npc(struct map_session_data *sd, const char *message);
    15. int log_chat(const char* type, int type_id, int src_charid, int src_accid, const char* map, int x, int y, const char* dst_charname, const char* message);
    16. int log_atcommand(struct map_session_data *sd, const char *message);
    17. //Old, but useful logs
    18. int log_branch(struct map_session_data *sd);
    19. int log_mvpdrop(struct map_session_data *sd, int monster_id, int *log_mvp);
    20. int log_config_read(char *cfgName);
    21. typedef enum log_what {
    22.         LOG_ALL                 = 0xFFFF,
    23.         LOG_TRADES              = 0x0002,
    24.         LOG_VENDING             = 0x0004,
    25.         LOG_PLAYER_ITEMS        = 0x0008, // dropped/picked
    26.         LOG_MONSTER_ITEMS       = 0x0010, // dropped/looted
    27.         LOG_NPC_TRANSACTIONS    = 0x0020, // npc shops?
    28.         LOG_SCRIPT_TRANSACTIONS = 0x0040,
    29.         LOG_STOLEN_ITEMS        = 0x0080, // stolen from mobs
    30.         LOG_USED_ITEMS          = 0x0100, // used by player
    31.         LOG_MVP_PRIZE           = 0x0200,
    32.         LOG_COMMAND_ITEMS       = 0x0400, // created/deleted through @/# commands
    33.         LOG_STORAGE_ITEMS        = 0x0800, // placed/retrieved from storage
    34.         LOG_GSTORAGE_ITEMS        = 0x1000, // placed/retrieved from guild storage
    35.         LOG_MAILS                = 0x2000  // mail system transactions
    36. } log_what;
    37. extern struct Log_Config {
    38.         enum log_what enable_logs;
    39.         int filter;
    40.         bool sql_logs;
    41.         int rare_items_log,refine_items_log,price_items_log,amount_items_log; //for filter
    42.         int branch, drop, mvpdrop, zeny, gm, npc, chat;
    43.         char log_branch[64], log_pick[64], log_zeny[64], log_mvpdrop[64], log_gm[64], log_npc[64], log_chat[64];
    44.         char log_branch_db[32], log_pick_db[32], log_zeny_db[32], log_mvpdrop_db[32], log_gm_db[32], log_npc_db[32], log_chat_db[32];
    45. } log_config;
    46. #endif /* _LOG_H_ */
    複製代碼


    請各位大大教我要怎麼加入loginlog吧!!!
    回復 支持 反對

    使用道具 舉報

    您需要登錄後才可以回帖 登錄 | 註冊

    本版積分規則

    Archiver|手機版|小黑屋|OK討論區

    GMT+8, 2025-6-30 10:35 PM , Processed in 0.219935 second(s), 19 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回復 返回頂部 返回列表