#ifndef __NETWAKERPGEM_H__
#define __NETWAKERPGEM_H__

//-----------------------------------------------------------------------------------
#include "../NetWaker/NetWakerDefine.h"
#include "SmallObj/StaticString.h"
//-----------------------------------------------------------------------------------
#pragma		warning (disable:4200)
#define _MAX_NAMESTRING_LEN_		    32          //角色名稱長度
#define _Def_Max_ZoneID_                255         //最多給個 區域
#define _Def_Max_ItemID_                10000       //區域最多幾個物件
#define _Def_WorldItemID_Base_          100000      //基本區域配發id的區塊大小
//-----------------------------------------------------------------------------------
#define Def_Item_Pos_Body		0
#define Def_Item_Pos_Bank		1
#define Def_Item_Pos_EQ     	2
#define Def_Item_Pos_BodyMoney	3
#define Def_Item_Pos_BankMoney	4
//-----------------------------------------------------------------------------------
enum	GamePGCommandEnum
{
    EM_PG__NULL                    = -1        ,
    // 測試資料
    EM_PG_Test_CliToGSrv           = 0         ,
    EM_PG_Test_GSrvToCli                       ,
    EM_PG_Test_GSrvToAllCli                    ,
    EM_PG_Test_GSrvToGSrv                      ,

    // 角色連結 GSrv 的封包
    EM_PG_CliConnect_LtoC_PlayerItemID = 10    ,
    EM_PG_CliConnect_LtoC_ZoneInfo             ,
    EM_PG_CliConnect_LtoC_PlayerData           ,    
    EM_PG_CliConnect_LtoC_PrepareChangeZone    ,
    EM_PG_CliConnect_LtoC_ChangeZoneOK         ,
    EM_PG_CliConnect_CtoL_RequestLogout        ,
    EM_PG_CliConnect_LtoL_ChangeZoneNodify     ,
    EM_PG_CliConnect_LtoC_ModifyNPCInfo        ,
    EM_PG_CliConnect_CtoL_ModifyNPCInfo        ,
	EM_PG_CliConnect_LtoL_ChangeZoneNodifyOK   ,

    // 動做位置 的封包
    EM_PG_Move_LtoC_AddToPartition = 20        ,
    EM_PG_Move_LtoC_DelFromPartition           ,
    EM_PG_Move_LtoC_SetPostion                 ,
    EM_PG_Move_LtoC_ObjectMove                 ,
    EM_PG_Move_CtoL_PlayerMoveObject           ,
    EM_PG_Move_LtoC_DoAction                   ,
    EM_PG_Move_LtoC_MoveSpeed                  ,
    EM_PG_Move_LtoC_ModelRate                  ,
    EM_PG_Move_LtoC_EQInfo                     ,
    EM_PG_Move_LtoC_FixEQInfo                  ,
    EM_PG_Move_LtoC_LookFace                   ,
    EM_PG_Move_CtoL_DoAction                   ,
    EM_PG_Move_LtoC_ClientAutoPlot             ,
    EM_PG_Move_LtoC_ActionType                 ,
    EM_PG_Move_CtoL_JumpBegin                  ,
    EM_PG_Move_LtoC_JumpBegin                  ,
    EM_PG_Move_CtoL_JumpEnd                    ,
    EM_PG_Move_LtoC_JumpEnd                    ,
    EM_PG_Move_LtoC_Relation                   ,
	EM_PG_Move_LtoC_PartyMemberMove			   ,
	EM_PG_Move_LtoC_PlayMotion                 ,

	// SERVER LIST
	EM_PG_SL_SL2SL_RequestServerData			= 40,
	EM_PG_SL_SL2SL_RegsiterServerData			,
	EM_PG_SL_SL2SL_TransmitServerData			,
	EM_PG_SL_SL2SL_RegSrvDataFailed				,
	EM_PG_SL_SL2SL_LocalID						,



    EM_PG_ChannelBase_toChat_DataTransmitToGSrv_Group = 50,
    EM_PG_ChannelBase_toChat_DataTransmitToCli_Group    ,
    EM_PG_ChannelBase_toChat_DataTransmitToSrv          ,
    EM_PG_ChannelBase_toChat_DataTransmitToCli          ,

    EM_PG_ChannelBase_LtoChat_CreateChannel             ,
    EM_PG_ChannelBase_ChattoL_CreateChannelResult       ,
    EM_PG_ChannelBase_LtoChat_AddUser                   ,
    EM_PG_ChannelBase_ChattoL_AddUserResult             ,
    EM_PG_ChannelBase_LtoChat_DelUser                   ,
    EM_PG_ChannelBase_ChattoL_DelUserResult             ,
	
