SEGS  0.6.1-develop [39915b3b]
Super Entity Game Server
DbError.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]]
14 class DbError : public AuthLinkEvent
15 {
16 public:
17  // [[ev_def:field]]
18  uint8_t m_err_arr[8];
20  {}
21  void init(EventSrc *ev_src,const uint8_t *error_arr) {memcpy(m_err_arr,error_arr,8);m_event_source=ev_src;}
22  void serializeto(GrowingBuffer &buf) const override
23  {
24  buf.uPut((uint8_t)3);
25  buf.uPutBytes(m_err_arr,8);
26  }
27  void serializefrom(GrowingBuffer &buf) override
28  {
29  uint8_t op;
30  buf.uGet(op);
31  assert(op==3);
32  buf.uGetBytes(m_err_arr,8);
33  }
35 };
36 } // end of namespace SEGSEvents
EventSrc * m_event_source
Definition: SEGSEvent.h:40
void uGetBytes(uint8_t *t, uint32_t len)
Definition: Buffer.cpp:144
Definition: EventProcessor.h:14
void serializefrom(GrowingBuffer &buf) override
Definition: DbError.h:27
void uGet(T &val)
Definition: Buffer.h:77
Definition: LinkLevelEvent.h:13
void init(EventSrc *ev_src, const uint8_t *error_arr)
Definition: DbError.h:21
Definition: Buffer.h:17
uint8_t m_err_arr[8]
Definition: DbError.h:18
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77
void uPut(const T &val)
Definition: Buffer.h:70
Definition: DbError.h:14
Definition: AuthEvents.h:35
DbError()
Definition: DbError.h:19
void uPutBytes(const uint8_t *t, uint32_t len)
Definition: Buffer.cpp:108
void serializeto(GrowingBuffer &buf) const override
Definition: DbError.h:22
Definition: AuthEvents.h:18