SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
AuthorizationError.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:
17  // [[ev_def:field]]
18  uint32_t m_error_type = 0;
20  {}
21  AuthorizationError(uint32_t err) : AuthLinkEvent(evAuthorizationError),m_error_type(err)
22  {}
23  void init(EventSrc *ev_src,uint32_t error_type) {m_error_type=error_type; m_event_source=ev_src;}
24  void serializeto(GrowingBuffer &buf) const override
25  {
26  buf.uPut((uint8_t)1);
27  buf.uPut(m_error_type);
28  }
29  void serializefrom(GrowingBuffer &buf) override
30  {
31  uint8_t op;
32  buf.uGet(op);
33  assert(op==1);
34  buf.uGet(m_error_type);
35  }
37 };
38 }
EventSrc * m_event_source
Definition: SEGSEvent.h:40
uint32_t m_error_type
Definition: AuthorizationError.h:18
Definition: EventProcessor.h:14
void uGet(T &val)
Definition: Buffer.h:77
Definition: LinkLevelEvent.h:13
void serializeto(GrowingBuffer &buf) const override
Definition: AuthorizationError.h:24
Definition: Buffer.h:17
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77
void uPut(const T &val)
Definition: Buffer.h:70
AuthorizationError()
Definition: AuthorizationError.h:19
void serializefrom(GrowingBuffer &buf) override
Definition: AuthorizationError.h:29
Definition: AuthorizationError.h:14
AuthorizationError(uint32_t err)
Definition: AuthorizationError.h:21
Definition: AuthEvents.h:33
void init(EventSrc *ev_src, uint32_t error_type)
Definition: AuthorizationError.h:23
Definition: AuthEvents.h:18