SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
10 
12 {
13  char login[14];
14  char password[16];
15  uint32_t unkval1=0;
16  uint16_t unkval2=0;
17 };
19 {
20 public:
22  {}
23  void serializeto(GrowingBuffer &buf) const
24  {
25  buf.uPut(uint8_t(0));
26  buf.uPutBytes((uint8_t*)m_data.login, sizeof(m_data.login));
27  buf.uPutBytes((uint8_t*)m_data.password, sizeof(m_data.password));
28  buf.uPut(m_data.unkval1);
29  buf.uPut(m_data.unkval2);
30  //assert(!"Not implemented");
31  }
33  {
34  uint8_t packet_code;
35  buf.uGet(packet_code);
36  if(packet_code!=0)
37  {
38  //assert(packet_code==0);
39  }
40  buf.uGetBytes((uint8_t *)m_data.login, sizeof(m_data.login));
41  buf.uGetBytes((uint8_t *)m_data.password, sizeof(m_data.password));
42  buf.uGet(m_data.unkval1);
43  buf.uGet(m_data.unkval2);
44  }
46 };
LoginRequestData m_data
Definition: LoginRequest.h:45
char password[16]
Definition: LoginRequest.h:14
Definition: AuthEvents.h:34
void uGet(T &val)
Definition: Buffer.h:76
void serializeto(GrowingBuffer &buf) const
Definition: LoginRequest.h:23
uint16_t unkval2
Definition: LoginRequest.h:16
Definition: LoginRequest.h:11
Definition: Buffer.h:17
void uPutBytes(const uint8_t *t, size_t len)
Definition: Buffer.cpp:96
uint32_t unkval1
Definition: LoginRequest.h:15
void uPut(const T &val)
Definition: Buffer.h:69
Definition: LoginRequest.h:18
void serializefrom(GrowingBuffer &buf)
Definition: LoginRequest.h:32
LoginRequest()
Definition: LoginRequest.h:21
char login[14]
Definition: LoginRequest.h:13
void uGetBytes(uint8_t *t, size_t len)
Definition: Buffer.cpp:133
Definition: AuthEvents.h:15