The Battle for Wesnoth  1.15.0-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 
35 #include <iterator>
36 
37 #include <boost/algorithm/string.hpp>
38 
39 static lg::log_domain log_config("config");
40 #define ERR_CF LOG_STREAM(err, log_config)
41 static lg::log_domain log_engine("engine");
42 #define WRN_NG LOG_STREAM(warn, log_engine)
43 
44 static lg::log_domain log_lobby("lobby");
45 #define DBG_LB LOG_STREAM(info, log_lobby)
46 #define LOG_LB LOG_STREAM(info, log_lobby)
47 #define ERR_LB LOG_STREAM(err, log_lobby)
48 
49 namespace mp {
50 
52  const std::string& user,
53  const std::string& message)
54  : timestamp(timestamp), user(user), message(message)
55 {
56 }
57 
59 {
60 }
61 
62 void chat_session::add_message(const std::time_t& timestamp,
63  const std::string& user,
64  const std::string& message)
65 {
66  history_.emplace_back(timestamp, user, message);
67 }
68 
69 
70 void chat_session::add_message(const std::string& user, const std::string& message)
71 {
72  add_message(std::time(nullptr), user, message);
73 }
74 
76 {
77  history_.clear();
78 }
79 
80 room_info::room_info(const std::string& name) : name_(name), members_(), log_()
81 {
82 }
83 
84 bool room_info::is_member(const std::string& user) const
85 {
86  return members_.find(user) != members_.end();
87 }
88 
89 void room_info::add_member(const std::string& user)
90 {
91  members_.insert(user);
92 }
93 
94 void room_info::remove_member(const std::string& user)
95 {
96  members_.erase(user);
97 }
98 
100 {
101  members_.clear();
102  for(const auto & m : data.child_range("member"))
103  {
104  members_.insert(m["name"]);
105  }
106 }
107 
109  : name(c["name"])
110  , game_id(c["game_id"])
111  , relation(ME)
112  , state(game_id == 0 ? LOBBY : GAME)
113  , registered(c["registered"].to_bool())
114  , observing(c["status"] == "observing")
115 {
116  update_relation();
117 }
118 
119 void user_info::update_state(int selected_game_id,
120  const room_info* current_room /*= nullptr*/)
121 {
122  if(game_id != 0) {
123  if(game_id == selected_game_id) {
124  state = SEL_GAME;
125  } else {
126  state = GAME;
127  }
128  } else {
129  if(current_room != nullptr && current_room->is_member(name)) {
130  state = SEL_ROOM;
131  } else {
132  state = LOBBY;
133  }
134  }
135  update_relation();
136 }
137 
139 {
140  if(name == preferences::login()) {
141  relation = ME;
142  } else if(preferences::is_ignored(name)) {
143  relation = IGNORED;
144  } else if(preferences::is_friend(name)) {
145  relation = FRIEND;
146  } else {
147  relation = NEUTRAL;
148  }
149 }
150 
151 bool user_info::operator<(const user_info& b) const
152 {
153  return relation < b.relation || (relation == b.relation && translation::icompare(name, b.name) < 0);
154 }
155 
156 namespace
157 {
158 const std::string& spaced_em_dash()
159 {
160  static const std::string res = " " + font::unicode_em_dash + " ";
161  return res;
162 }
163 
164 // Returns an abbreviated form of the provided string - ie, 'Ageless Era' should become 'AE'
165 std::string make_short_name(const std::string& long_name)
166 {
167  if(long_name.empty()) {
168  return "";
169  }
170 
171  std::size_t pos = 0;
172 
173  std::stringstream ss;
174  ss << long_name[pos];
175 
176  while(pos < long_name.size()) {
177  pos = long_name.find(' ', pos + 1);
178 
179  if(pos <= long_name.size() - 2) {
180  ss << long_name[pos + 1];
181  }
182  }
183 
184  return ss.str();
185 }
186 
187 std::string make_game_type_marker(std::string text, bool color_for_missing)
188 {
189  if(color_for_missing) {
190  return formatter() << "<b><span color='#f00'>[" << text << "]</span></b> ";
191  } else {
192  return formatter() << "<b>[" << text << "]</b> ";
193  }
194 }
195 
196 } // end anon namespace
197 
198 game_info::game_info(const config& game, const std::vector<std::string>& installed_addons)
199  : id(game["id"])
200  , map_data(game["map_data"])
201  , name(font::escape_text(game["name"]))
202  , scenario()
203  , remote_scenario(false)
204  , map_info()
205  , map_size_info()
206  , era()
207  , era_short()
208  , gold(game["mp_village_gold"])
209  , support(game["mp_village_support"])
210  , xp(game["experience_modifier"].str() + "%")
211  , vision()
212  , status()
213  , time_limit()
214  , vacant_slots()
215  , current_turn(0)
216  , reloaded(game["savegame"].to_bool())
217  , started(false)
218  , fog(game["mp_fog"].to_bool())
219  , shroud(game["mp_shroud"].to_bool())
220  , observers(game["observer"].to_bool(true))
221  , shuffle_sides(game["shuffle_sides"].to_bool(true))
222  , use_map_settings(game["mp_use_map_settings"].to_bool())
223  , registered_users_only(game["registered_users_only"].to_bool())
224  , verified(true)
225  , password_required(game["password"].to_bool())
226  , have_era(true)
227  , have_all_mods(true)
228  , has_friends(false)
229  , has_ignored(false)
230  , display_status(NEW)
231  , required_addons()
232  , addons_outcome(SATISFIED)
233 {
235 
236  // Parse the list of addons required to join this game.
237  for(const config& addon : game.child_range("addon")) {
238  if(addon.has_attribute("id")) {
239  if(std::find(installed_addons.begin(), installed_addons.end(), addon["id"].str()) == installed_addons.end()) {
240  required_addon r;
241  r.addon_id = addon["id"].str();
243 
244  // Use addon name if provided, else fall back on the addon id.
245  if(addon.has_attribute("name")) {
246  r.message = VGETTEXT("Missing addon: $name", {{"name", addon["name"].str()}});
247  } else {
248  r.message = VGETTEXT("Missing addon: $id", {{"id", addon["id"].str()}});
249  }
250 
251  required_addons.push_back(std::move(r));
252 
253  if(addons_outcome == SATISFIED) {
255  }
256  }
257  }
258  }
259 
260  if(!game["mp_era"].empty()) {
261  const config& era_cfg = game_config.find_child("era", "id", game["mp_era"]);
262  const bool require = game["require_era"].to_bool(true);
263  if(era_cfg) {
264  era = era_cfg["name"].str();
265  era_short = era_cfg["short_name"].str();
266  if(era_short.empty()) {
267  era_short = make_short_name(era);
268  }
269 
270  if(require) {
271  ADDON_REQ result = check_addon_version_compatibility(era_cfg, game);
272  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
273  }
274  } else {
275  have_era = !require;
276  era = game["mp_era_name"].str();
277  era_short = make_short_name(era);
278  verified = false;
279 
280  if(!have_era) {
282  }
283  }
284  } else {
285  era = _("Unknown era");
286  era_short = "??";
287  verified = false;
288  }
289 
290  std::stringstream info_stream;
291  info_stream << era;
292 
293  for(const config& cfg : game.child_range("modification")) {
294  mod_info.emplace_back(cfg["name"].str(), true);
295  info_stream << ' ' << mod_info.back().first;
296 
297  if(cfg["require_modification"].to_bool(false)) {
298  if(const config& mod = game_config.find_child("modification", "id", cfg["id"])) {
299  ADDON_REQ result = check_addon_version_compatibility(mod, game);
300  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
301  } else {
302  have_all_mods = false;
303  mod_info.back().second = false;
304 
306  }
307  }
308  }
309 
310  std::sort(mod_info.begin(), mod_info.end(), [](const auto& lhs, const auto& rhs) {
311  return translation::icompare(lhs.first, rhs.first) < 0;
312  });
313 
314  info_stream << ' ';
315 
316  if(map_data.empty()) {
317  map_data = filesystem::read_map(game["mp_scenario"]);
318  }
319 
320  if(map_data.empty()) {
321  info_stream << " — ??×??";
322  } else {
323  try {
324  gamemap map(std::make_shared<terrain_type_data>(game_config), map_data);
325  std::ostringstream msi;
326  msi << map.w() << font::unicode_multiplication_sign << map.h();
327  map_size_info = msi.str();
328  info_stream << spaced_em_dash() << map_size_info;
329  } catch(const incorrect_map_format_error&) {
330  verified = false;
331  } catch(const wml_exception& e) {
332  ERR_CF << "map could not be loaded: " << e.dev_message << '\n';
333  verified = false;
334  }
335  }
336 
337  info_stream << " ";
338 
339  //
340  // Check scenarios and campaigns
341  //
342  if(!game["mp_scenario"].empty() && game["mp_campaign"].empty()) {
343  // Check if it's a multiplayer scenario
344  const config* level_cfg = &game_config.find_child("multiplayer", "id", game["mp_scenario"]);
345  const bool require = game["require_scenario"].to_bool(false);
346 
347  // Check if it's a user map
348  if(!*level_cfg) {
349  level_cfg = &game_config.find_child("generic_multiplayer", "id", game["mp_scenario"]);
350  }
351 
352  if(*level_cfg) {
353  scenario = formatter() << make_game_type_marker(_("scenario_abbreviation^S"), false) << (*level_cfg)["name"].str();
354  info_stream << scenario;
355 
356  // Reloaded games do not match the original scenario hash, so it makes no sense
357  // to test them, since they always would appear as remote scenarios
358  if(!reloaded) {
359  if(const config& hashes = game_config.child("multiplayer_hashes")) {
360  std::string hash = game["hash"];
361  bool hash_found = false;
362  for(const auto & i : hashes.attribute_range()) {
363  if(i.first == game["mp_scenario"] && i.second == hash) {
364  hash_found = true;
365  break;
366  }
367  }
368 
369  if(!hash_found) {
370  remote_scenario = true;
371  info_stream << spaced_em_dash();
372  info_stream << _("Remote scenario");
373  verified = false;
374  }
375  }
376  }
377 
378  if(require) {
379  ADDON_REQ result = check_addon_version_compatibility((*level_cfg), game);
380  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
381  }
382  } else {
383  if(require) {
384  addons_outcome = std::max(addons_outcome, NEED_DOWNLOAD); // Elevate to most severe error level encountered so far
385  }
386  scenario = formatter() << make_game_type_marker(_("scenario_abbreviation^S"), true) << game["mp_scenario_name"].str();
387  info_stream << scenario;
388  verified = false;
389  }
390  } else if(!game["mp_campaign"].empty()) {
391  if(const config& campaign_cfg = game_config.find_child("campaign", "id", game["mp_campaign"])) {
392  std::stringstream campaign_text;
393  campaign_text
394  << make_game_type_marker(_("campaign_abbreviation^C"), false)
395  << campaign_cfg["name"] << spaced_em_dash()
396  << game["mp_scenario_name"];
397 
398  // Difficulty
399  config difficulties = gui2::dialogs::generate_difficulty_config(campaign_cfg);
400  for(const config& difficulty : difficulties.child_range("difficulty")) {
401  if(difficulty["define"] == game["difficulty_define"]) {
402  campaign_text << spaced_em_dash() << difficulty["description"];
403 
404  break;
405  }
406  }
407 
408  scenario = campaign_text.str();
409  info_stream << campaign_text.rdbuf();
410 
411  // TODO: should we have this?
412  //if(game["require_scenario"].to_bool(false)) {
413  ADDON_REQ result = check_addon_version_compatibility(campaign_cfg, game);
414  addons_outcome = std::max(addons_outcome, result); // Elevate to most severe error level encountered so far
415  //}
416  } else {
417  scenario = formatter() << make_game_type_marker(_("campaign_abbreviation^C"), true) << game["mp_campaign_name"].str();
418  info_stream << scenario;
419  verified = false;
420  }
421  } else {
422  scenario = _("Unknown scenario");
423  info_stream << scenario;
424  verified = false;
425  }
426 
427  // Remove any newlines that might have been in game titles
428  boost::replace_all(scenario, "\n", " " + font::unicode_em_dash + " ");
429 
430  if(reloaded) {
431  info_stream << spaced_em_dash();
432  info_stream << _("Reloaded game");
433  verified = false;
434  }
435 
436  // These should always be present in the data the server sends, but may or may not be empty.
437  // I'm just using child_or_empty here to preempt any cases where they might not be included.
438  const config& s = game.child_or_empty("slot_data");
439  const config& t = game.child_or_empty("turn_data");
440 
441  if(!s.empty()) {
442  started = false;
443 
444  vacant_slots = s["vacant"].to_unsigned();
445 
446  if(vacant_slots > 0) {
447  status = formatter() << _n("Vacant Slot:", "Vacant Slots:", vacant_slots) << " " << vacant_slots << "/" << s["max"];
448  } else {
449  status = _("mp_game_available_slots^Full");
450  }
451  }
452 
453  if(!t.empty()) {
454  started = true;
455 
456  current_turn = t["current"].to_unsigned();
457  const int max_turns = t["max"].to_int();
458 
459  if(max_turns > -1) {
460  status = formatter() << _("Turn") << " " << t["current"] << "/" << max_turns;
461  } else {
462  status = formatter() << _("Turn") << " " << t["current"];
463  }
464  }
465 
466  if(fog) {
467  vision = _("Fog");
468  if(shroud) {
469  vision += "/";
470  vision += _("Shroud");
471  }
472  } else if(shroud) {
473  vision = _("Shroud");
474  } else {
475  vision = _("vision^none");
476  }
477 
478  if(game["mp_countdown"].to_bool()) {
480  << game["mp_countdown_init_time"].str() << "+"
481  << game["mp_countdown_turn_bonus"].str() << "/"
482  << game["mp_countdown_action_bonus"].str();
483  } else {
484  time_limit = _("time limit^none");
485  }
486 
487  map_info = info_stream.str();
488 }
489 
491 {
492  if(!local_item.has_attribute("addon_id") || !local_item.has_attribute("addon_version")) {
493  return SATISFIED;
494  }
495 
496  if(const config& game_req = game.find_child("addon", "id", local_item["addon_id"])) {
497  required_addon r {local_item["addon_id"].str(), SATISFIED, ""};
498 
499  // Local version
500  const version_info local_ver(local_item["addon_version"].str());
501  version_info local_min_ver(local_item.has_attribute("addon_min_version") ? local_item["addon_min_version"] : local_item["addon_version"]);
502 
503  // If the UMC didn't specify last compatible version, assume no backwards compatibility.
504  // Also apply some sanity checking regarding min version; if the min ver doesn't make sense, ignore it.
505  local_min_ver = std::min(local_min_ver, local_ver);
506 
507  // Remote version
508  const version_info remote_ver(game_req["version"].str());
509  version_info remote_min_ver(game_req.has_attribute("min_version") ? game_req["min_version"] : game_req["version"]);
510 
511  remote_min_ver = std::min(remote_min_ver, remote_ver);
512 
513  // Check if the host is too out of date to play.
514  if(local_min_ver > remote_ver) {
515  DBG_LB << "r.outcome = CANNOT_SATISFY for item='" << local_item["id"]
516  << "' addon='" << local_item["addon_id"]
517  << "' addon_min_version='" << local_item["addon_min_version"]
518  << "' addon_min_version_parsed='" << local_min_ver.str()
519  << "' addon_version='" << local_item["addon_version"]
520  << "' remote_ver='" << remote_ver.str()
521  << "'\n";
522  r.outcome = CANNOT_SATISFY;
523 
524  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>.", {
525  {"addon", local_item["addon_title"].str()},
526  {"host_ver", remote_ver.str()},
527  {"local_ver", local_ver.str()}
528  });
529 
530  required_addons.push_back(r);
531  return r.outcome;
532  }
533 
534  // Check if our version is too out of date to play.
535  if(remote_min_ver > local_ver) {
536  r.outcome = NEED_DOWNLOAD;
537 
538  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>.", {
539  {"addon", local_item["addon_title"].str()},
540  {"host_ver", remote_ver.str()},
541  {"local_ver", local_ver.str()}
542  });
543 
544  required_addons.push_back(r);
545  return r.outcome;
546  }
547  }
548 
549  return SATISFIED;
550 }
551 
553 {
554  return !started && vacant_slots > 0;
555 }
556 
558 {
560 }
561 
563 {
564  switch(display_status) {
565  case game_info::CLEAN:
566  return "clean";
567  case game_info::NEW:
568  return "new";
569  case game_info::DELETED:
570  return "deleted";
571  case game_info::UPDATED:
572  return "updated";
573  default:
574  ERR_CF << "BAD display_status " << display_status << " in game " << id << "\n";
575  return "?";
576  }
577 }
578 
579 bool game_info::match_string_filter(const std::string& filter) const
580 {
581  const std::string& s1 = name;
582  const std::string& s2 = map_info;
583  return std::search(s1.begin(), s1.end(), filter.begin(), filter.end(),
584  chars_equal_insensitive) != s1.end()
585  || std::search(s2.begin(), s2.end(), filter.begin(), filter.end(),
586  chars_equal_insensitive) != s2.end();
587 }
588 
589 }
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:423
void add_message(const std::time_t &timestamp, const std::string &user, const std::string &message)
Definition: lobby_data.cpp:62
int h() const
Effective map height.
Definition: map.hpp:128
ADDON_REQ addons_outcome
Definition: lobby_data.hpp:200
std::string status
Definition: lobby_data.hpp:162
std::string era()
Definition: game.cpp:698
#define ERR_CF
Definition: lobby_data.cpp:40
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:156
bool is_authenticated()
Definition: game.cpp:184
Note: Specific to sdl_ttf.
unsigned int current_turn
Definition: lobby_data.hpp:166
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:838
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:217
user_state state
Definition: lobby_data.hpp:130
child_itors child_range(config_key_type key)
Definition: config.cpp:366
bool shuffle_sides()
Definition: game.cpp:473
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:163
#define b
static lg::log_domain log_lobby("lobby")
bool fog()
Definition: game.cpp:538
Pubic entry points for the MP workflow.
Definition: lobby_data.cpp:49
static const char * name(const std::vector< SDL_Joystick *> &joysticks, const std::size_t index)
Definition: joystick.cpp:48
static game_config_manager * get()
user_info(const config &c)
Definition: lobby_data.cpp:108
static UNUSEDNOWARN std::string _(const char *str)
Definition: gettext.hpp:89
chat_message(const std::time_t &timestamp, const std::string &user, const std::string &message)
Create a chat message.
Definition: lobby_data.cpp:51
bool is_friend(const std::string &nick)
Definition: game.cpp:292
std::ostringstream wrapper.
Definition: formatter.hpp:38
#define DBG_LB
Definition: lobby_data.cpp:45
std::string vision
Definition: lobby_data.hpp:161
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:93
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:84
bool registered_users_only()
Definition: game.cpp:463
std::string era_short
Definition: lobby_data.hpp:153
bool is_ignored(const std::string &nick)
Definition: game.cpp:305
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:548
int w() const
Effective map width.
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:562
std::size_t i
Definition: function.cpp:933
static lg::log_domain log_engine("engine")
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:490
bool use_map_settings()
Definition: game.cpp:491
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:557
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:119
room_info(const std::string &name)
Definition: lobby_data.cpp:80
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:164
const std::string unicode_em_dash
Definition: constants.cpp:40
void remove_member(const std::string &user)
Definition: lobby_data.cpp:94
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:138
#define e
game_info(const config &c, const std::vector< std::string > &installed_addons)
Definition: lobby_data.cpp:198
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:456
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:92
bool can_join() const
Definition: lobby_data.cpp:552
mock_char c
bool operator<(const user_info &b) const
Definition: lobby_data.cpp:151
std::string str() const
Definition: formatter.hpp:64
bool empty() const
Definition: config.cpp:886
const config & game_config() const
void process_room_members(const config &data)
Definition: lobby_data.cpp:99
bool match_string_filter(const std::string &filter) const
Definition: lobby_data.cpp:579
const std::string & name() const
Definition: lobby_data.hpp:72
void add_member(const std::string &user)
Definition: lobby_data.cpp:89