SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
LoginRequest.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 #include <array>
11 
13 {
14  std::array<char,14> login;
15  std::array<char,16> password;
16  uint32_t unkval1=0;
17  uint16_t unkval2=0;
18  template <class Archive>
19  void serialize( Archive & ar )
20  {
21  ar( login, password, unkval1,unkval2 );
22  }
23 };
24 namespace SEGSEvents
25 {
26 // [[ev_def:type]]
28 {
29 public:
31  {}
32  void serializeto(GrowingBuffer &buf) const override
33  {
34  buf.uPut(uint8_t(0));
35  buf.uPutBytes((uint8_t*)m_data.login.data(), m_data.login.size());
36  buf.uPutBytes((uint8_t*)m_data.password.data(), m_data.password.size());
37  buf.uPut(m_data.unkval1);
38  buf.uPut(m_data.unkval2);
39  //assert(!"Not implemented");
40  }
41  void serializefrom(GrowingBuffer &buf) override
42  {
43  uint8_t packet_code;
44  buf.uGet(packet_code);
45  if(packet_code!=0)
46  {
47  //assert(packet_code==0);
48  }
49  buf.uGetBytes((uint8_t *)m_data.login.data(), m_data.login.size());
50  buf.uGetBytes((uint8_t *)m_data.password.data(), m_data.password.size());
51  buf.uGet(m_data.unkval1);
52  buf.uGet(m_data.unkval2);
53  }
54  // [[ev_def:field]]
57 };
58 } // end of namespace SEGSEvents
std::array< char, 14 > login
Definition: LoginRequest.h:14
void serialize(Archive &ar)
Definition: LoginRequest.h:19
void uGetBytes(uint8_t *t, uint32_t len)
Definition: Buffer.cpp:144
void uGet(T &val)
Definition: Buffer.h:77
void serializeto(GrowingBuffer &buf) const override
Definition: LoginRequest.h:32
Definition: LinkLevelEvent.h:13
LoginRequest()
Definition: LoginRequest.h:30
uint16_t unkval2
Definition: LoginRequest.h:17
Definition: LoginRequest.h:12
Definition: Buffer.h:17
Definition: LoginRequest.h:27
#define EVENT_IMPL(name)
Definition: SEGSEvent.h:77
uint32_t unkval1
Definition: LoginRequest.h:16
void uPut(const T &val)
Definition: Buffer.h:70
LoginRequestData m_data
Definition: LoginRequest.h:55
void serializefrom(GrowingBuffer &buf) override
Definition: LoginRequest.h:41
Definition: AuthEvents.h:37
void uPutBytes(const uint8_t *t, uint32_t len)
Definition: Buffer.cpp:108
std::array< char, 16 > password
Definition: LoginRequest.h:15
Definition: AuthEvents.h:18