Implemented flag to block new players from joining
This commit is contained in:
parent
6f49fecab4
commit
784ac3ba4a
2 changed files with 9 additions and 2 deletions
|
@ -121,8 +121,13 @@ std::shared_ptr<InputIdentity> InputMapper::getInputIdentity(InputDeviceGroup de
|
||||||
|
|
||||||
// No identity found, create new
|
// No identity found, create new
|
||||||
auto newIdentity = std::make_shared<InputIdentity>(deviceGroup, gamepadId);
|
auto newIdentity = std::make_shared<InputIdentity>(deviceGroup, gamepadId);
|
||||||
|
|
||||||
|
// Only add to newInputIdentities if it is allowed, otherwise it will be discarded when possible anyway
|
||||||
|
if (allowNewInputIdentities) {
|
||||||
inputIdentities.insert(newIdentity);
|
inputIdentities.insert(newIdentity);
|
||||||
newInputIdentities.insert(newIdentity);
|
newInputIdentities.insert(newIdentity);
|
||||||
|
}
|
||||||
|
|
||||||
return newIdentity;
|
return newIdentity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
|
|
||||||
std::set<std::shared_ptr<InputIdentity>> getInputIdentities();
|
std::set<std::shared_ptr<InputIdentity>> getInputIdentities();
|
||||||
|
|
||||||
|
bool allowNewInputIdentities = true;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::set<std::shared_ptr<InputIdentity>> newInputIdentities;
|
std::set<std::shared_ptr<InputIdentity>> newInputIdentities;
|
||||||
std::set<std::shared_ptr<InputIdentity>> deprecatedInputIdentities;
|
std::set<std::shared_ptr<InputIdentity>> deprecatedInputIdentities;
|
||||||
|
|
Loading…
Reference in a new issue