refactor: renamed Client to Connection

Dieser Commit ist enthalten in:
Reinder Feenstra 2023-09-22 20:20:21 +02:00
Ursprung 6670c774de
Commit 11ac7d6909
8 geänderte Dateien mit 97 neuen und 97 gelöschten Zeilen

Datei anzeigen

@ -1,5 +1,5 @@
/**
* server/src/network/client.cpp
* server/src/network/connection.cpp
*
* This file is part of the traintastic source code.
*
@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "client.hpp"
#include "connection.hpp"
#include "server.hpp"
#include "../traintastic/traintastic.hpp"
#include "../core/eventloop.hpp"
@ -31,25 +31,25 @@
#define IS_SERVER_THREAD (std::this_thread::get_id() == m_server.threadId())
#endif
std::string clientId(const boost::asio::ip::tcp::socket& socket)
std::string connectionId(const boost::asio::ip::tcp::socket& socket)
{
return
std::string("client[")
std::string("connection[")
.append(socket.remote_endpoint().address().to_string())
.append(":")
.append(std::to_string(socket.remote_endpoint().port()))
.append("]");
}
Client::Client(Server& server, boost::asio::ip::tcp::socket socket)
Connection::Connection(Server& server, boost::asio::ip::tcp::socket socket)
: m_server{server}
, m_socket(std::move(socket))
, m_id{clientId(m_socket)}
, m_id{connectionId(m_socket)}
, m_authenticated{false}
{
assert(isEventLoopThread());
Log::log(m_id, LogMessage::I1003_CLIENT_CONNECTED);
Log::log(m_id, LogMessage::I1003_NEW_CONNECTION);
m_server.m_ioContext.post(
[this]()
@ -61,14 +61,14 @@ Client::Client(Server& server, boost::asio::ip::tcp::socket socket)
});
}
Client::~Client()
Connection::~Connection()
{
assert(isEventLoopThread());
assert(!m_session);
assert(!m_socket.is_open());
}
void Client::doReadHeader()
void Connection::doReadHeader()
{
assert(IS_SERVER_THREAD);
@ -85,7 +85,7 @@ void Client::doReadHeader()
if(m_readBuffer.message->dataSize() == 0)
{
if(m_readBuffer.message->command() != Message::Command::Ping)
EventLoop::call(&Client::processMessage, this, m_readBuffer.message);
EventLoop::call(&Connection::processMessage, this, m_readBuffer.message);
else
{} // TODO: ping hier replyen
m_readBuffer.message.reset();
@ -96,17 +96,17 @@ void Client::doReadHeader()
}
else if(ec == boost::asio::error::eof || ec == boost::asio::error::connection_aborted || ec == boost::asio::error::connection_reset)
{
EventLoop::call(std::bind(&Client::connectionLost, this));
EventLoop::call(std::bind(&Connection::connectionLost, this));
}
else if(ec != boost::asio::error::operation_aborted)
{
Log::log(m_id, LogMessage::E1007_SOCKET_READ_FAILED_X, ec);
EventLoop::call(std::bind(&Client::disconnect, this));
EventLoop::call(std::bind(&Connection::disconnect, this));
}
});
}
void Client::doReadData()
void Connection::doReadData()
{
assert(IS_SERVER_THREAD);
@ -121,7 +121,7 @@ void Client::doReadData()
if(!ec)
{
if(m_readBuffer.message->command() != Message::Command::Ping)
EventLoop::call(&Client::processMessage, this, m_readBuffer.message);
EventLoop::call(&Connection::processMessage, this, m_readBuffer.message);
else
{} // TODO: ping hier replyen
m_readBuffer.message.reset();
@ -129,17 +129,17 @@ void Client::doReadData()
}
else if(ec == boost::asio::error::eof || ec == boost::asio::error::connection_aborted || ec == boost::asio::error::connection_reset)
{
EventLoop::call(std::bind(&Client::connectionLost, this));
EventLoop::call(std::bind(&Connection::connectionLost, this));
}
else if(ec != boost::asio::error::operation_aborted)
{
Log::log(m_id, LogMessage::E1007_SOCKET_READ_FAILED_X, ec);
EventLoop::call(std::bind(&Client::disconnect, this));
EventLoop::call(std::bind(&Connection::disconnect, this));
}
});
}
void Client::doWrite()
void Connection::doWrite()
{
assert(IS_SERVER_THREAD);
@ -158,12 +158,12 @@ void Client::doWrite()
else if(ec != boost::asio::error::operation_aborted)
{
Log::log(m_id, LogMessage::E1006_SOCKET_WRITE_FAILED_X, ec);
EventLoop::call(std::bind(&Client::disconnect, this));
EventLoop::call(std::bind(&Connection::disconnect, this));
}
});
}
void Client::processMessage(const std::shared_ptr<Message> message)
void Connection::processMessage(const std::shared_ptr<Message> message)
{
assert(isEventLoopThread());
@ -201,7 +201,7 @@ void Client::processMessage(const std::shared_ptr<Message> message)
}
}
void Client::sendMessage(std::unique_ptr<Message> message)
void Connection::sendMessage(std::unique_ptr<Message> message)
{
assert(isEventLoopThread());
@ -215,7 +215,7 @@ void Client::sendMessage(std::unique_ptr<Message> message)
});
}
void Client::connectionLost()
void Connection::connectionLost()
{
assert(isEventLoopThread());
@ -223,7 +223,7 @@ void Client::connectionLost()
disconnect();
}
void Client::disconnect()
void Connection::disconnect()
{
assert(isEventLoopThread());
@ -244,7 +244,7 @@ void Client::disconnect()
EventLoop::call(
[this]()
{
m_server.clientGone(shared_from_this());
m_server.connectionGone(shared_from_this());
});
});
}

Datei anzeigen

@ -1,9 +1,9 @@
/**
* server/src/network/client.hpp
* server/src/network/connection.hpp
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2019-2022 Reinder Feenstra
* Copyright (C) 2019-2023 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -20,8 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef TRAINTASTIC_SERVER_NETWORK_CLIENT_HPP
#define TRAINTASTIC_SERVER_NETWORK_CLIENT_HPP
#ifndef TRAINTASTIC_SERVER_NETWORK_CONNECTION_HPP
#define TRAINTASTIC_SERVER_NETWORK_CONNECTION_HPP
#include <memory>
#include <queue>
@ -32,7 +32,7 @@
class Server;
class Session;
class Client : public std::enable_shared_from_this<Client>
class Connection : public std::enable_shared_from_this<Connection>
{
friend class Session;
@ -62,8 +62,8 @@ class Client : public std::enable_shared_from_this<Client>
void connectionLost();
public:
Client(Server& server, boost::asio::ip::tcp::socket socket);
virtual ~Client();
Connection(Server& server, boost::asio::ip::tcp::socket socket);
virtual ~Connection();
void disconnect();
};

Datei anzeigen

@ -23,7 +23,7 @@
#include "server.hpp"
#include <traintastic/network/message.hpp>
#include <version.hpp>
#include "client.hpp"
#include "connection.hpp"
#include "../core/eventloop.hpp"
#include "../log/log.hpp"
#include "../log/logmessageexception.hpp"
@ -129,15 +129,15 @@ Server::~Server()
if(m_thread.joinable())
m_thread.join();
while(!m_clients.empty())
m_clients.front()->disconnect();
while(!m_connections.empty())
m_connections.front()->disconnect();
}
void Server::clientGone(const std::shared_ptr<Client>& client)
void Server::connectionGone(const std::shared_ptr<Connection>& connection)
{
assert(isEventLoopThread());
m_clients.erase(std::find(m_clients.begin(), m_clients.end(), client));
m_connections.erase(std::find(m_connections.begin(), m_connections.end(), connection));
}
void Server::doReceive()
@ -212,11 +212,11 @@ void Server::doAccept()
{
try
{
m_clients.emplace_back(std::make_shared<Client>(*this, std::move(*socket)));
m_connections.emplace_back(std::make_shared<Connection>(*this, std::move(*socket)));
}
catch(const std::exception& e)
{
Log::log(id, LogMessage::C1002_CREATING_CLIENT_FAILED_X, e.what());
Log::log(id, LogMessage::C1002_CREATING_CONNECTION_FAILED_X, e.what());
}
});

Datei anzeigen

@ -3,7 +3,7 @@
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2022 Reinder Feenstra
* Copyright (C) 2022-2023 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -31,12 +31,12 @@
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ip/udp.hpp>
class Client;
class Connection;
class Message;
class Server : public std::enable_shared_from_this<Server>
{
friend class Client;
friend class Connection;
private:
boost::asio::io_context m_ioContext;
@ -47,13 +47,13 @@ class Server : public std::enable_shared_from_this<Server>
std::array<char, 8> m_udpBuffer;
boost::asio::ip::udp::endpoint m_remoteEndpoint;
const bool m_localhostOnly;
std::list<std::shared_ptr<Client>> m_clients;
std::list<std::shared_ptr<Connection>> m_connections;
void doReceive();
std::unique_ptr<Message> processMessage(const Message& message);
void doAccept();
void clientGone(const std::shared_ptr<Client>& client);
void connectionGone(const std::shared_ptr<Connection>& connection);
public:
static constexpr std::string_view id{"server"};

Datei anzeigen

@ -24,7 +24,7 @@
#include <boost/algorithm/string.hpp>
#include <boost/uuid/random_generator.hpp>
#include "../traintastic/traintastic.hpp"
#include "client.hpp"
#include "connection.hpp"
#include <traintastic/enum/interfaceitemtype.hpp>
#include <traintastic/enum/attributetype.hpp>
#ifndef NDEBUG
@ -43,8 +43,8 @@
#undef GetObject // GetObject is defined by a winapi header
#endif
Session::Session(const std::shared_ptr<Client>& client) :
m_client{client},
Session::Session(const std::shared_ptr<Connection>& connection) :
m_connection{connection},
m_uuid{boost::uuids::random_generator()()}
{
assert(isEventLoopThread());
@ -104,10 +104,10 @@ bool Session::processMessage(const Message& message)
{
auto response = Message::newResponse(message.command(), message.requestId());
writeObject(*response, obj);
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
}
else
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::UnknownObject));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::UnknownObject));
return true;
}
@ -132,7 +132,7 @@ bool Session::processMessage(const Message& message)
auto event = Message::newEvent(message.command(), sizeof(Handle));
event->write(handle);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
break;
}
@ -171,19 +171,19 @@ bool Session::processMessage(const Message& message)
catch(const std::exception& e) // set property failed
{
if(message.isRequest()) // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), e.what()));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), e.what()));
else // send changed event with current value:
objectPropertyChanged(*property);
}
if(message.isRequest()) // send success response
m_client->sendMessage(Message::newResponse(message.command(), message.requestId()));
m_connection->sendMessage(Message::newResponse(message.command(), message.requestId()));
}
else if(message.isRequest()) // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown property"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown property"));
}
else if(message.isRequest()) // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown object"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown object"));
}
return true;
}
@ -217,16 +217,16 @@ bool Session::processMessage(const Message& message)
{
auto response = Message::newResponse(message.command(), message.requestId());
writeObject(*response, obj);
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
}
else
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::UnknownObject));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::UnknownObject));
}
else // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown property"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown property"));
}
else // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown object"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown object"));
return true;
}
@ -247,16 +247,16 @@ bool Session::processMessage(const Message& message)
auto response = Message::newResponse(message.command(), message.requestId());
for(size_t i = startIndex; i <= endIndex; i++)
writeObject(*response, property->getObject(i));
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
}
else // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "invalid indices"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "invalid indices"));
}
else // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown property"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown property"));
}
else // send error response
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown object"));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), "unknown object"));
return true;
}
@ -381,7 +381,7 @@ bool Session::processMessage(const Message& message)
break;
}
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
}
@ -389,7 +389,7 @@ bool Session::processMessage(const Message& message)
{
if(message.isRequest())
{
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::Failed));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::Failed));
return true;
}
}
@ -407,7 +407,7 @@ bool Session::processMessage(const Message& message)
assert(model);
auto response = Message::newResponse(message.command(), message.requestId());
writeTableModel(*response, model);
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
model->columnHeadersChanged = [this](const TableModelPtr& tableModel)
{
@ -416,7 +416,7 @@ bool Session::processMessage(const Message& message)
event->write(tableModel->columnCount());
for(const auto& text : tableModel->columnHeaders())
event->write(text);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
};
model->rowCountChanged = [this](const TableModelPtr& tableModel)
@ -424,7 +424,7 @@ bool Session::processMessage(const Message& message)
auto event = Message::newEvent(Message::Command::TableModelRowCountChanged);
event->write(m_handles.getHandle(std::dynamic_pointer_cast<Object>(tableModel)));
event->write(tableModel->rowCount());
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
};
model->updateRegion = [this](const TableModelPtr& tableModel, const TableModel::Region& region)
@ -440,13 +440,13 @@ bool Session::processMessage(const Message& message)
for(uint32_t column = region.columnMin; column <= region.columnMax; column++)
event->write(tableModel->getText(column, row));
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
};
return true;
}
}
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::ObjectNotTable));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::ObjectNotTable));
return true;
}
case Message::Command::ReleaseTableModel:
@ -481,7 +481,7 @@ bool Session::processMessage(const Message& message)
response->write(info.id);
response->write(info.value);
}
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
break;
@ -500,7 +500,7 @@ bool Session::processMessage(const Message& message)
response->write(info.id);
response->write(info.value);
}
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
break;
@ -533,7 +533,7 @@ bool Session::processMessage(const Message& message)
if(tile.data().isActive())
writeObject(*response, it.second);
}
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
break;
@ -552,7 +552,7 @@ bool Session::processMessage(const Message& message)
response->write(item.menu);
response->writeBlockEnd();
}
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
case Message::Command::OutputMapGetItems:
@ -562,7 +562,7 @@ bool Session::processMessage(const Message& message)
auto response = Message::newResponse(message.command(), message.requestId());
for(auto& item : outputMap->items())
writeObject(*response, item);
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
break;
@ -574,7 +574,7 @@ bool Session::processMessage(const Message& message)
auto response = Message::newResponse(message.command(), message.requestId());
for(const auto& item : outputMap->outputs())
writeObject(*response, item);
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
break;
@ -598,9 +598,9 @@ bool Session::processMessage(const Message& message)
std::vector<std::byte> worldData;
message.read(worldData);
if(Traintastic::instance->importWorld(worldData))
m_client->sendMessage(Message::newResponse(message.command(), message.requestId()));
m_connection->sendMessage(Message::newResponse(message.command(), message.requestId()));
else
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::Failed));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::Failed));
}
break;
@ -614,11 +614,11 @@ bool Session::processMessage(const Message& message)
{
auto response = Message::newResponse(message.command(), message.requestId());
response->write(worldData);
m_client->sendMessage(std::move(response));
m_connection->sendMessage(std::move(response));
return true;
}
}
m_client->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::Failed));
m_connection->sendMessage(Message::newErrorResponse(message.command(), message.requestId(), Message::ErrorCode::Failed));
return true;
}
break;
@ -801,7 +801,7 @@ void Session::memoryLoggerChanged(const MemoryLogger& logger, const uint32_t add
event->write(log.args->at(j));
}
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::objectDestroying(Object& object)
@ -812,7 +812,7 @@ void Session::objectDestroying(Object& object)
auto event = Message::newEvent(Message::Command::ObjectDestroyed, sizeof(Handle));
event->write(handle);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::objectPropertyChanged(BaseProperty& baseProperty)
@ -836,7 +836,7 @@ void Session::objectPropertyChanged(BaseProperty& baseProperty)
else
assert(false);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::writePropertyValue(Message& message , const AbstractProperty& property)
@ -923,7 +923,7 @@ void Session::objectAttributeChanged(AbstractAttribute& attribute)
event->write(m_handles.getHandle(attribute.item().object().shared_from_this()));
event->write(attribute.item().name());
writeAttribute(*event, attribute);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::objectEventFired(const AbstractEvent& event, const Arguments& arguments)
@ -968,7 +968,7 @@ void Session::objectEventFired(const AbstractEvent& event, const Arguments& argu
}
i++;
}
m_client->sendMessage(std::move(message));
m_connection->sendMessage(std::move(message));
}
void Session::writeAttribute(Message& message , const AbstractAttribute& attribute)
@ -1057,7 +1057,7 @@ void Session::inputMonitorInputIdChanged(InputMonitor& inputMonitor, const uint3
event->write(m_handles.getHandle(inputMonitor.shared_from_this()));
event->write(address);
event->write(id);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::inputMonitorInputValueChanged(InputMonitor& inputMonitor, const uint32_t address, const TriState value)
@ -1066,7 +1066,7 @@ void Session::inputMonitorInputValueChanged(InputMonitor& inputMonitor, const ui
event->write(m_handles.getHandle(inputMonitor.shared_from_this()));
event->write(address);
event->write(value);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::outputKeyboardOutputIdChanged(OutputKeyboard& outputKeyboard, const uint32_t address, std::string_view id)
@ -1075,7 +1075,7 @@ void Session::outputKeyboardOutputIdChanged(OutputKeyboard& outputKeyboard, cons
event->write(m_handles.getHandle(outputKeyboard.shared_from_this()));
event->write(address);
event->write(id);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::outputKeyboardOutputValueChanged(OutputKeyboard& outputKeyboard, const uint32_t address, const TriState value)
@ -1084,7 +1084,7 @@ void Session::outputKeyboardOutputValueChanged(OutputKeyboard& outputKeyboard, c
event->write(m_handles.getHandle(outputKeyboard.shared_from_this()));
event->write(address);
event->write(value);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::boardTileDataChanged(Board& board, const TileLocation& location, const TileData& data)
@ -1100,7 +1100,7 @@ void Session::boardTileDataChanged(Board& board, const TileLocation& location, c
assert(tile);
writeObject(*event, tile);
}
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}
void Session::outputMapOutputsChanged(OutputMap& outputMap)
@ -1109,5 +1109,5 @@ void Session::outputMapOutputsChanged(OutputMap& outputMap)
event->write(m_handles.getHandle(outputMap.shared_from_this()));
for(const auto& item : outputMap.outputs())
writeObject(*event, item);
m_client->sendMessage(std::move(event));
m_connection->sendMessage(std::move(event));
}

Datei anzeigen

@ -3,7 +3,7 @@
*
* This file is part of the traintastic source code.
*
* Copyright (C) 2019-2022 Reinder Feenstra
* Copyright (C) 2019-2023 Reinder Feenstra
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -33,7 +33,7 @@
#include "../core/tablemodelptr.hpp"
#include "../core/argument.hpp"
class Client;
class Connection;
class MemoryLogger;
class BaseProperty;
class AbstractProperty;
@ -50,7 +50,7 @@ struct TileData;
class Session : public std::enable_shared_from_this<Session>
{
friend class Client;
friend class Connection;
private:
static void writePropertyValue(Message& message, const AbstractProperty& property);
@ -64,7 +64,7 @@ class Session : public std::enable_shared_from_this<Session>
using Handle = uint32_t;
using Handles = HandleList<Handle, ObjectPtr>;
std::shared_ptr<Client> m_client;
std::shared_ptr<Connection> m_connection;
boost::uuids::uuid m_uuid;
Handles m_handles;
std::unordered_multimap<Handle, boost::signals2::connection> m_objectSignals;
@ -92,7 +92,7 @@ class Session : public std::enable_shared_from_this<Session>
void outputMapOutputsChanged(OutputMap& outputMap);
public:
Session(const std::shared_ptr<Client>& client);
Session(const std::shared_ptr<Connection>& connection);
~Session();
const boost::uuids::uuid& uuid() const { return m_uuid; }

Datei anzeigen

@ -72,7 +72,7 @@ enum class LogMessage : uint32_t
// Info:
I1001_TRAINTASTIC_VX = LogMessageOffset::info + 1001,
I1002_SETTING_FILE_NOT_FOUND_USING_DEFAULTS = LogMessageOffset::info + 1002,
I1003_CLIENT_CONNECTED = LogMessageOffset::info + 1003,
I1003_NEW_CONNECTION = LogMessageOffset::info + 1003,
I1004_CONNECTION_LOST = LogMessageOffset::info + 1004,
I1005_BUILDING_WORLD_INDEX = LogMessageOffset::info + 1005,
I1006_X = LogMessageOffset::info + 1006, //!< boost version
@ -182,7 +182,7 @@ enum class LogMessage : uint32_t
// Critical:
C1001_LOADING_WORLD_FAILED_X = LogMessageOffset::critical + 1001,
C1002_CREATING_CLIENT_FAILED_X = LogMessageOffset::critical + 1002,
C1002_CREATING_CONNECTION_FAILED_X = LogMessageOffset::critical + 1002,
C1003_CANT_WRITE_TO_SETTINGS_FILE_X = LogMessageOffset::critical + 1003,
C1004_READING_WORLD_FAILED_X_X = LogMessageOffset::critical + 1004,
C1005_SAVING_WORLD_FAILED_X = LogMessageOffset::critical + 1005,

Datei anzeigen

@ -1673,7 +1673,7 @@
},
{
"term": "message:C1002",
"definition": "Creating client failed (%1)",
"definition": "Creating connection failed (%1)",
"context": "",
"term_plural": "",
"reference": "",
@ -2217,7 +2217,7 @@
},
{
"term": "message:I1003",
"definition": "Client connected",
"definition": "New connection",
"context": "",
"term_plural": "",
"reference": "",