SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TeamOffer.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 #include "Logging.h"
11 
12 #include "MapEvents.h"
13 #include "MapLink.h"
14 
15 enum TeamOfferType : uint8_t
16 {
17  NoMission = 0,
20 };
21 
22 class TeamOffer final : public GameCommand
23 {
24 public:
25  uint32_t m_db_id;
26  QString m_name;
28  TeamOffer(uint32_t &db_id, QString &name, TeamOfferType &type) : GameCommand(MapEventTypes::evTeamOffer),
29  m_db_id(db_id),
30  m_name(name),
31  m_type(type)
32  {
33  }
34  void serializeto(BitStream &bs) const override {
35  bs.StorePackedBits(1,type()-MapEventTypes::evFirstServerToClient); // 24
36  bs.StoreBits(32,m_db_id); // team offeree db_id
37  bs.StoreString(m_name); // team offerer name
38  bs.StoreBits(2,m_type); // team with mission?
39  }
40  void serializefrom(BitStream &src);
41 };
TeamOfferType
Definition: TeamOffer.h:15
QString m_name
Definition: TeamOffer.h:26
void StoreBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:114
void serializefrom(BitStream &src)
Definition: TeamOffer.h:19
Definition: BitStream.h:30
Definition: TeamOffer.h:22
void StorePackedBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:161
void StoreString(const char *str)
Definition: BitStream.cpp:204
void serializeto(BitStream &bs) const override
Definition: TeamOffer.h:34
Definition: TeamOffer.h:18
uint32_t m_db_id
Definition: TeamOffer.h:25
uint32_t type() const
Definition: GameCommandList.h:21
Definition: GameCommandList.h:15
TeamOfferType m_type
Definition: TeamOffer.h:27
TeamOffer(uint32_t &db_id, QString &name, TeamOfferType &type)
Definition: TeamOffer.h:28
Definition: MapEventTypes.h:11
Definition: TeamOffer.h:17