
#ifndef STRUCT_HEAD_FILE
#define STRUCT_HEAD_FILE


#pragma pack(1)

//////////////////////////////////////////////////////////////////////////////////
//Ϸб

//Ϸ
struct tagGameType {
    WORD							wJoinID;							//ҽ
    WORD							wSortID;							//
    WORD							wTypeID;							//
    TCHAR							szTypeName[LEN_TYPE];				//
};

//Ϸ
struct tagGameKind {
    WORD							wTypeID;							//
    WORD							wJoinID;							//ҽ
    WORD							wSortID;							//
    WORD							wKindID;							//
    WORD							wGameID;							//ģ
    DWORD							dwOnLineCount;						//
    DWORD							dwFullCount;						//Ա
    TCHAR							szKindName[LEN_KIND];				//Ϸ
    TCHAR							szProcessName[LEN_PROCESS];			//
    TCHAR                           szGameRuleURL[MAX_PATH];            //Ϸַ
    TCHAR                           szDownLoadURL[MAX_PATH];            //Ϸַ
};

//Ϸڵ
struct tagGameNode {
    WORD							wKindID;							//
    WORD							wJoinID;							//ҽ
    WORD							wSortID;							//
    WORD							wNodeID;							//ڵ
    TCHAR							szNodeName[LEN_NODE];				//ڵ
};

//
struct tagGamePage {
    WORD							wPageID;							//ҳ
    WORD							wKindID;							//
    WORD							wNodeID;							//ڵ
    WORD							wSortID;							//
    WORD							wOperateType;						//
    TCHAR							szDisplayName[LEN_PAGE];			//ʾ
};

//Ϸ
struct tagGameServer {
    WORD							wKindID;							//
    WORD							wNodeID;							//ڵ
    WORD							wSortID;							//
    WORD							wServerID;							//
    WORD							wServerPort;						//˿
    WORD                            wServerType;                        //
    DWORD							dwOnLineCount;						//
    DWORD							dwFullCount;						//Ա
    bool                            bAcceptNew;                         //Ƿڽ·
    TCHAR							szServerAddr[32];					//
    TCHAR							szServerName[LEN_SERVER];			//
};

//Ƶ
struct tagAVServerOption {
    WORD							wAVServerPort;						//Ƶ˿
    DWORD							dwAVServerAddr;						//Ƶַ
};

//Ϣ
struct tagOnLineInfoKind {
    WORD							wKindID;							//ͱʶ
    DWORD							dwOnLineCount;						//
};

//Ϣ
struct tagOnLineInfoServer {
    WORD							wServerID;							//ʶ
    DWORD							dwOnLineCount;						//
};

//////////////////////////////////////////////////////////////////////////////////
//ûϢ

//״̬
struct tagTableStatus {
    BYTE							cbTableLock;						//־
    BYTE							cbPlayStatus;						//Ϸ־
};

//û״̬
struct tagUserStatus {
    WORD							wTableID;							//
    WORD							wChairID;							//λ
    BYTE							cbUserStatus;						//û״̬
};

//û
struct tagUserAttrib {
    BYTE							cbCompanion;						//ûϵ
};

//û
struct tagUserScore {
    //Ϣ
    SCORE							lScore;								//û
    SCORE							lGrade;								//ûɼ
    SCORE							lInsure;							//û

    //ӮϢ
    DWORD							dwWinCount;							//ʤ
    DWORD							dwLostCount;						//ʧ
    DWORD							dwDrawCount;						//;
    DWORD							dwFleeCount;						//

    //ȫϢ
    DWORD							dwUserMedal;						//û
    DWORD							dwExperience;						//û
    LONG							lLoveLiness;						//û
};

//û
struct tagMobileUserScore {
    //Ϣ
    SCORE							lScore;								//û

    //ӮϢ
    DWORD							dwWinCount;							//ʤ
    DWORD							dwLostCount;						//ʧ
    DWORD							dwDrawCount;						//;
    DWORD							dwFleeCount;						//

    //ȫϢ
    DWORD							dwExperience;						//û
};


//ʹ
struct tagUsePropertyInfo {
    WORD                            wPropertyCount;                     //Ŀ
    WORD                            dwValidNum;						    //Ч
    DWORD                           dwEffectTime;                       //Чʱ
};


//û
struct tagUserProperty {
    WORD                            wPropertyUseMark;                   //߱ʾ
    tagUsePropertyInfo              PropertyInfo[MAX_PT_MARK];			//ʹϢ
};