	EM_PG_ChannelBase_CtoL_CreateChannel				,
	EM_PG_ChannelBase_LtoC_CreateChannelResult			,
	EM_PG_ChannelBase_CtoL_JoinChannel					,
	EM_PG_ChannelBase_LtoC_JoinChannelResult			,
	EM_PG_ChannelBase_CtoL_LeaveChannel					,
	EM_PG_ChannelBase_LtoC_LeaveChannelResult			,
	EM_PG_ChannelBase_CtoChat_DataTransmitToCli_Group	,
	EM_PG_ChannelBase_ChattoC_DataTransmitCliToCli		,

    EM_PG_ChannelBase_LtoChat_UserChangeZone            ,
	EM_PG_ChannelBase_ChattoC_ClientConnectToChat		,

	EM_PG_ChannelBase_ChattoL_AddorSetOnlinePlayer		,
	EM_PG_ChannelBase_ChattoL_DelOnlinePlayer			,
	EM_PG_ChannelBase_CtoChat_DataTransmitToCli_Name	,

	EM_PG_ChannelBase_CtoChat_ChannelPlayerList			,
	EM_PG_ChannelBase_ChattoC_ChannelPlayerListResult	,
	EM_PG_ChannelBase_CtoChat_JoinPlayerDisabled		,
	EM_PG_ChannelBase_ChattoC_JoinPlayerDisabledResult	,
	EM_PG_ChannelBase_CtoChat_KickPlayer				,
	EM_PG_ChannelBase_CtoChat_SetManager				,
	EM_PG_ChannelBase_ChattoC_SysChannel				,

	EM_PG_ChannelBase_CtoChat_ZoneChannelID				,


    EM_PG_Talk_TalkTo                                = 150 ,    
    EM_PG_Talk_Range                                    ,
    EM_PG_Talk_Zone                                     ,
    EM_PG_Talk_LtoC_SystemMsg                           ,
    EM_PG_Talk_CtoL_GMCommand                           ,
	EM_PG_Talk_LtoC_EventMsg							,
	EM_PG_Talk_Channel									,

	EM_PG_Talk_CtoL_Party								,
	EM_PG_Talk_LtoC_Party								,
	EM_PG_Talk_CtoL_Guild								,
	EM_PG_Talk_LtoC_Guild								,

    EM_PG_DCBase_XtoD_SavePlayer                    = 170,
    EM_PG_DBBase_DtoX_SavePlayerError                   ,
    EM_PG_DCBase_LtoD_SaveNPCRequest					,
    EM_PG_DCBase_DtoL_SaveNPCResult						,
    EM_PG_DBBase_LtoD_DropNPCRequest                    ,
    EM_PG_DBBase_DtoL_DropNPCResult                     ,
    EM_PG_DBBase_LtoD_LoadAllNPC                        ,
    EM_PG_DBBase_DtoL_LoadAllNPCResult                  ,
    EM_PG_DBBase_XtoD_SetPlayerLiveTime                 ,
    EM_PG_DBBase_DtoX_SetPlayerLiveTimeError            ,
    EM_PG_DBBase_XtoD_SetPlayerLiveTime_ByAccount       ,
    EM_PG_DBBase_DtoX_SetPlayerLiveTimeError_ByAccount  ,
	EM_PG_DBBase_LtoD_LoadAllNPCMoveInfo				,
	EM_PG_DBBase_DtoL_NPCMoveInfoResult					,
	EM_PG_DBBase_LtoD_SaveNPCMoveInfo					,



	// Master Server
	// Login , Client 剛連入時, 取出資料用
	EM_PG_Login_M2C_IdentifyMaster				= 200,
	EM_PG_Login_M2D_LoadAccountData				,
	EM_PG_Login_D2M_RoleData					,
	EM_PG_Login_D2M_RoleDataCount				,
	EM_PG_Login_D2M_LoadAccountFailed			,

	EM_PG_Login_M2C_SampleRoleData				,
	EM_PG_Login_M2C_SampleRoleDataEnd			,

	EM_PG_Login_C2M_CreateRole					,
	EM_PG_Login_M2C_CreateRoleResult			,
	EM_PG_Login_M2D_CreateRole					,
	EM_PG_Login_D2M_CreateRoleResult			,

	EM_PG_Login_C2M_DeleteRole					,
	EM_PG_Login_M2C_DeleteRoleResult			,
	EM_PG_Login_M2D_DeleteRole					,
	EM_PG_Login_D2M_DeleteRoleResult			,

	EM_PG_Login_C2M_SelectRole					,	
	EM_PG_Login_M2L_SetRoleToWorld				,
	EM_PG_Login_L2M_SetRoleToWorldResult		,
	EM_PG_Login_M2C_SelectRoleResult			,

	EM_PG_Login_M2C_EnterWorld					,
	EM_PG_Login_M2C_LeaveWorld					,
	
	EM_PG_Login_M2D_ClientLogout				,

