⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 serviceenginer.h

📁 游戏框架
💻 H
📖 第 1 页 / 共 2 页
字号:
};

//////////////////////////////////////////////////////////////////////////

#define VER_ITimerEngineManager INTERFACE_VERSION(1,1)
static const GUID IID_ITimerEngineManager={0xcdbfa840,0xdc45,0x41f7,0xb6,0x3c,0xad,0x83,0x75,0x98,0xc6,0x3e};

//定时器引擎接口
interface ITimerEngineManager : public IUnknownEx
{
	//开始服务
	virtual bool __cdecl StartService()=NULL;
	//停止服务
	virtual bool __cdecl StopService()=NULL;
	//设置接口
	virtual bool __cdecl SetTimerEngineSink(IUnknownEx * pIUnknownEx)=NULL;
};
//////////////////////////////////////////////////////////////////////////

#define VER_IActionEngine INTERFACE_VERSION(1,1)
static const GUID IID_IActionEngine={0x4a9b0421,0x1224,0x4e5e,0xa5,0x4f,0xb1,0x61,0x6e,0x62,0xdb,0x99};

interface IActionProcess;
//定时器引擎接口
interface IActionEngine : public IUnknownEx
{
	//设置定时器
	virtual bool __cdecl CreateAction(IGameObject* pIGameObject, enuActionType ActionType, WORD wActionID, DWORD dwElapse, DWORD dwRepeat, WPARAM wParam, BOOL bCheckExist = true)=NULL; 
	//设置定时器
	virtual bool __cdecl CreateAction(IGameObject* pIGameObject, IActionProcess* pIActionProcess, WORD wActionID, DWORD dwElapse, DWORD dwRepeat, WPARAM wParam, BOOL bCheckExist = true)=NULL;
	//删除定时器
	virtual bool __cdecl Remove(WORD wActionID)=NULL;
	//删除定时器
	virtual bool __cdecl RemoveAll()=NULL;
};

//////////////////////////////////////////////////////////////////////////

#define VER_IActionEngineManager INTERFACE_VERSION(1,1)
static const GUID IID_IActionEngineManager={0xcdbfa840,0xdc45,0x41f7,0xb6,0x3c,0xad,0x83,0x75,0x98,0xc6,0x3f};

//定时器引擎接口
interface IActionEngineManager : public IUnknownEx
{
	//开始服务
	virtual bool __cdecl StartService()=NULL;
	//停止服务
	virtual bool __cdecl StopService()=NULL;
	//设置接口
	virtual bool __cdecl SetActionEngineSink(IUnknownEx * pIUnknownEx)=NULL;
};
//////////////////////////////////////////////////////////////////////////

#define VER_IActionProcess INTERFACE_VERSION(1,1)
static const GUID IID_IActionProcess={0xcdbfa840,0xdc45,0x41f7,0xb6,0x3c,0xad,0x83,0x75,0x98,0xc6,0x4f};

//动作执行处理类
interface IActionProcess : public IUnknownEx
{
public:
	//动作执行
	virtual bool __cdecl Process(bool bFlag=false)=NULL;
	//重置
	virtual void __cdecl Reset()=NULL;
};

#define VER_IQueueServiceEngine INTERFACE_VERSION(1,1)
static const GUID IID_IQueueServiceEngine={0xba2c602e,0x7f5a,0x40ad,0xb7,0xa5,0x7d,0x1c,0x2a,0x8f,0xee,0x78};

//队列类引擎接口
interface IQueueServiceEngine : public IUnknownEx
{
	//开始服务
	virtual bool __cdecl StartService()=NULL;
	//停止服务
	virtual bool __cdecl StopService()=NULL;
	//设置接口
	virtual bool __cdecl SetQueueServiceSink(IUnknownEx * pIUnknownEx)=NULL;
	//负荷信息
	virtual bool __cdecl GetBurthenInfo(tagBurthenInfo & BurthenInfo)=NULL;
};

//////////////////////////////////////////////////////////////////////////
//枚举定义

//连接状态定义
enum enSocketState
{
	SocketState_NoConnect,			//没有连接
	SocketState_Connecting,			//正在连接
	SocketState_Connected,			//成功连接
};

//////////////////////////////////////////////////////////////////////////
//结构定义

//代理信息结构
struct tagProxyInfo
{
	BYTE							cbProxyType;						//代理类型
	WORD							wProxyPort;							//代理端口
	_CString							strProxyName;						//代理用户名
	_CString							strProxyPass;						//代理密码
	_CString							strProxyServer;						//代理地址
	_CString							strHttpDomain;						//代理域名
};

//////////////////////////////////////////////////////////////////////////

#define VER_IClientSocket INTERFACE_VERSION(1,1)
static const GUID IID_IClientSocket={0x8b0e3918,0x5139,0x48da,0xbf,0x40,0xba,0x95,0xad,0xce,0x59,0x64};

