SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GameServer_client.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_GameServer_client_b5cc02dd_HPP__
9 #define MPRPC_GameServer_client_b5cc02dd_HPP__
10 
11 #include "GameServer.hpp"
12 
13 namespace StickWorld {
14 
15 namespace GameServer {
16 
17 
18 class client : public msgpack::rpc::client::base {
19 public:
20  client(const msgpack::rpc::address& addr, msgpack::rpc::loop lo = msgpack::rpc::loop()) :
21  msgpack::rpc::client::base(addr, lo) { }
22 
23  client(const std::string& host, uint16_t port, msgpack::rpc::loop lo = msgpack::rpc::loop()) :
24  msgpack::rpc::client::base(host, port, lo) { }
25 
26  ~client() { }
27 
28  int32_t login_apply(
29  const GameServer::login& message) {
30  return instance.call_apply("login", message).get<int32_t>();
31  }
32 
33  int32_t login(
34  const std::string& login, const std::string& passw) {
35  GameServer::login _Message;
36  _Message.login = login;
37  _Message.passw = passw;
38  return login_apply(_Message);
39  }
40 
41  msgpack::rpc::future::type<int32_t> login_async_apply(
42  const GameServer::login& message) {
43  return instance.call_apply("login", message);
44  }
45 
46  msgpack::rpc::future::type<int32_t> login_async(
47  const std::string& login, const std::string& passw) {
48  GameServer::login _Message;
49  _Message.login = login;
50  _Message.passw = passw;
51  return login_async_apply(_Message);
52  }
53 };
54 
55 
56 } // namespace GameServer
57 
58 
59 } // namespace StickWorld
60 #endif
Definition: GameServer_client.hpp:18
client(const std::string &host, uint16_t port, msgpack::rpc::loop lo=msgpack::rpc::loop())
Definition: GameServer_client.hpp:23
std::string passw
Definition: GameServer.hpp:25
int32_t login(const std::string &login, const std::string &passw)
Definition: GameServer_client.hpp:33
~client()
Definition: GameServer_client.hpp:26
msgpack::rpc::future::type< int32_t > login_async_apply(const GameServer::login &message)
Definition: GameServer_client.hpp:41
client(const msgpack::rpc::address &addr, msgpack::rpc::loop lo=msgpack::rpc::loop())
Definition: GameServer_client.hpp:20
std::string login
Definition: GameServer.hpp:24
Definition: GameServer.hpp:18
msgpack::rpc::future::type< int32_t > login_async(const std::string &login, const std::string &passw)
Definition: GameServer_client.hpp:46
int32_t login_apply(const GameServer::login &message)
Definition: GameServer_client.hpp:28
Definition: GameServer.h:18