use the cvar bool feature

master
Martin Gerhardy 2016-03-31 19:55:08 +02:00
parent 874ea1b227
commit f65afec48a
2 changed files with 5 additions and 3 deletions

View File

@ -35,8 +35,8 @@ EntityId EntityStorage::getUserId(const std::string& user, const std::string& pa
int checkId = pq.loadUser(user, passwd, tmUid);
if (checkId == 0) {
const core::VarPtr& autoReg = core::Var::get("user_auto_register", "yes");
if (autoReg->strVal() == "yes") {
const core::VarPtr& autoReg = core::Var::get("sv_autoregister", "true");
if (autoReg->boolVal()) {
pq.storeUser(user, passwd, tmUid);
checkId = pq.loadUser(user, passwd, tmUid);
}

View File

@ -22,7 +22,9 @@ protected:
template<class MSGTYPE>
inline const MSGTYPE* getMsg(const void *data) const {
return static_cast<const MSGTYPE*>(data);
const MSGTYPE* msg = static_cast<const MSGTYPE*>(data);
// TODO: call verify
return msg;
}
public: