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

📄 msgchat.h

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

#include <stddef.h>
#include <string.h>
#include <sstream>
#include <iostream>

using namespace std;

#include "socket_api.h"
#include "message.h"
#include "client.h"

class MsgChat : public Message
{
public:
    MsgChat();
    MsgChat( const string& __msg );
    ~MsgChat();
public:
    static int* getTypePtr(void)
    {
        return &_type;
    }
    int getType(void) const
    {
        return _type;
    }
    int value_size(void);
    bool load( Buffer& __buffer );//return true for successed
    bool save( Buffer& __buffer ) const;//return true for successed
    bool preProcess( Connection* __conn, Remote* __remote, World* __world, shared_ptr<Message>& __this );//return true to be queued
    bool process( shared_ptr<Message>& __this );//return true to be removed from the queue
protected:
    static int _type;
    string _name;
    string _msg;
    Client* _client;
    World* _world;
};

#endif

⌨️ 快捷键说明

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