forked from supertuxkart/stk-code
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlobby_context.cpp
More file actions
84 lines (76 loc) · 3.22 KB
/
lobby_context.cpp
File metadata and controls
84 lines (76 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2025 kimden
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 3
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "utils/lobby_context.hpp"
#include "network/protocols/command_manager.hpp"
#include "utils/chat_manager.hpp"
#include "utils/hit_processor.hpp"
#include "utils/kart_elimination.hpp"
#include "utils/lobby_asset_manager.hpp"
#include "utils/lobby_queues.hpp"
#include "utils/lobby_settings.hpp"
#include "utils/map_vote_handler.hpp"
#include "utils/team_manager.hpp"
#include "utils/tournament.hpp"
#include "utils/lobby_gp_manager.hpp"
#include "utils/scoring/scoring.hpp"
#include "utils/crown_manager.hpp"
#include "network/game_setup.hpp"
#include "network/database_connector.hpp"
LobbyContext::LobbyContext(ServerLobby* lobby, bool make_tournament)
: m_lobby(lobby)
{
// Nothing for ServerLobby, as we create LC inside SL
m_asset_manager = std::make_shared<LobbyAssetManager>(this);
m_hit_processor = std::make_shared<HitProcessor>(this);
m_kart_elimination = std::make_shared<KartElimination>(this);
m_lobby_queues = std::make_shared<LobbyQueues>(this);
m_lobby_settings = std::make_shared<LobbySettings>(this);
m_map_vote_handler = std::make_shared<MapVoteHandler>(this);
m_command_manager = std::make_shared<CommandManager>(this);
m_chat_manager = std::make_shared<ChatManager>(this);
m_team_manager = std::make_shared<TeamManager>(this);
m_gp_manager = std::make_shared<LobbyGPManager>(this);
m_crown_manager = std::make_shared<CrownManager>(this);
#ifdef ENABLE_SQLITE3
m_db_connector = std::make_shared<DatabaseConnector>(this);
#endif
if (make_tournament)
m_tournament = std::make_shared<Tournament>(this);
} // LobbyContext
//-----------------------------------------------------------------------------
void LobbyContext::setup()
{
// Nothing for ServerLobby
m_asset_manager->setupContextUser();
m_hit_processor->setupContextUser();
m_kart_elimination->setupContextUser();
m_lobby_queues->setupContextUser();
m_lobby_settings->setupContextUser();
m_map_vote_handler->setupContextUser();
m_chat_manager->setupContextUser();
m_team_manager->setupContextUser();
m_command_manager->setupContextUser();
m_gp_manager->setupContextUser();
m_crown_manager->setupContextUser();
#ifdef ENABLE_SQLITE3
m_db_connector->setupContextUser();
#endif
if (m_tournament)
m_tournament->setupContextUser();
} // setup
//-----------------------------------------------------------------------------