//Ϣ
struct tagUserTaskInfoItem {
    WORD							wTaskID;							//ʶ
    WORD							wFinishCount;						//ɴ
    bool                            bFinished;                          //״̬
    bool                            bAccepted;                          //״̬
};
typedef std::map<int, tagUserTaskInfoItem> Map_Int_UserTaskInfoItem;
//û   ݿ⽻ʱʹ
struct tagUserTaskInfo {
    BYTE							cbTaskCount;						//Ŀ
    time_t							tloadTime;                          //ʱ
    tagUserTaskInfoItem				UserTaskInfo[MAX_TASK_COUNT];		//û
};

struct tagUserTaskInfoMapItem {
    void init() {
        tloadTime = 0;
        mapUserTaskInfo.clear();
    }
    time_t							tloadTime;
    Map_Int_UserTaskInfoItem		mapUserTaskInfo;
};

//߰
struct tagPropertyPackage {
    WORD                            wTrumpetCount;                     //С
    WORD                            wTyphonCount;                      //
};

//ʱϢ
struct tagTimeInfo {
    DWORD						dwEnterTableTimer;						//ʱ
    DWORD						dwLeaveTableTimer;						//뿪ʱ
    DWORD						dwStartGameTimer;						//ʼϷʱ
    DWORD						dwEndGameTimer;							//뿪Ϸʱ
};

//ûϢ
struct tagUserInfo {
    //
    DWORD							dwUserID;							//û I D
    DWORD							dwGameID;							//Ϸ I D
    DWORD							dwGroupID;							// I D
    TCHAR							szNickName[LEN_NICKNAME];			//ûǳ
    TCHAR							szGroupName[LEN_GROUP_NAME];		//
    TCHAR							szUnderWrite[LEN_UNDER_WRITE];		//ǩ
    char                            szHeadImgUrl[LEN_HEAD_IMG_URL];     //ͷurl
    TCHAR                           szLocation[LEN_DWELLING_PLACE];     //Ҷλ

    int                             nAccuracy;                           //λ
	SCORE                            lLocateTime;                         //λʱ

    BYTE                            cbAccountType;						//˻
    //ͷϢ
    WORD							wFaceID;							//ͷ
    DWORD							dwCustomID;							//Զʶ

    //û
    BYTE							cbGender;							//ûԱ
    BYTE							cbMemberOrder;						//Աȼ
    BYTE							cbMasterOrder;						//ȼ

    //û״̬
    WORD							wTableID;							//
    WORD							wChairID;							//
    BYTE							cbUserStatus;						//û״̬
    bool                            bForeground;                        //ֻǰ̨־
    bool                            bDynamicEnter;                      //;־

    //Ϣ
    SCORE							lScore;								//û
    SCORE							lGrade;								//ûɼ
    SCORE							lInsure;							//û

    //ϷϢ
    DWORD							dwWinCount;							//ʤ
    DWORD							dwLostCount;						//ʧ
    DWORD							dwDrawCount;						//;
    DWORD							dwFleeCount;						//
    DWORD							dwUserMedal;						//û
    DWORD							dwExperience;						//û
    LONG							lLoveLiness;						//û

    //ʱϢ
    tagTimeInfo						TimerInfo;							//ʱϢ

    //Ϣ
    BYTE							cbEnlistStatus;						//״̬

    //չʶ
    LONG							lExpand;
    DWORD							dwExpand;
};

//ûϢ
struct tagUserInfoHead {
    //û
    DWORD							dwGameID;							//Ϸ I D
    DWORD							dwUserID;							//û I D
    DWORD							dwGroupID;							// I D

    //ͷϢ
    WORD							wFaceID;							//ͷ
    DWORD							dwCustomID;							//Զʶ

    //û
    BYTE							cbGender;							//ûԱ
    BYTE							cbMemberOrder;						//Աȼ
    BYTE							cbMasterOrder;						//ȼ

    //û״̬
    WORD							wTableID;							//
    WORD							wChairID;							//
    BYTE							cbUserStatus;						//û״̬

    //Ϣ
    SCORE							lScore;								//û
    SCORE							lGrade;								//ûɼ
    SCORE							lInsure;							//û

    //ϷϢ
    DWORD							dwWinCount;							//ʤ
    DWORD							dwLostCount;						//ʧ
    DWORD							dwDrawCount;						//;
    DWORD							dwFleeCount;						//
    DWORD							dwUserMedal;						//û
    DWORD							dwExperience;						//û
    LONG							lLoveLiness;						//û
};

//ͷϢ
struct tagCustomFaceInfo {
    DWORD							dwDataSize;							//ݴС
    DWORD							dwCustomFace[FACE_CX*FACE_CY];		//ͼƬϢ
};

