#ifndef _STRUCTURES_H_
#define _STRUCTURES_H_

#define MAX_DESCRIB_LENGTH 1024
#define MAX_STYLE_NUM 80

#pragma once
enum EMessageType{
	e_InvalidMessage,

	e_versionRequest,
	e_versionResponse,
	e_softwareUpdateRequest,
	e_softwareUpdateResponse,
	e_styleUpdateRequest,
	e_styleUpdateResponse,

	e_loginRequest,
	e_loginResponse,
	e_verifyRequest,
	e_verifyResponse,
	e_purchaseRequest,
	e_purchaseResponse,

	e_uploadStyleRequest,
	e_uploadStyleResponse,
	e_dataSendInd,
	e_dataReceivedInd,

	e_udpConnectRequest,
	e_udpConnectResponse,

	e_MessgeTypeEnd
};

enum EExtraInfo{
	e_RequestSuccess,

	e_UpdateNoNeed,
	e_UpdateOptional,
	e_UpdateMandatory,

	e_VerifyInsufficient,

	e_RequestFailed = 0x8000,
	e_SocketError,
	e_WaitTimeout,
	e_DatabaseError,
	e_ParamError,
	e_LoginPasswordError,
	e_LoginUserNotExist,
	e_InvalidUserID,
	e_InvalidStyleID,

	e_UserCanceled,
	e_NoService,
	e_ServiceBusy,

	e_InvalidFileID,
	e_InvalidPackID,
	e_OutOfBound,

	e_ExtraEnd
};

#pragma pack (4)

//用户信息结构体（客户端侧）
typedef struct tUserInfo{
	char    strUserName[80];
	char    strPassword[80];
	int 	ID;		 //用户ID
	int		integral;//积分
	int     grade;	 //等级
	int     vipFlag; //VIP标志
	double  balance; //帐户余额
	int		ownStyleNum; //已购买风格数
	int		arrStyleId[1000]; //已购买风格ID数组

	tUserInfo(){ memset( this, 0, sizeof(tUserInfo) ); };
}TUSERINFO,*PTUSERINFO;

typedef struct tSoftwareInfo{
	WORD    majorVersion;
	WORD	minorVersion;
	WORD	modifyVersion;
	WORD	buildVersion;
    UINT  	nFileSize;
	UINT  	tIssueDate;
	char 	strDescribe[MAX_DESCRIB_LENGTH];
	UINT	nAvaliableStyleNum;
	tSoftwareInfo(){ memset( this, 0, sizeof(tSoftwareInfo) ); };
} TSOFTWAREINFO, *PTSOFTWAREINFO;


#endif