SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
ServerSelectResponse.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 "Auth/AuthEvents.h"
10 
11 namespace SEGSEvents
12 {
13 // [[ev_def:type]]
15 {
16 public:
18  {}
19  ServerSelectResponse(EventSrc *ev_src,uint32_t cookie,uint32_t dbcookie) : AuthLinkEvent(evServerSelectResponse,ev_src),
20  db_server_cookie(dbcookie),
21  m_cookie(cookie),
22  m_unk2(0)
23  {}
24  void serializefrom(GrowingBuffer &buf) override
25  {
26  assert(buf.GetReadableDataSize()>=10);
27  uint8_t op;
28  buf.uGet(op);
30  buf.uGet(m_cookie);
31  buf.uGet(m_unk2);
32  }
33  void serializeto(GrowingBuffer &buf) const override
34  {
35  buf.uPut((uint8_t)7);
37  buf.uPut(m_cookie);
38  buf.uPut(m_unk2);
39  }
40  void init(EventSrc *ev_src, uint32_t cookie, uint32_t dbcookie)
41  {
42  m_cookie = cookie;
43  db_server_cookie = dbcookie;
44  m_unk2 = 0;
45  m_event_source = ev_src;
46  }
47  // [[ev_def:field]]
48  uint32_t db_server_cookie=~0U;
49  // [[ev_def:field]]
50  uint32_t m_cookie = ~0U;
51  // [[ev_def:field]]
52  uint8_t m_unk2 = 0xFF;
54 };
55 } // end of namespace SEGSEvents
EventSrc * m_event_source
Definition: SEGSEvent.h:40
ServerSelectResponse()
Definition: ServerSelectResponse.h:17
void serializeto(GrowingBuffer &buf) const override
Definition: ServerSelectResponse.h:33
Definition: EventProcessor.h:14
uint32_t db_server_cookie
Definition: ServerSelectResponse.h:48
void uGet(T &val)
Definition: Buffer.h:77
Definition: LinkLevelEvent.h:13
uint32_t m_cookie
Definition: ServerSelectResponse.h:50
Definition: ServerSelectResponse.h:14
ServerSelectResponse(EventSrc *ev_src, uint32_t cookie, uint32_t dbcookie)
Definition: ServerSelectResponse.h:19
Definition: Buffer.h:17
uint32_t GetReadableDataSize() const
Definition: Buffer.h:97
uint8_t m_unk2
Definition: ServerSelectResponse.h:52
void serializefrom(GrowingBuffer &buf) override
Definition: ServerSelectResponse.h:24
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77
void uPut(const T &val)
Definition: Buffer.h:70
void init(EventSrc *ev_src, uint32_t cookie, uint32_t dbcookie)
Definition: ServerSelectResponse.h:40
Definition: AuthEvents.h:41
Definition: AuthEvents.h:18