SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
10 
11 class DbError : public AuthLinkEvent
12 {
13  uint8_t m_err_arr[8];
14 public:
16  {}
17  void init(EventProcessor *ev_src,const uint8_t *error_arr) {memcpy(m_err_arr,error_arr,8);m_event_source=ev_src;}
18  void serializeto(GrowingBuffer &buf) const
19  {
20  buf.uPut((uint8_t)3);
21  buf.uPutBytes(m_err_arr,8);
22  }
24  {
25  uint8_t op;
26  buf.uGet(op);
27  assert(op==3);
28  buf.uGetBytes(m_err_arr,8);
29  }
30 };
void serializeto(GrowingBuffer &buf) const
Definition: DbError.h:18
void uGet(T &val)
Definition: Buffer.h:76
DbError()
Definition: DbError.h:15
void serializefrom(GrowingBuffer &buf)
Definition: DbError.h:23
Definition: Buffer.h:17
void uPutBytes(const uint8_t *t, size_t len)
Definition: Buffer.cpp:96
Definition: DbError.h:11
void init(EventProcessor *ev_src, const uint8_t *error_arr)
Definition: DbError.h:17
void uPut(const T &val)
Definition: Buffer.h:69
Definition: AuthEvents.h:32
Definition: EventProcessor.h:13
EventProcessor * m_event_source
Definition: SEGSEvent.h:36
void uGetBytes(uint8_t *t, size_t len)
Definition: Buffer.cpp:133
Definition: AuthEvents.h:15