1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Use std::byte to manage network data

This commit is contained in:
Ivan Savenko
2024-02-02 01:27:19 +02:00
parent c12558bf8a
commit 29c0989849
19 changed files with 72 additions and 100 deletions

View File

@@ -164,7 +164,7 @@ void CVCMIServer::onNewConnection(const std::shared_ptr<INetworkConnection> & co
}
}
void CVCMIServer::onPacketReceived(const std::shared_ptr<INetworkConnection> & connection, const std::vector<uint8_t> & message)
void CVCMIServer::onPacketReceived(const std::shared_ptr<INetworkConnection> & connection, const std::vector<std::byte> & message)
{
std::shared_ptr<CConnection> c = findConnection(connection);
auto pack = c->retrievePack(message);
@@ -325,7 +325,7 @@ void CVCMIServer::startGameImmediately()
onTimer();
}
void CVCMIServer::onDisconnected(const std::shared_ptr<INetworkConnection> & connection)
void CVCMIServer::onDisconnected(const std::shared_ptr<INetworkConnection> & connection, const std::string & errorMessage)
{
logNetwork->error("Network error receiving a pack. Connection has been closed");