aboutsummaryrefslogtreecommitdiff
path: root/src/serverobject.h
Commit message (Expand)AuthorAge
* ObjectRef:set_armor_groups() and ObjectRef:set_properties() - works on player...Perttu Ahola2012-03-30
* Add GenericCAO and player armor groups, but don't use them yetPerttu Ahola2012-03-29
* added PlayerSAO and RemotePlayer, removed ServerRemotePlayerKahrl2012-03-29
* Entity damage system WIP; Remove C++ mobsPerttu Ahola2012-03-10
* Fix some warnings on some compilersGiuseppe Bilotta2012-02-02
* The huge item definition and item namespace unification patch (itemdef), see ...Kahrl2012-01-12
* Make players be again visible from a long distancePerttu Ahola2011-12-02
* Players are more like objects + related stuffPerttu Ahola2011-12-01
* Player-is-SAO WIPPerttu Ahola2011-12-01
* Add ServerActiveObject::removingFromEnvironment()Perttu Ahola2011-12-01
* CraftItem rework and Lua interfaceKahrl2011-11-29
* Create framework for getting rid of global definitions of node/tool/item/what...Perttu Ahola2011-11-29
* Scripting WIP: dynamic object stuffPerttu Ahola2011-11-29
* ServerRemotePlayer implements ServerActiveObjectPerttu Ahola2011-11-29
* Scripting WIPPerttu Ahola2011-11-29
* Scripting WIPPerttu Ahola2011-11-29
* Scripting WIPPerttu Ahola2011-11-29
* Scripting WIPPerttu Ahola2011-11-29
* Add peaceful / not peaceful distinction in mobs and the only_peaceful_mobs se...Perttu Ahola2011-10-16
* Improve mobv2Perttu Ahola2011-10-15
* Rats are now eatable. Also made their selection box move smoothly.Perttu Ahola2011-07-30
* reorganized a lot of stuff and modified mapgen and objects slightly while doi...Perttu Ahola2011-06-26
* Preliminary "active block" stuff + set up test code to grow grass.Perttu Ahola2011-05-22
* Some work-in-progress in hp and mobs and a frightening amount of random fixes.Perttu Ahola2011-04-21
* better support for old mapsPerttu Ahola2011-04-10
* new-style rats are now generated in the mapPerttu Ahola2011-04-10
* implemented rats in new system to verify that it worksPerttu Ahola2011-04-10
* items now fall by gravity... also some other random updatingPerttu Ahola2011-04-10
* new object systemPerttu Ahola2011-04-10
* Some progress on transitioning from MapBlockObject to ActiveObject.Perttu Ahola2011-04-08
* Removed lua stuffPerttu Ahola2011-04-03
* mainly work on object scripting apiPerttu Ahola2011-02-23
* preliminary lua scripting framework for objectsPerttu Ahola2011-02-21
* Temporary commit; lots of test code and stuffPerttu Ahola2011-02-21
::string line; std::getline(is, line, '\n'); Strfnd f(line); std::string ip = trim(f.next("|")); std::string name = trim(f.next("|")); if(!ip.empty()) { m_ips[ip] = name; } } m_modified = false; } void BanManager::save() { MutexAutoLock lock(m_mutex); infostream << "BanManager: saving to " << m_banfilepath << std::endl; std::ostringstream ss(std::ios_base::binary); for (const auto &ip : m_ips) ss << ip.first << "|" << ip.second << "\n"; if (!fs::safeWriteToFile(m_banfilepath, ss.str())) { infostream << "BanManager: failed saving to " << m_banfilepath << std::endl; throw SerializationError("BanManager::save(): Couldn't write file"); } m_modified = false; } bool BanManager::isIpBanned(const std::string &ip) { MutexAutoLock lock(m_mutex); return m_ips.find(ip) != m_ips.end(); } std::string BanManager::getBanDescription(const std::string &ip_or_name) { MutexAutoLock lock(m_mutex); std::string s; for (const auto &ip : m_ips) { if (ip.first == ip_or_name || ip.second == ip_or_name || ip_or_name.empty()) { s += ip.first + "|" + ip.second + ", "; } } s = s.substr(0, s.size() - 2); return s; } std::string BanManager::getBanName(const std::string &ip) { MutexAutoLock lock(m_mutex); StringMap::iterator it = m_ips.find(ip); if (it == m_ips.end()) return ""; return it->second; } void BanManager::add(const std::string &ip, const std::string &name) { MutexAutoLock lock(m_mutex); m_ips[ip] = name; m_modified = true; } void BanManager::remove(const std::string &ip_or_name) { MutexAutoLock lock(m_mutex); for (StringMap::iterator it = m_ips.begin(); it != m_ips.end();) { if ((it->first == ip_or_name) || (it->second == ip_or_name)) { m_ips.erase(it++); m_modified = true; } else { ++it; } } } bool BanManager::isModified() { MutexAutoLock lock(m_mutex); return m_modified; }