1.4.10 updates

This commit is contained in:
WolverinDEV
2020-02-28 11:24:07 +01:00
parent 2b929fd3c0
commit 0d456eea5d
48 changed files with 2267 additions and 781 deletions
+8 -5
View File
@@ -25,7 +25,7 @@ void LicenceRequest::handlePacketDisconnect(const std::string& message) {
}
void LicenceRequest::handlePacketHandshake(const std::string& data) {
if(this->state != protocol::HANDSCAKE) LICENSE_FERR(this, InvalidResponseException, "Protocol state mismatch");
if(this->state != protocol::HANDSCHAKE) LICENSE_FERR(this, InvalidResponseException, "Protocol state mismatch");
if(data.length() < 3) LICENSE_FERR(this, InvalidResponseException, "Invalid packet size");
if((uint8_t) data[0] != 0xAF || (uint8_t) data[1] != 0xFE) LICENSE_FERR(this, InvalidResponseException, "Invalid handshake");
@@ -54,14 +54,13 @@ void LicenceRequest::handlePacketHandshake(const std::string& data) {
}
void LicenceRequest::handlePacketLicenseInfo(const std::string& message) {
ts::proto::license::LicenseResponse response;
ts::proto::license::LicenseResponse response{};
if(!response.ParseFromString(message)) LICENSE_FERR(this, InvalidResponseException, "Could not parse response");
auto result = make_shared<LicenseRequestResponse>();
auto licenseInfo = make_shared<LicenseInfo>();
if(!response.has_license_info() && this->data->license && response.valid() && response.blacklist().state() == ts::proto::license::VALID) {
if(!response.has_license_info() && this->data->license && response.valid() && response.blacklist().state() == ts::proto::license::VALID)
LICENSE_FERR(this, InvalidResponseException, "Missing license info");
}
if(this->data->license) {
licenseInfo->type = (LicenseType) response.license_info().type();
@@ -88,7 +87,11 @@ void LicenceRequest::handlePacketLicenseInfo(const std::string& message) {
result->license = licenseInfo;
this->response = result;
ts::proto::license::PropertyUpdateRequest infos;
if(response.has_update_pending()) {
}
ts::proto::license::PropertyUpdateRequest infos{};
infos.set_speach_total(this->data->speach_total);
infos.set_speach_dead(this->data->speach_dead);
infos.set_speach_online(this->data->speach_online);