mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Formatting
This commit is contained in:
@@ -11,15 +11,15 @@
|
|||||||
#include "StdInc.h"
|
#include "StdInc.h"
|
||||||
#include "GlobalLobbyClient.h"
|
#include "GlobalLobbyClient.h"
|
||||||
|
|
||||||
#include "GlobalLobbyWindow.h"
|
|
||||||
#include "GlobalLobbyLoginWindow.h"
|
#include "GlobalLobbyLoginWindow.h"
|
||||||
|
#include "GlobalLobbyWindow.h"
|
||||||
|
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../gui/WindowHandler.h"
|
#include "../gui/WindowHandler.h"
|
||||||
#include "../windows/InfoWindows.h"
|
#include "../windows/InfoWindows.h"
|
||||||
|
|
||||||
#include "../../lib/MetaString.h"
|
|
||||||
#include "../../lib/CConfigHandler.h"
|
#include "../../lib/CConfigHandler.h"
|
||||||
|
#include "../../lib/MetaString.h"
|
||||||
#include "../../lib/TextOperations.h"
|
#include "../../lib/TextOperations.h"
|
||||||
#include "../../lib/network/NetworkClient.h"
|
#include "../../lib/network/NetworkClient.h"
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ void GlobalLobbyClient::receiveLoginSuccess(const JsonNode & json)
|
|||||||
|
|
||||||
void GlobalLobbyClient::receiveChatHistory(const JsonNode & json)
|
void GlobalLobbyClient::receiveChatHistory(const JsonNode & json)
|
||||||
{
|
{
|
||||||
for (auto const & entry : json["messages"].Vector())
|
for(const auto & entry : json["messages"].Vector())
|
||||||
{
|
{
|
||||||
std::string accountID = entry["accountID"].String();
|
std::string accountID = entry["accountID"].String();
|
||||||
std::string displayName = entry["displayName"].String();
|
std::string displayName = entry["displayName"].String();
|
||||||
@@ -257,4 +257,3 @@ std::shared_ptr<GlobalLobbyWindow> GlobalLobbyClient::createLobbyWindow()
|
|||||||
lobbyWindowLock = lobbyWindowPtr;
|
lobbyWindowLock = lobbyWindowPtr;
|
||||||
return lobbyWindowPtr;
|
return lobbyWindowPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class GlobalLobbyClient : public INetworkClientListener, boost::noncopyable
|
|||||||
void receiveChatHistory(const JsonNode & json);
|
void receiveChatHistory(const JsonNode & json);
|
||||||
void receiveChatMessage(const JsonNode & json);
|
void receiveChatMessage(const JsonNode & json);
|
||||||
void receiveActiveAccounts(const JsonNode & json);
|
void receiveActiveAccounts(const JsonNode & json);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GlobalLobbyClient();
|
explicit GlobalLobbyClient();
|
||||||
~GlobalLobbyClient();
|
~GlobalLobbyClient();
|
||||||
|
|||||||
@@ -14,18 +14,18 @@
|
|||||||
#include "GlobalLobbyClient.h"
|
#include "GlobalLobbyClient.h"
|
||||||
#include "GlobalLobbyWindow.h"
|
#include "GlobalLobbyWindow.h"
|
||||||
|
|
||||||
#include "../gui/CGuiHandler.h"
|
|
||||||
#include "../gui/WindowHandler.h"
|
|
||||||
#include "../widgets/TextControls.h"
|
|
||||||
#include "../widgets/Images.h"
|
|
||||||
#include "../widgets/Buttons.h"
|
|
||||||
#include "../widgets/MiscWidgets.h"
|
|
||||||
#include "../CGameInfo.h"
|
#include "../CGameInfo.h"
|
||||||
#include "../CServerHandler.h"
|
#include "../CServerHandler.h"
|
||||||
|
#include "../gui/CGuiHandler.h"
|
||||||
|
#include "../gui/WindowHandler.h"
|
||||||
|
#include "../widgets/Buttons.h"
|
||||||
|
#include "../widgets/Images.h"
|
||||||
|
#include "../widgets/MiscWidgets.h"
|
||||||
|
#include "../widgets/TextControls.h"
|
||||||
|
|
||||||
|
#include "../../lib/CConfigHandler.h"
|
||||||
#include "../../lib/CGeneralTextHandler.h"
|
#include "../../lib/CGeneralTextHandler.h"
|
||||||
#include "../../lib/MetaString.h"
|
#include "../../lib/MetaString.h"
|
||||||
#include "../../lib/CConfigHandler.h"
|
|
||||||
|
|
||||||
GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
|
GlobalLobbyLoginWindow::GlobalLobbyLoginWindow()
|
||||||
: CWindowObject(BORDERED)
|
: CWindowObject(BORDERED)
|
||||||
|
|||||||
@@ -11,17 +11,17 @@
|
|||||||
#include "StdInc.h"
|
#include "StdInc.h"
|
||||||
#include "GlobalLobbyServerSetup.h"
|
#include "GlobalLobbyServerSetup.h"
|
||||||
|
|
||||||
#include "../gui/CGuiHandler.h"
|
|
||||||
#include "../widgets/TextControls.h"
|
|
||||||
#include "../widgets/Images.h"
|
|
||||||
#include "../widgets/Buttons.h"
|
|
||||||
#include "../CGameInfo.h"
|
#include "../CGameInfo.h"
|
||||||
#include "../CServerHandler.h"
|
#include "../CServerHandler.h"
|
||||||
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../mainmenu/CMainMenu.h"
|
#include "../mainmenu/CMainMenu.h"
|
||||||
|
#include "../widgets/Buttons.h"
|
||||||
|
#include "../widgets/Images.h"
|
||||||
|
#include "../widgets/TextControls.h"
|
||||||
|
|
||||||
|
#include "../../lib/CConfigHandler.h"
|
||||||
#include "../../lib/CGeneralTextHandler.h"
|
#include "../../lib/CGeneralTextHandler.h"
|
||||||
#include "../../lib/MetaString.h"
|
#include "../../lib/MetaString.h"
|
||||||
#include "../../lib/CConfigHandler.h"
|
|
||||||
|
|
||||||
GlobalLobbyServerSetup::GlobalLobbyServerSetup()
|
GlobalLobbyServerSetup::GlobalLobbyServerSetup()
|
||||||
: CWindowObject(BORDERED)
|
: CWindowObject(BORDERED)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class GlobalLobbyWindow;
|
|||||||
class GlobalLobbyWidget : public InterfaceObjectConfigurable
|
class GlobalLobbyWidget : public InterfaceObjectConfigurable
|
||||||
{
|
{
|
||||||
GlobalLobbyWindow * window;
|
GlobalLobbyWindow * window;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GlobalLobbyWidget(GlobalLobbyWindow * window);
|
GlobalLobbyWidget(GlobalLobbyWindow * window);
|
||||||
|
|
||||||
|
|||||||
@@ -11,20 +11,20 @@
|
|||||||
#include "StdInc.h"
|
#include "StdInc.h"
|
||||||
#include "GlobalLobbyWindow.h"
|
#include "GlobalLobbyWindow.h"
|
||||||
|
|
||||||
#include "GlobalLobbyWidget.h"
|
|
||||||
#include "GlobalLobbyClient.h"
|
#include "GlobalLobbyClient.h"
|
||||||
#include "GlobalLobbyServerSetup.h"
|
#include "GlobalLobbyServerSetup.h"
|
||||||
|
#include "GlobalLobbyWidget.h"
|
||||||
|
|
||||||
|
#include "../CServerHandler.h"
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../gui/WindowHandler.h"
|
#include "../gui/WindowHandler.h"
|
||||||
#include "../widgets/TextControls.h"
|
#include "../widgets/TextControls.h"
|
||||||
#include "../CServerHandler.h"
|
|
||||||
|
|
||||||
#include "../../lib/MetaString.h"
|
|
||||||
#include "../../lib/CConfigHandler.h"
|
#include "../../lib/CConfigHandler.h"
|
||||||
|
#include "../../lib/MetaString.h"
|
||||||
|
|
||||||
GlobalLobbyWindow::GlobalLobbyWindow():
|
GlobalLobbyWindow::GlobalLobbyWindow()
|
||||||
CWindowObject(BORDERED)
|
: CWindowObject(BORDERED)
|
||||||
{
|
{
|
||||||
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
|
||||||
widget = std::make_shared<GlobalLobbyWidget>(this);
|
widget = std::make_shared<GlobalLobbyWidget>(this);
|
||||||
|
|||||||
@@ -26,5 +26,4 @@ public:
|
|||||||
void doCreateGameRoom();
|
void doCreateGameRoom();
|
||||||
|
|
||||||
void onGameChatMessage(const std::string & sender, const std::string & message, const std::string & when);
|
void onGameChatMessage(const std::string & sender, const std::string & message, const std::string & when);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -330,20 +330,11 @@ void LobbyDatabase::insertAccessCookie(const std::string & accountID, const std:
|
|||||||
insertAccessCookieStatement->executeOnce(accountID, accessCookieUUID);
|
insertAccessCookieStatement->executeOnce(accountID, accessCookieUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LobbyDatabase::updateAccessCookie(const std::string & accountID, const std::string & accessCookieUUID)
|
void LobbyDatabase::updateAccessCookie(const std::string & accountID, const std::string & accessCookieUUID) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
void LobbyDatabase::updateAccountLoginTime(const std::string & accountID) {}
|
||||||
|
|
||||||
void LobbyDatabase::updateAccountLoginTime(const std::string & accountID)
|
void LobbyDatabase::updateActiveAccount(const std::string & accountID, bool isActive) {}
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void LobbyDatabase::updateActiveAccount(const std::string & accountID, bool isActive)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string LobbyDatabase::getAccountDisplayName(const std::string & accountID)
|
std::string LobbyDatabase::getAccountDisplayName(const std::string & accountID)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,11 +13,11 @@
|
|||||||
#include "LobbyDatabase.h"
|
#include "LobbyDatabase.h"
|
||||||
|
|
||||||
#include "../lib/JsonNode.h"
|
#include "../lib/JsonNode.h"
|
||||||
#include "../lib/network/NetworkServer.h"
|
|
||||||
#include "../lib/network/NetworkConnection.h"
|
#include "../lib/network/NetworkConnection.h"
|
||||||
|
#include "../lib/network/NetworkServer.h"
|
||||||
|
|
||||||
#include <boost/uuid/uuid_io.hpp>
|
|
||||||
#include <boost/uuid/uuid_generators.hpp>
|
#include <boost/uuid/uuid_generators.hpp>
|
||||||
|
#include <boost/uuid/uuid_io.hpp>
|
||||||
|
|
||||||
static const auto accountCookieLifetime = std::chrono::hours(24 * 7);
|
static const auto accountCookieLifetime = std::chrono::hours(24 * 7);
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ bool LobbyServer::isAccountNameValid(const std::string & accountName)
|
|||||||
if(accountName.size() < 20)
|
if(accountName.size() < 20)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (auto const & c : accountName)
|
for(const auto & c : accountName)
|
||||||
if(!std::isalnum(c))
|
if(!std::isalnum(c))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ std::string LobbyServer::sanitizeChatMessage(const std::string & inputString) co
|
|||||||
|
|
||||||
NetworkConnectionPtr LobbyServer::findAccount(const std::string & accountID)
|
NetworkConnectionPtr LobbyServer::findAccount(const std::string & accountID)
|
||||||
{
|
{
|
||||||
for (auto const & account : activeAccounts)
|
for(const auto & account : activeAccounts)
|
||||||
if(account.second.accountID == accountID)
|
if(account.second.accountID == accountID)
|
||||||
return account.first;
|
return account.first;
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ NetworkConnectionPtr LobbyServer::findAccount(const std::string & accountID)
|
|||||||
|
|
||||||
NetworkConnectionPtr LobbyServer::findGameRoom(const std::string & gameRoomID)
|
NetworkConnectionPtr LobbyServer::findGameRoom(const std::string & gameRoomID)
|
||||||
{
|
{
|
||||||
for (auto const & account : activeGameRooms)
|
for(const auto & account : activeGameRooms)
|
||||||
if(account.second.roomID == gameRoomID)
|
if(account.second.roomID == gameRoomID)
|
||||||
return account.first;
|
return account.first;
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "LobbyDefines.h"
|
|
||||||
#include "../lib/network/NetworkListener.h"
|
#include "../lib/network/NetworkListener.h"
|
||||||
|
#include "LobbyDefines.h"
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
class JsonNode;
|
class JsonNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user