sources/network/rconsession.cpp

changeset 168
96ffd13c08a2
parent 163
5948441a1951
child 169
febc3ed5435c
child 179
7fc34735178e
equal deleted inserted replaced
164:e3794f48a589 168:96ffd13c08a2
110 bumpLastPing(); 110 bumpLastPing();
111 } 111 }
112 } 112 }
113 113
114 for (Datagram datagram; m_socket.read(datagram);) 114 for (Datagram datagram; m_socket.read(datagram);)
115 handlePacket(datagram); 115 {
116 } 116 // Only process packets that originate from the game server.
117 117 if (datagram.address == m_address)
118 // ------------------------------------------------------------------------------------------------- 118 handlePacket(datagram.message);
119 // 119 }
120 void RCONSession::handlePacket(Datagram& datagram) 120 }
121 { 121
122 if (datagram.address != m_address) 122 // -------------------------------------------------------------------------------------------------
123 return; 123 //
124 124 void RCONSession::handlePacket(ByteArray& message)
125 Bytestream stream(datagram.message); 125 {
126 Bytestream stream(message);
126 127
127 try 128 try
128 { 129 {
129 while (stream.bytesLeft() > 0) 130 while (stream.bytesLeft() > 0)
130 { 131 {

mercurial