The Battle for Wesnoth
1.21.0-dev
Loading...
Searching...
No Matches
server
wesnothd
player_connection.cpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2016 - 2025
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 <utility>
19
20
#include "
server/wesnothd/game.hpp
"
21
22
namespace
wesnothd
23
{
24
const
std::shared_ptr<game>
player_record::get_game
()
const
25
{
26
return
game_
;
27
}
28
29
std::shared_ptr<game>&
player_record::get_game
()
30
{
31
return
game_
;
32
}
33
34
int
player_record::game_id
()
const
35
{
36
return
game_
?
game_
->id() : 0;
37
}
38
39
void
player_record::set_game
(std::shared_ptr<game> new_game)
40
{
41
game_
= std::move(new_game);
42
}
43
44
void
player_record::enter_lobby
()
45
{
46
game_
.reset();
47
}
48
49
}
wesnothd::player_record::enter_lobby
void enter_lobby()
Definition
player_connection.cpp:44
wesnothd::player_record::set_game
void set_game(std::shared_ptr< game > new_game)
Definition
player_connection.cpp:39
wesnothd::player_record::game_
std::shared_ptr< game > game_
Definition
player_connection.hpp:82
wesnothd::player_record::game_id
int game_id() const
Definition
player_connection.cpp:34
wesnothd::player_record::get_game
const std::shared_ptr< game > get_game() const
Definition
player_connection.cpp:24
game.hpp
wesnothd
Definition
user_handler.hpp:29
player_connection.hpp
Generated by
1.9.8