SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChatClient.hpp
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 #ifndef MPRPC_ChatClient_d379a28d_HPP__
9 #define MPRPC_ChatClient_d379a28d_HPP__
10 
11 #include "types.hpp"
12 
13 namespace StickWorld {
14 
15 namespace ChatClient {
16 
17 
18 struct notify {
19 
21  {
22  }
23 
25 
26  template <typename Packer>
27  void msgpack_pack(Packer& _Pk) const {
28  _Pk.pack_array(1);
29  _Pk.pack(x);
30  }
31 
32  void msgpack_unpack(msgpack::object _Obj) {
33  if(_Obj.type != msgpack::type::ARRAY) {
34  throw msgpack::type_error();
35  }
36  const size_t _Length = _Obj.via.array.size;
37  msgpack::object* const _Array = _Obj.via.array.ptr;
38 
39  if(_Length < 0) {
40  throw msgpack::type_error();
41  }
42 
43 
44  if(_Length <= 0) { return; }
45  if(!_Array[0].is_nil()) {
46  _Array[0].convert(&x);
47  }
48 
49  }
50 };
51 
52 
53 } // namespace ChatClient
54 
55 } // namespace StickWorld
56 #endif
void msgpack_unpack(msgpack::object _Obj)
Definition: ChatClient.hpp:32
Definition: types.hpp:18
notify()
Definition: ChatClient.hpp:20
void msgpack_pack(Packer &_Pk) const
Definition: ChatClient.hpp:27
ChatMessage x
Definition: ChatClient.hpp:24
Definition: ChatClient.hpp:18