	// LocalServer 和 Master 間狀態溝通
	EM_PG_ZoneStatus_L2M_RoleEnterZone			= 270,
	EM_PG_ZoneStatus_L2M_RoleLeaveZone			,
	EM_PG_ZoneStatus_M2L_RequestZoneSrvReg		,
    EM_PG_ZoneStatus_L2M_ZoneSrvReg            ,
    EM_PG_ZoneStatus_M2L_ZoneSrvRegResult      ,
	EM_PG_ZoneStatus_L2M_ZoneSrvOkay			,
	EM_PG_ZoneStatus_L2M_RoleLeaveWorld			,

    //Partition 使用的封包
    EM_PG_PartBase_LtoP_SetLocal                = 300 , 
    EM_PG_PartBase_LtoP_AddObj                  ,
    EM_PG_PartBase_LtoP_MoveObj                 ,
    EM_PG_PartBase_LtoP_DelObj                  ,
    EM_PG_PartBase_PtoL_OnAddtoOtherSrv         ,
    EM_PG_PartBase_PtoL_OnAdd                   ,
    EM_PG_PartBase_PtoL_OnDelFromOtherSrv       ,
    EM_PG_PartBase_PtoL_OnDel                   ,
    EM_PG_PartBase_LtoP_DataTransfer            ,
    EM_PG_PartBase_PtoL_MoveObj                 ,
    EM_PG_PartBase_PtoL_ChangeZone              ,

    //區域重疊資料傳輸
    EM_PG_Part_LtoL_NewMirrorRole               = 350,
    EM_PG_Part_LtoL_ModifyMirrorRole            ,
    EM_PG_Part_LtoL_SettingStr                  ,
    EM_PG_Part_LtoL_SettingNumber               ,

    //物品
    EM_PG_Item_CtoL_GetGroundItem               ,
    EM_PG_Item_LtoC_GetItemResult               ,
    EM_PG_Item_LtoC_ClsItemInBuffer             ,
    EM_PG_Item_LtoC_NewItemInBuffer             ,
    EM_PG_Item_CtoL_GetBufferItem               ,
    EM_PG_Item_CtoL_DeleteItem                  ,
    EM_PG_Item_LtoC_DeleteItem                  ,
    EM_PG_Item_CtoL_ExchangeField               ,
    EM_PG_Item_LtoC_ExchangeField               ,
    EM_PG_Item_CtoL_RequestBodyBankMoneyExchange,
    EM_PG_Item_LtoC_BodyBankMoneyExchange       ,
    EM_PG_Item_CtoL_RequestBufferInfo           ,
    EM_PG_Item_CtoL_RequestApartBodyItem        ,
    EM_PG_Item_LtoC_FixItemInfo                 ,
    EM_PG_Item_CtoL_RequestFixAllItemInfo       ,
    EM_PG_Item_LtoC_FixAllItemInfo              ,
    EM_PG_Item_LtoC_FixMoney                    ,
    EM_PG_Item_LtoC_MaxItemCount                ,
    EM_PG_Item_LtoC_OpenBank                    ,
    EM_PG_Item_CtoL_CloseBank                   ,
	EM_PG_Item_LtoC_CloseBank                   ,
    EM_PG_Item_CtoL_UseItem                     ,
	EM_PG_Item_LtoC_UseItemResult               ,
	EM_PG_Item_LtoC_SetKeyItemFlag				,

    //裝備
    EM_PG_EQ_CtoL_SetEQ                         ,
    EM_PG_EQ_LtoC_SetEQResult                   ,

    EM_PG_Attack_CtoL_AttackSignal              = 400   , 
    EM_PG_Attack_LtoC_AttackResult              ,
    EM_PG_Attack_LtoC_Dead                      ,
    EM_PG_Attack_LtoC_Resurrection              ,
    EM_PG_Attack_CtoL_RequestResurrection       ,
    EM_PG_Attack_LtoC_HPMPSP                    ,
    EM_PG_Attack_LtoC_MaxHPMaxMPMaxSP           ,
    EM_PG_Attack_CtoL_EndAttackSignal           ,
    EM_PG_Attack_LtoC_AttackSignalResult        ,
    //EM_PG_Attack_CtoL_SetAttackMode             ,
	EM_PG_Attack_LtoC_PartyMemberHPMPSP			,
	EM_PG_Attack_LtoC_PartyMemberMaxHPMPSP		,

    //數值修正
    EM_PG_RoleValue_CtoL_RequestFixRoleValue    = 450 , 
    EM_PG_RoleValue_LtoC_FixAllRoleValue        ,
    EM_PG_RoleValue_LtoC_FixRoleValue           ,
    EM_PG_RoleValue_CtoL_RequestSetPoint        ,
    EM_PG_RoleValue_LtoC_ResultSetPoint         ,
    EM_PG_RoleValue_LtoC_NotifyLvUp             ,
    EM_PG_RoleValue_LtoC_SetTitleFlag           ,
    EM_PG_RoleValue_LtoC_SetFlag                ,
    EM_PG_RoleValue_CtoL_SetTitlRequest         ,
    EM_PG_RoleValue_LtoC_SetTitleResult         ,
    EM_PG_RoleValue_LtoC_Title                  ,
    EM_PG_RoleValue_LtoC_LevelUp                ,

