- fix menu for network/csnetwork

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7929 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ac8e8b79c7e2bcc2cac8d17ceacf1a18158a5135
Former-commit-id: 2bc1593466a065f1b0a02dcd307d5f59eeff3bbe
This commit is contained in:
torcs-ng 2022-01-22 01:22:21 +00:00
parent f1e6d2f077
commit 251d0b14cf
2 changed files with 505 additions and 491 deletions

View file

@ -137,13 +137,22 @@ GfRaceManagers::GfRaceManagers()
for (itRaceMan = _pPrivate->vecRaceMans.begin();
itRaceMan != _pPrivate->vecRaceMans.end(); ++itRaceMan)
if (std::find(_pPrivate->vecTypes.begin(), _pPrivate->vecTypes.end(), (*itRaceMan)->getType())
== _pPrivate->vecTypes.end())
== _pPrivate->vecTypes.end() && cmakeConfigurationPermits((*itRaceMan)->getType()))
_pPrivate->vecTypes.push_back((*itRaceMan)->getType());
// And log what we've got now.
print(/* bVerbose */false);
}
bool GfRaceManagers::cmakeConfigurationPermits(const std::string& raceManagerType) const
{
#ifdef CLIENT_SERVER
return raceManagerType != CLIENT_SERVER_ON_DISALLOWED_NETWORK_RACEMANAGER_TYPE;
#else
return raceManagerType != CLIENT_SERVER_OFF_DISALLOWED_NETWORK_RACEMANAGER_TYPE;
#endif
}
const std::vector<std::string>& GfRaceManagers::getTypes() const
{
return _pPrivate->vecTypes;

View file

@ -141,6 +141,11 @@ protected:
// Its private data.
class Private;
Private* _pPrivate;
private:
bool cmakeConfigurationPermits(const std::string& raceManagerType) const;
static constexpr const char *const CLIENT_SERVER_OFF_DISALLOWED_NETWORK_RACEMANAGER_TYPE = "Network";
static constexpr const char *const CLIENT_SERVER_ON_DISALLOWED_NETWORK_RACEMANAGER_TYPE = "Online";
};
#endif /* __TGFRACEMANAGERS__H__ */