aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/CMakeLists.txt
Commit message (Expand)AuthorAge
* Compile Lua as C++ (#11683)Jude Melton-Houghton2022-04-07
* Get rid of empty test filesfan52022-01-30
* Raise max mapgen limit constant to align with mapblock sizesfan52022-01-30
* Use a database for mod storage (#11763)Jude Melton-Houghton2022-01-07
* Localize error messages in mainmenu (#11495)Riceball LEE2021-11-01
* Add "MINETEST_MOD_PATH" environment variable (#11515)emixa-d2021-10-07
* Rename “Minimal development test” to “Development Test” (#9928)Wuzzy2020-05-26
* Add Irrlicht-specific smart pointer (#6814)Vitaliy2019-04-12
* Fix Address::isLocalhost algorithmLoic Blot2019-02-09
* Add an activeobject manager to hold active objects (#7939)Loïc Blot2018-12-13
* Replace auth.txt with SQLite auth database (#7279)Ben Deutsch2018-08-05
* Revert 6587 - Optimize entity-entity collision (#7539)lhofhansl2018-07-08
* Server: move shutdown parts to a specific shutdown state object (#7437)Loïc Blot2018-06-13
* Optimize entity-entity collision (#6587)Vitaliy2018-04-03
* Client eventmanager refactor (#7179)Loïc Blot2018-03-30
* Server: delegate mod management & config to ServerModConfiguration (#7131)Loïc Blot2018-03-16
* Add Voxelarea unittests (#7121)Loïc Blot2018-03-11
* GameUI refactor (part 1/X): GameUI object creation + GameUIFlags move to GameUILoic Blot2018-01-05
* Add unittests on ActiveObject and BanManager class (#6866)Loïc Blot2018-01-01
* Implement mod communication channels (#6351)Loïc Blot2017-09-26
* Add unittests to test player saving/loading (#4679)Ner'zhul2016-10-27
* Only include keycode unittests in client build (fixes #4559)sfan52016-09-29
* Add keycode.cpp unittestssfan52016-09-25
* Add MapSettingsManager and new mapgen setting script API functionskwolekr2016-07-03
* Clean up threadingShadowNinja2015-08-23
* Add AreaStore data structureest312015-07-27
* Tests: Add schematic unittestskwolekr2015-05-08
* Tests: Add NodeResolver unittestskwolekr2015-05-05
* Tests: Add ObjDef unittestskwolekr2015-05-03
* Tests: Add random unittestskwolekr2015-04-29
* Tests: Modularize unit testingkwolekr2015-04-26
pan class="hl opt">(state != MODCHANNEL_STATE_INIT); m_state = state; } bool ModChannelMgr::channelRegistered(const std::string &channel) const { return m_registered_channels.find(channel) != m_registered_channels.end(); } ModChannel *ModChannelMgr::getModChannel(const std::string &channel) { if (!channelRegistered(channel)) return nullptr; return m_registered_channels[channel].get(); } bool ModChannelMgr::canWriteOnChannel(const std::string &channel) const { const auto channel_it = m_registered_channels.find(channel); if (channel_it == m_registered_channels.end()) { return false; } return channel_it->second->canWrite(); } void ModChannelMgr::registerChannel(const std::string &channel) { m_registered_channels[channel] = std::unique_ptr<ModChannel>(new ModChannel(channel)); } bool ModChannelMgr::setChannelState(const std::string &channel, ModChannelState state) { if (!channelRegistered(channel)) return false; auto channel_it = m_registered_channels.find(channel); channel_it->second->setState(state); return true; } bool ModChannelMgr::removeChannel(const std::string &channel) { if (!channelRegistered(channel)) return false; m_registered_channels.erase(channel); return true; } bool ModChannelMgr::joinChannel(const std::string &channel, session_t peer_id) { if (!channelRegistered(channel)) registerChannel(channel); return m_registered_channels[channel]->registerConsumer(peer_id); } bool ModChannelMgr::leaveChannel(const std::string &channel, session_t peer_id) { if (!channelRegistered(channel)) return false; // Remove consumer from channel bool consumerRemoved = m_registered_channels[channel]->removeConsumer(peer_id); // If channel is empty, remove it if (m_registered_channels[channel]->getChannelPeers().empty()) { removeChannel(channel); } return consumerRemoved; } void ModChannelMgr::leaveAllChannels(session_t peer_id) { for (auto &channel_it : m_registered_channels) channel_it.second->removeConsumer(peer_id); } static std::vector<u16> empty_channel_list; const std::vector<u16> &ModChannelMgr::getChannelPeers(const std::string &channel) const { const auto &channel_it = m_registered_channels.find(channel); if (channel_it == m_registered_channels.end()) return empty_channel_list; return channel_it->second->getChannelPeers(); }