    //玩家交易
    EM_PG_Trade_CtoL_RequestTrade               = 500 ,
    EM_PG_Trade_LtoC_RequestTrade               ,
    EM_PG_Trade_CtoL_AgreeTrade                 ,
    EM_PG_Trade_LtoC_OpenTrade                  ,
    EM_PG_Trade_CtoL_PutItem                    ,
    EM_PG_Trade_LtoC_TargetPutItem              ,
    EM_PG_Trade_CtoL_PutMoney                   ,
    EM_PG_Trade_LtoC_TargetPutMoney             ,
    EM_PG_Trade_LtoC_OwnerPutMoney              ,
    EM_PG_Trade_CtoL_ItemOK                     ,
    EM_PG_Trade_LtoC_TargetItemOK               ,
    EM_PG_Trade_LtoC_CancelItemOK               ,
    EM_PG_Trade_LtoC_FinalOKEnable              ,
    EM_PG_Trade_CtoL_FinalOK                    ,
    EM_PG_Trade_LtoC_TargetFinalOK              ,
    EM_PG_Trade_LtoC_ClearTradeItem             ,
    EM_PG_Trade_LtoC_TradeItemResult            ,
    EM_PG_Trade_CtoL_StopTrade                  ,
    EM_PG_Trade_LtoC_PutItemResult              ,
	EM_PG_Trade_LtoC_RequestTradeError			,
	EM_PG_Trade_LtoC_DisagreeTrade				,

	// Quest 及 Script 系統
	EM_PG_Script_CtoL_QuestAccept				= 550 ,
	EM_PG_Script_CtoL_QuestComplete				,
	EM_PG_Script_CtoL_QuestDelete				,
	EM_PG_Script_CtoL_TouchEvent				,
	EM_PG_Script_CtoL_RangeEvent				,
	EM_PG_Script_CtoL_TouchObj					,
	EM_PG_Script_LtoC_QuestAccept_Result		,
	EM_PG_Script_LtoC_QuestComplete_Result		,
	EM_PG_Script_LtoC_QuestDelete_Result		,
	EM_PG_Script_LtoC_QuestFlag					,			// GM Command
	EM_PG_Script_CtoL_ClickQuestObj				,
	EM_PG_Script_CtoL_ClickQuestObjFailed		,
	EM_PG_Script_LtoC_ClickQuestObjResult		,
	EM_PG_Script_LtoC_QuestKillObjNotify		,
	EM_PG_Script_LtoC_PlayMotion				,


    //魔法封包
    EM_PG_Magic_CtoL_BeginSpell                 = 600 , 
    EM_PG_Magic_CtoL_BeginSpellSP               ,
    EM_PG_Magic_LtoC_BeginSpell                 ,
    EM_PG_Magic_LtoC_EndSpell                   ,
    EM_PG_Magic_LtoC_BeginSpellResult           ,
    EM_PG_Magic_LtoC_MagicAttack                ,
    EM_PG_Magic_LtoC_MagicAssistResult          ,
    EM_PG_Magic_LtoC_FixAssistMagicTime         ,
    EM_PG_Magic_LtoC_CancelSpellMagic           ,
    EM_PG_Magic_CtoL_SetMagicPoint              ,
    EM_PG_Magic_LtoC_SetMagicPointResult        ,
	EM_PG_Magic_CtoL_BeginSpell_Pos				,
	EM_PG_Magic_LtoC_AddBuffInfo				,
	EM_PG_Magic_LtoC_DelBuffInfo				,
	EM_PG_Magic_LtoC_ResetColdown				,
	EM_PG_Magic_LtoC_CancelAssistMagic			,
	EM_PG_Magic_LtoC_BeginShoot					,
	EM_PG_Magic_LtoC_SysBeginShoot				,
	EM_PG_Magic_LtoC_SysEndShoot				,
	EM_PG_Magic_LtoC_MagicShieldInfo			,


    //GMTools
    EM_PG_GM_LToGM_ZoneInfo                     = 650 ,
    EM_PG_GM_LToGM_PlayerInfo                   ,
    EM_PG_GM_LToGM_NPCInfo                      ,
    EM_PG_GM_LToGM_DelPlayer                    ,
    EM_PG_GM_LToGM_DelNPC                       ,
    EM_PG_GM_GMtoL_ObjectDataRequest            ,
    EM_PG_GM_LtoGM_ObjectData                   ,
    EM_PG_GM_CtoL_SendMsg                       ,
    EM_PG_GM_LtoGM_SendMsg                      ,
    EM_PG_GM_GMtoL_SendMsg                      ,
    EM_PG_GM_LtoC_SendMsg                       ,
    EM_PG_GM_LtoGM_SrvSysMsg                    ,

