MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Add

Method Add

src/network/network.cpp:190–199  ·  view source on GitHub ↗

* Add the given key to the authorized keys, when it is not already contained. * @param key The key to add. * @return \c true when the key was added, \c false when the key already existed or the key was empty. */

Source from the content-addressed store, hash-verified

188 * @return \c true when the key was added, \c false when the key already existed or the key was empty.
189 */
190bool NetworkAuthorizedKeys::Add(std::string_view key)
191{
192 if (key.empty()) return false;
193
194 auto iter = FindKey(this, key);
195 if (iter != this->end()) return false;
196
197 this->emplace_back(key);
198 return true;
199}
200
201/**
202 * Remove the given key from the authorized keys, when it is exists.

Callers 10

IndustrytilesChangeInfoFunction · 0.45
IndustriesChangeInfoFunction · 0.45
TownHouseChangeInfoFunction · 0.45
AirportChangeInfoFunction · 0.45
AirportTilesChangeInfoFunction · 0.45

Calls 3

FindKeyFunction · 0.85
emptyMethod · 0.45
endMethod · 0.45

Tested by 1