A lot of updates

This commit is contained in:
WolverinDEV
2019-08-20 13:46:23 +02:00
parent 7c490d2180
commit 787f911b6f
15 changed files with 95 additions and 33 deletions
@@ -75,6 +75,25 @@ CommandResult SpeakingClient::handleCommandHandshakeBegin(Command& cmd) { //If !
return {findError("web_handshake_invalid"), "Provided data is too old!"};
this->properties()[property::CLIENT_UNIQUE_IDENTIFIER] = base64::encode(digest::sha1("TeaSpeak-Forum#" + (*this->handshake.identityData)["user_id"].asString()));
this->properties()[property::CLIENT_TEAFORO_ID] = (*this->handshake.identityData)["user_id"].asInt64();
this->properties()[property::CLIENT_TEAFORO_NAME] = (*this->handshake.identityData)["user_name"].asString();
{
///* 0x01 := Banned | 0x02 := Stuff | 0x04 := Premium */
uint64_t flags = 0;
if((*this->handshake.identityData)["is_banned"].isBool() && (*this->handshake.identityData)["is_banned"].asBool())
flags |= 0x01U;
if((*this->handshake.identityData)["is_staff"].isBool() && (*this->handshake.identityData)["is_staff"].asBool())
flags |= 0x02U;
if((*this->handshake.identityData)["is_premium"].isBool() && (*this->handshake.identityData)["is_premium"].asBool())
flags |= 0x04U;
this->properties()[property::CLIENT_TEAFORO_FLAGS] = flags;
}
} catch (Json::Exception& exception) {
return {findError("web_handshake_invalid"), "invalid json!"};
}