    //商店
    EM_PG_Shop_LtoC_ShopOpen                    = 700 , 
    EM_PG_Shop_LtoC_ShopClose                   ,
    EM_PG_Shop_CtoL_ShopCloseNotify             ,
    EM_PG_Shop_CtoL_BuyItemRequest              ,
    EM_PG_Shop_LtoC_BuyItemResult               ,
    EM_PG_Shop_CtoL_SelectSellItemRequest       ,
    EM_PG_Shop_LtoC_SelectSellItemResult        ,
    EM_PG_Shop_CtoL_RepairWeaponRequest         ,
    EM_PG_Shop_LtoC_RepairWeaponResult          ,

	EM_PG_Shop_LtoC_AddSellItemRecord			,
	EM_PG_Shop_LtoC_DelSellItemRecord			,
	EM_PG_Shop_CtoL_BuySellItemRecord			,
	EM_PG_Shop_LtoC_FixShopItemCount			,

	//Party 
	EM_PG_Party_CtoChat_Invite					= 800 ,
	EM_PG_Party_ChattoC_Invite					,
	EM_PG_Party_CtoChat_Join					,
	EM_PG_Party_ChattoL_PartyBaseInfo			,
	EM_PG_Party_ChattoL_AddMember				,
	EM_PG_Party_ChattoL_DelMember				,
	EM_PG_Party_ChattoC_PartyBaseInfo			,
	EM_PG_Party_ChattoC_AddMember				,
	EM_PG_Party_ChattoC_DelMember				,
	EM_PG_Party_ChattoC_FixMember				,
	EM_PG_Party_CtoChat_KickMember				,
	EM_PG_Party_CtoChat_PartyRule				,
	EM_PG_Party_LtoC_PartyMemberInfo			,
	EM_PG_Party_ChattoL_FixMember				,
	//Party 物品分配
	EM_PG_Party_LtoChat_PartyTreasure			,
	EM_PG_Party_ChattoC_PartyTreasure			,
	EM_PG_Party_ChattoL_GiveItem				,
	EM_PG_Party_ChattoC_PartyTreasureLoot		,
	EM_PG_Party_CtoChat_PartyTreasureLoot		,
	EM_PG_Party_ChattoC_GiveItemInfo			,

	EM_PG_Party_LtoC_PartyMemberHPMPSP			,
	EM_PG_Party_LtoC_PartyMemberMaxHPMPSP		,

	//其它
	EM_PG_Other_LtoL_RequestPlayerPos			= 850 , 
	EM_PG_Other_LtoL_PlayerPos					,
	EM_PG_Other_LtoL_CallPlayer					,

	//好友名單
	EM_PG_Friend_CtoChat_BefriendRequest		= 900 ,
	EM_PG_Friend_ChattoC_BefriendRequest		,
	EM_PG_Friend_CtoChat_BefriendResult			,
	EM_PG_Friend_ChattoL_AddFriend				,
	EM_PG_Friend_LtoC_AddFriend					,
	EM_PG_Friend_LtoChat_AddFriendNotFound		,
	EM_PG_Friend_CtoL_DelFriend					,
	EM_PG_Friend_LtoC_DelFriend					,
	EM_PG_Friend_LtoC_FriendList				,
	
	EM_PG_Friend_LtoChat_RegisterInfo			,
	EM_PG_Friend_ChattoC_PlayerOnline			,
	EM_PG_Friend_ChattoC_PlayerOffline			,
	EM_PG_Friend_CtoL_ModifyMyInfo				,
	EM_PG_Friend_LtoChat_ModifyInfo				,
	EM_PG_Friend_ChattoC_ModifyInfo				,
	EM_PG_Friend_CtoL_AddBadFriend				,
	EM_PG_Friend_CtoL_DelBadFriend				,
	EM_PG_Friend_LtoChat_AddFriend				,
	EM_PG_Friend_LtoChat_DelFriend				,
	EM_PG_Friend_CtoL_SetFriendInfo				,

	//郵件系統
	EM_PG_Mail_CtoL_SendMail					= 1000,
	EM_PG_Mail_CtoL_MailList					,
	EM_PG_Mail_CtoL_SendBack					,
	EM_PG_Mail_CtoL_DelMail						,
	EM_PG_Mail_CtoL_ReadMail					,
	EM_PG_Mail_CtoL_GetItem						,

	EM_PG_Mail_LtoC_SendMailResult				,
	EM_PG_Mail_LtoC_GetItemResult				,

	EM_PG_Mail_LtoD_SendMail					,
	EM_PG_Mail_LtoD_MailList					,
	EM_PG_Mail_LtoD_SendBack					,
	EM_PG_Mail_LtoD_DelMail						,
	EM_PG_Mail_LtoD_ReadMail					,
	EM_PG_Mail_LtoD_GetItem						,

	EM_PG_Mail_DtoL_SendMailResult				,
	EM_PG_Mail_DtoL_GetItemResult				,
	
	EM_PG_Mail_DtoC_MailListResult				,
//	EM_PG_Mail_DtoC_ReadMailResult				,
	EM_PG_Mail_DtoC_MailListCountResult			,

