LobbyWindow.cpp 882 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * LobbyWindow.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "LobbyWindow.h"
  12. #include "../gui/CGuiHandler.h"
  13. #include "../gui/WindowHandler.h"
  14. void LobbyClient::onPacketReceived(const std::vector<uint8_t> & message)
  15. {
  16. }
  17. LobbyWidget::LobbyWidget()
  18. {
  19. addCallback("closeWindow", [](int) { GH.windows().popWindows(1); });
  20. const JsonNode config(JsonPath::builtin("config/widgets/lobbyWindow.json"));
  21. build(config);
  22. }
  23. LobbyWindow::LobbyWindow():
  24. CWindowObject(BORDERED)
  25. {
  26. OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
  27. widget = std::make_shared<LobbyWidget>();
  28. pos = widget->pos;
  29. center();
  30. connection = std::make_shared<LobbyClient>();
  31. connection->start("127.0.0.1", 30303);
  32. }