SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EmailRead.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include "GameCommandList.h"
10 
11 #include <QtCore/QString>
12 
13 class EmailRead final : public GameCommand
14 {
15 public:
16  EmailRead(const int id, const QString &message, const QString recipient) : GameCommand(MapEventTypes::evEmailReadCmd),
17  m_id(id), m_message(message), m_recipient(recipient)
18  {
19  }
20 
21  void serializeto(BitStream &bs) const override {
22  bs.StorePackedBits(1, type()-MapEventTypes::evFirstServerToClient);
23  bs.StoreBits(32, m_id);
25  bs.StorePackedBits(1, m_count);
27  }
28 
29  void serializefrom(BitStream &src);
30 
31 protected:
32  int m_id;
33  QString m_message;
34  int m_count = 1; //Doesn't do anything in Issue 0, seemingly, so hardcoding as 1
35  QString m_recipient; //Possible misnamed variable, as this is actually the sender in the email's read tab
36 };
void serializefrom(BitStream &src)
void StoreBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:114
int m_count
Definition: EmailRead.h:34
Definition: BitStream.h:30
QString m_recipient
Definition: EmailRead.h:35
void StorePackedBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:161
void StoreString(const char *str)
Definition: BitStream.cpp:204
uint32_t type() const
Definition: GameCommandList.h:21
QString m_message
Definition: EmailRead.h:33
int m_id
Definition: EmailRead.h:32
Definition: GameCommandList.h:15
EmailRead(const int id, const QString &message, const QString recipient)
Definition: EmailRead.h:16
Definition: EmailRead.h:13
Definition: MapEventTypes.h:11
void serializeto(BitStream &bs) const override
Definition: EmailRead.h:21