	//AC 交易
	EM_PG_AC_CtoL_SearchItem					= 1100,
	EM_PG_AC_CtoL_GetNextSearchItem				,
	EM_PG_AC_CtoL_GetMyACItemInfo				,
	EM_PG_AC_CtoL_BuyItem						,
	EM_PG_AC_CtoL_SellItem						,
	EM_PG_AC_CtoL_CancelSellItem				,
	EM_PG_AC_CtoL_CloseAC						,
	EM_PG_AC_CtoL_ItemHistoryRequest			,

	EM_PG_AC_LtoDC_SearchItem					,
	EM_PG_AC_LtoDC_GetNextSearchItem			,
	EM_PG_AC_LtoDC_GetMyACItemInfo				,
	EM_PG_AC_LtoDC_BuyItem						,
	EM_PG_AC_LtoDC_SellItem						,
	EM_PG_AC_LtoDC_CancelSellItem				,
	EM_PG_AC_LtoDC_CloseAC						,
	EM_PG_AC_LtoDC_OpenAC						,
	EM_PG_AC_LtoDC_ItemHistoryRequest			,

	EM_PG_AC_DCtoC_SearchItemCountResult		,
	EM_PG_AC_DCtoC_SearchItemResult				,
	EM_PG_AC_DCtoC_FixSearchItemResult			,
	EM_PG_AC_DCtoC_SelfCompetitive_BuyItem		,
	EM_PG_AC_DCtoC_SelfCompetitive_SellItem		,
	EM_PG_AC_DCtoC_CancelSellItemResult			,
	EM_PG_AC_DCtoC_CloseAC						,
	EM_PG_AC_DCtoC_OpenAC						,	
	EM_PG_AC_DCtoC_LostCompetitiveItem			,
	EM_PG_AC_DCtoC_FixBuyOrderItem				,
	EM_PG_AC_DCtoC_ItemHistoryListResult		,

	EM_PG_AC_DCtoL_BuyItemResult				,
	EM_PG_AC_DCtoL_SellItemResult				,

	EM_PG_AC_LtoC_BuyItemResult					,
	EM_PG_AC_LtoC_SellItemResult				,

	EM_PG_AC_DCtoC_SelfCompetitive_ItemDataEnd	,
	EM_PG_AC_DCtoC_FixSellOrderItem				,

	//全Server擁有的腳色資料
	EM_PG_PlayerInfo_LtoAllSrv_SetPlayerData	= 1200,
	EM_PG_PlayerInfo_LtoAllSrv_PlayerLogout		,

	//NPC路徑處理
	EM_PG_CliConnect_CtoL_GetNPCMoveInfoRequest = 1250,
	EM_PG_CliConnect_LtoC_GetNPCMoveInfoResult	,
	EM_PG_CliConnect_CtoL_SaveNPCMoveInfo		,

	//合成製造
	EM_PG_Recipe_CtoL_LockResourceAndRefineRequest = 1300,
	EM_PG_Recipe_LtoC_LockResourceAndRefineResult	,
	EM_PG_Recipe_LtoC_ProduceItemResult				,

	//公會
	EM_PG_Guild_CtoL_CreateGuild				= 1400	,
	EM_PG_Guild_LtoD_CreateGuild					,
	EM_PG_Guild_DtoL_CreateGuildResult				,
	EM_PG_Guild_LtoC_CreateGuildResult				,
	EM_PG_Guild_CtoL_NewGuildInvite					,
	EM_PG_Guild_LtoC_NewGuildInvite					,
	EM_PG_Guild_CtoL_NewGuildInviteResult			,
	EM_PG_Guild_LtoC_NewGuildInviteResult			,
	EM_PG_Guild_LtoD_AddNewGuildMember				,
	EM_PG_Guild_DtoL_AddNewGuildMemberResult		,
	EM_PG_Guild_LtoC_JoindNewGuild					,

	EM_PG_Guild_DtoL_AddGuild						,
	EM_PG_Guild_DtoL_DelGuild						,
	EM_PG_Guild_DtoL_AddGuildMember					,
	EM_PG_Guild_DtoL_DelGuildMember					,

	EM_PG_Guild_CtoL_LeaveNewGuild					,
	EM_PG_Guild_LtoD_LeaveNewGuild					,
	EM_PG_Guild_DtoL_LeaveNewGuildResult			,
	EM_PG_Guild_LtoC_LeaveNewGuildResult			,
	EM_PG_Guild_CtoL_DelNewGuild					,
	EM_PG_Guild_LtoD_DelNewGuild					,
	EM_PG_Guild_DtoL_DelNewGuildResult				,
	EM_PG_Guild_LtoC_DelNewGuildResult				,

