#ifndef CMD_CORRESPOND_HEAD_FILE
#define CMD_CORRESPOND_HEAD_FILE

#pragma pack(1)

//////////////////////////////////////////////////////////////////////////////////
//ע

#define MDM_CS_REGISTER				1									//ע

//ע
#define SUB_CS_C_REGISTER_PLAZA		100									//ע㳡
#define SUB_CS_C_REGISTER_SERVER	101									//ע᷿

//ע
#define SUB_CS_S_REGISTER_FAILURE	200									//עʧ

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

//ע㳡
struct CMD_CS_C_RegisterPlaza {
    TCHAR							szServerAddr[32];					//ַ
    TCHAR							szServerName[LEN_SERVER];			//
};

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

//עʧ
struct CMD_CS_S_RegisterFailure {
    LONG							lErrorCode;							//
    TCHAR							szDescribeString[128];				//Ϣ
};

//////////////////////////////////////////////////////////////////////////////////
//Ϣ

#define MDM_CS_SERVICE_INFO			2									//Ϣ

//Ϣ
#define SUB_CS_C_SERVER_ONLINE		1									//
#define SUB_CS_C_SERVER_MODIFY		2									//޸

//㳡
#define SUB_CS_S_PLAZA_INFO			100									//㳡Ϣ
#define SUB_CS_S_PLAZA_INSERT		101									//㳡б
#define SUB_CS_S_PLAZA_REMOVE		103									//㳡ɾ
#define SUB_CS_S_PLAZA_FINISH		104									//㳡

//
#define SUB_CS_S_SERVER_INFO		110									//Ϣ
#define SUB_CS_S_SERVER_ONLINE		111									//
#define SUB_CS_S_SERVER_INSERT		112									//б
#define SUB_CS_S_SERVER_MODIFY		113									//޸
#define SUB_CS_S_SERVER_REMOVE		114									//ɾ
#define SUB_CS_S_SERVER_FINISH		115									//

#define SUB_CS_S_TASK_FRESH         120                                 //5ˢϢ

//////////////////////////////////////////////////////////////////////////////////
struct CMD_CS_S_TaskFresh{
	time_t tTaskFreshTime;
};
//
struct CMD_CS_C_ServerModify {
    WORD							wSortID;							//
    WORD							wKindID;							//
    WORD							wNodeID;							//ڵ
    WORD							wServerPort;						//˿
    DWORD							dwOnLineCount;						//
    DWORD							dwFullCount;						//Ա
    TCHAR							szServerAddr[32];					//ַ
    TCHAR							szServerName[LEN_SERVER];			//
	bool							bAcceptNew;							//Ƿ·
};

//
struct CMD_CS_C_ServerOnLine {
    DWORD							dwOnLineCount;						//
};

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

//㳡ɾ
struct CMD_CS_S_PlazaRemove {
    DWORD							dwPlazaID;							//㳡ʶ
};

//
struct CMD_CS_S_ServerOnLine {
    WORD							wServerID;							//ʶ
    DWORD							dwOnLineCount;						//
};

//޸
struct CMD_CS_S_ServerModify {
    WORD							wSortID;							//
    WORD							wKindID;							//
    WORD							wNodeID;							//ڵ
    WORD							wServerID;							//ʶ
    WORD							wServerPort;						//˿
    DWORD							dwOnLineCount;						//
    DWORD							dwFullCount;						//Ա
    TCHAR							szServerAddr[32];					//ַ
    TCHAR							szServerName[LEN_SERVER];			//
	bool							bAcceptNew;							//Ƿ·

};

//ɾ
struct CMD_CS_S_ServerRemove {
    WORD							wServerID;							//ʶ
};

//////////////////////////////////////////////////////////////////////////////////
//û

#define MDM_CS_USER_COLLECT			3									//û

//û״̬
#define SUB_CS_C_USER_ENTER			1									//û
#define SUB_CS_C_USER_LEAVE			2									//û뿪
#define SUB_CS_C_USER_FINISH		3									//û

//û״̬
#define SUB_CS_S_COLLECT_REQUEST	100									//

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

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

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

//û뿪
struct CMD_CS_C_UserLeave {
    DWORD							dwUserID;							//ûʶ
};

//////////////////////////////////////////////////////////////////////////////////
//Զ̷

#define MDM_CS_REMOTE_SERVICE		4									//Զ̷

//ҷ
#define SUB_CS_C_SEARCH_DATABASE	1									//ݲ
#define SUB_CS_C_SEARCH_CORRESPOND	2									//Э

//ҽ
#define SUB_CS_S_SEARCH_DATABASE	100									//ݲ
#define SUB_CS_S_SEARCH_CORRESPOND	101									//Э

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

//Э
struct CMD_CS_C_SearchCorrespond {
    //Ӳ
    DWORD							dwSocketID;							//ʶ
    DWORD							dwClientAddr;						//ӵַ

    //
    DWORD							dwGameID;							//Ϸʶ
    TCHAR							szNickName[LEN_NICKNAME];			//ûǳ
};

//Э
struct CMD_CS_S_SearchCorrespond {
    //Ϣ
    DWORD							dwSocketID;							//ʶ
    DWORD							dwClientAddr;						//ӵַ

    //Ϣ
    WORD							wUserCount;							//ûĿ
    tagUserRemoteInfo				UserRemoteInfo[16];					//ûϢ
};

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

#define MDM_CS_MANAGER_SERVICE		5									//

#define SUB_CS_C_SYSTEM_MESSAGE 	1									//ϵͳϢ
#define SUB_CS_C_PROPERTY_TRUMPET 	2									//Ϣ

#define SUB_CS_S_SYSTEM_MESSAGE 	100									//ϵͳϢ
#define SUB_CS_S_PROPERTY_TRUMPET  	200									//Ϣ


//
struct CMD_CS_S_SendTrumpet {
    WORD                           wPropertyIndex;                      //
    DWORD                          dwSendUserID;                         //û I D
    DWORD                          TrumpetColor;                        //ɫ
    TCHAR                          szSendNickName[32];				    //ǳ
    TCHAR                          szTrumpetContent[TRUMPET_MAX_CHAR];  //
};
//////////////////////////////////////////////////////////////////////////////////
#pragma pack()

#endif