The Battle for Wesnoth
1.19.5+dev
server
wesnothd
player_connection.cpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2016 - 2024
3
by Sergey Popov <loonycyborg@gmail.com>
4
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY.
12
13
See the COPYING file for more details.
14
*/
15
16
#include "
server/wesnothd/player_connection.hpp
"
17
18
#include "
server/wesnothd/game.hpp
"
19
20
namespace
wesnothd
21
{
22
const
std::shared_ptr<game>
player_record::get_game
()
const
23
{
24
return
game_
;
25
}
26
27
std::shared_ptr<game>&
player_record::get_game
()
28
{
29
return
game_
;
30
}
31
32
int
player_record::game_id
()
const
33
{
34
return
game_
?
game_
->id() : 0;
35
}
36
37
void
player_record::set_game
(std::shared_ptr<game> new_game)
38
{
39
game_
= new_game;
40
}
41
42
void
player_record::enter_lobby
()
43
{
44
game_
.reset();
45
}
46
47
}
wesnothd::player_record::enter_lobby
void enter_lobby()
Definition:
player_connection.cpp:42
wesnothd::player_record::set_game
void set_game(std::shared_ptr< game > new_game)
Definition:
player_connection.cpp:37
wesnothd::player_record::game_
std::shared_ptr< game > game_
Definition:
player_connection.hpp:78
wesnothd::player_record::game_id
int game_id() const
Definition:
player_connection.cpp:32
wesnothd::player_record::get_game
const std::shared_ptr< game > get_game() const
Definition:
player_connection.cpp:22
game.hpp
wesnothd
Definition:
user_handler.hpp:29
player_connection.hpp
Generated by
1.9.1