diff --git a/src/Components/Modules/Network.cpp b/src/Components/Modules/Network.cpp index 250cde61..14d46722 100644 --- a/src/Components/Modules/Network.cpp +++ b/src/Components/Modules/Network.cpp @@ -15,11 +15,11 @@ namespace Components } void Network::Address::SetPort(unsigned short port) { - this->address.port = ntohs(port); + this->address.port = htons(port); }; unsigned short Network::Address::GetPort() { - return htons(this->address.port); + return ntohs(this->address.port); } void Network::Address::SetIP(DWORD ip) { diff --git a/src/Components/Modules/Node.hpp b/src/Components/Modules/Node.hpp index 130b2ec8..2120fb0e 100644 --- a/src/Components/Modules/Node.hpp +++ b/src/Components/Modules/Node.hpp @@ -60,7 +60,7 @@ namespace Components Network::Address address; address.SetIP(this->ip); - address.SetPort(this->port); + address.SetPort(ntohs(this->port)); address.SetType(Game::netadrtype_t::NA_IP); return address; @@ -69,7 +69,7 @@ namespace Components void fromNetAddress(Network::Address address) { this->ip = address.GetIP(); - this->port = address.GetPort(); + this->port = htons(address.GetPort()); } }; #pragma pack(pop)