aboutsummaryrefslogtreecommitdiff
path: root/src/clientiface.cpp
Commit message (Expand)AuthorAge
* Optimize block sent: Fix rendering issueLars Hofhansl2016-12-03
* Optimize/adjust blocks/ActiveObjects sent at the server based on client setti...lhofhansl2016-11-30
* Fix incorrect distance computation for visible blocks (#4765)Rogier-52016-11-11
* Retrieve mapblocks from the server in a sphere, not a cubeLars Hofhansl2016-11-08
* Don't use reduced vertical limits for mapblock send and generationLars Hofhansl2016-11-07
* Optionally disable optimization that causes underwater and cave rendering gli...lhofhansl2016-10-30
* PlayerSAO/LocalPlayer refactor: (#4612)Ner'zhul2016-10-30
* Move RemotePlayer code to its own cpp/headerLoic Blot2016-10-08
* Optimize ClientIface::getPlayerNames(): return const ref instead a copy of al...Loic Blot2016-10-08
* More code cleanup (UNORDERED + RemotePlayer/LocalPlayer)Loic Blot2016-10-08
* Replace various std::map with UNORDERED_MAP + various cleanupsLoic Blot2016-10-05
* Resend blocks when modified while sending to clientJeija2016-03-12
* Reset block send timer when invoking setBlock(s)NotSent()orwell962016-02-22
* Rename macros with two leading underscoresShadowNinja2015-10-14
* Make ClientInterface::statenames consistent with the state enum againest312015-08-31
* Clean up threadingShadowNinja2015-08-23
* Add map limit config optionrubenwardy2015-08-02
* Make early protocol auth mechanism generic, and add SRPest312015-05-11
* Move globals from main.cpp to more sane locationsCraig Robbins2015-04-01
* Replace NetworkPacket pointers to referencesLoic Blot2015-03-13
* ClientInterface::getClientIDs doesn't need a std::list. Use a std::vector for...Loic Blot2015-03-04
* Performance Improvement: Use a cache which caches result for getFacePositions.Loic Blot2015-02-16
* [Patch 2/4] Network rework: packet writing, sending and cleanupsLoic Blot2015-02-16
* Fix all warnings and remove -Wno-unused-but-set cflagkwolekr2015-01-18
* Use std::string::empty() instead of size() where applicableAnton2014-12-12
* Split settings into seperate source and header filesShadowNinja2014-09-21
* Fix "ghost" blocks if block update is "on wire" while player digs nodessapier2014-08-22
* Add prefixes to enum values and fix style issueskwolekr2014-06-28
* Cleanup client init states by bumping protocol versionsapier2014-04-08
* Fix bug in RemoteClient::GetNextBlocksPerttu Ahola2014-03-26
* Add missing headerBlockMen2014-02-06
* Add propper client initializationsapier2014-01-31
ss="hl kwa">if(map_format_version >= 25){ writeU8(os, 2+4+4); writeU16(os, m_data.size()); } for(std::map<v3s16, NodeTimer>::const_iterator i = m_data.begin(); i != m_data.end(); i++){ v3s16 p = i->first; NodeTimer t = i->second; u16 p16 = p.Z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + p.Y*MAP_BLOCKSIZE + p.X; writeU16(os, p16); t.serialize(os); } } void NodeTimerList::deSerialize(std::istream &is, u8 map_format_version) { m_data.clear(); if(map_format_version == 24){ u8 timer_version = readU8(is); if(timer_version == 0) return; if(timer_version != 1) throw SerializationError("unsupported NodeTimerList version"); } if(map_format_version >= 25){ u8 timer_data_len = readU8(is); if(timer_data_len != 2+4+4) throw SerializationError("unsupported NodeTimer data length"); } u16 count = readU16(is); for(u16 i=0; i<count; i++) { u16 p16 = readU16(is); v3s16 p; p.Z = p16 / MAP_BLOCKSIZE / MAP_BLOCKSIZE; p16 &= MAP_BLOCKSIZE * MAP_BLOCKSIZE - 1; p.Y = p16 / MAP_BLOCKSIZE; p16 &= MAP_BLOCKSIZE - 1; p.X = p16; NodeTimer t; t.deSerialize(is); if(t.timeout <= 0) { infostream<<"WARNING: NodeTimerList::deSerialize(): " <<"invalid data at position" <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring." <<std::endl; continue; } if(m_data.find(p) != m_data.end()) { infostream<<"WARNING: NodeTimerList::deSerialize(): " <<"already set data at position" <<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring." <<std::endl; continue; } m_data.insert(std::make_pair(p, t)); } } std::map<v3s16, NodeTimer> NodeTimerList::step(float dtime) { std::map<v3s16, NodeTimer> elapsed_timers; // Increment timers for(std::map<v3s16, NodeTimer>::iterator i = m_data.begin(); i != m_data.end(); i++){ v3s16 p = i->first; NodeTimer t = i->second; t.elapsed += dtime; if(t.elapsed >= t.timeout) elapsed_timers.insert(std::make_pair(p, t)); else i->second = t; } // Delete elapsed timers for(std::map<v3s16, NodeTimer>::const_iterator i = elapsed_timers.begin(); i != elapsed_timers.end(); i++){ v3s16 p = i->first; m_data.erase(p); } return elapsed_timers; }