	EM_PG_Guild_DtoL_ModifyGuild					,
	EM_PG_Guild_DtoL_ModifyGuildMember				,
	EM_PG_Guild_DtoC_GuildCreate					,
	EM_PG_Guild_CtoL_GuildInfoRequet				,
	EM_PG_Guild_LtoC_GuildInfo						,
	EM_PG_Guild_CtoL_GuildMemberListRequet			,
	EM_PG_Guild_LtoC_GuildMemberListCount			,
	EM_PG_Guild_LtoC_GuildMemberBaseInfo			,
	EM_PG_Guild_CtoL_GuildMemberInfoRequet			,
	EM_PG_Guild_LtoC_GuildMemberInfo				,
	EM_PG_Guild_LtoD_ModifyGuildInfoRequest			,
	EM_PG_Guild_CtoL_ModifyGuildInfoRequest			,
	EM_PG_Guild_CtoL_ModifyGuildMemberInfoRequest	,
	EM_PG_Guild_LtoD_ModifyGuildMemberInfoRequest	,

	EM_PG_Guild_CtoL_GuildInvite					,
	EM_PG_Guild_LtoC_GuildInvite					,
	EM_PG_Guild_CtoL_GuildInviteResult				,
	EM_PG_Guild_LtoC_GuildInviteResult				,
	EM_PG_Guild_LtoD_AddGuildMember					,
	EM_PG_Guild_DtoL_AddGuildMemberResult			,
	EM_PG_Guild_LtoC_JoindGuild						,
	EM_PG_Guild_CtoL_LeaveGuild						,
	EM_PG_Guild_LtoD_LeaveGuild						,
	EM_PG_Guild_DtoL_LeaveGuildResult				,
	EM_PG_Guild_LtoC_LeaveGuildResult				,
	EM_PG_Guild_CtoL_DelGuild						,
	EM_PG_Guild_LtoD_DelGuild						,
	EM_PG_Guild_DtoL_DelGuildResult					,
	EM_PG_Guild_LtoC_DelGuildResult					,

	EM_PG_Guild_LtoD_SetGuildReady					,

	EM_PG_Guild_CtoL_BoardPostRequest				,
	EM_PG_Guild_LtoD_BoardPostRequest				,
	EM_PG_Guild_DtoC_BoardPostResult				,
	EM_PG_Guild_CtoL_BoardListRequest				,
	EM_PG_Guild_LtoD_BoardListRequest				,
	EM_PG_Guild_DtoC_BoardListCount					,
	EM_PG_Guild_DtoC_BoardListData					,
	EM_PG_Guild_CtoL_BoardMessageRequest			,
	EM_PG_Guild_LtoD_BoardMessageRequest			,
	EM_PG_Guild_DtoC_BoardMessageResult				,
	EM_PG_Guild_CtoL_BoardModifyMessageRequest		,
	EM_PG_Guild_LtoD_BoardModifyMessageRequest		,
	EM_PG_Guild_DtoC_BoardModifyMessageResult		,
	EM_PG_Guild_CtoL_BoardModifyModeRequest			,
	EM_PG_Guild_LtoD_BoardModifyModeRequest			,
	EM_PG_Guild_DtoC_BoardModifyModeResult			,



    //測試
    /*
    EM_PG_SmallGame_LtoG1_JoinGame              = 3000 ,
    EM_PG_SmallGame_G1toL_JoinGameResult        ,
    EM_PG_SmallGame_LtoG1_LeaveGame             ,
    EM_PG_SmallGame_G1toL_GameOver              ,
    EM_PG_SmallGame_G1toL_TrainMoney            ,
    EM_PG_SmallGame_LtoG1_TrainMoneyResult      ,

    EM_PG_SmallGameCli_G1toC_Connect            ,
    EM_PG_SmallGameCli_CtoG1_CreateRoom         ,
    EM_PG_SmallGameCli_G1toC_CreateRoomResult   ,
    EM_PG_SmallGameCli_CtoG1_LeaveRoomRequest   ,
    EM_PG_SmallGameCli_G1toC_LeaveRoom          ,
    EM_PG_SmallGameCli_CtoG1_JoinRoomRequest    ,
    EM_PG_SmallGameCli_G1toC_JoinRoomFalase     ,
    EM_PG_SmallGameCli_G1toC_JoinRoom           ,
    EM_PG_SmallGameCli_G1toC_AddRoomPlayer      ,
    EM_PG_SmallGameCli_G1toC_DelRoomPlayer      ,   

    EM_PG_SmallGameCli_G1toC_BeginGame          ,
    EM_PG_SmallGameCli_G1toC_CardInfo           ,
    EM_PG_SmallGameCli_G1toC_CardTurn           ,
    EM_PG_SmallGameCli_CtoG1_CardOut            ,
    EM_PG_SmallGameCli_G1toC_ClearTable         ,
    EM_PG_SmallGameCli_G1toC_EndGame            ,
    EM_PG_SmallGameCli_CtoG1_PlayAgain          ,
*/

    EM_GamePGCommandEnum_MAX         = 0xffffffff,
};