//网络组件接口
interface IClientSocket : public IUnknownEx
{
	//取消代理
	virtual void __cdecl CancelProxyServer()=NULL;
	//代理服务器
	virtual void __cdecl SetProxyServer(tagProxyInfo & ProxyInfo)=NULL;
	//设置加密
	virtual void __cdecl SetEncrypted(bool bEncrypted=true)=NULL;
	//是否加密
	virtual bool __cdecl IsEncrypted()=NULL;
	//设置接口
	virtual bool __cdecl SetSocketSink(IUnknownEx * pIUnknownEx)=NULL;
	//获取接口
	virtual void  * __cdecl GetSocketSink(const IID & Guid, DWORD dwQueryVer)=NULL;
	//获取发送间隔
	virtual DWORD __cdecl GetLastSendTick()=NULL;
	//获取接收间隔
	virtual DWORD __cdecl GetLastRecvTick()=NULL;
	//获取发送数目
	virtual DWORD __cdecl GetSendPacketCount()=NULL;
	//获取接收数目
	virtual DWORD __cdecl GetRecvPacketCount()=NULL;
	//获取状态
	virtual enSocketState __cdecl GetConnectState()=NULL;
	//连接服务器
	virtual bool __cdecl Connect(DWORD dwServerIP, WORD wPort)=NULL;
	//连接服务器
	virtual bool __cdecl Connect(const LPCTSTR szServerIP, WORD wPort)=NULL;
	//发送函数
	virtual bool __cdecl SendData(WORD wMainCmdID, WORD wSubCmdID)=NULL;
	//发送函数
	virtual bool __cdecl SendData(WORD wMainCmdID, WORD wSubCmdID, void * pData, WORD wDataSize)=NULL;
	//关闭连接
	virtual bool __cdecl CloseSocket(bool bNotify)=NULL;
};

//////////////////////////////////////////////////////////////////////////

#define VER_IClientSocketSink INTERFACE_VERSION(1,1)
static const GUID IID_IClientSocketSink={0x55fcf8aa,0x526a,0x44c2,0x9a,0xd1,0x4,0xe,0x7,0xd6,0x8a,0x2a};

//网络钩子接口
interface IClientSocketSink : public IUnknownEx
{
	//网络连接消息
	virtual bool __cdecl OnSocketConnect(int iErrorCode, LPCTSTR pszErrorDesc)=NULL;
	//网络读取消息
	virtual bool __cdecl OnSocketRead(CMD_Command Command, void * pBuffer, WORD wDataSize)=NULL;
	//网络关闭消息
	virtual bool __cdecl OnSocketClose()=NULL;
};

//////////////////////////////////////////////////////////////////////////

#define VER_IAttemperEngineSink INTERFACE_VERSION(1,1)
static const GUID IID_IAttemperEngineSink={0x82d2c5,0x4e6f,0x4031,0xae,0xd4,0x6f,0xee,0x5a,0x17,0x1b,0x8a};

//调度模块钩子接口
interface IAttemperEngineSink : public IUnknownEx
{
	//管理接口
public:
	//调度模块启动
	virtual bool __cdecl StartService(IUnknownEx * pIUnknownEx)=NULL;
	//调度模块关闭
	virtual bool __cdecl StopService(IUnknownEx * pIUnknownEx)=NULL;
	//事件处理接口
	virtual bool __cdecl OnAttemperEvent(WORD wIdentifier, void * pBuffer, WORD wDataSize, DWORD dwInsertTime)=NULL;

	//事件接口
public:
	//定时器事件
	virtual bool __cdecl OnEventTimer(WORD wTimerID, WPARAM wBindParam)=NULL;
	//定时器事件
	virtual bool __cdecl OnEventAction(IGameObject* pIGameObject, WORD wActionID, DWORD dwRepeatTimes, WPARAM wBindParam)=NULL;
	//数据库事件
	virtual bool __cdecl OnEventDataBase(void * pDataBuffer, WORD wDataSize, NTY_DataBaseEvent * pDataBaseEvent)=NULL;
	//网络应答事件
	virtual bool __cdecl OnEventSocketAccept(NTY_SocketAcceptEvent * pSocketAcceptEvent)=NULL;
	//网络读取事件
	virtual bool __cdecl OnEventSocketRead(CMD_Command Command, void * pDataBuffer, WORD wDataSize, NTY_SocketReadEvent * pSocketReadEvent)=NULL;
	//网络关闭事件
	virtual bool __cdecl OnEventSocketClose(NTY_SocketCloseEvent * pSocketCloseEvent)=NULL;
	//网络连接消息
	virtual bool __cdecl OnEventClientSocketConnect(int iErrorCode, LPCTSTR pszErrorDesc)=NULL;
	//网络读取消息
	virtual bool __cdecl OnEventClientSocketRead(CMD_Command Command, void * pBuffer, WORD wDataSize)=NULL;
	//网络关闭消息
	virtual bool __cdecl OnEventClientSocketClose()=NULL;

};

//////////////////////////////////////////////////////////////////////////

#define VER_IAttemperEngine INTERFACE_VERSION(1,1)
static const GUID IID_IAttemperEngine={0x967b3e64,0x69af,0x434a,0xb8,0x6c,0x67,0x9b,0x72,0xbb,0x2e,0xe};

//调度引擎接口
interface IAttemperEngine : public IUnknownEx
{
	//管理接口
public:
	//启动服务
	virtual bool __cdecl StartService()=NULL;
	//停止服务
	virtual bool __cdecl StopService()=NULL;
	//设置网络
	virtual bool __cdecl SetSocketEngine(IUnknownEx * pIUnknownEx)=NULL;
	//设置钩子
	virtual bool __cdecl SetAttemperEngineSink(IUnknownEx * pIUnknownEx)=NULL;
	//获取接口
	virtual void * __cdecl GetQueueService(const IID & Guid, DWORD dwQueryVer)=NULL;
};


//////////////////////////////////////////////////////////////////////////

//导出类头文件
#ifndef SERVICE_ENGINER_DLL
	//#include "ServiceThread.h"
	#include "QueueServiceEvent.h"
	#include "TimerEngine.h"
	#include "QueueService.h"
	#include "AttemperEngine.h"
	#include "ActionEngine.h"
	#include "ActionProcess.h"
	#include "ClientSocket.h"
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -