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

📄 smsgdirg2addservice.h

📁 游戏《家园》源码
💻 H
字号:
#ifndef _SMsgDirG2AddService_H
#define _SMsgDirG2AddService_H

// SMsgDirG2AddService.h

// DirectoryServer add service message.  Adds a new service at specified path.

#include "STRING"
#include "SMsgDirG2UpdateExtendBase.h"


namespace WONMsg {

class SMsgDirG2AddService : public SMsgDirG2UpdateExtendBase
{
public:
    // Default ctor
    explicit SMsgDirG2AddService(bool isExtended=false);

    // SmallMessage ctor
    explicit SMsgDirG2AddService(const SmallMessage& theMsgR);

    // Copy ctor
    SMsgDirG2AddService(const SMsgDirG2AddService& theMsgR);

    // Destructor
    ~SMsgDirG2AddService(void);

    // Assignment
    SMsgDirG2AddService& operator=(const SMsgDirG2AddService& theMsgR);

    // Virtual Duplicate
    TRawMsg* Duplicate(void) const;

    // Pack and Unpack the message
    // Unpack will throw a BadMsgException is message is not of this type
    void* Pack(void);
    void  Unpack(void);

    // EntityFlags access
    unsigned char GetEntityFlags() const;
    void SetEntityFlags(unsigned char theFlags);

    // DisplayName access
    const std::wstring& GetDisplayName() const;
    void SetDisplayName(const std::wstring& theName);

    // Lifespan access
    unsigned long GetLifespan() const;
    void SetLifespan(unsigned long theSpan);

private:
    unsigned char mEntityFlags;  // Flags for add
    std::wstring  mDisplayName;  // Service display name
    unsigned long mLifespan;     // Lifespan in seconds
};


// Inlines
inline TRawMsg*
SMsgDirG2AddService::Duplicate(void) const
{ return new SMsgDirG2AddService(*this); }

inline unsigned char
SMsgDirG2AddService::GetEntityFlags(void) const
{ return mEntityFlags; }

inline void
SMsgDirG2AddService::SetEntityFlags(unsigned char theFlags)
{ mEntityFlags = theFlags; }

inline const std::wstring&
SMsgDirG2AddService::GetDisplayName(void) const
{ return mDisplayName; }

inline void
SMsgDirG2AddService::SetDisplayName(const std::wstring& theName)
{ mDisplayName = theName; }

inline unsigned long
SMsgDirG2AddService::GetLifespan(void) const
{ return mLifespan; }

inline void
SMsgDirG2AddService::SetLifespan(unsigned long theSpan)
{ mLifespan = theSpan; }

};  // Namespace WONMsg

#endif

⌨️ 快捷键说明

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