Some license server improvements
This commit is contained in:
@@ -89,7 +89,7 @@ bool LicenseServer::handleHandshake(shared_ptr<ConnectedClient>& client, protoco
|
||||
}
|
||||
|
||||
bool LicenseServer::handleDisconnect(shared_ptr<ConnectedClient>& client, protocol::packet& packet, std::string &error) {
|
||||
logMessage("[CLIENT][" + client->address() + "] Remote disconnect. Reason: " + packet.data);
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Remote disconnect. Reason: " + packet.data);
|
||||
this->closeConnection(client);
|
||||
return true;
|
||||
}
|
||||
@@ -236,24 +236,24 @@ bool LicenseServer::handlePacketPropertyUpdate(shared_ptr<ConnectedClient> &clie
|
||||
}
|
||||
PARSE_PROTO(PropertyUpdateRequest, pkt);
|
||||
|
||||
logMessage("[CLIENT][" + client->address() + "] Got server statistics:");
|
||||
logMessage("[CLIENT][" + client->address() + "] Spoken total : " + to_string(pkt.speach_total()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Spoken dead : " + to_string(pkt.speach_dead()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Spoken online : " + to_string(pkt.speach_online()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Spoken varianz : " + to_string(pkt.speach_varianz()));
|
||||
logMessage("[CLIENT][" + client->address() + "] -------------------------------");
|
||||
logMessage("[CLIENT][" + client->address() + "] Users online : " + to_string(pkt.clients_online()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Web Users online : " + to_string(pkt.web_clients_online()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Queries online : " + to_string(pkt.queries_online()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Bots online : " + to_string(pkt.bots_online()));
|
||||
logMessage("[CLIENT][" + client->address() + "] Servers : " + to_string(pkt.servers_online()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Got server statistics:");
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Spoken total : " + to_string(pkt.speach_total()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Spoken dead : " + to_string(pkt.speach_dead()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Spoken online : " + to_string(pkt.speach_online()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Spoken varianz : " + to_string(pkt.speach_varianz()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] -------------------------------");
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Users online : " + to_string(pkt.clients_online()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Web Users online : " + to_string(pkt.web_clients_online()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Queries online : " + to_string(pkt.queries_online()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Bots online : " + to_string(pkt.bots_online()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Servers : " + to_string(pkt.servers_online()));
|
||||
this->manager->logStatistic(client->key, client->unique_identifier, client->address(), pkt);
|
||||
//TODO test stuff if its possible!
|
||||
|
||||
ts::proto::license::WebCertificate* web_certificate{nullptr};
|
||||
if(pkt.has_web_cert_revision()) {
|
||||
logMessage("[CLIENT][" + client->address() + "] -------------------------------");
|
||||
logMessage("[CLIENT][" + client->address() + "] Web cert revision : " + hex::hex(pkt.web_cert_revision()));
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] -------------------------------");
|
||||
logMessage(LOG_GENERAL, "[CLIENT][" + client->address() + "] Web cert revision : " + hex::hex(pkt.web_cert_revision()));
|
||||
|
||||
auto cert = this->web_certificate;
|
||||
if(cert && cert->revision != pkt.web_cert_revision()) {
|
||||
@@ -285,7 +285,7 @@ bool LicenseServer::handlePacketAuth(shared_ptr<ConnectedClient> &client, protoc
|
||||
TEST_PROTOCOL_STATE(MANAGER_AUTHORIZATION);
|
||||
PARSE_PROTO(AuthorizationRequest, pkt);
|
||||
|
||||
logMessage("[MANAGER][" + client->address() + "] Got login. User: " + pkt.username() + " Password: " + pkt.password());
|
||||
logMessage(LOG_GENERAL, "[MANAGER][" + client->address() + "] Got login. User: " + pkt.username() + " Password: " + pkt.password());
|
||||
|
||||
ts::proto::license::AuthorizationResponse response;
|
||||
response.set_success(false);
|
||||
@@ -316,11 +316,11 @@ bool LicenseServer::handlePacketAuth(shared_ptr<ConnectedClient> &client, protoc
|
||||
response.set_message("username or password mismatch");
|
||||
|
||||
if(response.success()) {
|
||||
logMessage("[MANAGER][" + client->address() + "] Got succeeded user login. User: " + pkt.username() + " Password: " + pkt.password());
|
||||
logMessage(LOG_GENERAL, "[MANAGER][" + client->address() + "] Got succeeded user login. User: " + pkt.username() + " Password: " + pkt.password());
|
||||
client->username = pkt.username();
|
||||
client->protocol.state = protocol::MANAGER_CONNECTED;
|
||||
} else
|
||||
logMessage("[MANAGER][" + client->address() + "] Got failed user login. User: " + pkt.username() + " Password: " + pkt.password());
|
||||
logMessage(LOG_GENERAL, "[MANAGER][" + client->address() + "] Got failed user login. User: " + pkt.username() + " Password: " + pkt.password());
|
||||
|
||||
client->sendPacket(protocol::packet{protocol::PACKET_SERVER_AUTH_RESPONSE, response});
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user