//ûϢ
struct tagUserRemoteInfo {
    //ûϢ
    DWORD							dwUserID;							//ûʶ
    DWORD							dwGameID;							//Ϸʶ
    TCHAR							szNickName[LEN_NICKNAME];			//ûǳ

    //ȼϢ
    BYTE							cbGender;							//ûԱ
    BYTE							cbMemberOrder;						//Աȼ
    BYTE							cbMasterOrder;						//ȼ

    //λϢ
    WORD							wKindID;							//ͱʶ
    WORD							wServerID;							//ʶ
    TCHAR							szGameServer[LEN_SERVER];			//λ
};

//////////////////////////////////////////////////////////////////////////////////

//㳡
struct tagGamePlaza {
    WORD							wPlazaID;							//㳡ʶ
    TCHAR							szServerAddr[32];					//ַ
    TCHAR							szServerName[32];					//
};

//
struct tagLevelItem {
    LONG							lLevelScore;						//
    TCHAR							szLevelName[16];					//
};

//Ա
struct tagMemberItem {
    BYTE							cbMemberOrder;						//ȼʶ
    TCHAR							szMemberName[16];					//ȼ
};

//
struct tagMasterItem {
    BYTE							cbMasterOrder;						//ȼʶ
    TCHAR							szMasterName[16];					//ȼ
};

//б
struct tagColumnItem {
    BYTE							cbColumnWidth;						//б
    BYTE							cbDataDescribe;						//ֶ
    TCHAR							szColumnName[16];					//б
};

//ַϢ
struct tagAddressInfo {
    TCHAR							szAddress[32];						//ַ
};

//Ϣ
struct tagDataBaseParameter {
    WORD							wDataBasePort;						//ݿ˿
    TCHAR							szDataBaseAddr[32];					//ݿַ
    TCHAR							szDataBaseUser[32];					//ݿû
    TCHAR							szDataBasePass[32];					//ݿ
    TCHAR							szDataBaseName[32];					//ݿ
};

//
struct tagServerOptionInfo {
    //ҽ
    WORD							wKindID;							//ҽ
    WORD							wNodeID;							//ҽӽڵ
    WORD							wSortID;							//бʶ

    //˰
    WORD							wRevenueRatio;						//˰ձ
    SCORE							lServiceScore;						//

    //
    SCORE							lRestrictScore;						//ƻ
    SCORE							lMinTableScore;						//ͻ
    SCORE							lMinEnterScore;						//ͻ
    SCORE							lMaxEnterScore;						//߻

    //Ա
    BYTE							cbMinEnterMember;					//ͻԱ
    BYTE							cbMaxEnterMember;					//߻Ա

    //
    DWORD							dwServerRule;						//
    TCHAR							szServerName[LEN_SERVER];			//
};

//ûϢ
struct tagMobileUserInfoHead {
    //û
    DWORD							dwGameID;							//Ϸ I D
    DWORD							dwUserID;							//û I D

    //ͷϢ
    WORD							wFaceID;							//ͷ
    DWORD							dwCustomID;							//Զʶ

    //û
    BYTE							cbGender;							//ûԱ
    BYTE							cbMemberOrder;						//Աȼ

    //û״̬
    WORD							wTableID;							//
    WORD							wChairID;							//
    BYTE							cbUserStatus;						//û״̬

    //Ϣ
    SCORE							lScore;								//û

    //ϷϢ
    DWORD							dwWinCount;							//ʤ
    DWORD							dwLostCount;						//ʧ
    DWORD							dwDrawCount;						//;
    DWORD							dwFleeCount;						//
    DWORD							dwExperience;						//û
};
//////////////////////////////////////////////////////////////////////////////////
//Ϣ
struct tagGameTaskInfoItem {
    tagGameTaskInfoItem() {

        wTaskID = 0;
        cbTaskType = 0;
        cbCondition = 0;
        wAmount = 0;
        cbAwardType = 0;
        lAwardCount = 0;
    }
    WORD							wTaskID;							//ʶ
    BYTE							cbTaskType;							//
    BYTE							cbCondition;						//
    WORD							wAmount;							//
    BYTE							cbAwardType;						//
    LONG							lAwardCount;						//
    WORD							wKindID;							//
};
typedef std::map<int, tagGameTaskInfoItem> Map_Int_GameTaskInfoItem;
typedef Map_Int_GameTaskInfoItem* pMap_Int_GameTaskInfoItem;

//
struct tagSendTaskInfoItem: public tagGameTaskInfoItem {
    WORD							wFinishCount;						//ɴ
};

//
struct tagGameTaskInfo {
    BYTE							cbTaskCount;						//Ŀ
    tagGameTaskInfoItem				GameTaskInfo[MAX_TASK_COUNT];		//
};
#pragma pack()

#endif