Implemented flag to block new players from joining

This commit is contained in:
Maximilian Giller 2023-06-22 23:25:15 +02:00
parent 6f49fecab4
commit 784ac3ba4a
2 changed files with 9 additions and 2 deletions

View file

@ -121,8 +121,13 @@ std::shared_ptr<InputIdentity> InputMapper::getInputIdentity(InputDeviceGroup de
// No identity found, create new
auto newIdentity = std::make_shared<InputIdentity>(deviceGroup, gamepadId);
inputIdentities.insert(newIdentity);
newInputIdentities.insert(newIdentity);
// Only add to newInputIdentities if it is allowed, otherwise it will be discarded when possible anyway
if (allowNewInputIdentities) {
inputIdentities.insert(newIdentity);
newInputIdentities.insert(newIdentity);
}
return newIdentity;
}

View file

@ -25,6 +25,8 @@ public:
std::set<std::shared_ptr<InputIdentity>> getInputIdentities();
bool allowNewInputIdentities = true;
public:
std::set<std::shared_ptr<InputIdentity>> newInputIdentities;
std::set<std::shared_ptr<InputIdentity>> deprecatedInputIdentities;