RigsofRods
Soft-body Physics Simulation
GUI_MultiplayerSelector.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3 
4  Copyright 2005-2012 Pierre-Michel Ricordel
5  Copyright 2007-2012 Thomas Fischer
6  Copyright 2013-2020 Petr Ohlidal
7 
8  For more information, see http://www.rigsofrods.org/
9 
10  Rigs of Rods is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License version 3, as
12  published by the Free Software Foundation.
13 
14  Rigs of Rods is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
24 
25 #include "Application.h"
26 #include "ContentManager.h"
27 #include "GameContext.h"
28 #include "GUIManager.h"
29 #include "GUIUtils.h"
30 #include "RoRnet.h"
31 #include "RoRVersion.h"
32 #include "Language.h"
33 
34 #include <imgui.h>
35 #include <rapidjson/document.h>
36 #include <fmt/core.h>
37 #include <vector>
38 
39 #ifdef USE_CURL
40 # include <curl/curl.h>
41 # include <curl/easy.h>
42 #endif //USE_CURL
43 
44 #if defined(_MSC_VER) && defined(GetObject) // This MS Windows macro from <wingdi.h> (Windows Kit 8.1) clashes with RapidJSON
45 # undef GetObject
46 #endif
47 
48 using namespace RoR;
49 using namespace GUI;
50 
51 #if defined(USE_CURL)
52 
53 // From example: https://gist.github.com/whoshuu/2dc858b8730079602044
54 size_t CurlWriteFunc(void *ptr, size_t size, size_t nmemb, std::string* data)
55 {
56  data->append((char*) ptr, size * nmemb);
57  return size * nmemb;
58 }
59 
60 void FetchServerlist(std::string portal_url)
61 {
62  std::string serverlist_url = portal_url + "/server-list?json=true";
63  std::string response_payload;
64  std::string response_header;
65  long response_code = 0;
66 
67  CURL *curl = curl_easy_init();
68  curl_easy_setopt(curl, CURLOPT_URL, serverlist_url.c_str());
69  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteFunc);
70  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response_payload);
71  curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response_header);
72 
73  CURLcode curl_result = curl_easy_perform(curl);
74  curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
75 
76  curl_easy_cleanup(curl);
77  curl = nullptr;
78 
79  if (curl_result != CURLE_OK || response_code != 200)
80  {
81  Ogre::LogManager::getSingleton().stream()
82  << "[RoR|Multiplayer] Failed to retrieve serverlist;"
83  << " Error: '" << curl_easy_strerror(curl_result) << "'; HTTP status code: " << response_code;
84 
85  CurlFailInfo* failinfo = new CurlFailInfo();
86  failinfo->title = _LC("MultiplayerSelector", "Error connecting to server :(");
87  failinfo->curl_result = curl_result;
88  failinfo->http_response = response_code;
89 
92  return;
93  }
94 
95  rapidjson::Document j_data_doc;
96  j_data_doc.Parse(response_payload.c_str());
97  if (j_data_doc.HasParseError() || !j_data_doc.IsArray())
98  {
99  Ogre::LogManager::getSingleton().stream()
100  << "[RoR|Multiplayer] Error parsing serverlist JSON"; // TODO: Report the actual error
102  Message(MSG_NET_REFRESH_SERVERLIST_FAILURE, _LC("MultiplayerSelector", "Server returned invalid data :(")));
103  return;
104  }
105 
106  // Pre-process data for display
107  size_t num_rows = j_data_doc.GetArray().Size();
108  GUI::MpServerInfoVec* servers_ptr = new GUI::MpServerInfoVec();
109  GUI::MpServerInfoVec& servers = *servers_ptr;
110  servers.resize(num_rows);
111  for (size_t i = 0; i < num_rows; ++i)
112  {
113  rapidjson::Value& j_row = j_data_doc[static_cast<rapidjson::SizeType>(i)];
114 
115  servers[i].display_name = j_row["name"].GetString();
116  servers[i].display_terrn = j_row["terrain-name"].GetString();
117  servers[i].net_host = j_row["ip"].GetString();
118  servers[i].net_port = j_row["port"].GetInt();
119 
120  servers[i].has_password = j_row["has-password"].GetBool();
121  servers[i].display_passwd = servers[i].has_password ? _LC("MultiplayerSelector","Yes") : _LC("MultiplayerSelector","No");
122 
123  servers[i].display_host = fmt::format("{}:{}", j_row["ip"].GetString(), j_row["port"].GetInt());
124  servers[i].display_users = fmt::format("{} / {}", j_row["current-users"].GetInt(), j_row["max-clients"].GetInt());
125 
126  servers[i].net_version = j_row["version"].GetString();
127  servers[i].display_version = Ogre::StringUtil::replaceAll(j_row["version"].GetString(), "RoRnet_", "");
128  }
129 
131  Message(MSG_NET_REFRESH_SERVERLIST_SUCCESS, (void*)servers_ptr));
132 }
133 #endif // defined(USE_CURL)
134 
135 inline void DrawTableHeader(const char* title) // Internal helper
136 {
137  float table_padding_y = 4.f;
138  ImGui::SetCursorPosY(ImGui::GetCursorPosY() + table_padding_y);
139  ImGui::Text("%s", title);
140  ImGui::NextColumn();
141 }
142 
144 {
145  snprintf(m_window_title, 100, "Multiplayer (Rigs of Rods %s | %s)", ROR_VERSION_STRING, RORNET_VERSION);
146 }
147 
149 {
150  int window_flags = ImGuiWindowFlags_NoCollapse;
151  ImGui::SetNextWindowSize(ImVec2(750.f, 400.f), ImGuiCond_FirstUseEver);
152  ImGui::SetNextWindowPosCenter();
153  bool keep_open = true;
154  ImGui::Begin(m_window_title, &keep_open, window_flags);
155 
156  ImGui::BeginTabBar("GameSettingsTabs");
157 
158  if (ImGui::BeginTabItem(_LC("MultiplayerSelector", "Online (click to refresh)")))
159  {
160  if (ImGui::IsItemClicked())
161  {
162  this->StartAsyncRefresh();
163  }
164  this->DrawServerlistTab();
165  ImGui::EndTabItem();
166  }
167  if (ImGui::BeginTabItem(_LC("MultiplayerSelector", "Direct IP")))
168  {
169  this->DrawDirectTab();
170  ImGui::EndTabItem();
171  }
172  if (ImGui::BeginTabItem(_LC("MultiplayerSelector", "Settings")))
173  {
174  this->DrawSetupTab();
175  ImGui::EndTabItem();
176  }
177 
178  ImGui::EndTabBar();
179 
180  ImGui::End();
181  if (!keep_open)
182  {
183  this->SetVisible(false);
184  }
185 }
186 
188 {
189  ImGui::PushID("setup");
190 
191  DrawGCheckbox(App::mp_join_on_startup, _LC("MultiplayerSelector", "Auto connect"));
192  DrawGCheckbox(App::mp_chat_auto_hide, _LC("MultiplayerSelector", "Auto hide chat"));
193  DrawGCheckbox(App::mp_hide_net_labels, _LC("MultiplayerSelector", "Hide net labels"));
194  DrawGCheckbox(App::mp_hide_own_net_label, _LC("MultiplayerSelector", "Hide own net label"));
195  DrawGCheckbox(App::mp_pseudo_collisions, _LC("MultiplayerSelector", "Multiplayer collisions"));
196  DrawGCheckbox(App::mp_cyclethru_net_actors, _LC("MultiplayerSelector", "Include remote actors when cycling via hotkeys"));
197 
198  ImGui::SetCursorPosY(ImGui::GetCursorPosY() + BUTTONS_EXTRA_SPACE);
199  ImGui::Separator();
200 
201  ImGui::PushItemWidth(250.f);
202 
203  DrawGTextEdit(App::mp_player_name, _LC("MultiplayerSelector", "Player nickname"), m_player_name_buf);
204  DrawGTextEdit(App::mp_server_password, _LC("MultiplayerSelector", "Default server password"), m_password_buf);
205 
206  ImGui::SetCursorPosY(ImGui::GetCursorPosY() + BUTTONS_EXTRA_SPACE);
207  ImGui::Separator();
208 
209  DrawGTextEdit(App::mp_player_token, _LC("MultiplayerSelector", "User token"), m_user_token_buf);
210  ImGui::PopItemWidth();
211 
212  ImGui::PopID();
213 }
214 
216 {
217  ImGui::PushID("direct");
218 
219  ImGui::PushItemWidth(250.f);
220  DrawGTextEdit(App::mp_server_host, _LC("MultiplayerSelector", "Server host"), m_server_host_buf);
221  DrawGIntBox(App::mp_server_port, _LC("MultiplayerSelector", "Server port"));
222  ImGui::InputText( _LC("MultiplayerSelector", "Server password"), m_password_buf.GetBuffer(), m_password_buf.GetCapacity());
223  ImGui::PopItemWidth();
224 
225  ImGui::SetCursorPosY(ImGui::GetCursorPosY() + BUTTONS_EXTRA_SPACE);
226  if (ImGui::Button(_LC("MultiplayerSelector", "Join")))
227  {
230  }
231 
232  ImGui::PopID();
233 }
234 
235 
237 {
239 
240  // LOAD RESOURCES
241  if (!m_lock_icon)
242  {
243  try
244  {
246  m_lock_icon = Ogre::TextureManager::getSingleton().load(
247  "lock.png", ContentManager::ResourcePack::FAMICONS.resource_group_name);
248  }
249  catch (...) {} // Logged by OGRE
250  }
251 
252  if (m_show_spinner)
253  {
254  float spinner_size = 25.f;
255  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - spinner_size);
256  ImGui::SetCursorPosY((ImGui::GetWindowSize().y / 2.f) - spinner_size);
257  LoadingIndicatorCircle("spinner", spinner_size, theme.value_blue_text_color, theme.value_blue_text_color, 10, 10);
258  }
259 
260  // DRAW SERVERLIST TABLE
261  if (m_draw_table)
262  {
263  // Setup serverlist table ... the scroll area
264  const float table_height = ImGui::GetWindowHeight()
265  - ((2.f * ImGui::GetStyle().WindowPadding.y) + (3.f * ImGui::GetItemsLineHeightWithSpacing())
266  + ImGui::GetStyle().ItemSpacing.y);
267  ImGui::BeginChild("scrolling", ImVec2(0.f, table_height), false);
268  // ... and the table itself
269  const float table_width = ImGui::GetWindowContentRegionWidth();
270  ImGui::Columns(5, "mp-selector-columns"); // Col #0: Server name (and lock icon)
271  ImGui::SetColumnOffset(1, 0.36f * table_width); // Col #1: Terrain name
272  ImGui::SetColumnOffset(2, 0.67f * table_width); // Col #2: Users/Max
273  ImGui::SetColumnOffset(3, 0.74f * table_width); // Col #3: Version
274  ImGui::SetColumnOffset(4, 0.82f * table_width); // Col #4: Host/Port
275  // Draw table header
276  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + TABLE_PADDING_LEFT);
277  DrawTableHeader(_LC("MultiplayerSelector", "Name"));
278  DrawTableHeader(_LC("MultiplayerSelector", "Terrain"));
279  DrawTableHeader(_LC("MultiplayerSelector", "Users"));
280  DrawTableHeader(_LC("MultiplayerSelector", "Version"));
281  DrawTableHeader(_LC("MultiplayerSelector", "Host/Port"));
282  ImGui::Separator();
283  // Draw table body
284  for (int i = 0; i < (int)m_serverlist_data.size(); i++)
285  {
286  ImGui::PushID(i);
287 
288  // First column (name)
289  ImGui::SetCursorPosX(ImGui::GetCursorPosX() + TABLE_PADDING_LEFT);
290  MpServerInfo& server = m_serverlist_data[i];
291  if (ImGui::Selectable(server.display_name.c_str(), m_selected_item == i, ImGuiSelectableFlags_SpanAllColumns))
292  {
293  // Update selection
294  m_selected_item = i;
295  }
296  if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0))
297  {
298  // Handle left doubleclick
300  App::mp_server_host->setStr(server.net_host.c_str());
303  }
304  if (server.has_password && m_lock_icon)
305  {
306  // Draw lock icon for password-protected servers.
307  ImGui::SameLine();
308  ImGui::Image(reinterpret_cast<ImTextureID>(m_lock_icon->getHandle()), ImVec2(16, 16));
309  }
310  ImGui::NextColumn();
311 
312  bool compatible = (server.net_version == RORNET_VERSION);
313  ImVec4 version_color = compatible ? ImVec4(0.0f, 0.9f, 0.0f, 1.0f) : ImVec4(0.9f, 0.0f, 0.0f, 1.0f);
314 
315  // Other collumns
316  ImGui::Text("%s", server.display_terrn.c_str()); ImGui::NextColumn();
317  ImGui::Text("%s", server.display_users.c_str()); ImGui::NextColumn();
318  ImGui::PushStyleColor(ImGuiCol_Text, version_color);
319  ImGui::Text("%s", server.display_version.c_str()); ImGui::NextColumn();
320  ImGui::PopStyleColor();
321  ImGui::Text("%s", server.display_host.c_str()); ImGui::NextColumn();
322 
323  ImGui::PopID();
324  }
325  ImGui::Columns(1);
326  ImGui::EndChild(); // End of scroll area
327 
328  // Simple join button (and password input box)
330  {
332  if (ImGui::Button(_LC("MultiplayerSelector", "Join"), ImVec2(200.f, 0.f)))
333  {
335  App::mp_server_host->setStr(server.net_host.c_str());
338  }
339  if (server.has_password)
340  {
341  // TODO: Find out why this is always visible ~ ulteq 01/2019
342  ImGui::SameLine();
343  ImGui::PushItemWidth(250.f);
344  ImGui::InputText(_LC("MultiplayerSelector", "Server password"), m_password_buf.GetBuffer(), m_password_buf.GetCapacity());
345  ImGui::PopItemWidth();
346  }
347  }
348  }
349 
350  // DRAW CENTERED LABEL
351  if (m_serverlist_msg != "")
352  {
353  const ImVec2 label_size = ImGui::CalcTextSize(m_serverlist_msg.c_str());
354  float y = (ImGui::GetWindowSize().y / 2.f) - (ImGui::GetTextLineHeight() / 2.f);
355  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - (label_size.x / 2.f));
356  ImGui::SetCursorPosY(y);
357  ImGui::TextColored(m_serverlist_msg_color, "%s", m_serverlist_msg.c_str());
358  y += ImGui::GetTextLineHeightWithSpacing();
359 
360  if (m_serverlist_curlmsg != "")
361  {
362  const ImVec2 detail_size = ImGui::CalcTextSize(m_serverlist_curlmsg.c_str());
363  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - (detail_size.x / 2.f));
364  ImGui::SetCursorPosY(y);
365  ImGui::TextDisabled("%s", m_serverlist_curlmsg.c_str());
366  y += ImGui::GetTextLineHeight();
367  }
368 
369  if (m_serverlist_httpmsg != "")
370  {
371  const ImVec2 detail_size = ImGui::CalcTextSize(m_serverlist_httpmsg.c_str());
372  ImGui::SetCursorPosX((ImGui::GetWindowSize().x / 2.f) - (detail_size.x / 2.f));
373  ImGui::SetCursorPosY(y);
374  ImGui::TextDisabled("%s", m_serverlist_httpmsg.c_str());
375  }
376  }
377 }
378 
380 {
381 #if defined(USE_CURL)
382  m_show_spinner = true;
383  m_draw_table = false;
384  m_serverlist_data.clear();
385  m_selected_item = -1;
386  m_serverlist_msg = "";
387  std::packaged_task<void(std::string)> task(FetchServerlist);
388  std::thread(std::move(task), App::mp_api_url->getStr()).detach(); // launch on a thread
389 #endif // defined(USE_CURL)
390 }
391 
393 {
394  m_is_visible = visible;
395  if (visible && m_serverlist_data.size() == 0) // Do an initial refresh
396  {
397  this->StartAsyncRefresh();
399  }
400  else if (!visible && App::app_state->getEnum<AppState>() == AppState::MAIN_MENU)
401  {
403  }
404 }
405 
407 {
408  m_show_spinner = false;
409  m_serverlist_msg = failinfo->title;
411  m_draw_table = false;
412  if (failinfo->curl_result != CURLE_OK)
413  m_serverlist_curlmsg = curl_easy_strerror(failinfo->curl_result);
414  if (failinfo->http_response != 0)
415  m_serverlist_httpmsg = fmt::format(_L("HTTP code: {}"), failinfo->http_response);
416 }
417 
419 {
420  m_show_spinner = false;
421  m_serverlist_data = *data;
422  m_draw_table = true;
423  if (m_serverlist_data.empty())
424  {
425  m_serverlist_msg = _LC("MultiplayerSelector", "There are no available servers :/");
427  }
428  else
429  {
430  m_serverlist_msg = "";
431  }
432 }
433 
GameContext.h
Game state manager and message-queue provider.
RoR::App::GetContentManager
ContentManager * GetContentManager()
Definition: Application.cpp:267
RoR::GUI::MultiplayerSelector::SetVisible
void SetVisible(bool v)
Definition: GUI_MultiplayerSelector.cpp:392
y
float y
Definition: (ValueTypes) quaternion.h:6
RoR::GUI::MultiplayerSelector::StartAsyncRefresh
void StartAsyncRefresh()
Launch refresh from main thread.
Definition: GUI_MultiplayerSelector.cpp:379
RoR::App::mp_hide_net_labels
CVar * mp_hide_net_labels
Definition: Application.cpp:118
CurlWriteFunc
size_t CurlWriteFunc(void *ptr, size_t size, size_t nmemb, std::string *data)
Definition: GUI_MultiplayerSelector.cpp:54
RoR::GUI::MpServerInfo::display_users
std::string display_users
Definition: GUI_MultiplayerSelector.h:44
RoR::Str::GetBuffer
char * GetBuffer()
Definition: Str.h:48
RoR::GUIManager::GuiTheme
Definition: GUIManager.h:68
RoR::CurlFailInfo::http_response
long http_response
Definition: Network.h:51
RoR::GUI::MultiplayerSelector::DisplayRefreshFailed
void DisplayRefreshFailed(CurlFailInfo *failinfo)
Definition: GUI_MultiplayerSelector.cpp:406
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:269
RoR::DrawGTextEdit
void DrawGTextEdit(CVar *cvar, const char *label, Str< 1000 > &buf)
Definition: GUIUtils.cpp:319
RoR::App::mp_api_url
CVar * mp_api_url
Definition: Application.cpp:126
RoR::GUIManager::GuiTheme::value_blue_text_color
ImVec4 value_blue_text_color
Definition: GUIManager.h:75
RoR::GUI::MultiplayerSelector::UpdateServerlist
void UpdateServerlist(MpServerInfoVec *data)
Definition: GUI_MultiplayerSelector.cpp:418
RoR::DrawGIntBox
void DrawGIntBox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:281
RoR::App::mp_player_name
CVar * mp_player_name
Definition: Application.cpp:124
RoR::App::mp_player_token
CVar * mp_player_token
Definition: Application.cpp:125
RoR::AppState::MAIN_MENU
@ MAIN_MENU
RORNET_VERSION
#define RORNET_VERSION
Definition: RoRnet.h:35
ContentManager.h
format
Truck file format(technical spec)
RoR::GUI::MpServerInfo::display_terrn
std::string display_terrn
Definition: GUI_MultiplayerSelector.h:41
GUIUtils.h
RoR::GUI::MpServerInfo::net_host
std::string net_host
Definition: GUI_MultiplayerSelector.h:45
RoR::GUI::MpServerInfo
Definition: GUI_MultiplayerSelector.h:36
RoR::App::mp_join_on_startup
CVar * mp_join_on_startup
Definition: Application.cpp:116
RoR::Str::GetCapacity
size_t GetCapacity() const
Definition: Str.h:49
RoR::GUI::MpServerInfo::display_version
std::string display_version
Definition: GUI_MultiplayerSelector.h:47
RoR::GUI::MultiplayerSelector::MultiplayerSelector
MultiplayerSelector()
Definition: GUI_MultiplayerSelector.cpp:143
RoR::MSG_NET_REFRESH_SERVERLIST_FAILURE
@ MSG_NET_REFRESH_SERVERLIST_FAILURE
Payload = RoR::CurlFailInfo* (owner)
Definition: Application.h:107
RoR::GUI::MultiplayerSelector::m_serverlist_curlmsg
std::string m_serverlist_curlmsg
Displayed as dimmed text.
Definition: GUI_MultiplayerSelector.h:89
RoR::GUI::MultiplayerSelector::m_player_name_buf
Str< 1000 > m_player_name_buf
Definition: GUI_MultiplayerSelector.h:80
RoR::GUI::MultiplayerSelector::m_server_host_buf
Str< 1000 > m_server_host_buf
Definition: GUI_MultiplayerSelector.h:82
RoR::CurlFailInfo
Definition: Network.h:47
Language.h
RoR::GUI::MultiplayerSelector::m_serverlist_data
MpServerInfoVec m_serverlist_data
Definition: GUI_MultiplayerSelector.h:74
RoR::MSG_NET_CONNECT_REQUESTED
@ MSG_NET_CONNECT_REQUESTED
Definition: Application.h:97
RoR::GUI::MultiplayerSelector::DrawServerlistTab
void DrawServerlistTab()
Definition: GUI_MultiplayerSelector.cpp:236
RoR::GUI::MultiplayerSelector::m_draw_table
bool m_draw_table
Definition: GUI_MultiplayerSelector.h:78
GUI_MultiplayerSelector.h
GUIManager.h
RoR::GUI::MultiplayerSelector::TABLE_PADDING_LEFT
const float TABLE_PADDING_LEFT
Definition: GUI_MultiplayerSelector.h:58
RoR::CurlFailInfo::title
std::string title
Definition: Network.h:49
RoR::App::mp_cyclethru_net_actors
CVar * mp_cyclethru_net_actors
Include remote actors when cycling through with CTRL + [ and CTRL + ].
Definition: Application.cpp:127
RoR::MSG_NET_REFRESH_SERVERLIST_SUCCESS
@ MSG_NET_REFRESH_SERVERLIST_SUCCESS
Payload = GUI::MpServerInfoVec* (owner)
Definition: Application.h:106
RoR::GUIManager::GetTheme
GuiTheme & GetTheme()
Definition: GUIManager.h:154
RoR::GUI::MultiplayerSelector::m_selected_item
int m_selected_item
Definition: GUI_MultiplayerSelector.h:75
FetchServerlist
void FetchServerlist(std::string portal_url)
Definition: GUI_MultiplayerSelector.cpp:60
DrawTableHeader
void DrawTableHeader(const char *title)
Definition: GUI_MultiplayerSelector.cpp:135
RoR::CVar::getStr
std::string const & getStr() const
Definition: CVar.h:95
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:65
RoR::App::app_state
CVar * app_state
Definition: Application.cpp:79
RoR::App::mp_server_password
CVar * mp_server_password
Definition: Application.cpp:123
RoR::GUI::MultiplayerSelector::DrawSetupTab
void DrawSetupTab()
Definition: GUI_MultiplayerSelector.cpp:187
RoR::GUI::MpServerInfo::net_port
int net_port
Definition: GUI_MultiplayerSelector.h:48
Application.h
Central state/object manager and communications hub.
RoR::App::mp_hide_own_net_label
CVar * mp_hide_own_net_label
Definition: Application.cpp:119
RoR::GUI::MultiplayerSelector::m_serverlist_msg
std::string m_serverlist_msg
Definition: GUI_MultiplayerSelector.h:87
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
RoR::GUI::MpServerInfo::display_name
std::string display_name
Definition: GUI_MultiplayerSelector.h:40
RoR::GUI::MultiplayerSelector::DrawDirectTab
void DrawDirectTab()
Definition: GUI_MultiplayerSelector.cpp:215
RoR::GUIManager::GuiTheme::no_entries_text_color
ImVec4 no_entries_text_color
Definition: GUIManager.h:71
RoRVersion.h
RoR::GUI::GameMainMenu::SetVisible
void SetVisible(bool v)
Definition: GUI_GameMainMenu.h:43
ROR_VERSION_STRING
const char *const ROR_VERSION_STRING
_LC
#define _LC(ctx, str)
Definition: Language.h:42
RoR::GUI::MpServerInfo::display_host
std::string display_host
Definition: GUI_MultiplayerSelector.h:49
RoR::ContentManager::AddResourcePack
void AddResourcePack(ResourcePack const &resource_pack, std::string const &override_rgn="")
Loads resources if not already loaded.
Definition: ContentManager.cpp:98
RoR::GUI::MpServerInfoVec
std::vector< MpServerInfo > MpServerInfoVec
Definition: GUI_MultiplayerSelector.h:52
RoR::App::mp_server_port
CVar * mp_server_port
Definition: Application.cpp:122
RoR::Message
Unified game event system - all requests and state changes are reported using a message.
Definition: GameContext.h:51
RoR::App::mp_server_host
CVar * mp_server_host
Definition: Application.cpp:121
RoR::CVar::setVal
void setVal(T val)
Definition: CVar.h:72
_L
#define _L
Definition: ErrorUtils.cpp:34
RoR::GUI::MultiplayerSelector::m_is_visible
bool m_is_visible
Definition: GUI_MultiplayerSelector.h:77
RoR::GUI::MpServerInfo::net_version
std::string net_version
Definition: GUI_MultiplayerSelector.h:46
RoR::GUI::MultiplayerSelector::m_show_spinner
bool m_show_spinner
Definition: GUI_MultiplayerSelector.h:84
RoR::GUI::MultiplayerSelector::m_lock_icon
Ogre::TexturePtr m_lock_icon
Definition: GUI_MultiplayerSelector.h:83
RoR::DrawGCheckbox
bool DrawGCheckbox(CVar *cvar, const char *label)
Definition: GUIUtils.cpp:261
RoR::CurlFailInfo::curl_result
CURLcode curl_result
Definition: Network.h:50
RoR::GUIManager::GuiTheme::error_text_color
ImVec4 error_text_color
Definition: GUIManager.h:72
RoR::App::mp_chat_auto_hide
CVar * mp_chat_auto_hide
Definition: Application.cpp:117
RoR::ContentManager::ResourcePack::FAMICONS
static const ResourcePack FAMICONS
Definition: ContentManager.h:54
RoR::GUI::MultiplayerSelector::Draw
void Draw()
Definition: GUI_MultiplayerSelector.cpp:148
RoR::GUI::MultiplayerSelector::m_serverlist_msg_color
ImVec4 m_serverlist_msg_color
Definition: GUI_MultiplayerSelector.h:88
RoR::LoadingIndicatorCircle
void LoadingIndicatorCircle(const char *label, const float indicator_radius, const ImVec4 &main_color, const ImVec4 &backdrop_color, const int circle_count, const float speed)
Draws animated loading spinner.
Definition: GUIUtils.cpp:132
RoR
Definition: AppContext.h:36
x
float x
Definition: (ValueTypes) quaternion.h:5
RoR::CVar::setStr
void setStr(std::string const &str)
Definition: CVar.h:83
RoR::GUI::MultiplayerSelector::m_window_title
char m_window_title[100]
Definition: GUI_MultiplayerSelector.h:76
RoR::GUIManager::GameMainMenu
GUI::GameMainMenu GameMainMenu
Definition: GUIManager.h:104
RoR::GUI::MultiplayerSelector::m_password_buf
Str< 1000 > m_password_buf
Definition: GUI_MultiplayerSelector.h:81
RoR::App::mp_pseudo_collisions
CVar * mp_pseudo_collisions
Definition: Application.cpp:120
RoR::GUI::MpServerInfo::has_password
bool has_password
Definition: GUI_MultiplayerSelector.h:38
RoR::GUI::MultiplayerSelector::m_serverlist_httpmsg
std::string m_serverlist_httpmsg
Displayed as dimmed text.
Definition: GUI_MultiplayerSelector.h:90
RoR::GUI::MultiplayerSelector::BUTTONS_EXTRA_SPACE
const float BUTTONS_EXTRA_SPACE
Definition: GUI_MultiplayerSelector.h:57
RoR::GUI::MultiplayerSelector::m_user_token_buf
Str< 1000 > m_user_token_buf
Definition: GUI_MultiplayerSelector.h:79