//-----------------------------------------------------------------------------------
//封包機本型定義
//---------------------------------------------------------------------------
//封包基本型
struct PacketBaseStruct
{
    GamePGCommandEnum	Command;
    char    Data[0];
};
//-----------------------------------------------------------------------------------
//封包基本型
struct PacketBaseMaxStruct
{
    GamePGCommandEnum	Command;
    char    Data[0x1000];
};
//-----------------------------------------------------------------------------------
//封包基本型
struct PacketBaseDefine
{
	GamePGCommandEnum	Command;
	PacketBaseDefine( GamePGCommandEnum tCommand ){ Command = tCommand; }
};
//-----------------------------------------------------------------------------------
//全域的ID
union GItemData
{
    int GUID;
    struct
    {
        short ID;
        short Zone;
    };
};
//-----------------------------------------------------------------------------------------------------
enum GroupObjectTypeEnum
{
	EM_GroupObjectType_SysChannel    = 0  ,	//系統
	EM_GroupObjectType_SysZoneChannel   ,	//每個區域都有的
	EM_GroupObjectType_PlayerChannel    ,	//玩家的
	EM_GroupObjectType_Party            ,	//隊伍
	EM_GroupObjectType_Guild            ,	//工會

	EM_GroupObjectType_Count            ,   //類形種數
	EM_GroupObjectType_MAX        = 0xffffffff    ,
};
//-----------------------------------------------------------------------------------
// Party 相關資料結構
//-----------------------------------------------------------------------------------
struct PartyMemberInfoStruct
{
	int		MemberID;
	StaticString <_MAX_NAMESTRING_LEN_> Name;	
	union
	{
		int		GItemID;	// -1 代表下線狀態
		struct
		{
			short   ItemID;            
			short   ZoneID;
		};
	};
	int DBID;
};
enum	PartyItemShareENUM
{
	EM_PartyItemShare_Roll		,
	EM_PartyItemShare_Assign	,
//	EM_PartyItemShare_InOrder	,
};
struct PartyBaseInfoStruct
{
	int		PartyID;
	//	int		CreateTime;
	StaticString <_MAX_NAMESTRING_LEN_> LeaderName;		//隊長
	StaticString <_MAX_NAMESTRING_LEN_> AttackName;		//攻擊者
	StaticString <_MAX_NAMESTRING_LEN_> ShareName;		//分配者

	PartyItemShareENUM	ItemShareType;	//分享的模式
	int					RollTypeLV;		//需要擲骰子的等級 or 分配等級
	bool				Roll_CanUse;	//可使用者才可以擲骰子 or 分配等級

	PartyBaseInfoStruct( )
	{
		PartyID = -1;
		ItemShareType = EM_PartyItemShare_Roll;
		RollTypeLV = 0;
		Roll_CanUse = false;
	}

};
//-----------------------------------------------------------------------------------
//修改物件資訊
struct ModifyNPCInfo
{
    int     GItemID;
    int		OrgObjID;	
    int 	X;			
    int 	Y;			
    int 	Z;			
    int 	Dir;			
    int     QuestID;
    int     Mode;        
    int     PID;         
    StaticString <_MAX_NAMESTRING_LEN_> Name;
    StaticString <_MAX_NAMESTRING_LEN_> AutoPlot;
    StaticString <_MAX_NAMESTRING_LEN_> ClassName;

};
//-----------------------------------------------------------------------------------
// 要加 Server 類型, EM_SERVER_TYPE_END 一定要調整

enum EM_SERVER_TYPE
{
	EM_SERVER_TYPE_MASTER		=	0,
	EM_SERVER_TYPE_LOCAL		,
	EM_SERVER_TYPE_CHAT			,
	EM_SERVER_TYPE_DATACENTER	,
    EM_SERVER_TYPE_PARTITION	,
    EM_SERVER_TYPE_GMTOOLS  	,
//    EM_SERVER_TYPE_SMALLGAME	, //測試
	EM_SERVER_TYPE_END			,

    EM_SERVER_TYPE_MAX         = 0xffffffff,
};




#define DF_NO_LOCALID			-1
#define DF_REQUEST_LOCALID			-2

//-----------------------------------------------------------------------------------
// 小輝泛用 Define

#define		DF_OK				0

// 小輝自定 Define
//------------------------------------------------------
#define M_PACKET( type ) type* pPacket = (type*)pData
#define M_CLIENT_OBJ( id ) BaseItemObject*	pObj =	Global::GetObjBySockID( id ); if( pObj == NULL ) return
//------------------------------------------------------
#define PACKET_CONSTRUCT( type ) GamePGCommandEnum Command; type(){ Command = EM_##type; }

#define  Srv_NetCliReg( PGName ) _Net->RegOnCliPacketFunction( EM_##PGName , _##PGName , sizeof(PGName) , sizeof(PGName) )
#define  Cli_NetReg( PGName )   _Net.RegOnSrvPacketFunction( EM_##PGName , _##PGName )
//-----------------------------------------------------------------------------------
#endif //__NETWAKERPGEM_H__