Sat, 23 Jul 2016 12:32:23 +0300
Reduce delta to protocol5 branch by importing the change to RCONSessoin::handlePacket's signature
sources/network/rconsession.cpp | file | annotate | diff | comparison | revisions | |
sources/network/rconsession.h | file | annotate | diff | comparison | revisions |
--- a/sources/network/rconsession.cpp Sat Jul 23 12:23:07 2016 +0300 +++ b/sources/network/rconsession.cpp Sat Jul 23 12:32:23 2016 +0300 @@ -112,17 +112,18 @@ } for (Datagram datagram; m_socket.read(datagram);) - handlePacket(datagram); + { + // Only process packets that originate from the game server. + if (datagram.address == m_address) + handlePacket(datagram.message); + } } // ------------------------------------------------------------------------------------------------- // -void RCONSession::handlePacket(Datagram& datagram) +void RCONSession::handlePacket(ByteArray& message) { - if (datagram.address != m_address) - return; - - Bytestream stream(datagram.message); + Bytestream stream(message); try {
--- a/sources/network/rconsession.h Sat Jul 23 12:23:07 2016 +0300 +++ b/sources/network/rconsession.h Sat Jul 23 12:32:23 2016 +0300 @@ -103,7 +103,7 @@ const String& getLevel() const; UDPSocket* getSocket(); RCONSessionState getState() const; - void handlePacket(Datagram& datagram); + void handlePacket(ByteArray& message); bool isActive() const; void processServerUpdates(Bytestream& packet); void requestTabCompletion(const String& part);