#pragma once
#ifndef __DISPATCH_H__
#define __DISPATCH_H__
#include "import.h"
#include "inline_hook.h"
#include "Singleton.h"
#include "./sdk/sdk_class.h"
#include "utils.h"
#include "GameDataManager.h"

enum NOTI_PACKETMESSAGE_TYPE : int
{
	NOTI_SYSTEM = 0,

};

struct USER_DATA
{
	int abnormal_data_count;		//异常数据计次  要使用map进行用户数据存储

};

class CDispatch
{
public:
	SINGLETON_DEFINE_S(CDispatch);
	CDispatch();
	~CDispatch();
public:
	ENUM_PACK_RET_TYPE UseEquipmentMoveItem(CUser* user, PacketBuf* pBuf);

	ENUM_PACK_RET_TYPE Dispatcher_ModItemAttr_dispatch_sig(Dispatcher_ModItemAttr* dis_mod, CUser* user, PacketBuf* pBuf);

	ENUM_PACK_RET_TYPE UseJewel_dispatch_sig(void* pDispatcher_UseJewel, CUser* user, PacketBuf* pBuf);

	ENUM_PACK_RET_TYPE MoveMap_dispatch_sig(void* a1, CUser* user, PacketBuf* pBuf);

	ENUM_PACK_RET_TYPE Inter_LoadEtc_dispatch_sig(void* a1, CUser* user, char* a3);

	ENUM_PACK_RET_TYPE DisPatcher_ReturnToSelectCharacter_dispatch_sig(void* a1, CUser* user, char* a3);

	ENUM_PACK_RET_TYPE ProcessIPG_ResultOutput(CUser* user, int Goods_No, int item_id, int Cera_Type, InterfacePacketBuf* pbuf);

	ENUM_PACK_RET_TYPE Init_done(int argc, const char** argv);

	ENUM_PACK_RET_TYPE importCashShopItemList(const std::string* str);

	void SendMsg(CUser* user, int pack_id, int status, const std::string& str);

	void SendNoti(CUser* user, const std::string& str, NOTI_PACKETMESSAGE_TYPE type = NOTI_SYSTEM);
protected:


private:
	int last_move_map_tickcount;
	Utils::TMap<CUser*, USER_DATA> user_map;
};


#endif // __DISPATCH_H__

