StoneAge/gmsv/include/family.h

256 lines
6.7 KiB
C
Raw Normal View History

2018-08-07 15:51:35 +08:00
#ifndef __FAMILY_H__
#define __FAMILY_H__
#include "version.h"
#include "common.h"
#include "util.h"
#include "net.h"
#include "time.h"
#define FAMILY_MAXNUM 1000 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef _FMVER21
#define FAMILY_MAXMEMBER 100 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define FAMILY_MAXCHANNELMEMBER 50 // Ƶ<><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#else
#define FAMILY_MAXMEMBER 50 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define FAMILY_MAXCHANNELMEMBER 10 // Ƶ<><C6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif
#define FAMILY_MAXCHANNEL 5 // <20><><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5>
#define CHAR_MAXNAME 20
#define CHAR_MAXID 20
#define MINFMLEVLEFORPOINT 3 // 3 <20><><EFBFBD><EFBFBD>ׯ԰<D7AF><D4B0><EFBFBD>͵ȼ<CDB5>
#define FMLEADERLV 30 // <20><EFBFBD>ȼ<EFBFBD>
#ifdef _FAMILY_MANORNUM_CHANGE
#define FAMILY_FMPKFLOOR 15 // <20><><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>ͼ<EFBFBD><CDBC>
#else
#define FAMILY_FMPKFLOOR 9 // <20><><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD>ͼ<EFBFBD><CDBC>
#define FMPOINTNUM 4 // <20>оݵ<D0BE><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define MANORNUM 4
#define FAMILY_MAXHOME 4 // <20><><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>
#endif
enum
{
FM_TOP_INTEGRATE = 1, // DPTOP <20>ۺ<EFBFBD>
FM_TOP_ADV, // DPTOP ð<><C3B0>
FM_TOP_FEED, // DPTOP <20><><EFBFBD><EFBFBD>
FM_TOP_SYNTHESIZE, // DPTOP <20>ϳ<EFBFBD>
FM_TOP_DEALFOOD, // DPTOP <20><><EFBFBD><EFBFBD>
FM_TOP_PK, // DPTOP <20>У<EFBFBD>
#ifdef _NEW_MANOR_LAW
FM_TOP_MOMENTUM = 8, // DPTOP <20><><EFBFBD><EFBFBD>
#endif
FM_TOP_NUM, // DPTOP <20><><EFBFBD><EFBFBD>
};
enum
{
FM_FIX_ACCEPTFLAG = 1,
FM_FIX_FMPK,
FM_FIX_FMPET,
FM_FIX_FMRULE,
FM_FIX_DELFMTIME,
FM_FIX_FMGOLD,
FM_FIX_FMADV,
FM_FIX_FMFEED,
FM_FIX_FMSYNTHESIZE,
FM_FIX_FMDEALFOOD,
FM_FIX_FMLEADERCHANGE,
#ifdef _NEW_MANOR_LAW
FM_FIX_FMMOMENTUM,
FM_FIX_FAME,
#endif
};
/*
* <EFBFBD>ӡ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ְ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> cdkey charname <EFBFBD><EFBFBD>Ӯ<EFBFBD><EFBFBD>ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>׻<EFBFBD><EFBFBD><EFBFBD>
* CHEKEYLEN, CHARNAMELEN
* ë<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʣ<EFBFBD>
*/
void CHAR_Family(int fd, int index, char* message);
void ACAddFM(int fd, int result, int fmindex, int index);
void ACJoinFM(int fd, int result, int recv);
void ACLeaveFM(int fd, int result, int resultflag);
void ACDelFM(int fd, int result);
void ACShowFMList(int ret, int fmnum, char *data);
void ACFMDetail(int ret, char *data, int charfdid);
void ACShowMemberList(int result, int index, int fmnumm,
int fmacceptflag, int fmjoinnum, char *data);
void ACShowDpTop(int result,int num, char *data, int kindflag);
void ACShowPointList(int result, char *data);
void ACShowFMMemo(int result, int index, int num, int dataindex, char *data);
#ifdef _PERSONAL_FAME // Arminius: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void ACFMCharLogin(int fd, int ret, int index, int floor, int fmdp,
int joinflag, int fmsetupflag, int flag, int charindex, int charfame
#ifdef _NEW_MANOR_LAW
,int momentum
#endif
);
#else
void ACFMCharLogin(int fd, int ret, int index, int floor, int fmdp,
int joinflag, int fmsetupflag, int flag, int charindex);
#endif
void ACFMPointList(int ret, char *data);
void ACSetFMPoint(int ret, int r, int clifd);
void ACFMAnnounce(int ret, char *fmname, int fmindex, int index, int kindflag,
char *data, int color);
void ACFixFMPK(int winindex, int loseindex, int data);
void ACFMJob( int fd, int ret, char* data1, char* data2 );
void FAMILY_Add(int fd, int meindex, char *message);
void FAMILY_Join(int fd, int meindex, char *message);
void FAMILY_Leave(int fd, int meindex, char *message);
void FAMILY_Detail(int fd, int meindex, char *message);
void FAMILY_CheckMember(int fd, int meindex, char *message);
void FAMILY_Channel(int fd, int meindex, char *message);
void FAMILY_Bank(int fd, int meindex, char *message);
void FAMILY_SetPoint(int fd, int meindex, char *message);
void FAMILY_Init(void);
void FAMILY_SetAcceptFlag(int fd, int meindex, char *message);
void FAMILY_FixRule( int fd, int meindex, char* message );
void FAMILY_RidePet( int fd, int meindex, char* message );
void FAMILY_LeaderFunc( int fd, int meindex, char* message );
#ifdef _CK_ONLINE_PLAYER_COUNT // WON ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void GS_SEND_PLAYER_COUNT(void);
#endif
void SetFMPetVarInit(int meindex);
void SetFMVarInit(int meindex);
int CheckFMLeader(int meindex);
int getFmLv(int playerindex);
void getNewFMList( void );
void checkFamilyIndex( void );
int CheckLeaderQ(int meindex);
// shan add Begin
struct FMMEMBER_LIST
{
// int fmindex;
int fmnum;
int fmjoinnum;
// BOOL use; // 0->ûʹ<C3BB><CAB9> 1->ʹ<><CAB9>
int memberindex[FAMILY_MAXMEMBER];
char numberlistarray[FAMILY_MAXMEMBER][64];
char memo[35][220]; // family dengon
int accept; // <20><>ļ<EFBFBD><C4BC>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD>
int memonum;
int memoindex;
};
// <20><><EFBFBD><EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>԰<EFBFBD>
struct FMS_MEMO
{
char memo[140][220];
int memonum;
int memoindex;
};
// <20><><EFBFBD><EFBFBD>ǿ<EFBFBD>߱<EFBFBD>
struct FMS_DPTOP
{
int num; // <20><>¼<EFBFBD>ж<EFBFBD><D0B6>ٸ<EFBFBD><D9B8><EFBFBD><EFBFBD><EFBFBD>(<28>ۺ<EFBFBD>)
char topmemo[FAMILY_MAXNUM][128];
int fmtopid[FAMILY_MAXNUM]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef _FMVER21
int fmtopdp[FAMILY_MAXNUM]; // <20><><EFBFBD><EFBFBD><EFBFBD>ۺ<EFBFBD><DBBA><EFBFBD><EFBFBD><EFBFBD>
#endif
#ifdef _NEW_MANOR_LAW
int fmMomentum[FAMILY_MAXNUM]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char momentum_topmemo[30][96]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> top
int momentum_topid[FAMILY_MAXNUM]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> top id <20><><EFBFBD><EFBFBD>
#endif
int adv_num; // ð<><C3B0>
char adv_topmemo[30][96];
int feed_num; // <20><><EFBFBD><EFBFBD>
char feed_topmemo[30][96];
int syn_num; // <20>ϳ<EFBFBD>
char syn_topmemo[30][96];
int food_num; // <20><><EFBFBD><EFBFBD>
char food_topmemo[30][96];
int pk_num; // <20>У<EFBFBD>
char pk_topmemo[30][96];
};
// <20><><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>
struct FM_POINTLIST
{
char pointlistarray[FAMILY_MAXHOME][1024]; // Arminius: 32->1024
#ifdef _NEW_MANOR_LAW
int fm_momentum[FAMILY_MAXHOME]; // <20><>¼<EFBFBD><C2BC>սʱ<D5BD>ڿ<EFBFBD>ʼʱ<CABC><CAB1><EFBFBD><EFBFBD>ׯ<EFBFBD><D7AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
BOOL fm_inwar[FAMILY_MAXHOME]; // <20><>ׯ԰<D7AF>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>ׯ԰<D7AF>ų<EFBFBD><C5B3><EFBFBD>
#endif
};
// <20><><EFBFBD><EFBFBD>PKͼ<4B><CDBC>
struct FM_PKFLOOR
{
int fl;
};
// End
#ifdef _NEW_MANOR_LAW
typedef struct _ManorSchedule_t{
int iFmIndex[10]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ս<EFBFBD>ų̵ļ<CCB5><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int iFmMomentum[10]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int iSort[10]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char szMemo[10][256]; // <20><>¼: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>սʱ<D5BD><CAB1>|<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char szFmName[10][32]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
struct tm tm1[10]; // <20><>¼<EFBFBD><C2BC>սʱ<D5BD><CAB1>
}ManorSchedule_t;
extern ManorSchedule_t ManorSchedule[MANORNUM];
#endif
#define MAXFAMILYLIST 120000
extern char familyListBuf[MAXFAMILYLIST];
void JoinMemberIndex( int charaindex, int fmindexi);
#ifdef _DEATH_FAMILY_GM_COMMAND // WON ADD <20><><EFBFBD><EFBFBD>սGMָ<4D><D6B8>
#define fm_pk_max 200
typedef struct _fm_pk_struct
{
int fm_index[fm_pk_max];
int fm_win[fm_pk_max];
int fm_lose[fm_pk_max];
int fm_score[fm_pk_max];
char fm_name[fm_pk_max][30];
}FM_PK_STRUCT;
enum{
FM_INDEX =0,
FM_WIN,
FM_LOSE,
FM_SCORE,
FM_NAME,
};
void setInt_fm_pk_struct( int index, int type, int num );
void setChar_fm_pk_struct( int index, int type, char *msg );
int getInt_fm_pk_struct( int index, int type );
char *getChar_fm_pk_struct( int index, int type );
int get_fm_leader_index( int fm1 );
#endif
#endif