#pragma once
#pragma warning (disable:4949)
#include "../../RoleData/RoleBaseDef.h"
#include "..\NetWakerPGEnum.h"
#pragma unmanaged

//-----------------------------------------------------------------------------------------
//		寄件
//-----------------------------------------------------------------------------------------
//要求寄件		
//Client -> Local
struct PG_Mail_CtoL_SendMail
{
	GamePGCommandEnum	Command;

	MailBaseInfoStruct  MailBaseInfo;
	int					ItemPos;	

	int 					ContentSize;
	StaticString <2048>		Content;

	PG_Mail_CtoL_SendMail( )
	{	Command = EM_PG_Mail_CtoL_SendMail;	}

	int	PGSize()
	{
		 return sizeof(*this)-sizeof(Content)+ContentSize;
	}
	static int BasePGSize()
	{
		return sizeof( PG_Mail_CtoL_SendMail) - 2048;
	}
};
//-----------------------------------------------------------------------------------------
//要求寄件結果		
//Local -> Client
enum	SendMailResultEnum
{
	EM_SendMailResult_OK	= 0			,
	EM_SendMailResult_Unknow			,
	EM_SendMailResult_MoneyError		,
	EM_SendMailResult_ItemError			,
	EM_SendMailResult_TargetNotFind		,
	EM_SendMailResult_TargetMailFull	,
	EM_SendMailResult_OwnerNameError	,
	
};
struct PG_Mail_LtoC_SendMailResult
{
	GamePGCommandEnum	Command;

	SendMailResultEnum	Result;

	PG_Mail_LtoC_SendMailResult( )
	{	Command = EM_PG_Mail_LtoC_SendMailResult;	}

};
//-----------------------------------------------------------------------------------------
//要求寄件		
//Local -> DataCenter
struct PG_Mail_LtoD_SendMail
{
	GamePGCommandEnum	Command;
	
	int					DBID;	//要求者的DBID

	MailBaseInfoStruct  MailBaseInfo;

	int 					ContentSize;
	StaticString <2048>		Content;

	PG_Mail_LtoD_SendMail( )
	{	Command = EM_PG_Mail_LtoD_SendMail;	}

	int	PGSize()
	{
		return sizeof(*this)-sizeof(Content)+ContentSize;
	}
};
//-----------------------------------------------------------------------------------------
//要求寄件結果
//DC -> Local
struct PG_Mail_DtoL_SendMailResult
{
	GamePGCommandEnum	Command;

	int					DBID;	//要求者的DBID

	ItemFieldStruct		Item;	//寄送物品

	int		Money;				
	bool	IsSendMoney;		//true 寄送金錢 false 獲到付款
	bool	IsSystem;			//是否為系統信件

	SendMailResultEnum	Result;

	PG_Mail_DtoL_SendMailResult( )
	{	Command = EM_PG_Mail_DtoL_SendMailResult;	}

};
//-----------------------------------------------------------------------------------------
//		收信
//-----------------------------------------------------------------------------------------
//要求郵件列表 
//Client -> Local
struct PG_Mail_CtoL_MailList
{
	GamePGCommandEnum	Command;

	PG_Mail_CtoL_MailList( )
	{	Command = EM_PG_Mail_CtoL_MailList;	}
};
//-----------------------------------------------------------------------------------------
//要求郵件列表
//Local -> DataCenter
struct PG_Mail_LtoD_MailList
{
	GamePGCommandEnum	Command;
	int					DBID;		//要求者的DBID
	int					CliSockID;	//用來直接傳資料給Client
	int					CliProxyID;

	PG_Mail_LtoD_MailList( )
	{	Command = EM_PG_Mail_LtoD_MailList;	}
};
//-----------------------------------------------------------------------------------------
//通知信件總數
//DataCenter -> Client
struct PG_Mail_DtoC_MailListCountResult
{
	GamePGCommandEnum	Command;

	int					MaxCount;	//總量
	int					Count;		//要送出的量



	PG_Mail_DtoC_MailListCountResult( )
	{	Command = EM_PG_Mail_DtoC_MailListCountResult;	}
};
//-----------------------------------------------------------------------------------------
//要求信件列表結果
//DataCenter -> Client
struct PG_Mail_DtoC_MailListResult
{
	GamePGCommandEnum	Command;

	int					MailDBID;	//信件的DBID
	int					Index;		//地幾筆

	MailBaseInfoStruct	MailBaseInfo;
	int					ContentSize;
	StaticString <2048>	Content;

	PG_Mail_DtoC_MailListResult( )
	{	Command = EM_PG_Mail_DtoC_MailListResult;	}

