mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fixed minetest reliable udp implementation (compatible to old clients)
This commit is contained in:
parent
8b0b857eaa
commit
9edb91da57
8 changed files with 2844 additions and 1156 deletions
|
@ -538,7 +538,7 @@ void Client::step(float dtime)
|
|||
writeU16(&data[53], CLIENT_PROTOCOL_VERSION_MAX);
|
||||
|
||||
// Send as unreliable
|
||||
Send(0, data, false);
|
||||
Send(1, data, false);
|
||||
}
|
||||
|
||||
// Not connected, return
|
||||
|
@ -597,7 +597,7 @@ void Client::step(float dtime)
|
|||
writeV3S16(&reply[2+1+6*k], *j);
|
||||
k++;
|
||||
}
|
||||
m_con.Send(PEER_ID_SERVER, 1, reply, true);
|
||||
m_con.Send(PEER_ID_SERVER, 2, reply, true);
|
||||
|
||||
if(i == deleted_blocks.end())
|
||||
break;
|
||||
|
@ -745,7 +745,7 @@ void Client::step(float dtime)
|
|||
reply[2] = 1;
|
||||
writeV3S16(&reply[3], r.p);
|
||||
// Send as reliable
|
||||
m_con.Send(PEER_ID_SERVER, 1, reply, true);
|
||||
m_con.Send(PEER_ID_SERVER, 2, reply, true);
|
||||
}
|
||||
}
|
||||
if(num_processed_meshes > 0)
|
||||
|
@ -840,7 +840,7 @@ void Client::step(float dtime)
|
|||
std::string s = os.str();
|
||||
SharedBuffer<u8> data((u8*)s.c_str(), s.size());
|
||||
// Send as reliable
|
||||
Send(0, data, true);
|
||||
Send(1, data, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -957,7 +957,7 @@ void Client::request_media(const std::list<std::string> &file_requests)
|
|||
std::string s = os.str();
|
||||
SharedBuffer<u8> data((u8*)s.c_str(), s.size());
|
||||
// Send as reliable
|
||||
Send(0, data, true);
|
||||
Send(1, data, true);
|
||||
infostream<<"Client: Sending media request list to server ("
|
||||
<<file_requests.size()<<" files)"<<std::endl;
|
||||
}
|
||||
|
@ -970,7 +970,7 @@ void Client::received_media()
|
|||
std::string s = os.str();
|
||||
SharedBuffer<u8> data((u8*)s.c_str(), s.size());
|
||||
// Send as reliable
|
||||
Send(0, data, true);
|
||||
Send(1, data, true);
|
||||
infostream<<"Client: Notifying server that we received all media"
|
||||
<<std::endl;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue