SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AuthorizationProtocolVersion.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
10 
12 {
13  uint32_t m_seed;
14  uint32_t m_proto_vers;
15 public:
17  {}
18  AuthorizationProtocolVersion(uint32_t version_id,uint32_t seed) :
20  m_seed(seed),
21  m_proto_vers(version_id)
22  {}
23  void init(EventProcessor *ev_src,uint32_t version_id,uint32_t seed)
24  {
25  m_proto_vers=version_id;
26  m_event_source=ev_src; m_seed=seed;
27  }
28  void serializeto(GrowingBuffer &buf) const
29  {
30  buf.uPut((uint8_t)0);
31  buf.uPut(m_seed);
32  buf.uPut(m_proto_vers);
33  }
35  {
36  uint8_t packet_type;
37  buf.uGet(packet_type);
38  buf.uGet(m_seed);
39  buf.uGet(m_proto_vers);
40  }
41  uint32_t getSeed() const
42  {
43  return m_seed;
44  }
45  uint32_t getProtoVers() const
46  {
47  return m_proto_vers;
48  }
49 };
50 
51 
52 
53 
void serializefrom(GrowingBuffer &buf)
Definition: AuthorizationProtocolVersion.h:34
void serializeto(GrowingBuffer &buf) const
Definition: AuthorizationProtocolVersion.h:28
void uGet(T &val)
Definition: Buffer.h:76
uint32_t getSeed() const
Definition: AuthorizationProtocolVersion.h:41
Definition: AuthEvents.h:29
Definition: AuthorizationProtocolVersion.h:11
Definition: Buffer.h:17
AuthorizationProtocolVersion()
Definition: AuthorizationProtocolVersion.h:16
void uPut(const T &val)
Definition: Buffer.h:69
uint32_t getProtoVers() const
Definition: AuthorizationProtocolVersion.h:45
void init(EventProcessor *ev_src, uint32_t version_id, uint32_t seed)
Definition: AuthorizationProtocolVersion.h:23
Definition: EventProcessor.h:13
EventProcessor * m_event_source
Definition: SEGSEvent.h:36
AuthorizationProtocolVersion(uint32_t version_id, uint32_t seed)
Definition: AuthorizationProtocolVersion.h:18
Definition: AuthEvents.h:15