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

📄 message.h

📁 网络游戏通用架构, 这是基于boost和libevent写的一个程序
💻 H
字号:
#ifndef MESSAGE_H
#define MESSAGE_H

#include "common.h"
#include "connection.h"
#include "remote.h"
#include "world.h"

class EXPORT Message
{
public:
    Message();
    virtual ~Message();
public:
    virtual int getType(void) const =0;
    virtual int value_size(void) =0;
    virtual bool load( Buffer& __buffer ) =0;//return true for successed
    virtual bool save( Buffer& __buffer ) const =0;//return true for successed
    virtual bool preProcess( Connection* __conn, Remote* __remote, World* __world, shared_ptr<Message>& __this ) =0;//return true to be queued
    virtual bool process( shared_ptr<Message>& __this ) =0;//return true to be removed from the queue
};

#endif

⌨️ 快捷键说明

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