chuyiwen_gmsv/include/log.h

321 lines
6.4 KiB
C
Raw Normal View History

2016-12-24 08:45:52 +08:00
#ifndef __LOG_H__
#define __LOG_H__
#include <time.h>
typedef enum
{
LOG_TALK,
LOG_PROC,
LOG_ITEM,
LOG_STONE,
LOG_PET,
LOG_TENSEI,
LOG_KILL, //ttom 12/26/2000 kill the pet & items
LOG_TRADE, // CoolFish: 2001/4/19
LOG_HACK, // Arminius 2001/6/14
LOG_SPEED, // Nuke 0626
LOG_FMPOP, // CoolFish: 2001/9/12
LOG_FAMILY, // Robin 10/02
LOG_GM, // Shan
#ifdef _GAMBLE_ROULETTE
LOG_GAMBLE,
#endif
LOG_LOGIN,
PETTRANS,
//Syu <20><><EFBFBD><EFBFBD>ׯ԰սʤ<D5BD><CAA4>Log
LOG_FMPKRESULT,
// Syu ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD>ȡLog (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
LOG_BANKSTONELOG,
LOG_ACMESS,
LOG_PKCONTEND,
#ifdef _STREET_VENDOR
LOG_STREET_VENDOR,
#endif
#ifdef _ANGEL_SUMMON
LOG_ANGEL,
#endif
#ifdef _NEW_MANOR_LAW
LOG_FMPK_GETMONEY,
LOG_FM_FAME_SHOP,
#endif
LOG_LOGOUT,
LOG_TYPE_NUM,
}LOG_TYPE;
void closeAllLogFile( void );
BOOL initLog( char* filename );
void printl( LOG_TYPE logtype, char* format , ... );
void LogAcMess( int fd, char *type, char *mess );
void LogItem(
char *CharName, /* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> */
char *CharID,
int ItemNo, /* ʧ<><CAA7> ة į */
char *Key, /* ƽ<><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int floor, /* <20><> */
int x,
int y,
char *uniquecode, // shan 2001/12/14
char *itemname, int itemID
);
void LogPkContend( char *teamname1, char *teamname2,
int floor, int x, int y, int flg );
void LogPetTrans(
char *cdkey, char *uniwuecde, char *uniwuecde2, char *CharName, int floor, int x, int y,
int petID1, char *PetName1, int petLV, int petrank, int vital1, int str1, int tgh1, int dex1, int total1,
int petID2, char *PetName2, int vital2, int str2, int tgh2, int dex2, int total2,
int work0, int work1, int work2, int work3, int ans, int trans
);
void LogPet(
char *CharName, /* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> */
char *CharID,
char *PetName,
int PetLv,
char *Key, /* ƽ<><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int floor, /* <20><> */
int x,
int y,
char *uniquecode // shan 2001/12/14
);
#ifdef _STREET_VENDOR
void LogStreetVendor(
char *SellName,
char *SellID,
char *BuyName,
char *BuyID,
char *ItemPetName,
int PetLv, //<2F><><EFBFBD>ǵ<EFBFBD><C7B5>ߴ<EFBFBD>ֵΪ -1
int iPrice,
char *Key,
int Sfloor,
int Sx,
int Sy,
int Bfloor,
int Bx,
int By,
char *uniquecode,
int streettype
);
#endif
void LogTensei(
char *CharName, /* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> */
char *CharID,
char *Key, /* ƽ<><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int level, //<2F><>ì<EFBFBD><C3AC>
int transNum, //<2F><>Ϸ<EFBFBD><CFB7><EFBFBD><EFBFBD>
int quest, //<2F>;޵<CDBE><DEB5><EFBFBD><EFBFBD><EFBFBD>
int home, //<2F><><EFBFBD>
int item, // <20><>ʧ<EFBFBD><CAA7> ة <20><>Ի<EFBFBD><D4BB>
int pet, // <20><>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD> <20><>Ի<EFBFBD><D4BB>
int vital, // <20><><EFBFBD><EFBFBD>Vital
int b_vital, // <20><> vital
int str, // <20><><EFBFBD><EFBFBD>str
int b_str, // <20><> str
int tgh, // <20><><EFBFBD><EFBFBD>
int b_tgh, // <20><>
int dex, // <20><><EFBFBD><EFBFBD>
int b_dex // <20><>
);
// Syu ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD>ȡLog (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
void LogFamilyBankStone(
char *CharName,
char *CharId,
int Gold,
int MyGold,
char *Key,
int floor,
int x,
int y,
int banksum
);
void LogStone(
int TotalGold,
char *CharName, /* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> */
char *CharId, /* <20><><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>ID */
int Gold, /* <20>ź<EFBFBD> */
int MyGold,
char *Key, /* ƽ<><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int floor, /* <20><> */
int x,
int y
);
void LogTalk(
char *CharName, /* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> */
char *CharID,
int floor, /* <20><> */
int x,
int y,
char *message
);
//ttom 12/26/2000 kill pet & items
void LogKill(
char *CharName,
char *CharId,
char *CharPet_Item
);
//ttom
// CoolFish: 2001/4/19
void LogTrade(char *message);
// CoolFish: 2001/9/12
void LogFMPOP(char *message);
// Arminius 2001/6/14
enum
{
HACK_NOTHING,
HACK_GETFUNCFAIL,
HACK_NOTDISPATCHED,
HACK_CHECKSUMERROR,
HACK_HP,
HACK_CDKEYWRONG,
HACK_TYPE_NUM,
}HACK_TYPE;
void logHack(int fd, int errcode);
void logHackKick(int fd);
// Nuke 0626
void logSpeed(int fd);
void closeAllLogFile( void );
int openAllLogFile( void );
// Robin 10/02
void LogFamily(
char *FMName,
int fmindex,
char *charName,
char *charId,
char *keyWord,
char *data
);
// Shan 11/02
void LogGM(
char *CharName, //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
char *CharID, //<2F><><EFBFBD><EFBFBD>ID
char *Message, //ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int floor,
int x,
int y
);
void LogLogin(
char *CharID, //<2F><><EFBFBD><EFBFBD>ID
char *CharName, //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
int saveIndex,
char *ipadress,char *pcid
);
void LogLogout(
char *CharID, //<2F><><EFBFBD><EFBFBD>ID
char *CharName, //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
int floor,
int hp,
char *file,
int line
);
void LogCreatFUPet(
char *PetName, int petid, int lv, int hp,
int vital, int str, int tgh, int dex,
int fixstr, int fixtgh, int fixdex, int trans, int flg);
#ifdef _GAMBLE_ROULETTE
void LogGamble(
char *CharName, //<2F><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
char *CharID, //<2F><><EFBFBD><EFBFBD>ID
char *Key, //˵<><CBB5>
int floor,
int x,
int y,
int player_stone, //<2F><>ӵ<EFBFBD>н<EFBFBD>Ǯ
int Gamble_stone, //<2F><>ע<EFBFBD><D7A2><EFBFBD><EFBFBD>
int get_stone, //<2F><><EFBFBD><EFBFBD>
int Gamble_num,
int flg //flg = 1 <20><><EFBFBD><EFBFBD> 2 ׯ<><D7AF>
);
#endif
void LogBankStone(
char *CharName, /* ƽ<>ҷ<EFBFBD><D2B7><EFBFBD><EFBFBD><EFBFBD> */
char *CharId, /* <20><><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>ID */
int meindex,
int Gold, /* <20>ź<EFBFBD> */
char *Key, /* ƽ<><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int floor, /* <20><> */
int x,
int y,
int my_gold,
int my_personagold
);
//Syu <20><><EFBFBD><EFBFBD>ׯ԰սʤ<D5BD><CAA4>Log
void Logfmpk(
char *winner, int winnerindex, int num1,
char *loser, int loserindex, int num2, char *date, char *buf1, char *buf2, int flg);
#ifdef _NEW_MANOR_LAW
void LogFMPKGetMomey(
char *szFMName,
char *szID,
char *szCharName,
int iMomentum,
int iGetMoney,
int iDest
);
void LogFMFameShop(
char *szFMName,
char *szID,
char *szCharName,
int iFame,
int iCostFame
);
#endif
void backupAllLogFile( struct tm *ptm );
void LogPetPointChange(
char * CharName, char *CharID, char *PetName, int petindex, int errtype,
int PetLv, char *Key,int floor, int x, int y);
void LogPetFeed(
char * CharName, char *CharID, char *PetName, int petindex,
int PetLv, char *Key,int floor, int x, int y, char *ucode);
#ifdef _ANGEL_SUMMON
void LogAngel( char *msg);
#endif
void Logfmpk_war(int dueltime,int mytime);
void warplog_to_file( void );
void warplog_from_file( void );
typedef struct {
int floor;
int incount;
int outcount;
}tagWarplog;
#define MAXMAPNUM 700
extern tagWarplog warplog[MAXMAPNUM];
typedef struct {
int floor1;
int floor2;
int count;
}tagWarpCount;
#define MAXMAPLINK 1000
extern tagWarpCount warpCount[MAXMAPLINK];
#endif