1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Clean up some packet-related code

This commit is contained in:
sfan5 2025-02-22 16:37:45 +01:00
parent 5e89371ecd
commit ee9258cefd
11 changed files with 94 additions and 239 deletions

View file

@ -398,11 +398,7 @@ void Client::step(float dtime)
if (dtime > DTIME_LIMIT)
dtime = DTIME_LIMIT;
m_animation_time += dtime;
if(m_animation_time > 60.0)
m_animation_time -= 60.0;
m_time_of_day_update_timer += dtime;
m_animation_time = fmodf(m_animation_time + dtime, 60.0f);
ReceiveAll();
@ -873,14 +869,6 @@ void Client::deletingPeer(con::IPeer *peer, bool timeout)
m_access_denied_reason = gettext("Connection aborted (protocol error?).");
}
/*
u16 command
u16 number of files requested
for each file {
u16 length of name
string name
}
*/
void Client::request_media(const std::vector<std::string> &file_requests)
{
std::ostringstream os(std::ios_base::binary);

View file

@ -538,11 +538,6 @@ private:
// Pending downloads of dynamic media (key: token)
std::vector<std::pair<u32, std::shared_ptr<SingleMediaDownloader>>> m_pending_media_downloads;
// time_of_day speed approximation for old protocol
bool m_time_of_day_set = false;
float m_last_time_of_day_f = -1.0f;
float m_time_of_day_update_timer = 0.0f;
// An interval for generally sending object positions and stuff
float m_recommended_send_interval = 0.1f;