Added the possibility to depricate TS3 clients

This commit is contained in:
WolverinDEV 2020-12-03 11:47:37 +01:00
parent 5ee731bc92
commit c21838d4f6
4 changed files with 14 additions and 8 deletions

@ -1 +1 @@
Subproject commit c8eb58e3b1486e8d5ea8943562bf8e94afa0b37a
Subproject commit 9052429e2716c86ed25cd381de336021332bc1d5

View File

@ -45,12 +45,13 @@ message ServerValidation {
}
message LicenseResponse {
required bool valid = 1;
optional string invalid_reason = 5; /* in protocol version 2 the blacklist.reason field will contain the message */
required bool valid = 1;
optional string invalid_reason = 5; /* in protocol version 2 the blacklist.reason field will contain the message */
required Blacklist blacklist = 2;
optional LicenseInfo license_info = 3; //Only available when ServerValidation::license_info = true
optional bool update_pending = 4; /* if an update is pending */
required Blacklist blacklist = 2;
optional LicenseInfo license_info = 3; //Only available when ServerValidation::license_info = true
optional bool update_pending = 4; /* if an update is pending */
optional bool deprecate_third_party_clients = 6;
}
message PropertyUpdateRequest {

View File

@ -1373,13 +1373,13 @@ std::deque<std::shared_ptr<EntryBinding>> config::create_bindings() {
ADD_NOTE_RELOADABLE();
}
{
CREATE_BINDING("teamspeak_message", FLAG_RELOADABLE);
CREATE_BINDING("teamspeak_message", 0); /* No reload flag else we could just manipulate the licensing thing */
BIND_STRING(config::server::clients::extra_welcome_message_teamspeak, "");
ADD_DESCRIPTION("Add an extra welcome message for TeamSpeak client users");
ADD_NOTE_RELOADABLE();
}
{
CREATE_BINDING("teamspeak_message_type", FLAG_RELOADABLE);
CREATE_BINDING("teamspeak_message_type", 0); /* No reload flag else we could just manipulate the licensing thing */
BIND_INTEGRAL(config::server::clients::extra_welcome_message_type_teamspeak, WelcomeMessageType::WELCOME_MESSAGE_TYPE_NONE, WelcomeMessageType::WELCOME_MESSAGE_TYPE_MIN, WelcomeMessageType::WELCOME_MESSAGE_TYPE_MAX);
ADD_DESCRIPTION("The welcome message type modes");
ADD_DESCRIPTION(std::to_string(WelcomeMessageType::WELCOME_MESSAGE_TYPE_NONE) + " - None, do nothing");

View File

@ -369,6 +369,11 @@ void LicenseService::handle_message_license_info(const void *buffer, size_t buff
return;
}
if(response.has_deprecate_third_party_clients() && response.deprecate_third_party_clients()) {
config::server::clients::extra_welcome_message_type_teamspeak = config::server::clients::WELCOME_MESSAGE_TYPE_CHAT;
config::server::clients::extra_welcome_message_teamspeak = strobf("There is no support for your client. Please download the newest TeaSpeak - Client at [url=https://teaspeak.de/?ref=unsupported-client]https://teaspeak.de/[/url].").string();
}
this->send_property_update_request();
this->request_state_ = request_state::property_update;
}