From cc85f5f050b9cdf2910348a4b13788488e222b6c Mon Sep 17 00:00:00 2001 From: Quentin Bazin Date: Fri, 19 Jun 2020 17:18:18 +0200 Subject: [PATCH] [docs/network-protocol.md] Added. --- README.md | 2 +- docs/index.md | 4 + docs/network-protocol.md | 282 ++++++++++++++++++ docs/script.js | 5 + mkdocs.yml | 5 + requirements.txt | 2 +- source/client/network/Client.cpp | 2 +- .../client/network/ClientCommandHandler.cpp | 11 +- source/common/network/Network.hpp | 59 ++-- source/server/network/ClientInfo.hpp | 6 +- source/server/network/Server.cpp | 5 +- .../server/network/ServerCommandHandler.cpp | 29 +- source/server/network/ServerInfo.cpp | 4 +- source/server/network/ServerInfo.hpp | 2 +- 14 files changed, 345 insertions(+), 73 deletions(-) create mode 100644 docs/network-protocol.md create mode 100644 docs/script.js diff --git a/README.md b/README.md index b0578dec..d9405978 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ The long-term goal of this project is to provide a viable alternative to Minecra - [Mod API](https://openminer.readthedocs.io/en/latest/lua-api-mod/) - [GUI API](https://openminer.readthedocs.io/en/latest/lua-api-gui/) - [C++ classes in Lua](https://openminer.readthedocs.io/en/latest/lua-api-cpp/) -- [Network Protocol](https://github.com/Unarelith/OpenMiner/wiki/Network-Protocol) +- [Network Protocol](https://openminer.readthedocs.io/en/latest/network-protocol/) ## Keys diff --git a/docs/index.md b/docs/index.md index 655c692a..a4df149b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -20,3 +20,7 @@ - [Progress bar](lua-api-gui-progress-bar.md) - [Scroll bar](lua-api-gui-scroll-bar.md) +# Misc + +- [Network Protocol](network-protocol.md) + diff --git a/docs/network-protocol.md b/docs/network-protocol.md new file mode 100644 index 00000000..1e6a2496 --- /dev/null +++ b/docs/network-protocol.md @@ -0,0 +1,282 @@ +# Network Protocol + +**Note:** All packets are sent using TCP only. + +## Integer types + +Integer types are represented with `s8`/`s16`/`s32`/`s64` and `u8`/`u16`/`u32`/`u64`. + +The `s`/`u` means `signed`/`unsigned` and the number is the size of the type in bits. + +## Login + +### Clientbound + +#### ClientOk + +Packet sent from a server to accept a connection. + +| Field name | Field type | Notes | +| ------------- | ---------- | ---------------------------------------------------- | +| Client ID | u16 | ID assigned by the server for this client | +| Singleplayer? | bool | Whether or not the server runs a singleplayer game | + +#### ClientRefused + +Packet sent from a server to refuse a connection. + +_This packet has no field._ + +### Serverbound + +#### ClientConnect + +Packet sent from a client attempting to connect. + +_This packet has no field._ + +#### ClientDisconnect + +Packet sent from a client attempting to disconnect. + +_This packet has no field._ + +## Game + +### Clientbound + +#### ServerClosed + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Message | std::string | Why the server has been closed | + +#### ChunkData + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Chunk X | s32 | Chunk X coordinate | +| Chunk Y | s32 | Chunk Y coordinate | +| Chunk Z | s32 | Chunk Z coordinate | +| Array | | | +| - Block data | u32 | Block ID and data | +| - Light value | u8 | Sunlight and torchlight values | + +#### PlayerInvUpdate (clientbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| ID | u16 | Player ID | +| Inventory | Inventory | Player inventory | + +#### PlayerPosUpdate (clientbound) + +| Field name | Field type | Notes | +| -------------- | ----------- | ---------------------------------------------------- | +| ID | u16 | Player ID | +| Player X | double | Player X coordinate | +| Player Y | double | Player Y coordinate | +| Player Z | double | Player Z coordinate | +| Teleportation? | bool | Whether or not this update is a teleportation | + +#### PlayerSpawn + +| Field name | Field type | Notes | +| -------------- | ----------- | ---------------------------------------------------- | +| ID | u16 | Player ID | +| Player X | double | Player X coordinate | +| Player Y | double | Player Y coordinate | +| Player Z | double | Player Z coordinate | + +#### PlayerChangeDimension + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| ID | u16 | Player ID | +| Spawn X | s32 | Spawn X coordinate in the new dimension | +| Spawn Y | s32 | Spawn Y coordinate in the new dimension | +| Spawn Z | s32 | Spawn Z coordinate in the new dimension | +| Dimension | u16 | New dimension ID | + +#### BlockUpdate + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | +| Block ID | u32 | Block ID and data | + +#### BlockGUIData + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Width | u16 | Width of the GUI | +| Height | u16 | Height of the GUI | +| Centered? | bool | Whether or not the GUI is centered on the screen | +| Widget defs | Array | List of widget definitions (see LuaGUI::show) | + +#### BlockInvUpdate (clientbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | +| Inventory | Inventory | Block inventory | + +#### BlockDataUpdate + +| Field name | Field type | Notes | +| -------------- | ------------- | ----------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | +| Metadata | BlockMetadata | Block metadata | +| Use alt tiles? | bool | Whether or not the block should use alternative tiles | + +#### RegistryData + +| Field name | Field type | Notes | +| -------------- | ------------- | ----------------------------------------------------- | +| Registry | Registry | Registry | + +#### ChatMessage (clientbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| ID | u16 | Player ID (`0` means it's a server message) | +| Message | std::string | Message sent by the client | + +#### EntitySpawn + +| Field name | Field type | Notes | +| ------------- | ------------ | ---------------------------------------------------- | +| ID | entt::entity | Entity ID | + +#### EntityDespawn + +| Field name | Field type | Notes | +| ------------- | ------------ | ---------------------------------------------------- | +| ID | entt::entity | Entity ID | + +#### EntityPosition + +| Field name | Field type | Notes | +| ------------- | ------------ | ---------------------------------------------------- | +| ID | entt::entity | Entity ID | +| Entity X | double | Entity X coordinate | +| Entity Y | double | Entity Y coordinate | +| Entity Z | double | Entity Z coordinate | + +#### EntityRotation + +| Field name | Field type | Notes | +| --------------- | ------------ | ---------------------------------------------------- | +| ID | entt::entity | Entity ID | +| Rotation | glm::quat4 | Entity rotation quaternion | + +#### EntityAnimation + +| Field name | Field type | Notes | +| ------------- | ------------------ | ---------------------------------------------------- | +| ID | entt::entity | Entity ID | +| Animation | AnimationComponent | Entity animation data | + +#### EntityDrawableDef + +| Field name | Field type | Notes | +| ------------- | ------------------ | ---------------------------------------------------- | +| ID | entt::entity | Entity ID | +| Drawable def | DrawableDef | Entity drawable component definition | + +### Serverbound + +#### ChunkRequest + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Chunk X | s32 | Chunk X coordinate | +| Chunk Y | s32 | Chunk Y coordinate | +| Chunk Z | s32 | Chunk Z coordinate | + +#### PlayerPlaceBlock + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | +| Block ID | u32 | Block ID and data | + +#### PlayerDigBlock + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | + +#### PlayerInvUpdate (serverbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Inventory | Inventory | Player inventory | + +#### PlayerPosUpdate (serverbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Player X | double | Player X coordinate | +| Player Y | double | Player Y coordinate | +| Player Z | double | Player Z coordinate | + +#### PlayerRotUpdate + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Camera Yaw | float | Horizontal camera view angle | +| Camera Pitch | float | Vertical camera view angle | + +#### PlayerHeldItemChanged + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Hotbar slot | u8 | ID of the current hotbar slot | +| Item ID | u16 | Current item ID (to check match with server) | + +#### BlockActivated + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | +| Screen width | u16 | Client screen width | +| Screen height | u16 | Client screen height | +| GUI scale | u8 | Client GUI scale | + +#### BlockInvUpdate (serverbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Block X | s32 | Block X coordinate | +| Block Y | s32 | Block Y coordinate | +| Block Z | s32 | Block Z coordinate | +| Inventory | Inventory | Block inventory | + +#### ChatMessage (serverbound) + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Message | std::string | Message sent by the client | + +#### KeyPressed + +| Field name | Field type | Notes | +| ------------- | ----------- | ---------------------------------------------------- | +| Key ID | u16 | Key ID in the registry | +| Screen width | u16 | Client screen width | +| Screen height | u16 | Client screen height | +| GUI scale | u8 | Client GUI scale | + diff --git a/docs/script.js b/docs/script.js new file mode 100644 index 00000000..51ab787f --- /dev/null +++ b/docs/script.js @@ -0,0 +1,5 @@ +document.addEventListener("DOMContentLoaded", function() { + document.querySelectorAll("table").forEach(function(table) { + table.classList.add("docutils"); + }); +}); diff --git a/mkdocs.yml b/mkdocs.yml index f11b980c..d2dcb2ba 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -24,6 +24,8 @@ nav: - 'Inventory widget': 'lua-api-gui-inventory.md' - 'Progress bar': 'lua-api-gui-progress-bar.md' - 'Scroll bar': 'lua-api-gui-scroll-bar.md' + - 'Misc': + - 'Network Protocol': 'network-protocol.md' theme: name: readthedocs @@ -31,3 +33,6 @@ theme: hljs_languages: - lua +extra_javascript: + - script.js + diff --git a/requirements.txt b/requirements.txt index 33dff294..b3667f94 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -mkdocs==1.1 +mkdocs==1.1.2 diff --git a/source/client/network/Client.cpp b/source/client/network/Client.cpp index 2ef35e51..87caa352 100644 --- a/source/client/network/Client.cpp +++ b/source/client/network/Client.cpp @@ -40,7 +40,7 @@ void Client::connect(sf::IpAddress serverAddress, u16 serverPort) { throw ClientConnectException("Network error: Unable to connect to server " + serverAddress.toString() + ":" + std::to_string(serverPort)); Network::Packet packet; - packet << Network::Command::ClientConnect << sf::IpAddress::getLocalAddress().toString(); + packet << Network::Command::ClientConnect; m_tcpSocket->send(packet); Network::Packet answer; diff --git a/source/client/network/ClientCommandHandler.cpp b/source/client/network/ClientCommandHandler.cpp index 54a7c8b4..05d75ab0 100644 --- a/source/client/network/ClientCommandHandler.cpp +++ b/source/client/network/ClientCommandHandler.cpp @@ -46,8 +46,6 @@ void ClientCommandHandler::sendPlayerInvUpdate() { Network::Packet invPacket; invPacket << Network::Command::PlayerInvUpdate; - // FIXME: Sending client id shouldn't be necessary when sending this packet from client - invPacket << m_client.id(); invPacket << m_player.inventory(); m_client.send(invPacket); } @@ -55,20 +53,15 @@ void ClientCommandHandler::sendPlayerInvUpdate() { void ClientCommandHandler::sendPlayerPosUpdate() { Network::Packet packet; packet << Network::Command::PlayerPosUpdate; - // FIXME: Sending client id shouldn't be necessary when sending this packet from client - packet << m_client.id(); packet << m_player.x(); packet << m_player.y(); packet << m_player.z(); - packet << false; m_client.send(packet); } void ClientCommandHandler::sendPlayerRotUpdate() { Network::Packet packet; packet << Network::Command::PlayerRotUpdate; - // FIXME: Sending client id shouldn't be necessary when sending this packet from client - packet << m_client.id(); packet << m_player.cameraYaw(); packet << m_player.cameraPitch(); m_client.send(packet); @@ -124,8 +117,6 @@ void ClientCommandHandler::sendChunkRequest(s32 chunkX, s32 chunkY, s32 chunkZ) void ClientCommandHandler::sendChatMessage(const std::string &message) { Network::Packet packet; packet << Network::Command::ChatMessage; - // FIXME: Sending client id shouldn't be necessary - packet << m_client.id(); packet << message; m_client.send(packet); } @@ -133,7 +124,7 @@ void ClientCommandHandler::sendChatMessage(const std::string &message) { void ClientCommandHandler::sendKeyPressed(u16 keyID) { Network::Packet packet; packet << Network::Command::KeyPressed << keyID - << Config::screenWidth << Config::screenHeight << Config::guiScale; + << u16(Config::screenWidth) << u16(Config::screenHeight) << u8(Config::guiScale); m_client.send(packet); } diff --git a/source/common/network/Network.hpp b/source/common/network/Network.hpp index 6fba6516..f5d921fd 100644 --- a/source/common/network/Network.hpp +++ b/source/common/network/Network.hpp @@ -29,56 +29,57 @@ #include "CompressedPacket.hpp" +// Please update 'docs/network-protocol.md' if you change this namespace Network { using Packet = CompressedPacket; enum class Command { // Client commands - ClientConnect = 0x00, // [NetworkCommand] (from Client only) - ClientDisconnect = 0x01, // [NetworkCommand] (from Client only) - ClientOk = 0x02, // [NetworkCommand][u16 client id][bool isSingleplayer] (from Server only) - ClientRefused = 0x03, // [NetworkCommand] (from Server only) + ClientConnect = 0x00, + ClientDisconnect = 0x01, + ClientOk = 0x02, + ClientRefused = 0x03, // Server commands - ServerClosed = 0x04, // [NetworkCommand][string message] (from Server only) + ServerClosed = 0x04, // Chunk commands - ChunkData = 0x05, // [NetworkCommand][s32 cx, cy, cz][u32...] (from Server only) - ChunkRequest = 0x06, // [NetworkCommand][s32 cx, cy, cz] (from Client only) + ChunkData = 0x05, + ChunkRequest = 0x06, // Player commands - PlayerPlaceBlock = 0x07, // [NetworkCommand][s32 x, y, z][u32 block] (from Client only) - PlayerDigBlock = 0x08, // [NetworkCommand][s32 x, y, z] (from Client only) - PlayerInvUpdate = 0x09, // [NetworkCommand][u16 client id][[std::string item][u16 amount][u8 x, y]...] (both) [FIXME] - PlayerPosUpdate = 0x0a, // [NetworkCommand][u16 client id][s32 x, y, z][bool isTeleportation] (both) // FIXME - PlayerRotUpdate = 0x0b, // [NetworkCommand][u16 client id][float yaw][float pitch] (from Client only) - PlayerSpawn = 0x0c, // [NetworkCommand][u16 client id][s32 x, y, z] (from Server only) - PlayerChangeDimension = 0x0d, // [NetworkCommand][u16 client id][s32 x, y, z][u16 dimension] (from Server only) - PlayerHeldItemChanged = 0x0e, // [NetworkCommand][u8 hotbar slot][u16 item id (to check match with server)] (from Client only) + PlayerPlaceBlock = 0x07, + PlayerDigBlock = 0x08, + PlayerInvUpdate = 0x09, + PlayerPosUpdate = 0x0a, + PlayerRotUpdate = 0x0b, + PlayerSpawn = 0x0c, + PlayerChangeDimension = 0x0d, + PlayerHeldItemChanged = 0x0e, // Block commands - BlockUpdate = 0x0f, // [NetworkCommand][s32 x, y, z][u32 block] (from Server only) - BlockActivated = 0x10, // [NetworkCommand][s32 x, y, z][u16 screenWidth, screenHeight][u8 guiScale] (from Client only) - BlockGUIData = 0x11, // [NetworkCommand][LuaGUIData data] (from Server only) - BlockInvUpdate = 0x12, // [NetworkCommand][s32 x, y, z][[std::string item][u16 amount][u8 x, y]...] (both) [FIXME] - BlockDataUpdate = 0x13, // [NetworkCommand][s32 x, y, z][u64 data] (both) [FIXME] + BlockUpdate = 0x0f, + BlockActivated = 0x10, + BlockGUIData = 0x11, + BlockInvUpdate = 0x12, + BlockDataUpdate = 0x13, // Registry commands - RegistryData = 0x14, // [NetworkCommand][Block block] (from Server only) + RegistryData = 0x14, // Chat commands - ChatMessage = 0x15, // [NetworkCommand][u16 client id][std::string message] (both) + ChatMessage = 0x15, // Entity commands - EntitySpawn = 0x16, // [NetworkCommand][u32 entity id] (from Server only) - EntityDespawn = 0x17, // [NetworkCommand][u32 entity id] (from Server only) - EntityPosition = 0x18, // [NetworkCommand][u32 entity id][double x, double y, double z] (from Server only) - EntityRotation = 0x19, // [NetworkCommand][u32 entity id][float w, float x, float y, float z] (from Server only) - EntityAnimation = 0x1a, // [NetworkCommand][u32 entity id][AnimationComponent anim] (from Server only) - EntityDrawableDef = 0x1b, // [NetworkCommand][u32 entity id][DrawableDef def] (from Server only) + EntitySpawn = 0x16, + EntityDespawn = 0x17, + EntityPosition = 0x18, + EntityRotation = 0x19, + EntityAnimation = 0x1a, + EntityDrawableDef = 0x1b, // Key commands - KeyPressed = 0x1c, // [NetworkCommand][u16 key id][u16 screenWidth, screenHeight][u8 guiScale] (from Client only) + KeyPressed = 0x1c, }; std::string commandToString(Command command); diff --git a/source/server/network/ClientInfo.hpp b/source/server/network/ClientInfo.hpp index 3de118aa..543c1d98 100644 --- a/source/server/network/ClientInfo.hpp +++ b/source/server/network/ClientInfo.hpp @@ -35,14 +35,12 @@ class ClientInfo { public: - ClientInfo(u16 _id, sf::IpAddress _address, const std::shared_ptr &socket) - : id(_id), address(_address), tcpSocket(socket) {} + ClientInfo(u16 _id, const std::shared_ptr &socket) + : id(_id), tcpSocket(socket) {} u16 id; bool isReady = false; - sf::IpAddress address; - u32 previousKeyTimestamp = 0; std::shared_ptr tcpSocket; diff --git a/source/server/network/Server.cpp b/source/server/network/Server.cpp index cc21794f..3a67f096 100644 --- a/source/server/network/Server.cpp +++ b/source/server/network/Server.cpp @@ -60,10 +60,7 @@ void Server::handleNewConnections() { if (command != Network::Command::ClientConnect) gkError() << "Network error: Expected 'ClientConnect' packet for new clients."; else if (m_info.clients().size() < ServerConfig::maxPlayers) { - std::string address; - packet >> address; - - ClientInfo &client = m_info.addClient(address, clientSocket); + ClientInfo &client = m_info.addClient(clientSocket); m_selector.add(*client.tcpSocket); Network::Packet outPacket; diff --git a/source/server/network/ServerCommandHandler.cpp b/source/server/network/ServerCommandHandler.cpp index 7c9a3c9f..9b5f25ff 100644 --- a/source/server/network/ServerCommandHandler.cpp +++ b/source/server/network/ServerCommandHandler.cpp @@ -212,14 +212,9 @@ void ServerCommandHandler::setupCallbacks() { }); m_server.setCommandCallback(Network::Command::PlayerInvUpdate, [this](ClientInfo &client, Network::Packet &packet) { - u16 clientId; - packet >> clientId; - - ServerPlayer *player = m_players.getPlayer(clientId); + ServerPlayer *player = m_players.getPlayer(client.id); if (player) { - if (clientId == client.id) { - packet >> player->inventory(); - } + packet >> player->inventory(); } else gkError() << ("Failed to update inventory of player " + std::to_string(client.id) + ": Player not found").c_str(); @@ -227,28 +222,23 @@ void ServerCommandHandler::setupCallbacks() { m_server.setCommandCallback(Network::Command::PlayerPosUpdate, [this](ClientInfo &client, Network::Packet &packet) { double x, y, z; - u16 clientId; - packet >> clientId; packet >> x >> y >> z; - ServerPlayer *player = m_players.getPlayer(clientId); + ServerPlayer *player = m_players.getPlayer(client.id); if (player) { - if (clientId == client.id) - player->setPosition(x, y, z); + player->setPosition(x, y, z); } else gkError() << ("Failed to update position of player " + std::to_string(client.id) + ": Player not found").c_str(); }); m_server.setCommandCallback(Network::Command::PlayerRotUpdate, [this](ClientInfo &client, Network::Packet &packet) { - u16 clientId; float yaw, pitch; - packet >> clientId >> yaw >> pitch; + packet >> yaw >> pitch; ServerPlayer *player = m_players.getPlayer(client.id); if (player) { - if (clientId == client.id) - player->setRotation(yaw, pitch); + player->setRotation(yaw, pitch); } else gkError() << ("Failed to update rotation of player " + std::to_string(client.id) + ": Player not found").c_str(); @@ -354,15 +344,14 @@ void ServerCommandHandler::setupCallbacks() { }); m_server.setCommandCallback(Network::Command::ChatMessage, [this](ClientInfo &client, Network::Packet &packet) { - u16 clientID; std::string message; - packet >> clientID >> message; + packet >> message; if (message[0] != '/' || (message.length() > 1 && message[1] == '/')) { if (message[0] == '/' && message.length() > 1 && message[1] == '/') - sendChatMessage(clientID, message.substr(1)); + sendChatMessage(client.id, message.substr(1)); else - sendChatMessage(clientID, message); + sendChatMessage(client.id, message); } else { m_chatCommandHandler.parseCommand(message.substr(1), client); diff --git a/source/server/network/ServerInfo.cpp b/source/server/network/ServerInfo.cpp index e2fdfd77..057dca47 100644 --- a/source/server/network/ServerInfo.cpp +++ b/source/server/network/ServerInfo.cpp @@ -26,8 +26,8 @@ */ #include "ServerInfo.hpp" -ClientInfo &ServerInfo::addClient(sf::IpAddress address, const std::shared_ptr &socket) { - m_clients.emplace_back(m_clients.size() + 1, address, socket); +ClientInfo &ServerInfo::addClient(const std::shared_ptr &socket) { + m_clients.emplace_back(m_clients.size() + 1, socket); return m_clients.back(); } diff --git a/source/server/network/ServerInfo.hpp b/source/server/network/ServerInfo.hpp index f7d93a1b..16b0b88b 100644 --- a/source/server/network/ServerInfo.hpp +++ b/source/server/network/ServerInfo.hpp @@ -36,7 +36,7 @@ class ServerInfo { public: - ClientInfo &addClient(sf::IpAddress address, const std::shared_ptr &socket); + ClientInfo &addClient(const std::shared_ptr &socket); ClientInfo *getClient(u16 id); void removeClient(u16 id);