#ifndef __PG_TALK_H__
#define __PG_TALK_H__
#pragma warning (disable:4949)
#include "../../RoleData/RoleBaseDef.h"
#include "..\NetWakerPGEnum.h"
#pragma unmanaged
//----------------------------------------------------------------------------------------
// 事件訊息類別
enum	EM_EVENT_MSG
{
	EM_EVENT_MSG_GIVEQUESTITEM		= 0,
};


//----------------------------------------------------------------------------------------
//與某玩加單一談話
struct PG_Talk_TalkTo
{
    GamePGCommandEnum	Command;

    StaticString <_MAX_NAMESTRING_LEN_> SenderName;
	StaticString <_MAX_NAMESTRING_LEN_> TargetName;

    int 	                            ContentSize;
    StaticString <256>                  Content;
    //char	Content[512];

    PG_Talk_TalkTo()
    {	Command = EM_PG_Talk_TalkTo;	};

    int	Size()
    {
        return sizeof(*this)-sizeof(Content)+ContentSize;
    }

    static int SizeBase()
    {
        PG_Talk_TalkTo Temp;
        return sizeof( Temp ) - sizeof( Temp.Content ) + 1;
    }
    bool CheckPG( )
    {
        if( ContentSize >= sizeof( Content ) )
            return false;
        return true;
    }
};
//----------------------------------------------------------------------------------------
//範圍聊天
struct PG_Talk_Range
{
    GamePGCommandEnum	Command;

    int		GItemID;
    StaticString <_MAX_NAMESTRING_LEN_> Name;
    int 	                            ContentSize;
    StaticString <256>                  Content;


    PG_Talk_Range()
    {	Command = EM_PG_Talk_Range;	};

    int	Size()
    {
        return sizeof(*this)-sizeof(Content)+ContentSize;
    }

    static int SizeBase()
    {
        PG_Talk_Range Temp;
        return sizeof( Temp ) - sizeof( Temp.Content ) + 1;
    }
    bool CheckPG( )
    {

        if( ContentSize >= sizeof( Content ) )
            return false;
        return true;
    }
};
//-----------------------------------------------------------------------------------------------------
enum  TalkChannelTypeENUM
{
	EM_TalkChannelType_Normal	,
	EM_TalkChannelType_Sys		,
	EM_TalkChannelType_GM		,
	
};
//頻道說話
struct PG_Talk_Channel
{
	GamePGCommandEnum	Command;

	GroupObjectTypeEnum Type;
	int					ChannelID;
	TalkChannelTypeENUM	MsgType;

	StaticString <_MAX_NAMESTRING_LEN_> Name;
	int 	                            ContentSize;
	StaticString <256>                  Content;


	PG_Talk_Channel()
	{	Command = EM_PG_Talk_Channel;	};

	int	Size()
	{
		return sizeof(*this)-sizeof(Content)+ContentSize;
	}

	static int SizeBase()
	{
		PG_Talk_Channel Temp;
		return sizeof( Temp ) - sizeof( Temp.Content ) + 1;
	}
	bool CheckPG( )
	{

		if( ContentSize >= sizeof( Content ) )
			return false;
		return true;
	}
};
//-----------------------------------------------------------------------------------------------------
//訊息
struct PG_Talk_LtoC_SystemMsg
{
    GamePGCommandEnum	Command;

    int 	            ContentSize;
    StaticString <256>  Content;


    PG_Talk_LtoC_SystemMsg()
    {	Command = EM_PG_Talk_LtoC_SystemMsg;	};

    int	Size()
    {
        return sizeof(*this)-sizeof(Content)+ContentSize;
    }
    static int SizeBase()
    {
        PG_Talk_LtoC_SystemMsg Temp;
        return sizeof( Temp ) - sizeof( Temp.Content ) + 1;
    }
    bool CheckPG( )
    {

        if( ContentSize >= sizeof( Content ) )
            return false;
        return true;
    }
};
//-----------------------------------------------------------------------------------------------------
//GM命令要求
struct PG_Talk_CtoL_GMCommand
{
    GamePGCommandEnum	Command;

    int		            GItemID;
    int 	            ContentSize;
    StaticString <256>  Content;


    PG_Talk_CtoL_GMCommand()
    {	Command = EM_PG_Talk_CtoL_GMCommand;	};

    int	Size()
    {
        return sizeof(*this)-sizeof(Content)+ContentSize;
    }
    static int SizeBase()
    {
        PG_Talk_CtoL_GMCommand Temp;
        return sizeof( Temp ) - sizeof( Temp.Content ) + 1;
    }
    bool CheckPG( )
    {

        if( ContentSize >= sizeof( Content ) )
            return false;
        return true;
    }
};
//-----------------------------------------------------------------------------------------------------
//玩家送訊息給 GMTools
// Client -> GMTools
struct PG_GM_CtoL_SendMsg
{
    GamePGCommandEnum	Command;
    int 	            ContentSize;
    StaticString <256>  Content;

    PG_GM_CtoL_SendMsg( )
    {	Command = EM_PG_GM_CtoL_SendMsg;	}

    bool CheckPG( )
    {
        if( ContentSize >= sizeof( Content ) )
            return false;
        return true;
    }
};
//-----------------------------------------------------------------------------------------
//GMTools送訊玩家
// GMTools -> Client
struct PG_GM_LtoC_SendMsg
{
    GamePGCommandEnum	Command;
    int 	            ContentSize;
    StaticString <256>  Content;

    PG_GM_LtoC_SendMsg( )
    {	Command = EM_PG_GM_LtoC_SendMsg;	}
};
//-----------------------------------------------------------------------------------------

#pragma managed
#endif //__PG_TALK_H__