	int	PGSize()
	{
		return sizeof(*this)-sizeof(Content)+ContentSize;
	}
};
//-----------------------------------------------------------------------------------------
//退信
//Client -> Local
struct PG_Mail_CtoL_SendBack
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID

	PG_Mail_CtoL_SendBack( )
	{	Command = EM_PG_Mail_CtoL_SendBack;	}
};
//-----------------------------------------------------------------------------------------
//退信
//Local -> DataCenter
struct PG_Mail_LtoD_SendBack
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID
	int		DBID;		//擁有者

	PG_Mail_LtoD_SendBack( )
	{	Command = EM_PG_Mail_LtoD_SendBack;	}
};
//-----------------------------------------------------------------------------------------
// 刪信
//-----------------------------------------------------------------------------------------
//刪信
//Client -> Local
struct PG_Mail_CtoL_DelMail
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID

	PG_Mail_CtoL_DelMail( )
	{	Command = EM_PG_Mail_CtoL_DelMail;	}
};
//-----------------------------------------------------------------------------------------
//刪信
//Local -> DataCenter
struct PG_Mail_LtoD_DelMail
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID
	int		DBID;		//擁有者

	PG_Mail_LtoD_DelMail( )
	{	Command = EM_PG_Mail_LtoD_DelMail;	}
};
//-----------------------------------------------------------------------------------------
//	閱讀
//-----------------------------------------------------------------------------------------
//閱讀要求
//Client -> Local
struct PG_Mail_CtoL_ReadMail
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID

	PG_Mail_CtoL_ReadMail( )
	{	Command = EM_PG_Mail_CtoL_ReadMail;	}
};
//-----------------------------------------------------------------------------------------
//閱讀要求
//Local -> DataCenter
struct PG_Mail_LtoD_ReadMail
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID
	int		DBID;		//擁有者
//	int		CliSockID;	//用來直接傳資料給Client
//	int		CliProxyID;

	PG_Mail_LtoD_ReadMail( )
	{	Command = EM_PG_Mail_LtoD_ReadMail;	}
};
//-----------------------------------------------------------------------------------------
//閱讀結果
//DataCenter -> Client
/*
struct PG_Mail_DtoC_ReadMailResult
{
	GamePGCommandEnum	Command;

	int					MailDBID;	//信件的DBID
	bool				Result;

	MailBaseInfoStruct  MailBaseInfo;

	int 					ContentSize;
	StaticString <2048>		Content;


	PG_Mail_DtoC_ReadMailResult( )
	{	Command = EM_PG_Mail_DtoC_ReadMailResult;	}

	int	PGSize()
	{
		return sizeof(*this)-sizeof(Content)+ContentSize;
	}
};
*/
//-----------------------------------------------------------------------------------------
//	取物品與金錢
//-----------------------------------------------------------------------------------------
//取物品與金錢
//Client -> Local	
struct PG_Mail_CtoL_GetItem
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID (一定要最後一次讀取的信件)
	int		Money;		//+為獲得 -為付出

	PG_Mail_CtoL_GetItem( )
	{	Command = EM_PG_Mail_CtoL_GetItem;	}
};
//-----------------------------------------------------------------------------------------
//取物品與金錢
//要求 DBCenter 更新資料庫的資訊
//Local	-> DataCenter
struct PG_Mail_LtoD_GetItem
{
	GamePGCommandEnum	Command;
	
	int		DBID;		//擁有者的DBID
	int		MailDBID;	//信件的DBID (一定要最後一次讀取的信件)
	int		Money;		//+為獲得 -為付出

	PG_Mail_LtoD_GetItem( )
	{	Command = EM_PG_Mail_LtoD_GetItem;	}
};
//-----------------------------------------------------------------------------------------
//取物品與金錢 結果
//Local	-> DataCenter
struct PG_Mail_DtoL_GetItemResult
{
	GamePGCommandEnum	Command;
	int		DBID;
	int		MailDBID;	//信件的DBID (一定要最後一次讀取的信件)
	bool	Result;
	int		Money;		//金錢 ( + 獲得  - 付出 )
	ItemFieldStruct		Item;		//寄送物品


	PG_Mail_DtoL_GetItemResult( )
	{	Command = EM_PG_Mail_DtoL_GetItemResult;	}
};
//-----------------------------------------------------------------------------------------
//取物品與金錢 結果
//Local -> Client
struct PG_Mail_LtoC_GetItemResult
{
	GamePGCommandEnum	Command;

	int		MailDBID;	//信件的DBID (一定要最後一次讀取的信件)
	bool	Result;


	PG_Mail_LtoC_GetItemResult( )
	{	Command = EM_PG_Mail_LtoC_GetItemResult;	}
};
//-----------------------------------------------------------------------------------------

#pragma managed

