1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Remove legacy client handling code.

This commit is contained in:
Lars Hofhansl 2018-07-14 11:38:52 -07:00
parent b38c121856
commit ca8ec46843
3 changed files with 57 additions and 127 deletions

View file

@ -206,9 +206,6 @@ void ConnectionSendThread::runTimeouts(float dtime)
for (Channel &channel : udpPeer->channels) {
std::list<BufferedPacket> timed_outs;
if (udpPeer->getLegacyPeer())
channel.setWindowSize(WINDOW_SIZE);
// Remove timed out incomplete unreliable split packets
channel.incoming_splits.removeUnreliableTimedOuts(dtime, m_timeout);
@ -264,7 +261,7 @@ void ConnectionSendThread::runTimeouts(float dtime)
break; /* no need to check other channels if we already did timeout */
}
channel.UpdateTimers(dtime, udpPeer->getLegacyPeer());
channel.UpdateTimers(dtime);
}
/* skip to next peer if we did timeout */
@ -428,15 +425,6 @@ void ConnectionSendThread::processReliableCommand(ConnectionCommand &c)
}
return;
case CONCMD_DISABLE_LEGACY:
LOG(dout_con << m_connection->getDesc()
<< "UDP processing reliable CONCMD_DISABLE_LEGACY" << std::endl);
if (!rawSendAsPacket(c.peer_id, c.channelnum, c.data, c.reliable)) {
/* put to queue if we couldn't send it immediately */
sendReliable(c);
}
return;
case CONNCMD_SERVE:
case CONNCMD_CONNECT:
case CONNCMD_DISCONNECT:
@ -1208,18 +1196,6 @@ SharedBuffer<u8> ConnectionReceiveThread::handlePacketType_Control(Channel *chan
m_connection->SetPeerID(peer_id_new);
}
// set non legacy mode locally
dynamic_cast<UDPPeer *>(peer)->setNonLegacyPeer();
// request the same from the remote side
ConnectionCommand cmd;
SharedBuffer<u8> reply(2);
writeU8(&reply[0], PACKET_TYPE_CONTROL);
writeU8(&reply[1], CONTROLTYPE_ENABLE_BIG_SEND_WINDOW);
cmd.disableLegacy(PEER_ID_SERVER, reply);
m_connection->putCommand(cmd);
throw ProcessedSilentlyException("Got a SET_PEER_ID");
} else if (controltype == CONTROLTYPE_PING) {
// Just ignore it, the incoming data already reset
@ -1237,9 +1213,6 @@ SharedBuffer<u8> ConnectionReceiveThread::handlePacketType_Control(Channel *chan
}
throw ProcessedSilentlyException("Got a DISCO");
} else if (controltype == CONTROLTYPE_ENABLE_BIG_SEND_WINDOW) {
dynamic_cast<UDPPeer *>(peer)->setNonLegacyPeer();
throw ProcessedSilentlyException("Got non legacy control");
} else {
LOG(derr_con << m_connection->getDesc()
<< "INVALID TYPE_CONTROL: invalid controltype="