SEGS  0.6.1-develop [39915b3b]
Super Entity Game Server
SidekickOffer.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md for details.
6  */
7 
8 #pragma once
9 #include "MapEventTypes.h"
10 #include "GameCommand.h"
11 #include "BitStream.h"
12 #include "Logging.h"
13 
14 namespace SEGSEvents
15 {
16 // [[ev_def:type]]
17 class SidekickOffer final : public GameCommandEvent
18 {
19 public:
20  // [[ev_def:field]]
21  uint32_t m_db_id;
22  SidekickOffer(uint32_t db_id) : GameCommandEvent(MapEventTypes::evSidekickOffer),
23  m_db_id(db_id)
24  {
25  }
26 explicit SidekickOffer() : GameCommandEvent(MapEventTypes::evSidekickOffer) {}
27  void serializeto(BitStream &bs) const override
28  {
29  bs.StorePackedBits(1,type()-MapEventTypes::evFirstServerToClient); // 28
30  bs.StoreBits(32,m_db_id);
31  qCDebug(logTeams) << "Sidekick Offer db_id:" << m_db_id;
32  }
34 };
35 } // end of SEGSEvents namespace
36 
void StoreBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:114
Definition: GameCommand.h:16
SidekickOffer(uint32_t db_id)
Definition: SidekickOffer.h:22
Definition: BitStream.h:34
Definition: LinkLevelEvent.h:13
MapEventTypes
Definition: MapEventTypes.h:14
void StorePackedBits(uint32_t nBits, uint32_t dataBits)
Definition: BitStream.cpp:161
SidekickOffer()
Definition: SidekickOffer.h:26
uint32_t m_db_id
Definition: SidekickOffer.h:21
uint32_t type() const
Definition: SEGSEvent.h:66
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77
Definition: SidekickOffer.h:17
void serializeto(BitStream &bs) const override
Definition: SidekickOffer.h:27