The Battle for Wesnoth  1.15.2+dev
lobby_data.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2018 by Tomasz Sniatowski <kailoran@gmail.com>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
16 
17 #include "config.hpp"
19 #include "preferences/game.hpp"
21 #include "filesystem.hpp"
22 #include "font/pango/escape.hpp"
23 #include "formatter.hpp"
24 #include "formula/string_utils.hpp"
25 #include "game_config_manager.hpp"
26 #include "gettext.hpp"
27 #include "lexical_cast.hpp"
28 #include "log.hpp"
29 #include "map/map.hpp"
30 #include "map/exception.hpp"
31 #include "terrain/type_data.hpp"
32 #include "wml_exception.hpp"
33 #include "game_version.hpp"
34 #include "mp_game_settings.hpp"
35 
36 #include <iterator>
37 
38 #include <boost/algorithm/string.hpp>
39 
40 static lg::log_domain log_config("config");
41 #define ERR_CF LOG_STREAM(err, log_config)
42 static lg::log_domain log_engine("engine");
43 #define WRN_NG LOG_STREAM(warn, log_engine)
44 
45 static lg::log_domain log_lobby("lobby");
46 #define DBG_LB LOG_STREAM(info, log_lobby)
47 #define LOG_LB LOG_STREAM(info, log_lobby)
48 #define ERR_LB LOG_STREAM(err, log_lobby)
49 
50 namespace mp {
51 
53  const std::string& user,
54  const std::string& message)
55  : timestamp(timestamp), user(user), message(message)
56 {
57 }
58 
60 {
61 }
62 
63 void chat_session::add_message(const std::time_t& timestamp,
64  const std::string& user,
65  const std::string& message)
66 {
67  history_.emplace_back(timestamp, user, message);
68 }
69 
70 
71 void chat_session::add_message(const std::string& user, const std::string& message)
72 {
73  add_message(std::time(nullptr), user, message);
74 }
75 
77 {
78  history_.clear();
79 }
80 
81 room_info::room_info(const std::string& name) : name_(name), members_(), log_()
82 {
83 }
84 
85 bool room_info::is_member(const std::string& user) const
86 {
87  return members_.find(user) != members_.end();
88 }
89 
90 void room_info::add_member(const std::string& user)
91 {
92  members_.insert(user);
93 }
94 
95 void room_info::remove_member(const std::string& user)
96 {
97  members_.erase(user);
98 }
99 
101 {
102  members_.clear();
103  for(const auto & m : data.child_range("member"))
104  {
105  members_.insert(m["name"]);
106  }
107 }
108 
110  : name(c["name"])
111  , game_id(c["game_id"])
112  , relation(ME)
113  , state(game_id == 0 ? LOBBY : GAME)
114  , registered(c["registered"].to_bool())
115  , observing(c["status"] == "observing")
116 {
117  update_relation();
118 }
119 
120 void user_info::update_state(int selected_game_id,
121  const room_info* current_room /*= nullptr*/)
122 {
123  if(game_id != 0) {
124  if(game_id == selected_game_id) {
125  state = SEL_GAME;
126  } else {
127  state = GAME;
128  }
129  } else {
130  if(current_room != nullptr && current_room->is_member(name)) {
131  state = SEL_ROOM;
132  } else {
133  state = LOBBY;
134  }
135  }
136  update_relation();
137 }
138 
140 {
141  if(name == preferences::login()) {
142  relation = ME;
143  } else if(preferences::is_ignored(name)) {
144  relation = IGNORED;
145  } else if(preferences::is_friend(name)) {
146  relation = FRIEND;
147  } else {
148  relation = NEUTRAL;
149  }
150 }
151 
152 bool user_info::operator<(const user_info& b) const
153 {
154  return relation < b.relation || (relation == b.relation && translation::icompare(name, b.name) < 0);
155 }
156 
157 namespace
158 {
159 const std::string& spaced_em_dash()
160 {
161  static const std::string res = " " + font::unicode_em_dash + " ";
162  return res;
163 }
164 
165 std::string make_game_type_marker(const std::string& text, bool color_for_missing)
166 {
167  if(color_for_missing) {
168  return formatter() << "<b><span color='#f00'>[" << text << "]</span></b> ";
169  } else {
170  return formatter() << "<b>[" << text << "]</b> ";
171  }
172 }
173 
174 } // end anon namespace
175 
176 game_info::game_info(const config& game, const std::vector<std::string>& installed_addons)
177  : id(game["id"])
178  , map_data(game["map_data"])
179  , name(font::escape_text(game["name"]))
180  , scenario()
181  , remote_scenario(false)
182  , map_info()
183  , map_size_info()
184  , era()
185  , gold(game["mp_village_gold"])
186  , support(game["mp_village_support"])
187  , xp(game["experience_modifier"].str() + "%")
188  , vision()
189  , status()
190  , time_limit()
191  , vacant_slots()
192  , current_turn(0)
193  , reloaded(game["savegame"].to_enum<mp_game_settings::SAVED_GAME_MODE>(mp_game_settings::SAVED_GAME_MODE::NONE) != mp_game_settings::SAVED_GAME_MODE::NONE)
194  , started(false)
195  , fog(game["mp_fog"].to_bool())
196  , shroud(game["mp_shroud"].to_bool())
197  , observers(game["observer"].to_bool(true))
198  , shuffle_sides(game["shuffle_sides"].to_bool(true))
199  , use_map_settings(game["mp_use_map_settings"].to_bool())
200  , registered_users_only(game["registered_users_only"].to_bool())
201  , private_replay(game["private_replay"].to_bool())
202  , verified(true)
203  , password_required(game["password"].to_bool())
204  , have_era(true)
205  , have_all_mods(true)
206  , has_friends(false)
207  , has_ignored(false)
208  , display_status(NEW)
209  , required_addons()
210  , addons_outcome(SATISFIED)
211 {
213 
214  // Parse the list of addons required to join this game.
215  for(const config& addon : game.child_range("addon")) {
216  if(addon.has_attribute("id")) {
217  if(std::find(installed_addons.begin(), installed_addons.end(), addon["id"].str()) == installed_addons.end()) {
218  required_addon r;
219  r.addon_id = addon["id"].str();
221 
222  // Use addon name if provided, else fall back on the addon id.
223  if(addon.has_attribute("name")) {
224  r.message = VGETTEXT("Missing addon: $name", {{"name", addon["name"].str()}});
225  } else {
226  r.message = VGETTEXT("Missing addon: $id", {{"id", addon["id"].str()}});
227  }
228 
229  required_addons.push_back(std::move(r));
230 
231  if(addons_outcome == SATISFIED) {
233  }
234  }
235  }
236  }
237 
238  if(!game["mp_era"].empty()) {
239  const config& era_cfg = game_config.find_child("era", "id", game["mp_era"]);
240  const bool require = game["require_era"].to_bool(true);
241  if(era_cfg) {
242  era = era_cfg["name"].str();
243 
244  if(require) {
245  ADDON_REQ result = check_addon_version_compatibility(era_cfg, game);
246  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
247  }
248  } else {
249  have_era = !require;
250  era = game["mp_era_name"].str();
251  verified = false;
252 
253  if(!have_era) {
255  }
256  }
257  } else {
258  era = _("Unknown era");
259  verified = false;
260  }
261 
262  std::stringstream info_stream;
263  info_stream << era;
264 
265  for(const config& cfg : game.child_range("modification")) {
266  mod_info.emplace_back(cfg["name"].str(), true);
267  info_stream << ' ' << mod_info.back().first;
268 
269  if(cfg["require_modification"].to_bool(false)) {
270  if(const config& mod = game_config.find_child("modification", "id", cfg["id"])) {
271  ADDON_REQ result = check_addon_version_compatibility(mod, game);
272  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
273  } else {
274  have_all_mods = false;
275  mod_info.back().second = false;
276 
278  }
279  }
280  }
281 
282  std::sort(mod_info.begin(), mod_info.end(), [](const auto& lhs, const auto& rhs) {
283  return translation::icompare(lhs.first, rhs.first) < 0;
284  });
285 
286  info_stream << ' ';
287 
288  if(map_data.empty()) {
289  map_data = filesystem::read_map(game["mp_scenario"]);
290  }
291 
292  if(map_data.empty()) {
293  info_stream << " — ??×??";
294  } else {
295  try {
296  gamemap map(std::make_shared<terrain_type_data>(game_config), map_data);
297  std::ostringstream msi;
298  msi << map.w() << font::unicode_multiplication_sign << map.h();
299  map_size_info = msi.str();
300  info_stream << spaced_em_dash() << map_size_info;
301  } catch(const incorrect_map_format_error&) {
302  verified = false;
303  } catch(const wml_exception& e) {
304  ERR_CF << "map could not be loaded: " << e.dev_message << '\n';
305  verified = false;
306  }
307  }
308 
309  info_stream << " ";
310 
311  //
312  // Check scenarios and campaigns
313  //
314  if(!game["mp_scenario"].empty() && game["mp_campaign"].empty()) {
315  // Check if it's a multiplayer scenario
316  const config* level_cfg = &game_config.find_child("multiplayer", "id", game["mp_scenario"]);
317  const bool require = game["require_scenario"].to_bool(false);
318 
319  // Check if it's a user map
320  if(!*level_cfg) {
321  level_cfg = &game_config.find_child("generic_multiplayer", "id", game["mp_scenario"]);
322  }
323 
324  if(*level_cfg) {
325  scenario = formatter() << make_game_type_marker(_("scenario_abbreviation^S"), false) << (*level_cfg)["name"].str();
326  info_stream << scenario;
327 
328  // Reloaded games do not match the original scenario hash, so it makes no sense
329  // to test them, since they always would appear as remote scenarios
330  if(!reloaded) {
331  if(const config& hashes = game_config.child("multiplayer_hashes")) {
332  std::string hash = game["hash"];
333  bool hash_found = false;
334  for(const auto & i : hashes.attribute_range()) {
335  if(i.first == game["mp_scenario"] && i.second == hash) {
336  hash_found = true;
337  break;
338  }
339  }
340 
341  if(!hash_found) {
342  remote_scenario = true;
343  info_stream << spaced_em_dash();
344  info_stream << _("Remote scenario");
345  verified = false;
346  }
347  }
348  }
349 
350  if(require) {
351  ADDON_REQ result = check_addon_version_compatibility((*level_cfg), game);
352  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
353  }
354  } else {
355  if(require) {
356  addons_outcome = std::max(addons_outcome, NEED_DOWNLOAD); // Elevate to most severe error level encountered so far
357  }
358  scenario = formatter() << make_game_type_marker(_("scenario_abbreviation^S"), true) << game["mp_scenario_name"].str();
359  info_stream << scenario;
360  verified = false;
361  }
362  } else if(!game["mp_campaign"].empty()) {
363  if(const config& campaign_cfg = game_config.find_child("campaign", "id", game["mp_campaign"])) {
364  std::stringstream campaign_text;
365  campaign_text
366  << make_game_type_marker(_("campaign_abbreviation^C"), false)
367  << campaign_cfg["name"] << spaced_em_dash()
368  << game["mp_scenario_name"];
369 
370  // Difficulty
371  config difficulties = gui2::dialogs::generate_difficulty_config(campaign_cfg);
372  for(const config& difficulty : difficulties.child_range("difficulty")) {
373  if(difficulty["define"] == game["difficulty_define"]) {
374  campaign_text << spaced_em_dash() << difficulty["description"];
375 
376  break;
377  }
378  }
379 
380  scenario = campaign_text.str();
381  info_stream << campaign_text.rdbuf();
382 
383  // TODO: should we have this?
384  //if(game["require_scenario"].to_bool(false)) {
385  ADDON_REQ result = check_addon_version_compatibility(campaign_cfg, game);
386  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
387  //}
388  } else {
389  scenario = formatter() << make_game_type_marker(_("campaign_abbreviation^C"), true) << game["mp_campaign_name"].str();
390  info_stream << scenario;
391  verified = false;
392  }
393  } else {
394  scenario = _("Unknown scenario");
395  info_stream << scenario;
396  verified = false;
397  }
398 
399  // Remove any newlines that might have been in game titles
400  boost::replace_all(scenario, "\n", " " + font::unicode_em_dash + " ");
401 
402  if(reloaded) {
403  info_stream << spaced_em_dash();
404  info_stream << _("Reloaded game");
405  verified = false;
406  }
407 
408  // These should always be present in the data the server sends, but may or may not be empty.
409  // I'm just using child_or_empty here to preempt any cases where they might not be included.
410  const config& s = game.child_or_empty("slot_data");
411  const config& t = game.child_or_empty("turn_data");
412 
413  if(!s.empty()) {
414  started = false;
415 
416  vacant_slots = s["vacant"].to_unsigned();
417 
418  if(vacant_slots > 0) {
419  status = formatter() << _n("Vacant Slot:", "Vacant Slots:", vacant_slots) << " " << vacant_slots << "/" << s["max"];
420  } else {
421  status = _("mp_game_available_slots^Full");
422  }
423  }
424 
425  if(!t.empty()) {
426  started = true;
427 
428  current_turn = t["current"].to_unsigned();
429  const int max_turns = t["max"].to_int();
430 
431  if(max_turns > -1) {
432  status = formatter() << _("Turn") << " " << t["current"] << "/" << max_turns;
433  } else {
434  status = formatter() << _("Turn") << " " << t["current"];
435  }
436  }
437 
438  if(fog) {
439  vision = _("Fog");
440  if(shroud) {
441  vision += "/";
442  vision += _("Shroud");
443  }
444  } else if(shroud) {
445  vision = _("Shroud");
446  } else {
447  vision = _("vision^none");
448  }
449 
450  if(game["mp_countdown"].to_bool()) {
452  << game["mp_countdown_init_time"].str() << "+"
453  << game["mp_countdown_turn_bonus"].str() << "/"
454  << game["mp_countdown_action_bonus"].str();
455  } else {
456  time_limit = _("time limit^none");
457  }
458 
459  map_info = info_stream.str();
460 }
461 
463 {
464  if(!local_item.has_attribute("addon_id") || !local_item.has_attribute("addon_version")) {
465  return SATISFIED;
466  }
467 
468  if(const config& game_req = game.find_child("addon", "id", local_item["addon_id"])) {
469  required_addon r {local_item["addon_id"].str(), SATISFIED, ""};
470 
471  // Local version
472  const version_info local_ver(local_item["addon_version"].str());
473  version_info local_min_ver(local_item.has_attribute("addon_min_version") ? local_item["addon_min_version"] : local_item["addon_version"]);
474 
475  // If the UMC didn't specify last compatible version, assume no backwards compatibility.
476  // Also apply some sanity checking regarding min version; if the min ver doesn't make sense, ignore it.
477  local_min_ver = std::min(local_min_ver, local_ver);
478 
479  // Remote version
480  const version_info remote_ver(game_req["version"].str());
481  version_info remote_min_ver(game_req.has_attribute("min_version") ? game_req["min_version"] : game_req["version"]);
482 
483  remote_min_ver = std::min(remote_min_ver, remote_ver);
484 
485  // Check if the host is too out of date to play.
486  if(local_min_ver > remote_ver) {
487  DBG_LB << "r.outcome = CANNOT_SATISFY for item='" << local_item["id"]
488  << "' addon='" << local_item["addon_id"]
489  << "' addon_min_version='" << local_item["addon_min_version"]
490  << "' addon_min_version_parsed='" << local_min_ver.str()
491  << "' addon_version='" << local_item["addon_version"]
492  << "' remote_ver='" << remote_ver.str()
493  << "'\n";
494  r.outcome = CANNOT_SATISFY;
495 
496  r.message = VGETTEXT("The host's version of <i>$addon</i> is incompatible. They have version <b>$host_ver</b> while you have version <b>$local_ver</b>.", {
497  {"addon", local_item["addon_title"].str()},
498  {"host_ver", remote_ver.str()},
499  {"local_ver", local_ver.str()}
500  });
501 
502  required_addons.push_back(r);
503  return r.outcome;
504  }
505 
506  // Check if our version is too out of date to play.
507  if(remote_min_ver > local_ver) {
508  r.outcome = NEED_DOWNLOAD;
509 
510  r.message = VGETTEXT("Your version of <i>$addon</i> is incompatible. You have version <b>$local_ver</b> while the host has version <b>$host_ver</b>.", {
511  {"addon", local_item["addon_title"].str()},
512  {"host_ver", remote_ver.str()},
513  {"local_ver", local_ver.str()}
514  });
515 
516  required_addons.push_back(r);
517  return r.outcome;
518  }
519  }
520 
521  return SATISFIED;
522 }
523 
525 {
526  return !started && vacant_slots > 0;
527 }
528 
530 {
532 }
533 
535 {
536  switch(display_status) {
537  case game_info::CLEAN:
538  return "clean";
539  case game_info::NEW:
540  return "new";
541  case game_info::DELETED:
542  return "deleted";
543  case game_info::UPDATED:
544  return "updated";
545  default:
546  ERR_CF << "BAD display_status " << display_status << " in game " << id << "\n";
547  return "?";
548  }
549 }
550 
551 bool game_info::match_string_filter(const std::string& filter) const
552 {
553  const std::string& s1 = name;
554  const std::string& s2 = map_info;
555  return std::search(s1.begin(), s1.end(), filter.begin(), filter.end(),
556  chars_equal_insensitive) != s1.end()
557  || std::search(s2.begin(), s2.end(), filter.begin(), filter.end(),
558  chars_equal_insensitive) != s2.end();
559 }
560 
561 }
std::string scenario
Definition: lobby_data.hpp:148
std::string map_size_info
Definition: lobby_data.hpp:151
config & child(config_key_type key, int n=0)
Returns the nth child with the given key, or a reference to an invalid config if there is none...
Definition: config.cpp:420
void add_message(const std::time_t &timestamp, const std::string &user, const std::string &message)
Definition: lobby_data.cpp:63
int h() const
Effective map height, in hexes.
Definition: map.hpp:128
ADDON_REQ addons_outcome
Definition: lobby_data.hpp:200
std::string status
Definition: lobby_data.hpp:161
std::string era()
Definition: game.cpp:723
#define ERR_CF
Definition: lobby_data.cpp:41
Interfaces for manipulating version numbers of engine, add-ons, etc.
std::vector< std::pair< std::string, bool > > mod_info
List of modification names and whether they&#39;re installed or not.
Definition: lobby_data.hpp:155
bool is_authenticated()
Definition: game.cpp:181
Note: Specific to sdl_ttf.
unsigned int current_turn
Definition: lobby_data.hpp:165
std::deque< chat_message > history_
Definition: lobby_data.hpp:61
config & find_child(config_key_type key, const std::string &name, const std::string &value)
Returns the first child of tag key with a name attribute containing value.
Definition: config.cpp:836
Add a special kind of assert to validate whether the input from WML doesn&#39;t contain any problems that...
New lexcical_cast header.
bool has_attribute(config_key_type key) const
Definition: config.cpp:213
user_state state
Definition: lobby_data.hpp:130
child_itors child_range(config_key_type key)
Definition: config.cpp:362
bool shuffle_sides()
Definition: game.cpp:498
std::set< std::string > members_
Definition: lobby_data.hpp:96
std::string map_info
Definition: lobby_data.hpp:150
bool chars_equal_insensitive(char a, char b)
Definition: general.hpp:21
bool remote_scenario
Definition: lobby_data.hpp:149
Definitions for the interface to Wesnoth Markup Language (WML).
std::string name
Definition: lobby_data.hpp:147
std::string time_limit
Definition: lobby_data.hpp:162
#define b
static lg::log_domain log_lobby("lobby")
bool fog()
Definition: game.cpp:563
Pubic entry points for the MP workflow.
Definition: lobby_data.cpp:50
static game_config_manager * get()
user_info(const config &c)
Definition: lobby_data.cpp:109
static UNUSEDNOWARN std::string _(const char *str)
Definition: gettext.hpp:91
chat_message(const std::time_t &timestamp, const std::string &user, const std::string &message)
Create a chat message.
Definition: lobby_data.cpp:52
bool is_friend(const std::string &nick)
Definition: game.cpp:303
std::ostringstream wrapper.
Definition: formatter.hpp:38
#define DBG_LB
Definition: lobby_data.cpp:46
std::string vision
Definition: lobby_data.hpp:160
const std::string unicode_multiplication_sign
Definition: constants.cpp:42
Encapsulates the map of the game.
Definition: map.hpp:36
static UNUSEDNOWARN std::string _n(const char *str1, const char *str2, int n)
Definition: gettext.hpp:95
static lg::log_domain log_config("config")
std::string map_data
Definition: lobby_data.hpp:146
std::vector< std::string > installed_addons()
Retrieves the names of all installed add-ons.
Definition: manager.cpp:147
bool is_member(const std::string &user) const
Definition: lobby_data.cpp:85
bool registered_users_only()
Definition: game.cpp:488
bool is_ignored(const std::string &nick)
Definition: game.cpp:316
std::string read_map(const std::string &name)
Helper class, don&#39;t construct this directly.
std::string login()
std::string name
Definition: lobby_data.hpp:127
std::string dev_message
The message for developers telling which problem was triggered, this shouldn&#39;t be translated...
bool shroud()
Definition: game.cpp:573
int w() const
Effective map width, in hexes.
Definition: map.hpp:125
std::string escape_text(const std::string &text)
Escapes the pango markup characters in a text.
Definition: escape.hpp:32
const char * display_status_string() const
Definition: lobby_data.cpp:534
std::size_t i
Definition: function.cpp:933
static lg::log_domain log_engine("engine")
Default, unset return value.
Definition: retval.hpp:31
config generate_difficulty_config(const config &source)
Helper function to convert old difficulty markup.
Game configuration data as global variables.
Definition: build_info.cpp:49
static map_location::DIRECTION s
ADDON_REQ check_addon_version_compatibility(const config &local_item, const config &game)
Definition: lobby_data.cpp:462
bool use_map_settings()
Definition: game.cpp:516
This class represents the information a client has about a room.
Definition: lobby_data.hpp:67
Declarations for File-IO.
bool can_observe() const
Definition: lobby_data.cpp:529
static int sort(lua_State *L)
Definition: ltablib.cpp:411
#define VGETTEXT(msgid,...)
Handy wrappers around interpolate_variables_into_string and gettext.
Represents version numbers.
std::string era
Definition: lobby_data.hpp:152
This class represents the information a client has about another player.
Definition: lobby_data.hpp:104
void update_state(int selected_game_id, const room_info *current_room=nullptr)
Definition: lobby_data.cpp:120
room_info(const std::string &name)
Definition: lobby_data.cpp:81
double t
Definition: astarsearch.cpp:64
bool find(E event, F functor)
Tests whether an event handler is available.
static bool timestamp
Definition: log.cpp:45
int icompare(const std::string &s1, const std::string &s2)
Case-insensitive lexicographical comparison.
Definition: gettext.cpp:476
std::size_t vacant_slots
Definition: lobby_data.hpp:163
const std::string unicode_em_dash
Definition: constants.cpp:40
void remove_member(const std::string &user)
Definition: lobby_data.cpp:95
Standard logging facilities (interface).
std::string str() const
Serializes the version number into string form.
game_display_status display_status
Definition: lobby_data.hpp:189
std::vector< required_addon > required_addons
Definition: lobby_data.hpp:199
void update_relation()
Definition: lobby_data.cpp:139
#define e
game_info(const config &c, const std::vector< std::string > &installed_addons)
Definition: lobby_data.cpp:176
const config & child_or_empty(config_key_type key) const
Returns the first child with the given key, or an empty config if there is none.
Definition: config.cpp:453
user_relation relation
Definition: lobby_data.hpp:129
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:68
bool can_join() const
Definition: lobby_data.cpp:524
mock_char c
bool operator<(const user_info &b) const
Definition: lobby_data.cpp:152
std::string str() const
Definition: formatter.hpp:60
bool empty() const
Definition: config.cpp:884
const config & game_config() const
void process_room_members(const config &data)
Definition: lobby_data.cpp:100
bool match_string_filter(const std::string &filter) const
Definition: lobby_data.cpp:551
const std::string & name() const
Definition: lobby_data.hpp:72
void add_member(const std::string &user)
Definition: lobby_data.cpp:90