apply astylerc
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#define NUKI_HUB_VERSION "9.12"
|
||||
#define NUKI_HUB_VERSION_INT (uint32_t)912
|
||||
#define NUKI_HUB_BUILD "unknownbuildnr"
|
||||
#define NUKI_HUB_DATE "2025-07-21"
|
||||
#define NUKI_HUB_DATE "2025-08-13"
|
||||
|
||||
#define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest"
|
||||
#define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"
|
||||
|
||||
@@ -25,7 +25,8 @@ HomeAssistantDiscovery::HomeAssistantDiscovery(NetworkDevice* device, Preference
|
||||
char uidString[20];
|
||||
itoa(_preferences->getUInt(preference_device_id_lock, 0), uidString, 10);
|
||||
removeHASSConfig(uidString);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
@@ -41,13 +42,15 @@ HomeAssistantDiscovery::HomeAssistantDiscovery(NetworkDevice* device, Preference
|
||||
char uidString[20];
|
||||
itoa(_preferences->getUInt(preference_device_id_lock, 0), uidString, 10);
|
||||
removeHASSConfig(uidString);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
itoa(savedDevId, uidString, 10);
|
||||
removeHASSConfig(uidString);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
@@ -102,7 +105,8 @@ void HomeAssistantDiscovery::setupHASS(int type, uint32_t nukiId, char* nukiName
|
||||
void HomeAssistantDiscovery::disableHASS()
|
||||
{
|
||||
removeHASSConfig(_nukiHubUidString);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
@@ -113,7 +117,8 @@ void HomeAssistantDiscovery::disableHASS()
|
||||
{
|
||||
itoa(_preferences->getUInt(preference_nuki_id_lock, 0), uidString, 16);
|
||||
removeHASSConfig(uidString);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
@@ -122,7 +127,8 @@ void HomeAssistantDiscovery::disableHASS()
|
||||
{
|
||||
itoa(_preferences->getUInt(preference_nuki_id_opener, 0), uidString, 16);
|
||||
removeHASSConfig(uidString);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -151,7 +151,8 @@ int ImportExport::checkDuoAuth(PsychicRequest *request)
|
||||
}
|
||||
}
|
||||
|
||||
if (request->hasParam("id")) {
|
||||
if (request->hasParam("id"))
|
||||
{
|
||||
const PsychicWebParameter* p = request->getParam("id");
|
||||
String id = p->value();
|
||||
DuoAuthLib duoAuth;
|
||||
@@ -337,13 +338,15 @@ bool ImportExport::checkBypass(String bypass)
|
||||
|
||||
void ImportExport::exportHttpsJson(JsonDocument &json)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.crt not found");
|
||||
}
|
||||
else
|
||||
@@ -359,13 +362,15 @@ void ImportExport::exportHttpsJson(JsonDocument &json)
|
||||
}
|
||||
}
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.key");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.key not found");
|
||||
}
|
||||
else
|
||||
@@ -384,13 +389,15 @@ void ImportExport::exportHttpsJson(JsonDocument &json)
|
||||
|
||||
void ImportExport::exportMqttsJson(JsonDocument &json)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.ca not found");
|
||||
}
|
||||
else
|
||||
@@ -406,13 +413,15 @@ void ImportExport::exportMqttsJson(JsonDocument &json)
|
||||
}
|
||||
}
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.crt");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.crt not found");
|
||||
}
|
||||
else
|
||||
@@ -428,13 +437,15 @@ void ImportExport::exportMqttsJson(JsonDocument &json)
|
||||
}
|
||||
}
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.key");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.key not found");
|
||||
}
|
||||
else
|
||||
@@ -909,7 +920,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
nukiBlePref.end();
|
||||
if(!doc["mqtt_ssl.ca"].isNull())
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
json["mqtt_ssl.ca"] = "error";
|
||||
}
|
||||
@@ -918,7 +930,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
if(doc["mqtt_ssl.ca"].as<String>().length() > 0)
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.ca for writing");
|
||||
json["mqtt_ssl.ca"] = "error";
|
||||
}
|
||||
@@ -938,7 +951,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/mqtt_ssl.ca")) {
|
||||
if (!SPIFFS.remove("/mqtt_ssl.ca"))
|
||||
{
|
||||
Log->println("Failed to delete /mqtt_ssl.ca");
|
||||
json["mqtt_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -951,7 +965,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
if(!doc["mqtt_ssl.crt"].isNull())
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
json["mqtt_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -960,7 +975,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
if(doc["mqtt_ssl.crt"].as<String>().length() > 0)
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.crt", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.crt for writing");
|
||||
json["mqtt_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -980,7 +996,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/mqtt_ssl.crt")) {
|
||||
if (!SPIFFS.remove("/mqtt_ssl.crt"))
|
||||
{
|
||||
Log->println("Failed to delete /mqtt_ssl.crt");
|
||||
json["mqtt_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -993,7 +1010,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
if(!doc["mqtt_ssl.key"].isNull())
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
json["mqtt_ssl.key"] = "error";
|
||||
}
|
||||
@@ -1002,7 +1020,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
if(doc["mqtt_ssl.key"].as<String>().length() > 0)
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.key", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.key for writing");
|
||||
json["mqtt_ssl.key"] = "error";
|
||||
}
|
||||
@@ -1022,7 +1041,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/mqtt_ssl.key")) {
|
||||
if (!SPIFFS.remove("/mqtt_ssl.key"))
|
||||
{
|
||||
Log->println("Failed to delete /mqtt_ssl.key");
|
||||
}
|
||||
else
|
||||
@@ -1034,7 +1054,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
if(!doc["http_ssl.crt"].isNull())
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
json["http_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -1043,7 +1064,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
if(doc["http_ssl.crt"].as<String>().length() > 0)
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /http_ssl.crt for writing");
|
||||
json["http_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -1063,7 +1085,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/http_ssl.crt")) {
|
||||
if (!SPIFFS.remove("/http_ssl.crt"))
|
||||
{
|
||||
Log->println("Failed to delete /http_ssl.crt");
|
||||
json["http_ssl.crt"] = "error";
|
||||
}
|
||||
@@ -1076,7 +1099,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
if(!doc["http_ssl.key"].isNull())
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
json["http_ssl.key"] = "error";
|
||||
}
|
||||
@@ -1085,7 +1109,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
if(doc["http_ssl.key"].as<String>().length() > 0)
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.key", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /http_ssl.key for writing");
|
||||
json["http_ssl.key"] = "error";
|
||||
}
|
||||
@@ -1105,7 +1130,8 @@ JsonDocument ImportExport::importJson(JsonDocument &doc)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/http_ssl.key")) {
|
||||
if (!SPIFFS.remove("/http_ssl.key"))
|
||||
{
|
||||
Log->println("Failed to delete /http_ssl.key");
|
||||
json["http_ssl.key"] = "error";
|
||||
}
|
||||
|
||||
@@ -476,7 +476,8 @@ bool NukiNetwork::update()
|
||||
bool success = reconnect();
|
||||
if(!success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
@@ -488,7 +489,8 @@ bool NukiNetwork::update()
|
||||
if(forceEnableWebServer && !_webEnabled)
|
||||
{
|
||||
forceEnableWebServer = false;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -498,7 +500,8 @@ bool NukiNetwork::update()
|
||||
{
|
||||
forceEnableWebServer = false;
|
||||
}
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
@@ -513,13 +516,15 @@ bool NukiNetwork::update()
|
||||
forceEnableWebServer = true;
|
||||
}
|
||||
Log->println("Network timeout has been reached, restarting ...");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
restartEsp(RestartReason::NetworkTimeoutWatchdog);
|
||||
}
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
@@ -751,7 +756,8 @@ bool NukiNetwork::reconnect(bool force)
|
||||
|
||||
while(!_connectReplyReceived && espMillis() < timeout)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -767,7 +773,8 @@ bool NukiNetwork::reconnect(bool force)
|
||||
Log->println("MQTT connected");
|
||||
_mqttConnectedTs = millis();
|
||||
_mqttConnectionState = 1;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -1015,7 +1022,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
{
|
||||
Log->println("Restart requested via MQTT.");
|
||||
clearWifiFallback();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -1071,7 +1079,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
_preferences->putString(preference_ota_updater_url, GITHUB_LATEST_UPDATER_BINARY_URL);
|
||||
_preferences->putString(preference_ota_main_url, GITHUB_LATEST_RELEASE_BINARY_URL);
|
||||
Log->println("Updating to latest release version.");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -1089,7 +1098,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
_preferences->putString(preference_ota_updater_url, GITHUB_BETA_UPDATER_BINARY_URL);
|
||||
_preferences->putString(preference_ota_main_url, GITHUB_BETA_RELEASE_BINARY_URL);
|
||||
Log->println("Updating to latest beta version.");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -1107,7 +1117,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
_preferences->putString(preference_ota_updater_url, GITHUB_MASTER_UPDATER_BINARY_URL);
|
||||
_preferences->putString(preference_ota_main_url, GITHUB_MASTER_RELEASE_BINARY_URL);
|
||||
Log->println("Updating to latest developmemt version.");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -1125,7 +1136,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
_preferences->putString(preference_ota_updater_url, GITHUB_LATEST_UPDATER_BINARY_URL);
|
||||
_preferences->putString(preference_ota_main_url, GITHUB_LATEST_RELEASE_BINARY_URL);
|
||||
Log->println("Updating to latest release version.");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -1165,7 +1177,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
_preferences->putBool(preference_webserver_enabled, false);
|
||||
}
|
||||
clearWifiFallback();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -1197,7 +1210,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
{
|
||||
String jsonTotp = doc["totp"];
|
||||
|
||||
if (!_importExport->checkTOTP(&jsonTotp)) {
|
||||
if (!_importExport->checkTOTP(&jsonTotp))
|
||||
{
|
||||
publishString(_maintenancePathPrefix, mqtt_topic_nuki_hub_config_action_command_result, "{\"error\": \"totpIncorrect\"}", false);
|
||||
publishString(_maintenancePathPrefix, mqtt_topic_nuki_hub_config_action, "--", true);
|
||||
return;
|
||||
@@ -1219,7 +1233,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
while (duoResult == 2)
|
||||
{
|
||||
duoResult = _importExport->checkDuoApprove();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
@@ -1339,7 +1354,8 @@ void NukiNetwork::onMqttDataReceived(const char* topic, byte* payload, const uns
|
||||
serializeJson(json, _buffer, _bufferSize);
|
||||
publishString(_maintenancePathPrefix, mqtt_topic_nuki_hub_config_json, _buffer, false);
|
||||
publishString(_maintenancePathPrefix, mqtt_topic_nuki_hub_config_action, "--", true);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -247,7 +247,8 @@ void NukiOpenerWrapper::update()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -268,7 +269,8 @@ void NukiOpenerWrapper::update()
|
||||
Log->print("No BLE beacon received from the opener for ");
|
||||
Log->print((ts - lastReceivedBeaconTs) / 1000);
|
||||
Log->println(" seconds, signalling to restart BLE controller.");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -304,7 +306,8 @@ void NukiOpenerWrapper::update()
|
||||
|
||||
_network->publishRetry(std::to_string(retryCount + 1));
|
||||
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(_retryDelay / portTICK_PERIOD_MS);
|
||||
@@ -343,7 +346,8 @@ void NukiOpenerWrapper::update()
|
||||
|
||||
if(_statusUpdated)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
@@ -615,7 +619,8 @@ void NukiOpenerWrapper::updateBatteryState()
|
||||
{
|
||||
Log->print("Querying opener battery state: ");
|
||||
result = _nukiOpener.requestBatteryReport(&_batteryReport);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -790,7 +795,8 @@ void NukiOpenerWrapper::updateAuthData(bool retrieved)
|
||||
if(result == Nuki::CmdResult::Success)
|
||||
{
|
||||
_waitAuthLogUpdateTs = espMillis() + 5000;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -1020,7 +1026,8 @@ void NukiOpenerWrapper::updateAuth(bool retrieved)
|
||||
{
|
||||
Log->print("Querying opener authorization: ");
|
||||
result = _nukiOpener.retrieveAuthorizationEntries(0, _preferences->getInt(preference_auth_max_entries, MAX_AUTH));
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -3062,7 +3069,8 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
|
||||
|
||||
if(resultKp == Nuki::CmdResult::Success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
@@ -3431,7 +3439,8 @@ void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value)
|
||||
|
||||
if(resultTc == Nuki::CmdResult::Success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
@@ -3890,7 +3899,8 @@ void NukiOpenerWrapper::onAuthCommandReceived(const char *value)
|
||||
|
||||
if(resultAuth == Nuki::CmdResult::Success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -263,7 +263,8 @@ void NukiWrapper::update(bool reboot)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -284,7 +285,8 @@ void NukiWrapper::update(bool reboot)
|
||||
Log->print("No BLE beacon received from the lock for ");
|
||||
Log->print((ts - lastReceivedBeaconTs) / 1000);
|
||||
Log->println(" seconds, signalling to restart BLE controller.");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -324,7 +326,8 @@ void NukiWrapper::update(bool reboot)
|
||||
|
||||
_network->publishRetry(std::to_string(retryCount + 1));
|
||||
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(_retryDelay / portTICK_PERIOD_MS);
|
||||
@@ -367,7 +370,8 @@ void NukiWrapper::update(bool reboot)
|
||||
|
||||
if(_statusUpdated)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
@@ -821,8 +825,10 @@ void NukiWrapper::updateDebug()
|
||||
Log->print("Result: ");
|
||||
Log->println(result);
|
||||
count = 0;
|
||||
while (count < 5) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
while (count < 5)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
@@ -843,8 +849,10 @@ void NukiWrapper::updateDebug()
|
||||
Log->println(result);
|
||||
|
||||
count = 0;
|
||||
while (count < 15) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
while (count < 15)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
@@ -865,8 +873,10 @@ void NukiWrapper::updateDebug()
|
||||
Log->println(result);
|
||||
|
||||
count = 0;
|
||||
while (count < 20) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
while (count < 20)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
@@ -948,7 +958,8 @@ void NukiWrapper::updateAuthData(bool retrieved)
|
||||
if(result == Nuki::CmdResult::Success)
|
||||
{
|
||||
_waitAuthLogUpdateTs = espMillis() + 5000;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -1176,7 +1187,8 @@ void NukiWrapper::updateAuth(bool retrieved)
|
||||
{
|
||||
Log->print("Querying lock authorization: ");
|
||||
result = _nukiLock.retrieveAuthorizationEntries(0, _preferences->getInt(preference_auth_max_entries, MAX_AUTH));
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -3312,7 +3324,8 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
|
||||
|
||||
if(resultKp == Nuki::CmdResult::Success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
@@ -3682,7 +3695,8 @@ void NukiWrapper::onTimeControlCommandReceived(const char *value)
|
||||
|
||||
if(resultTc == Nuki::CmdResult::Success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
@@ -3901,7 +3915,8 @@ void NukiWrapper::onAuthCommandReceived(const char *value)
|
||||
if(idExists)
|
||||
{
|
||||
result = _nukiLock.deleteAuthorizationEntry(authId);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -4124,7 +4139,8 @@ void NukiWrapper::onAuthCommandReceived(const char *value)
|
||||
}
|
||||
|
||||
result = _nukiLock.addAuthorizationEntry(entry);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -4150,7 +4166,8 @@ void NukiWrapper::onAuthCommandReceived(const char *value)
|
||||
|
||||
if(resultAuth == Nuki::CmdResult::Success)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
@@ -4296,7 +4313,8 @@ void NukiWrapper::onAuthCommandReceived(const char *value)
|
||||
}
|
||||
|
||||
result = _nukiLock.updateAuthorizationEntry(entry);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -4411,7 +4429,8 @@ void NukiWrapper::readConfig()
|
||||
{
|
||||
++retryCount;
|
||||
Log->println("Failed to retrieve lock config, retrying in 1s");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
@@ -4442,7 +4461,8 @@ void NukiWrapper::readAdvancedConfig()
|
||||
{
|
||||
++retryCount;
|
||||
Log->println("Failed to retrieve lock advanced config, retrying in 1s");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -300,7 +300,10 @@ inline void initPreferences(Preferences* preferences)
|
||||
Log->print("Current config version: ");
|
||||
Log->println(NUKI_HUB_VERSION_INT);
|
||||
|
||||
if(lastConfigVer >= NUKI_HUB_VERSION_INT && lastConfigVer < 20000) return;
|
||||
if(lastConfigVer >= NUKI_HUB_VERSION_INT && lastConfigVer < 20000)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastConfigVer < 834)
|
||||
{
|
||||
@@ -429,13 +432,15 @@ inline void initPreferences(Preferences* preferences)
|
||||
|
||||
if (caLength > 1)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.ca for writing");
|
||||
}
|
||||
else
|
||||
@@ -455,13 +460,15 @@ inline void initPreferences(Preferences* preferences)
|
||||
|
||||
if (crtLength > 1)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.crt", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.crt for writing");
|
||||
}
|
||||
else
|
||||
@@ -480,13 +487,15 @@ inline void initPreferences(Preferences* preferences)
|
||||
|
||||
if (keyLength > 1)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.key", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.key for writing");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -30,7 +30,8 @@ extern bool timeSynced;
|
||||
#include "ArduinoJson.h"
|
||||
#include <freertos/queue.h>
|
||||
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
int socket;
|
||||
char *buffer;
|
||||
size_t len;
|
||||
@@ -183,7 +184,8 @@ esp_err_t WebCfgServer::logoutSession(PsychicRequest *request, PsychicResponse*
|
||||
resp->setCookie("duoId", "", 0, "Secure; HttpOnly");
|
||||
}
|
||||
|
||||
if (request->hasCookie("duoId")) {
|
||||
if (request->hasCookie("duoId"))
|
||||
{
|
||||
String cookie2 = request->getCookie("duoId");
|
||||
_importExport->_duoSessions.remove(cookie2);
|
||||
saveSessions(1);
|
||||
@@ -205,7 +207,8 @@ esp_err_t WebCfgServer::logoutSession(PsychicRequest *request, PsychicResponse*
|
||||
resp->setCookie("totpId", "", 0, "Secure; HttpOnly");
|
||||
}
|
||||
|
||||
if (request->hasCookie("totpId")) {
|
||||
if (request->hasCookie("totpId"))
|
||||
{
|
||||
String cookie2 = request->getCookie("totpId");
|
||||
_importExport->_totpSessions.remove(cookie2);
|
||||
saveSessions(2);
|
||||
@@ -227,7 +230,8 @@ esp_err_t WebCfgServer::logoutSession(PsychicRequest *request, PsychicResponse*
|
||||
resp->setCookie("bypassId", "", 0, "Secure; HttpOnly");
|
||||
}
|
||||
|
||||
if (request->hasCookie("bypassId")) {
|
||||
if (request->hasCookie("bypassId"))
|
||||
{
|
||||
String cookie2 = request->getCookie("bypassId");
|
||||
_importExport->_bypassSessions.remove(cookie2);
|
||||
}
|
||||
@@ -284,7 +288,8 @@ void WebCfgServer::loadSessions(int type)
|
||||
{
|
||||
file = SPIFFS.open("/sessions.json", "r");
|
||||
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("sessions.json not found");
|
||||
}
|
||||
else
|
||||
@@ -296,7 +301,8 @@ void WebCfgServer::loadSessions(int type)
|
||||
{
|
||||
file = SPIFFS.open("/duosessions.json", "r");
|
||||
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("duosessions.json not found");
|
||||
}
|
||||
else
|
||||
@@ -308,7 +314,8 @@ void WebCfgServer::loadSessions(int type)
|
||||
{
|
||||
file = SPIFFS.open("/totpsessions.json", "r");
|
||||
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("totpsessions.json not found");
|
||||
}
|
||||
else
|
||||
@@ -476,11 +483,13 @@ void WebCfgServer::initialize()
|
||||
|
||||
//prepare our message queue of 10 messages
|
||||
wsMessages = xQueueCreate(10, sizeof(WebsocketMessage));
|
||||
if (wsMessages == 0) {
|
||||
if (wsMessages == 0)
|
||||
{
|
||||
Log->printf("Failed to create queue= %p\n", wsMessages);
|
||||
}
|
||||
|
||||
websocketHandler->onOpen([](PsychicWebSocketClient *client) {
|
||||
websocketHandler->onOpen([](PsychicWebSocketClient *client)
|
||||
{
|
||||
Log->printf("[socket] connection #%u connected from %s\n", client->socket(), client->remoteIP().toString());
|
||||
client->sendMessage("NukiHub WebSerial started");
|
||||
});
|
||||
@@ -518,7 +527,8 @@ void WebCfgServer::initialize()
|
||||
}
|
||||
return ESP_OK;
|
||||
});
|
||||
websocketHandler->onClose([](PsychicWebSocketClient *client) {
|
||||
websocketHandler->onClose([](PsychicWebSocketClient *client)
|
||||
{
|
||||
Log->printf("[socket] connection #%u closed from %s\n", client->socket(), client->remoteIP().toString());
|
||||
});
|
||||
|
||||
@@ -1721,7 +1731,8 @@ bool WebCfgServer::processWiFi(PsychicRequest *request, PsychicResponse* resp, S
|
||||
int loop = 0;
|
||||
while(!_network->isConnected() && loop < 150)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -2272,14 +2283,17 @@ esp_err_t WebCfgServer::buildLoginHtml(PsychicRequest *request, PsychicResponse*
|
||||
response.print("<label for=\"password\"><b>Password</b></label><input type=\"password\" placeholder=\"Enter Password\" name=\"password\" required>");
|
||||
if (_importExport->getTOTPEnabled() || _duoEnabled)
|
||||
{
|
||||
if (_importExport->getTOTPEnabled()) {
|
||||
if (_importExport->getTOTPEnabled())
|
||||
{
|
||||
response.print("<button name=\"totp\" type=\"submit\" formaction=\"/post?page=login&totp=1\">Login with TOTP</button>");
|
||||
}
|
||||
if (_duoEnabled) {
|
||||
if (_duoEnabled)
|
||||
{
|
||||
response.print("<button name=\"duo\" type=\"submit\">Login with Duo</button>");
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
response.print("<button type=\"submit\">Login</button>");
|
||||
}
|
||||
response.print("<label><input type=\"checkbox\" name=\"remember\"> Remember me</label></div>");
|
||||
@@ -2398,7 +2412,8 @@ esp_err_t WebCfgServer::buildCoredumpHtml(PsychicRequest *request, PsychicRespon
|
||||
{
|
||||
File file = SPIFFS.open("/coredump.hex", "r");
|
||||
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("coredump.hex not found");
|
||||
}
|
||||
else
|
||||
@@ -2454,7 +2469,8 @@ esp_err_t WebCfgServer::buildDuoHtml(PsychicRequest *request, PsychicResponse* r
|
||||
PsychicStreamResponse response(resp, "text/html");
|
||||
char buffer[33];
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
sprintf(buffer + (i * 8), "%08lx", (unsigned long int)esp_random());
|
||||
}
|
||||
|
||||
@@ -2535,10 +2551,12 @@ bool WebCfgServer::processLogin(PsychicRequest *request, PsychicResponse* resp)
|
||||
char buffer[33];
|
||||
int i;
|
||||
int64_t durationLength = 60*60*_preferences->getInt(preference_cred_session_lifetime_remember, 720);
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
sprintf(buffer + (i * 8), "%08lx", (unsigned long int)esp_random());
|
||||
}
|
||||
if(!request->hasParam("remember")) {
|
||||
if(!request->hasParam("remember"))
|
||||
{
|
||||
durationLength = _preferences->getInt(preference_cred_session_lifetime, 3600);
|
||||
}
|
||||
|
||||
@@ -2580,7 +2598,8 @@ bool WebCfgServer::processBypass(PsychicRequest *request, PsychicResponse* resp)
|
||||
{
|
||||
char buffer[33];
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
sprintf(buffer + (i * 8), "%08lx", (unsigned long int)esp_random());
|
||||
}
|
||||
|
||||
@@ -2601,7 +2620,8 @@ bool WebCfgServer::processBypass(PsychicRequest *request, PsychicResponse* resp)
|
||||
char randomstr2[33];
|
||||
randomSeed(esp_random());
|
||||
char chars[] = {'1', '2', '3','4', '5', '6','7', '8', '9', '0', 'A', 'B', 'C', 'D','E', 'F', 'G','H', 'I', 'J','K', 'L', 'M', 'N', 'O','P', 'Q','R', 'S', 'T','U', 'V', 'W','X', 'Y', 'Z'};
|
||||
for(int i = 0;i < 32; i++){
|
||||
for(int i = 0; i < 32; i++)
|
||||
{
|
||||
randomstr2[i] = chars[random(36)];
|
||||
}
|
||||
randomstr2[32] = '\0';
|
||||
@@ -2627,7 +2647,8 @@ bool WebCfgServer::processTOTP(PsychicRequest *request, PsychicResponse* resp)
|
||||
char buffer[33];
|
||||
int i;
|
||||
int64_t durationLength = 60*60*_preferences->getInt(preference_cred_session_lifetime_totp_remember, 720);
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
sprintf(buffer + (i * 8), "%08lx", (unsigned long int)esp_random());
|
||||
}
|
||||
|
||||
@@ -2670,12 +2691,14 @@ esp_err_t WebCfgServer::sendWebSerial(PsychicRequest* request, PsychicResponse*
|
||||
|
||||
void WebCfgServer::updateWebSerial()
|
||||
{
|
||||
if (websocketHandler != nullptr) {
|
||||
if (websocketHandler != nullptr)
|
||||
{
|
||||
WebsocketMessage message;
|
||||
while (xQueueReceive(wsMessages, &message, 0) == pdTRUE)
|
||||
{
|
||||
PsychicWebSocketClient *client = websocketHandler->getClient(message.socket);
|
||||
if (client == NULL) {
|
||||
if (client == NULL)
|
||||
{
|
||||
Log->printf("[socket] client #%d bad, bailing\n", message.socket);
|
||||
return;
|
||||
}
|
||||
@@ -2856,7 +2879,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else if(key == "MQTTCA")
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
@@ -2866,7 +2890,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
if(value != "")
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.ca for writing");
|
||||
}
|
||||
else
|
||||
@@ -2880,7 +2905,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/mqtt_ssl.ca")) {
|
||||
if (!SPIFFS.remove("/mqtt_ssl.ca"))
|
||||
{
|
||||
Log->println("Failed to delete /mqtt_ssl.ca");
|
||||
}
|
||||
}
|
||||
@@ -2892,7 +2918,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else if(key == "MQTTCRT")
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
@@ -2902,7 +2929,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
if(value != "")
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.crt", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.crt for writing");
|
||||
}
|
||||
else
|
||||
@@ -2916,7 +2944,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/mqtt_ssl.crt")) {
|
||||
if (!SPIFFS.remove("/mqtt_ssl.crt"))
|
||||
{
|
||||
Log->println("Failed to delete /mqtt_ssl.crt");
|
||||
}
|
||||
}
|
||||
@@ -2928,7 +2957,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else if(key == "MQTTKEY")
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
@@ -2938,7 +2968,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
if(value != "")
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.key", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /mqtt_ssl.key for writing");
|
||||
}
|
||||
else
|
||||
@@ -2952,7 +2983,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/mqtt_ssl.key")) {
|
||||
if (!SPIFFS.remove("/mqtt_ssl.key"))
|
||||
{
|
||||
Log->println("Failed to delete /mqtt_ssl.key");
|
||||
}
|
||||
}
|
||||
@@ -2964,7 +2996,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else if(key == "HTTPCRT" && nuki_hub_https_server_enabled)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
@@ -2974,7 +3007,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
if(value != "")
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /http_ssl.crt for writing");
|
||||
}
|
||||
else
|
||||
@@ -2988,7 +3022,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/http_ssl.crt")) {
|
||||
if (!SPIFFS.remove("/http_ssl.crt"))
|
||||
{
|
||||
Log->println("Failed to delete /http_ssl.crt");
|
||||
}
|
||||
}
|
||||
@@ -3000,7 +3035,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else if(key == "HTTPKEY" && nuki_hub_https_server_enabled)
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
@@ -3010,7 +3046,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
if(value != "")
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.key", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /http_ssl.key for writing");
|
||||
}
|
||||
else
|
||||
@@ -3024,7 +3061,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.remove("/http_ssl.key")) {
|
||||
if (!SPIFFS.remove("/http_ssl.key"))
|
||||
{
|
||||
Log->println("Failed to delete /http_ssl.key");
|
||||
}
|
||||
}
|
||||
@@ -3297,7 +3335,8 @@ bool WebCfgServer::processArgs(PsychicRequest *request, PsychicResponse* resp, S
|
||||
if(_preferences->getBool(preference_cred_duo_enabled, false) != (value == "1"))
|
||||
{
|
||||
_preferences->putBool(preference_cred_duo_enabled, (value == "1"));
|
||||
if (value == "1") {
|
||||
if (value == "1")
|
||||
{
|
||||
_preferences->putBool(preference_update_time, true);
|
||||
}
|
||||
Log->print("Setting changed: ");
|
||||
@@ -5219,19 +5258,22 @@ esp_err_t WebCfgServer::buildCredHtml(PsychicRequest *request, PsychicResponse*
|
||||
|
||||
char randomstr[17];
|
||||
randomSeed(esp_random());
|
||||
for(int i = 0;i < 16; i++){
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
randomstr[i] = chars[random(32)];
|
||||
}
|
||||
randomstr[16] = '\0';
|
||||
char randomstr2[33];
|
||||
randomSeed(esp_random());
|
||||
for(int i = 0;i < 32; i++){
|
||||
for(int i = 0; i < 32; i++)
|
||||
{
|
||||
randomstr2[i] = chars2[random(36)];
|
||||
}
|
||||
randomstr2[32] = '\0';
|
||||
char randomstr3[33];
|
||||
randomSeed(esp_random());
|
||||
for(int i = 0;i < 32; i++){
|
||||
for(int i = 0; i < 32; i++)
|
||||
{
|
||||
randomstr3[i] = chars2[random(36)];
|
||||
}
|
||||
randomstr3[32] = '\0';
|
||||
@@ -5455,13 +5497,15 @@ esp_err_t WebCfgServer::buildMqttSSLConfigHtml(PsychicRequest *request, PsychicR
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.ca not found");
|
||||
}
|
||||
else
|
||||
@@ -5488,13 +5532,15 @@ esp_err_t WebCfgServer::buildMqttSSLConfigHtml(PsychicRequest *request, PsychicR
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.crt");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.crt not found");
|
||||
}
|
||||
else
|
||||
@@ -5521,13 +5567,15 @@ esp_err_t WebCfgServer::buildMqttSSLConfigHtml(PsychicRequest *request, PsychicR
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.key");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.key not found");
|
||||
}
|
||||
else
|
||||
@@ -5573,13 +5621,15 @@ esp_err_t WebCfgServer::buildHttpSSLConfigHtml(PsychicRequest *request, PsychicR
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.crt not found");
|
||||
}
|
||||
else
|
||||
@@ -5606,13 +5656,15 @@ esp_err_t WebCfgServer::buildHttpSSLConfigHtml(PsychicRequest *request, PsychicR
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.key");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.key not found");
|
||||
}
|
||||
else
|
||||
@@ -6272,7 +6324,8 @@ esp_err_t WebCfgServer::buildInfoHtml(PsychicRequest *request, PsychicResponse*
|
||||
response.print("\nWeb configurator enabled: ");
|
||||
response.print(_preferences->getBool(preference_webserver_enabled, true) ? "Yes" : "No");
|
||||
response.print("\nHTTP SSL: ");
|
||||
if (!SPIFFS.begin(true) || !nuki_hub_https_server_enabled) {
|
||||
if (!SPIFFS.begin(true) || !nuki_hub_https_server_enabled)
|
||||
{
|
||||
response.print("Disabled");
|
||||
}
|
||||
else
|
||||
@@ -6401,13 +6454,15 @@ esp_err_t WebCfgServer::buildInfoHtml(PsychicRequest *request, PsychicResponse*
|
||||
response.print("\nMQTT SSL: ");
|
||||
if(_preferences->getBool(preference_mqtt_ssl_enabled, false))
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
response.print("Disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
response.print("Disabled");
|
||||
}
|
||||
else
|
||||
@@ -7296,14 +7351,17 @@ void WebCfgServer::createSSLCertificate()
|
||||
"20350101000000"
|
||||
);
|
||||
|
||||
if (createCertResult == 0) {
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (createCertResult == 0)
|
||||
{
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /http_ssl.crt for writing");
|
||||
}
|
||||
else
|
||||
@@ -7316,7 +7374,8 @@ void WebCfgServer::createSSLCertificate()
|
||||
}
|
||||
|
||||
File file2 = SPIFFS.open("/http_ssl.key", FILE_WRITE);
|
||||
if (!file2) {
|
||||
if (!file2)
|
||||
{
|
||||
Log->println("Failed to open /http_ssl.key for writing");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
// converted to char array by bin2array
|
||||
const char stylecss[] = {
|
||||
const char stylecss[] =
|
||||
{
|
||||
#include "webServerConstants/style.h"
|
||||
};
|
||||
|
||||
// converted to char array by bin2array
|
||||
const uint8_t favicon_32x32[] = {
|
||||
const uint8_t favicon_32x32[] =
|
||||
{
|
||||
#include "webServerConstants/favicon-32x32.h"
|
||||
};
|
||||
|
||||
#ifndef NUKI_HUB_UPDATER
|
||||
const uint8_t WEBSERIAL_HTML[] = {
|
||||
const uint8_t WEBSERIAL_HTML[] =
|
||||
{
|
||||
#include "webServerConstants/webSerial.h"
|
||||
};
|
||||
#endif
|
||||
124
src/main.cpp
124
src/main.cpp
@@ -210,28 +210,36 @@ uint8_t checkPartition()
|
||||
}
|
||||
}
|
||||
|
||||
void listDir(fs::FS &fs, const char *dirname, uint8_t levels) {
|
||||
void listDir(fs::FS &fs, const char *dirname, uint8_t levels)
|
||||
{
|
||||
Serial.printf("Listing directory: %s\r\n", dirname);
|
||||
|
||||
File root = fs.open(dirname);
|
||||
if (!root) {
|
||||
if (!root)
|
||||
{
|
||||
Serial.println("- failed to open directory");
|
||||
return;
|
||||
}
|
||||
if (!root.isDirectory()) {
|
||||
if (!root.isDirectory())
|
||||
{
|
||||
Serial.println(" - not a directory");
|
||||
return;
|
||||
}
|
||||
|
||||
File file = root.openNextFile();
|
||||
while (file) {
|
||||
if (file.isDirectory()) {
|
||||
while (file)
|
||||
{
|
||||
if (file.isDirectory())
|
||||
{
|
||||
Serial.print(" DIR : ");
|
||||
Serial.println(file.name());
|
||||
if (levels) {
|
||||
if (levels)
|
||||
{
|
||||
listDir(fs, file.path(), levels - 1);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.print(" FILE: ");
|
||||
Serial.print(file.name());
|
||||
Serial.print("\tSIZE: ");
|
||||
@@ -247,7 +255,8 @@ void listDir(fs::FS &fs, const char *dirname, uint8_t levels) {
|
||||
}
|
||||
}
|
||||
|
||||
void cbSyncTime(struct timeval *tv) {
|
||||
void cbSyncTime(struct timeval *tv)
|
||||
{
|
||||
Log->println("NTP time synced");
|
||||
timeSynced = true;
|
||||
}
|
||||
@@ -272,7 +281,8 @@ void startWebServer()
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.crt not found");
|
||||
}
|
||||
else
|
||||
@@ -302,7 +312,8 @@ void startWebServer()
|
||||
|
||||
psychicServerRedirect = new PsychicHttpServer();
|
||||
psychicServerRedirect->config.ctrl_port = 20424;
|
||||
psychicServerRedirect->onNotFound([](PsychicRequest* request, PsychicResponse* response) {
|
||||
psychicServerRedirect->onNotFound([](PsychicRequest* request, PsychicResponse* response)
|
||||
{
|
||||
String url = "https://" + request->host() + request->url();
|
||||
if (preferences->getString(preference_https_fqdn, "") != "")
|
||||
{
|
||||
@@ -320,7 +331,8 @@ void startWebServer()
|
||||
psychicSSLServer->config.stack_size = HTTPD_TASK_SIZE;
|
||||
webCfgServerSSL = new WebCfgServer(nuki, nukiOpener, network, gpio, preferences, network->networkDeviceType() == NetworkDeviceType::WiFi, partitionType, psychicSSLServer, importExport);
|
||||
webCfgServerSSL->initialize();
|
||||
psychicSSLServer->onNotFound([](PsychicRequest* request, PsychicResponse* response) {
|
||||
psychicSSLServer->onNotFound([](PsychicRequest* request, PsychicResponse* response)
|
||||
{
|
||||
return response->redirect("/");
|
||||
});
|
||||
psychicSSLServer->begin();
|
||||
@@ -337,7 +349,8 @@ void startWebServer()
|
||||
psychicServer->config.stack_size = HTTPD_TASK_SIZE;
|
||||
webCfgServer = new WebCfgServer(nuki, nukiOpener, network, gpio, preferences, network->networkDeviceType() == NetworkDeviceType::WiFi, partitionType, psychicServer, importExport);
|
||||
webCfgServer->initialize();
|
||||
psychicServer->onNotFound([](PsychicRequest* request, PsychicResponse* response) {
|
||||
psychicServer->onNotFound([](PsychicRequest* request, PsychicResponse* response)
|
||||
{
|
||||
return response->redirect("/");
|
||||
});
|
||||
psychicServer->begin();
|
||||
@@ -456,13 +469,15 @@ void restartServices(bool reconnect)
|
||||
Log->println("Scanner nulled from main");
|
||||
}
|
||||
|
||||
if (BLEDevice::isInitialized()) {
|
||||
if (BLEDevice::isInitialized())
|
||||
{
|
||||
Log->println("Deinit BLE device");
|
||||
BLEDevice::deinit(false);
|
||||
Log->println("Deinit BLE device done");
|
||||
}
|
||||
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
@@ -508,7 +523,8 @@ void restartServices(bool reconnect)
|
||||
}
|
||||
|
||||
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2000 / portTICK_PERIOD_MS);
|
||||
@@ -559,7 +575,8 @@ void networkTask(void *pvParameters)
|
||||
}
|
||||
#endif
|
||||
network->update();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -606,7 +623,8 @@ void networkTask(void *pvParameters)
|
||||
if(connected && webSerialEnabled && (webSSLStarted || webStarted))
|
||||
{
|
||||
webCfgServerSSL->updateWebSerial();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -615,7 +633,8 @@ void networkTask(void *pvParameters)
|
||||
if(connected && lockStarted)
|
||||
{
|
||||
rebootLock = networkLock->update();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -624,7 +643,8 @@ void networkTask(void *pvParameters)
|
||||
if(connected && openerStarted)
|
||||
{
|
||||
networkOpener->update();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -650,7 +670,8 @@ void networkTask(void *pvParameters)
|
||||
restartEsp(RestartReason::RestartTimer);
|
||||
}
|
||||
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -674,14 +695,16 @@ static void print_all_tasks_info(void)
|
||||
Log->printf("\n--------------------------------------------------------------------------------\n");
|
||||
Log->printf("PRINTING ALL TASKS INFO\n");
|
||||
Log->printf("--------------------------------------------------------------------------------\n");
|
||||
for (size_t task_idx = 0; task_idx < tasks_stat.task_count; task_idx++) {
|
||||
for (size_t task_idx = 0; task_idx < tasks_stat.task_count; task_idx++)
|
||||
{
|
||||
task_stat_t task_stat = tasks_stat.stat_arr[task_idx];
|
||||
Log->printf("%s: %s: Peak Usage %" PRIu16 ", Current Usage %" PRIu16 "\n", task_stat.name,
|
||||
task_stat.is_alive ? "ALIVE " : "DELETED",
|
||||
task_stat.overall_peak_usage,
|
||||
task_stat.overall_current_usage);
|
||||
|
||||
for (size_t heap_idx = 0; heap_idx < task_stat.heap_count; heap_idx++) {
|
||||
for (size_t heap_idx = 0; heap_idx < task_stat.heap_count; heap_idx++)
|
||||
{
|
||||
heap_stat_t heap_stat = task_stat.heap_stat[heap_idx];
|
||||
Log->printf(" %s: Caps: %" PRIu32 ". Size %" PRIu16 ", Current Usage %" PRIu16 ", Peak Usage %" PRIu16 ", alloc count %" PRIu16 "\n", heap_stat.name,
|
||||
heap_stat.caps,
|
||||
@@ -690,7 +713,8 @@ static void print_all_tasks_info(void)
|
||||
heap_stat.peak_usage,
|
||||
heap_stat.alloc_count);
|
||||
|
||||
for (size_t alloc_idx = 0; alloc_idx < heap_stat.alloc_count; alloc_idx++) {
|
||||
for (size_t alloc_idx = 0; alloc_idx < heap_stat.alloc_count; alloc_idx++)
|
||||
{
|
||||
heap_task_block_t alloc_stat = heap_stat.alloc_stat[alloc_idx];
|
||||
Log->printf(" %p: Size: %" PRIu32 "\n", alloc_stat.address, alloc_stat.size);
|
||||
}
|
||||
@@ -711,14 +735,16 @@ void nukiTask(void *pvParameters)
|
||||
if (esp_psram_get_size() <= 0)
|
||||
{
|
||||
Log->println("Waiting 20 seconds to start BLE because of MQTT SSL");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(20000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
#else
|
||||
Log->println("Waiting 20 seconds to start BLE because of MQTT SSL");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(20000 / portTICK_PERIOD_MS);
|
||||
@@ -733,7 +759,8 @@ void nukiTask(void *pvParameters)
|
||||
if(bleScannerStarted)
|
||||
{
|
||||
bleScanner->update();
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(20 / portTICK_PERIOD_MS);
|
||||
@@ -743,7 +770,8 @@ void nukiTask(void *pvParameters)
|
||||
|
||||
if (needsPairing)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(2500 / portTICK_PERIOD_MS);
|
||||
@@ -833,7 +861,8 @@ void nukiTask(void *pvParameters)
|
||||
Log->println("nukiTask is running");
|
||||
nukiLoopTs = espMillis();
|
||||
}
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||
@@ -982,7 +1011,8 @@ void otaTask(void *pvParameter)
|
||||
{
|
||||
Log->println("Firmware upgrade failed, retrying in 5 seconds");
|
||||
retryCount++;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
@@ -990,7 +1020,8 @@ void otaTask(void *pvParameter)
|
||||
}
|
||||
while (1)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
@@ -1040,7 +1071,8 @@ void setupTasks(bool ota)
|
||||
void logCoreDump()
|
||||
{
|
||||
coredumpPrinted = false;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
@@ -1066,7 +1098,8 @@ void logCoreDump()
|
||||
else
|
||||
{
|
||||
file = SPIFFS.open("/coredump.hex", FILE_WRITE);
|
||||
if (!file) {
|
||||
if (!file)
|
||||
{
|
||||
Log->println("Failed to open /coredump.hex for writing");
|
||||
}
|
||||
else
|
||||
@@ -1106,14 +1139,16 @@ void logCoreDump()
|
||||
}
|
||||
Serial.printf("%s", str_dst);
|
||||
|
||||
if (file) {
|
||||
if (file)
|
||||
{
|
||||
file.printf("%s", str_dst);
|
||||
}
|
||||
}
|
||||
|
||||
Serial.println("");
|
||||
|
||||
if (file) {
|
||||
if (file)
|
||||
{
|
||||
file.println("");
|
||||
file.close();
|
||||
}
|
||||
@@ -1221,18 +1256,21 @@ void setup()
|
||||
{
|
||||
bool failed = true;
|
||||
|
||||
if (!nuki_hub_https_server_enabled) {
|
||||
if (!nuki_hub_https_server_enabled)
|
||||
{
|
||||
Log->println("Not running on HTTPS server enabled device");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/http_ssl.crt");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.crt not found");
|
||||
}
|
||||
else
|
||||
@@ -1246,7 +1284,8 @@ void setup()
|
||||
cert[filesize] = '\0';
|
||||
|
||||
File file2 = SPIFFS.open("/http_ssl.key");
|
||||
if (!file2 || file2.isDirectory()) {
|
||||
if (!file2 || file2.isDirectory())
|
||||
{
|
||||
Log->println("http_ssl.key not found");
|
||||
}
|
||||
else
|
||||
@@ -1261,7 +1300,8 @@ void setup()
|
||||
|
||||
psychicServer = new PsychicHttpServer();
|
||||
psychicServer->config.ctrl_port = 20424;
|
||||
psychicServer->onNotFound([](PsychicRequest* request, PsychicResponse* response) {
|
||||
psychicServer->onNotFound([](PsychicRequest* request, PsychicResponse* response)
|
||||
{
|
||||
String url = "https://" + request->host() + request->url();
|
||||
if (preferences->getString(preference_https_fqdn, "") != "")
|
||||
{
|
||||
@@ -1279,7 +1319,8 @@ void setup()
|
||||
psychicSSLServer->config.stack_size = HTTPD_TASK_SIZE;
|
||||
webCfgServerSSL = new WebCfgServer(network, preferences, network->networkDeviceType() == NetworkDeviceType::WiFi, partitionType, psychicSSLServer, importExport);
|
||||
webCfgServerSSL->initialize();
|
||||
psychicSSLServer->onNotFound([](PsychicRequest* request, PsychicResponse* response) {
|
||||
psychicSSLServer->onNotFound([](PsychicRequest* request, PsychicResponse* response)
|
||||
{
|
||||
return response->redirect("/");
|
||||
});
|
||||
psychicSSLServer->begin();
|
||||
@@ -1296,7 +1337,8 @@ void setup()
|
||||
psychicServer->config.stack_size = HTTPD_TASK_SIZE;
|
||||
webCfgServer = new WebCfgServer(network, preferences, network->networkDeviceType() == NetworkDeviceType::WiFi, partitionType, psychicServer, importExport);
|
||||
webCfgServer->initialize();
|
||||
psychicServer->onNotFound([](PsychicRequest* request, PsychicResponse* response) {
|
||||
psychicServer->onNotFound([](PsychicRequest* request, PsychicResponse* response)
|
||||
{
|
||||
return response->redirect("/");
|
||||
});
|
||||
psychicServer->begin();
|
||||
|
||||
@@ -69,7 +69,8 @@ const String EthernetDevice::deviceName() const
|
||||
|
||||
void EthernetDevice::initialize()
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||
@@ -79,7 +80,8 @@ void EthernetDevice::initialize()
|
||||
Log->println("Failed to initialize ethernet hardware");
|
||||
Log->println("Network device has a critical failure, enable fallback to Wi-Fi and reboot.");
|
||||
wifiFallback = true;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -147,7 +149,8 @@ void EthernetDevice::initialize()
|
||||
Log->println("Failed to initialize ethernet hardware");
|
||||
Log->println("Network device has a critical failure, enable fallback to Wi-Fi and reboot.");
|
||||
wifiFallback = true;
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -232,7 +235,8 @@ void EthernetDevice::onNetworkEvent(arduino_event_id_t event, arduino_event_info
|
||||
|
||||
void EthernetDevice::reconfigure()
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32P4)
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
ETH_CLOCK_GPIO0_IN = 0,
|
||||
ETH_CLOCK_GPIO0_OUT = 1,
|
||||
ETH_CLOCK_GPIO16_OUT = 2,
|
||||
|
||||
@@ -12,14 +12,17 @@ void NetworkDevice::init()
|
||||
{
|
||||
_useEncryption = false;
|
||||
|
||||
if(_preferences->getBool(preference_mqtt_ssl_enabled, false)) {
|
||||
if (!SPIFFS.begin(true)) {
|
||||
if(_preferences->getBool(preference_mqtt_ssl_enabled, false))
|
||||
{
|
||||
if (!SPIFFS.begin(true))
|
||||
{
|
||||
Log->println("SPIFFS Mount Failed");
|
||||
}
|
||||
else
|
||||
{
|
||||
File file = SPIFFS.open("/mqtt_ssl.ca");
|
||||
if (!file || file.isDirectory()) {
|
||||
if (!file || file.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.ca not found");
|
||||
}
|
||||
else
|
||||
@@ -47,7 +50,8 @@ void NetworkDevice::init()
|
||||
|
||||
File file2 = SPIFFS.open("/mqtt_ssl.crt");
|
||||
File file3 = SPIFFS.open("/mqtt_ssl.key");
|
||||
if (!file2 || file2.isDirectory() || !file3 || file3.isDirectory()) {
|
||||
if (!file2 || file2.isDirectory() || !file3 || file3.isDirectory())
|
||||
{
|
||||
Log->println("mqtt_ssl.crt or mqtt_ssl.key not found");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -21,7 +21,8 @@ const String WifiDevice::deviceName() const
|
||||
|
||||
void WifiDevice::initialize()
|
||||
{
|
||||
if (_hostname != "fakep4forhosted") {
|
||||
if (_hostname != "fakep4forhosted")
|
||||
{
|
||||
ssid = _preferences->getString(preference_wifi_ssid, "");
|
||||
ssid.trim();
|
||||
pass = _preferences->getString(preference_wifi_pass, "");
|
||||
@@ -61,8 +62,10 @@ void WifiDevice::initialize()
|
||||
WiFi.disconnect();
|
||||
|
||||
int loop = 0;
|
||||
while (!_wifiClientStarted && loop < 50) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
while (!_wifiClientStarted && loop < 50)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -85,8 +88,10 @@ void WifiDevice::scan(bool passive, bool async)
|
||||
}
|
||||
|
||||
int loop = 0;
|
||||
while (!_wifiClientStarted && loop < 50) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
while (!_wifiClientStarted && loop < 50)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -122,12 +127,14 @@ void WifiDevice::openAP()
|
||||
Log->println("Starting AP with SSID NukiHub and Password NukiHubESP32");
|
||||
_startAP = false;
|
||||
WiFi.mode(WIFI_AP);
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
WiFi.softAPsetHostname(_hostname.c_str());
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
@@ -142,8 +149,10 @@ void WifiDevice::openAP()
|
||||
bool WifiDevice::connect()
|
||||
{
|
||||
int loop = 0;
|
||||
while (!_wifiClientStarted && loop < 50) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
while (!_wifiClientStarted && loop < 50)
|
||||
{
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -211,7 +220,8 @@ bool WifiDevice::connect()
|
||||
while(!isConnected() && loop < 600)
|
||||
{
|
||||
Log->print(".");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(25 / portTICK_PERIOD_MS);
|
||||
@@ -226,7 +236,8 @@ bool WifiDevice::connect()
|
||||
if(_preferences->getBool(preference_restart_on_disconnect, false) && (espMillis() > 60000))
|
||||
{
|
||||
Log->println("Restart on disconnect watchdog triggered, rebooting");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||
@@ -253,7 +264,8 @@ void WifiDevice::reconfigure()
|
||||
{
|
||||
_preferences->putString(preference_wifi_ssid, "");
|
||||
_preferences->putString(preference_wifi_pass, "");
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK) {
|
||||
if (esp_task_wdt_status(NULL) == ESP_OK)
|
||||
{
|
||||
esp_task_wdt_reset();
|
||||
}
|
||||
vTaskDelay(200 / portTICK_PERIOD_MS);
|
||||
@@ -307,7 +319,8 @@ void WifiDevice::onWifiEvent(const WiFiEvent_t &event, const WiFiEventInfo_t &in
|
||||
{
|
||||
Log->printf("[WiFi-event] event: %d\n", event);
|
||||
|
||||
switch (event) {
|
||||
switch (event)
|
||||
{
|
||||
case ARDUINO_EVENT_WIFI_READY:
|
||||
Log->println("WiFi interface ready");
|
||||
break;
|
||||
|
||||
@@ -243,7 +243,8 @@ NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDevice
|
||||
}
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32P4)
|
||||
if (fakedevice) {
|
||||
if (fakedevice)
|
||||
{
|
||||
Log->println("Create dummy WiFi device for Hosted on P4");
|
||||
NetworkDevice* device2 = nullptr;
|
||||
device2 = new WifiDevice("fakep4forhosted", preferences, ipConfiguration);
|
||||
|
||||
@@ -28,42 +28,51 @@ SSLCert::SSLCert(uint16_t certLength, uint16_t pkLength, String keyPEM, String c
|
||||
_certLength(certLength),
|
||||
_pkLength(pkLength),
|
||||
_keyPEM(keyPEM),
|
||||
_certPEM(certPEM) {
|
||||
_certPEM(certPEM)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SSLCert::~SSLCert() {
|
||||
SSLCert::~SSLCert()
|
||||
{
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
uint16_t SSLCert::getCertLength() {
|
||||
uint16_t SSLCert::getCertLength()
|
||||
{
|
||||
return _certLength;
|
||||
}
|
||||
|
||||
uint16_t SSLCert::getPKLength() {
|
||||
uint16_t SSLCert::getPKLength()
|
||||
{
|
||||
return _pkLength;
|
||||
}
|
||||
|
||||
String SSLCert::getKeyPEM() {
|
||||
String SSLCert::getKeyPEM()
|
||||
{
|
||||
return _keyPEM;
|
||||
}
|
||||
|
||||
String SSLCert::getCertPEM() {
|
||||
String SSLCert::getCertPEM()
|
||||
{
|
||||
return _certPEM;
|
||||
}
|
||||
|
||||
void SSLCert::setPK(String keyPEM) {
|
||||
void SSLCert::setPK(String keyPEM)
|
||||
{
|
||||
_keyPEM = keyPEM;
|
||||
_pkLength = keyPEM.length();
|
||||
}
|
||||
|
||||
|
||||
void SSLCert::setCert(String certPEM) {
|
||||
void SSLCert::setCert(String certPEM)
|
||||
{
|
||||
_certPEM = certPEM;
|
||||
_certLength = certPEM.length();
|
||||
}
|
||||
|
||||
void SSLCert::clear() {
|
||||
void SSLCert::clear()
|
||||
{
|
||||
_certLength = 0;
|
||||
_pkLength = 0;
|
||||
|
||||
@@ -74,14 +83,17 @@ void SSLCert::clear() {
|
||||
/**
|
||||
* Returns the CN value from a DN, or "" if it cannot be found
|
||||
*/
|
||||
static std::string get_cn(std::string dn) {
|
||||
static std::string get_cn(std::string dn)
|
||||
{
|
||||
size_t cnStart = dn.find("CN=");
|
||||
if (cnStart == std::string::npos) {
|
||||
if (cnStart == std::string::npos)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
cnStart += 3;
|
||||
size_t cnStop = dn.find(",", cnStart);
|
||||
if (cnStop == std::string::npos) {
|
||||
if (cnStop == std::string::npos)
|
||||
{
|
||||
cnStop = dn.length();
|
||||
}
|
||||
return dn.substr(cnStart, cnStop - cnStart);
|
||||
@@ -90,7 +102,8 @@ static std::string get_cn(std::string dn) {
|
||||
/**
|
||||
* Sets the DN as subjectAltName extension in the certificate
|
||||
*/
|
||||
static int add_subject_alt_name(mbedtls_x509write_cert *crt, std::string &cn) {
|
||||
static int add_subject_alt_name(mbedtls_x509write_cert *crt, std::string &cn)
|
||||
{
|
||||
size_t bufsize = cn.length() + 8; // some additional space for tags and length fields
|
||||
uint8_t buf[bufsize];
|
||||
uint8_t *p = &buf[bufsize - 1];
|
||||
@@ -128,7 +141,8 @@ static int add_subject_alt_name(mbedtls_x509write_cert *crt, std::string &cn) {
|
||||
*
|
||||
* Based on programs/pkey/gen_key.c
|
||||
*/
|
||||
static int gen_key(SSLCert &certCtx, SSLKeySize keySize) {
|
||||
static int gen_key(SSLCert &certCtx, SSLKeySize keySize)
|
||||
{
|
||||
|
||||
// Initialize the entropy source
|
||||
mbedtls_entropy_context entropy;
|
||||
@@ -141,7 +155,8 @@ static int gen_key(SSLCert &certCtx, SSLKeySize keySize) {
|
||||
&ctr_drbg, mbedtls_entropy_func, &entropy,
|
||||
NULL, 0
|
||||
);
|
||||
if (rngRes != 0) {
|
||||
if (rngRes != 0)
|
||||
{
|
||||
mbedtls_entropy_free( &entropy );
|
||||
return HTTPS_SERVER_ERROR_KEYGEN_RNG;
|
||||
}
|
||||
@@ -150,7 +165,8 @@ static int gen_key(SSLCert &certCtx, SSLKeySize keySize) {
|
||||
mbedtls_pk_context key;
|
||||
mbedtls_pk_init( &key );
|
||||
int resPkSetup = mbedtls_pk_setup( &key, mbedtls_pk_info_from_type( MBEDTLS_PK_RSA ) );
|
||||
if ( resPkSetup != 0) {
|
||||
if ( resPkSetup != 0)
|
||||
{
|
||||
mbedtls_ctr_drbg_free( &ctr_drbg );
|
||||
mbedtls_entropy_free( &entropy );
|
||||
return HTTPS_SERVER_ERROR_KEYGEN_SETUP_PK;
|
||||
@@ -164,7 +180,8 @@ static int gen_key(SSLCert &certCtx, SSLKeySize keySize) {
|
||||
keySize,
|
||||
65537
|
||||
);
|
||||
if ( resPkGen != 0) {
|
||||
if ( resPkGen != 0)
|
||||
{
|
||||
mbedtls_pk_free( &key );
|
||||
mbedtls_ctr_drbg_free( &ctr_drbg );
|
||||
mbedtls_entropy_free( &entropy );
|
||||
@@ -177,7 +194,8 @@ static int gen_key(SSLCert &certCtx, SSLKeySize keySize) {
|
||||
|
||||
// Allocate the space on the heap, as stack size is quite limited
|
||||
unsigned char * output_buf = new unsigned char[4096];
|
||||
if (output_buf == NULL) {
|
||||
if (output_buf == NULL)
|
||||
{
|
||||
mbedtls_pk_free( &key );
|
||||
return HTTPS_SERVER_ERROR_KEY_OUT_OF_MEM;
|
||||
}
|
||||
@@ -185,7 +203,8 @@ static int gen_key(SSLCert &certCtx, SSLKeySize keySize) {
|
||||
|
||||
// Write the key to the temporary buffer and determine its length
|
||||
int resPkWrite = mbedtls_pk_write_key_pem( &key, output_buf, 4096 );
|
||||
if (resPkWrite < 0) {
|
||||
if (resPkWrite < 0)
|
||||
{
|
||||
delete[] output_buf;
|
||||
mbedtls_pk_free( &key );
|
||||
return HTTPS_SERVER_ERROR_KEY_WRITE_PK;
|
||||
@@ -214,21 +233,25 @@ static int parse_serial_decimal_format(unsigned char *obuf, size_t obufmax,
|
||||
errno = 0;
|
||||
dec = strtoull(ibuf, &end_ptr, 10);
|
||||
|
||||
if ((errno != 0) || (end_ptr == ibuf)) {
|
||||
if ((errno != 0) || (end_ptr == ibuf))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
*len = 0;
|
||||
|
||||
while (remaining_bytes > 0) {
|
||||
if (obufmax < (*len + 1)) {
|
||||
while (remaining_bytes > 0)
|
||||
{
|
||||
if (obufmax < (*len + 1))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
val = (dec >> ((remaining_bytes - 1) * 8)) & 0xFF;
|
||||
|
||||
/* Skip leading zeros */
|
||||
if ((val != 0) || (*len != 0)) {
|
||||
if ((val != 0) || (*len != 0))
|
||||
{
|
||||
*p = val;
|
||||
(*len)++;
|
||||
p++;
|
||||
@@ -248,7 +271,8 @@ static int parse_serial_decimal_format(unsigned char *obuf, size_t obufmax,
|
||||
* Based on programs/x509/cert_write.c
|
||||
*/
|
||||
|
||||
static int cert_write(SSLCert &certCtx, std::string dn, std::string validityFrom, std::string validityTo) {
|
||||
static int cert_write(SSLCert &certCtx, std::string dn, std::string validityFrom, std::string validityTo)
|
||||
{
|
||||
int funcRes = 0;
|
||||
int stepRes = 0;
|
||||
|
||||
@@ -268,7 +292,8 @@ static int cert_write(SSLCert &certCtx, std::string dn, std::string validityFrom
|
||||
strcpy(dn_cstr, dn.c_str());
|
||||
|
||||
std::string cn = get_cn(dn);
|
||||
if (cn == "") {
|
||||
if (cn == "")
|
||||
{
|
||||
return HTTPS_SERVER_ERROR_CERTGEN_CN;
|
||||
}
|
||||
|
||||
@@ -278,7 +303,8 @@ static int cert_write(SSLCert &certCtx, std::string dn, std::string validityFrom
|
||||
// Initialize the RNG
|
||||
mbedtls_ctr_drbg_init( &ctr_drbg );
|
||||
stepRes = mbedtls_ctr_drbg_seed( &ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0 );
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_RNG;
|
||||
goto error_after_entropy;
|
||||
}
|
||||
@@ -286,7 +312,8 @@ static int cert_write(SSLCert &certCtx, std::string dn, std::string validityFrom
|
||||
mbedtls_pk_init( &key );
|
||||
|
||||
stepRes = mbedtls_pk_parse_key( &key, (const unsigned char *)certCtx.getKeyPEM().c_str(), certCtx.getPKLength() + 1, NULL, 0, mbedtls_ctr_drbg_random, &ctr_drbg);
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_READKEY;
|
||||
goto error_after_key;
|
||||
}
|
||||
@@ -303,53 +330,61 @@ static int cert_write(SSLCert &certCtx, std::string dn, std::string validityFrom
|
||||
|
||||
// Set issuer and subject (same, as we self-sign)
|
||||
stepRes = mbedtls_x509write_crt_set_subject_name( &crt, dn_cstr );
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_NAME;
|
||||
goto error_after_cert;
|
||||
}
|
||||
stepRes = mbedtls_x509write_crt_set_issuer_name( &crt, dn_cstr );
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_NAME;
|
||||
goto error_after_cert;
|
||||
}
|
||||
|
||||
// Set the validity of the certificate. At the moment, it's fixed from 2019 to end of 2029.
|
||||
stepRes = mbedtls_x509write_crt_set_validity( &crt, validityFrom.c_str(), validityTo.c_str());
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_VALIDITY;
|
||||
goto error_after_cert;
|
||||
}
|
||||
|
||||
// Make this a CA certificate
|
||||
stepRes = mbedtls_x509write_crt_set_basic_constraints( &crt, 1, 0 );
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_VALIDITY;
|
||||
goto error_after_cert;
|
||||
}
|
||||
|
||||
stepRes = add_subject_alt_name( &crt, cn );
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_NAME;
|
||||
goto error_after_cert;
|
||||
}
|
||||
|
||||
// Initialize the serial number
|
||||
stepRes = mbedtls_x509write_crt_set_serial_raw( &crt, (unsigned char *)serial, strlen(serial) );
|
||||
if (stepRes != 0) {
|
||||
if (stepRes != 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_SERIAL;
|
||||
goto error_after_cert_serial;
|
||||
}
|
||||
|
||||
// Create buffer to write the certificate
|
||||
primary_buffer = new unsigned char[4096];
|
||||
if (primary_buffer == NULL) {
|
||||
if (primary_buffer == NULL)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_OUT_OF_MEM;
|
||||
goto error_after_cert_serial;
|
||||
}
|
||||
|
||||
// Write the actual certificate
|
||||
stepRes = mbedtls_x509write_crt_pem(&crt, primary_buffer, 4096, mbedtls_ctr_drbg_random, &ctr_drbg );
|
||||
if (stepRes < 0) {
|
||||
if (stepRes < 0)
|
||||
{
|
||||
funcRes = HTTPS_SERVER_ERROR_CERTGEN_WRITE;
|
||||
goto error_after_primary_buffer;
|
||||
}
|
||||
@@ -375,18 +410,21 @@ error_after_entropy:
|
||||
return funcRes;
|
||||
}
|
||||
|
||||
int createSelfSignedCert(SSLCert &certCtx, SSLKeySize keySize, std::string dn, std::string validFrom, std::string validUntil) {
|
||||
int createSelfSignedCert(SSLCert &certCtx, SSLKeySize keySize, std::string dn, std::string validFrom, std::string validUntil)
|
||||
{
|
||||
|
||||
// Add the private key
|
||||
int keyRes = gen_key(certCtx, keySize);
|
||||
if (keyRes != 0) {
|
||||
if (keyRes != 0)
|
||||
{
|
||||
// Key-generation failed, return the failure code
|
||||
return keyRes;
|
||||
}
|
||||
|
||||
// Add the self-signed certificate
|
||||
int certRes = cert_write(certCtx, dn, validFrom, validUntil);
|
||||
if (certRes != 0) {
|
||||
if (certRes != 0)
|
||||
{
|
||||
// Cert writing failed, reset the pk and return failure code
|
||||
certCtx.setPK("");
|
||||
return certRes;
|
||||
|
||||
@@ -1,363 +1,344 @@
|
||||
0x2f, 0x2a, 0x0d, 0x0a, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68,
|
||||
0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x65, 0x73, 0x63, 0x61,
|
||||
0x70, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x0d, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x3a, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x63, 0x64, 0x6e, 0x2e, 0x6a, 0x73,
|
||||
0x64, 0x65, 0x6c, 0x69, 0x76, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x70, 0x6d, 0x2f, 0x40,
|
||||
0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x77, 0x2e, 0x63,
|
||||
0x73, 0x73, 0x40, 0x31, 0x2e, 0x31, 0x2e, 0x32, 0x2f, 0x6e, 0x65, 0x77, 0x2e, 0x6d, 0x69, 0x6e,
|
||||
0x2e, 0x63, 0x73, 0x73, 0x0d, 0x0a, 0x2a, 0x2f, 0x0d, 0x0a, 0x0d, 0x0a, 0x2f, 0x2a, 0x0d, 0x0a,
|
||||
0x20, 0x2a, 0x20, 0x55, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x0d, 0x0a, 0x20, 0x2a, 0x20, 0x43, 0x6f,
|
||||
0x6d, 0x70, 0x61, 0x63, 0x74, 0x20, 0x2f, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x66, 0x79, 0x20, 0x74,
|
||||
0x68, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e,
|
||||
0x79, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x0d, 0x0a, 0x20, 0x2a, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x20,
|
||||
0x6f, 0x6e, 0x65, 0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20,
|
||||
0x74, 0x6f, 0x20, 0x73, 0x72, 0x63, 0x2f, 0x57, 0x65, 0x62, 0x43, 0x66, 0x67, 0x53, 0x65, 0x72,
|
||||
0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x68, 0x20, 0x61,
|
||||
0x73, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x63, 0x73, 0x73, 0x0d, 0x0a, 0x20, 0x2a, 0x20, 0x54,
|
||||
0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68,
|
||||
0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x20, 0x75, 0x70, 0x6f, 0x6e, 0x20,
|
||||
0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3a, 0x29, 0x0d, 0x0a, 0x2a, 0x2f, 0x0d,
|
||||
0x0a, 0x0d, 0x0a, 0x3a, 0x72, 0x6f, 0x6f, 0x74, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x61, 0x6e, 0x73, 0x3a, 0x20,
|
||||
0x27, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x27, 0x2c, 0x2d, 0x61, 0x70, 0x70, 0x6c, 0x65, 0x2d, 0x73,
|
||||
0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x42, 0x6c, 0x69, 0x6e, 0x6b, 0x4d, 0x61, 0x63, 0x53, 0x79,
|
||||
0x73, 0x74, 0x65, 0x6d, 0x46, 0x6f, 0x6e, 0x74, 0x2c, 0x27, 0x53, 0x65, 0x67, 0x6f, 0x65, 0x20,
|
||||
0x55, 0x49, 0x27, 0x2c, 0x52, 0x6f, 0x62, 0x6f, 0x74, 0x6f, 0x2c, 0x4f, 0x78, 0x79, 0x67, 0x65,
|
||||
0x6e, 0x2c, 0x55, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x2c, 0x43, 0x61, 0x6e, 0x74, 0x61, 0x72, 0x65,
|
||||
0x6c, 0x6c, 0x2c, 0x27, 0x4f, 0x70, 0x65, 0x6e, 0x20, 0x53, 0x61, 0x6e, 0x73, 0x27, 0x2c, 0x27,
|
||||
0x48, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61, 0x20, 0x4e, 0x65, 0x75, 0x65, 0x27, 0x2c,
|
||||
0x73, 0x61, 0x6e, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x69, 0x66, 0x2c, 0x27, 0x41, 0x70, 0x70, 0x6c,
|
||||
0x65, 0x20, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x45, 0x6d, 0x6f, 0x6a, 0x69, 0x27, 0x2c, 0x27,
|
||||
0x53, 0x65, 0x67, 0x6f, 0x65, 0x20, 0x55, 0x49, 0x20, 0x45, 0x6d, 0x6f, 0x6a, 0x69, 0x27, 0x2c,
|
||||
0x27, 0x53, 0x65, 0x67, 0x6f, 0x65, 0x20, 0x55, 0x49, 0x20, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c,
|
||||
0x27, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x66, 0x6f, 0x6e,
|
||||
0x74, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x61, 0x73,
|
||||
0x2c, 0x6d, 0x6f, 0x6e, 0x61, 0x63, 0x6f, 0x2c, 0x27, 0x55, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x20,
|
||||
0x4d, 0x6f, 0x6e, 0x6f, 0x27, 0x2c, 0x27, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x20, 0x4d, 0x6f, 0x6e, 0x6f, 0x27, 0x2c, 0x27, 0x43, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72,
|
||||
0x20, 0x4e, 0x65, 0x77, 0x27, 0x2c, 0x43, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x2c, 0x6d, 0x6f,
|
||||
0x6e, 0x6f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d,
|
||||
0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x30, 0x3b, 0x0d, 0x0a,
|
||||
0x2f, 0x2a, 0x0a, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x68, 0x74,
|
||||
0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x65, 0x73, 0x63, 0x61, 0x70,
|
||||
0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x20,
|
||||
0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x63, 0x64, 0x6e, 0x2e, 0x6a, 0x73, 0x64, 0x65,
|
||||
0x6c, 0x69, 0x76, 0x72, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x6e, 0x70, 0x6d, 0x2f, 0x40, 0x65, 0x78,
|
||||
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x65, 0x76, 0x2f, 0x6e, 0x65, 0x77, 0x2e, 0x63, 0x73, 0x73,
|
||||
0x40, 0x31, 0x2e, 0x31, 0x2e, 0x32, 0x2f, 0x6e, 0x65, 0x77, 0x2e, 0x6d, 0x69, 0x6e, 0x2e, 0x63,
|
||||
0x73, 0x73, 0x0a, 0x2a, 0x2f, 0x0a, 0x0a, 0x2f, 0x2a, 0x0a, 0x20, 0x2a, 0x20, 0x55, 0x73, 0x61,
|
||||
0x67, 0x65, 0x3a, 0x0a, 0x20, 0x2a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x20, 0x2f,
|
||||
0x20, 0x6d, 0x69, 0x6e, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x64,
|
||||
0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x0a,
|
||||
0x20, 0x2a, 0x20, 0x43, 0x6f, 0x70, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x2d, 0x6c, 0x69, 0x6e, 0x65,
|
||||
0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x72, 0x63, 0x2f, 0x57,
|
||||
0x65, 0x62, 0x43, 0x66, 0x67, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x73, 0x74,
|
||||
0x61, 0x6e, 0x74, 0x73, 0x2e, 0x68, 0x20, 0x61, 0x73, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x63,
|
||||
0x73, 0x73, 0x0a, 0x20, 0x2a, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x61, 0x75, 0x74, 0x6f,
|
||||
0x6d, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73,
|
||||
0x73, 0x20, 0x75, 0x70, 0x6f, 0x6e, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20,
|
||||
0x3a, 0x29, 0x0a, 0x2a, 0x2f, 0x0a, 0x0a, 0x3a, 0x72, 0x6f, 0x6f, 0x74, 0x20, 0x7b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x61, 0x6e,
|
||||
0x73, 0x3a, 0x20, 0x27, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x27, 0x2c, 0x2d, 0x61, 0x70, 0x70, 0x6c,
|
||||
0x65, 0x2d, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2c, 0x42, 0x6c, 0x69, 0x6e, 0x6b, 0x4d, 0x61,
|
||||
0x63, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x46, 0x6f, 0x6e, 0x74, 0x2c, 0x27, 0x53, 0x65, 0x67,
|
||||
0x6f, 0x65, 0x20, 0x55, 0x49, 0x27, 0x2c, 0x52, 0x6f, 0x62, 0x6f, 0x74, 0x6f, 0x2c, 0x4f, 0x78,
|
||||
0x79, 0x67, 0x65, 0x6e, 0x2c, 0x55, 0x62, 0x75, 0x6e, 0x74, 0x75, 0x2c, 0x43, 0x61, 0x6e, 0x74,
|
||||
0x61, 0x72, 0x65, 0x6c, 0x6c, 0x2c, 0x27, 0x4f, 0x70, 0x65, 0x6e, 0x20, 0x53, 0x61, 0x6e, 0x73,
|
||||
0x27, 0x2c, 0x27, 0x48, 0x65, 0x6c, 0x76, 0x65, 0x74, 0x69, 0x63, 0x61, 0x20, 0x4e, 0x65, 0x75,
|
||||
0x65, 0x27, 0x2c, 0x73, 0x61, 0x6e, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x69, 0x66, 0x2c, 0x27, 0x41,
|
||||
0x70, 0x70, 0x6c, 0x65, 0x20, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x45, 0x6d, 0x6f, 0x6a, 0x69,
|
||||
0x27, 0x2c, 0x27, 0x53, 0x65, 0x67, 0x6f, 0x65, 0x20, 0x55, 0x49, 0x20, 0x45, 0x6d, 0x6f, 0x6a,
|
||||
0x69, 0x27, 0x2c, 0x27, 0x53, 0x65, 0x67, 0x6f, 0x65, 0x20, 0x55, 0x49, 0x20, 0x53, 0x79, 0x6d,
|
||||
0x62, 0x6f, 0x6c, 0x27, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x66,
|
||||
0x6f, 0x6e, 0x74, 0x2d, 0x6d, 0x6f, 0x6e, 0x6f, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c,
|
||||
0x61, 0x73, 0x2c, 0x6d, 0x6f, 0x6e, 0x61, 0x63, 0x6f, 0x2c, 0x27, 0x55, 0x62, 0x75, 0x6e, 0x74,
|
||||
0x75, 0x20, 0x4d, 0x6f, 0x6e, 0x6f, 0x27, 0x2c, 0x27, 0x4c, 0x69, 0x62, 0x65, 0x72, 0x61, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x20, 0x4d, 0x6f, 0x6e, 0x6f, 0x27, 0x2c, 0x27, 0x43, 0x6f, 0x75, 0x72, 0x69,
|
||||
0x65, 0x72, 0x20, 0x4e, 0x65, 0x77, 0x27, 0x2c, 0x43, 0x6f, 0x75, 0x72, 0x69, 0x65, 0x72, 0x2c,
|
||||
0x6d, 0x6f, 0x6e, 0x6f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d,
|
||||
0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x30, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x32, 0x3a, 0x20, 0x23,
|
||||
0x31, 0x61, 0x31, 0x61, 0x31, 0x61, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e,
|
||||
0x63, 0x2d, 0x62, 0x67, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x3b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x3a, 0x20, 0x23, 0x66,
|
||||
0x36, 0x66, 0x38, 0x66, 0x61, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x62, 0x67, 0x2d, 0x33, 0x3a, 0x20, 0x23, 0x65, 0x35, 0x65, 0x37, 0x65, 0x62, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x31, 0x3a, 0x20,
|
||||
0x23, 0x30, 0x30, 0x37, 0x30, 0x66, 0x33, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d,
|
||||
0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x32, 0x3a, 0x20, 0x23, 0x30, 0x33, 0x36, 0x36, 0x64, 0x36,
|
||||
0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74,
|
||||
0x78, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d,
|
||||
0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x37, 0x39, 0x66, 0x66, 0x65, 0x31,
|
||||
0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x74,
|
||||
0x78, 0x3a, 0x20, 0x23, 0x30, 0x63, 0x34, 0x30, 0x34, 0x37, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d,
|
||||
0x0a, 0x40, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x28, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x2d,
|
||||
0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x3a, 0x20, 0x64, 0x61,
|
||||
0x72, 0x6b, 0x29, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3a, 0x72, 0x6f, 0x6f, 0x74,
|
||||
0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x74, 0x78, 0x2d, 0x31, 0x3a, 0x23, 0x66, 0x66, 0x66, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x32, 0x3a, 0x20,
|
||||
0x23, 0x65, 0x65, 0x65, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d,
|
||||
0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x30, 0x3b, 0x0d,
|
||||
0x31, 0x61, 0x31, 0x61, 0x31, 0x61, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x62, 0x67, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x3a, 0x20, 0x23, 0x66, 0x36, 0x66,
|
||||
0x38, 0x66, 0x61, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67,
|
||||
0x2d, 0x33, 0x3a, 0x20, 0x23, 0x65, 0x35, 0x65, 0x37, 0x65, 0x62, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x37,
|
||||
0x30, 0x66, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b,
|
||||
0x2d, 0x32, 0x3a, 0x20, 0x23, 0x30, 0x33, 0x36, 0x36, 0x64, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74, 0x78, 0x3a, 0x20, 0x23, 0x66, 0x66,
|
||||
0x66, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x31,
|
||||
0x3a, 0x20, 0x23, 0x37, 0x39, 0x66, 0x66, 0x65, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d,
|
||||
0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x74, 0x78, 0x3a, 0x20, 0x23, 0x30, 0x63, 0x34, 0x30,
|
||||
0x34, 0x37, 0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x28, 0x70, 0x72, 0x65,
|
||||
0x66, 0x65, 0x72, 0x73, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2d, 0x73, 0x63, 0x68, 0x65, 0x6d,
|
||||
0x65, 0x3a, 0x20, 0x64, 0x61, 0x72, 0x6b, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3a,
|
||||
0x72, 0x6f, 0x6f, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d,
|
||||
0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x3a, 0x23, 0x66, 0x66, 0x66, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x32,
|
||||
0x3a, 0x20, 0x23, 0x65, 0x65, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x30, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67,
|
||||
0x2d, 0x32, 0x3a, 0x20, 0x23, 0x31, 0x31, 0x31, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x33, 0x3a, 0x20, 0x23, 0x32,
|
||||
0x32, 0x32, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e,
|
||||
0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x33, 0x32, 0x39, 0x31, 0x66, 0x66, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c,
|
||||
0x6b, 0x2d, 0x32, 0x3a, 0x20, 0x23, 0x30, 0x30, 0x37, 0x30, 0x66, 0x33, 0x3b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74,
|
||||
0x78, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x37, 0x39,
|
||||
0x32, 0x38, 0x63, 0x61, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d,
|
||||
0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x74, 0x78, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x2a, 0x20, 0x7b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x30, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x30,
|
||||
0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x69, 0x6d, 0x67, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74,
|
||||
0x2c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x70, 0x2c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2c,
|
||||
0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x2c, 0x75, 0x6c, 0x20, 0x7b, 0x0d, 0x0a, 0x20,
|
||||
0x2d, 0x32, 0x3a, 0x20, 0x23, 0x31, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x33, 0x3a, 0x20, 0x23, 0x32, 0x32,
|
||||
0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d,
|
||||
0x6c, 0x6b, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x33, 0x32, 0x39, 0x31, 0x66, 0x66, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x32,
|
||||
0x3a, 0x20, 0x23, 0x30, 0x30, 0x37, 0x30, 0x66, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74, 0x78, 0x3a, 0x20, 0x23,
|
||||
0x66, 0x66, 0x66, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e,
|
||||
0x63, 0x2d, 0x61, 0x63, 0x2d, 0x31, 0x3a, 0x20, 0x23, 0x37, 0x39, 0x32, 0x38, 0x63, 0x61, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63,
|
||||
0x2d, 0x74, 0x78, 0x3a, 0x20, 0x23, 0x66, 0x66, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a,
|
||||
0x7d, 0x0a, 0x0a, 0x2a, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69,
|
||||
0x6e, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e,
|
||||
0x67, 0x3a, 0x20, 0x30, 0x0a, 0x7d, 0x0a, 0x0a, 0x69, 0x6d, 0x67, 0x2c, 0x69, 0x6e, 0x70, 0x75,
|
||||
0x74, 0x2c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x70, 0x2c, 0x74, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x2c, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x2c, 0x75, 0x6c, 0x20, 0x7b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
|
||||
0x3a, 0x20, 0x31, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x62, 0x75, 0x74,
|
||||
0x74, 0x6f, 0x6e, 0x2c, 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x2c, 0x73,
|
||||
0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e,
|
||||
0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d,
|
||||
0x6e, 0x63, 0x2d, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x61, 0x6e, 0x73, 0x29, 0x0d, 0x0a, 0x7d,
|
||||
0x0d, 0x0a, 0x0d, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x30, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20,
|
||||
0x37, 0x35, 0x30, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64,
|
||||
0x69, 0x6e, 0x67, 0x3a, 0x20, 0x32, 0x72, 0x65, 0x6d, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x36,
|
||||
0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f,
|
||||
0x77, 0x2d, 0x78, 0x3a, 0x20, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x3b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x77, 0x6f, 0x72, 0x64, 0x2d, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3a, 0x20, 0x6e, 0x6f,
|
||||
0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x66,
|
||||
0x6c, 0x6f, 0x77, 0x2d, 0x77, 0x72, 0x61, 0x70, 0x3a, 0x20, 0x61, 0x6e, 0x79, 0x77, 0x68, 0x65,
|
||||
0x72, 0x65, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
|
||||
0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67,
|
||||
0x2d, 0x31, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a,
|
||||
0x3a, 0x20, 0x31, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e,
|
||||
0x2c, 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x2c, 0x73, 0x65, 0x6c, 0x65,
|
||||
0x63, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61,
|
||||
0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x66,
|
||||
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x61, 0x6e, 0x73, 0x29, 0x0a, 0x7d, 0x0a, 0x0a, 0x62, 0x6f, 0x64,
|
||||
0x79, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20,
|
||||
0x30, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d,
|
||||
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x37, 0x35, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x32, 0x72, 0x65, 0x6d, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69,
|
||||
0x75, 0x73, 0x3a, 0x20, 0x36, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x76, 0x65,
|
||||
0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2d, 0x78, 0x3a, 0x20, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x6f, 0x72, 0x64, 0x2d, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3a,
|
||||
0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x76, 0x65,
|
||||
0x72, 0x66, 0x6c, 0x6f, 0x77, 0x2d, 0x77, 0x72, 0x61, 0x70, 0x3a, 0x20, 0x61, 0x6e, 0x79, 0x77,
|
||||
0x68, 0x65, 0x72, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72,
|
||||
0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62,
|
||||
0x67, 0x2d, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a,
|
||||
0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x32, 0x29, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a,
|
||||
0x20, 0x31, 0x2e, 0x30, 0x33, 0x72, 0x65, 0x6d, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c,
|
||||
0x69, 0x6e, 0x65, 0x2d, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x35, 0x0d,
|
||||
0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x3a, 0x3a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
|
||||
0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63,
|
||||
0x2d, 0x31, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a,
|
||||
0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x74, 0x78, 0x29,
|
||||
0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x31, 0x2c, 0x68, 0x32, 0x2c, 0x68, 0x33, 0x2c,
|
||||
0x68, 0x34, 0x2c, 0x68, 0x35, 0x2c, 0x68, 0x36, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2e, 0x38,
|
||||
0x37, 0x35, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x31, 0x2c, 0x68,
|
||||
0x32, 0x2c, 0x68, 0x33, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
|
||||
0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31,
|
||||
0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d,
|
||||
0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x32, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a,
|
||||
0x20, 0x38, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
|
||||
0x72, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f,
|
||||
0x6c, 0x69, 0x64, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d,
|
||||
0x32, 0x29, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x34, 0x2c, 0x68, 0x35, 0x2c, 0x68,
|
||||
0x36, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d,
|
||||
0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x2e, 0x33, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d,
|
||||
0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x31, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f,
|
||||
0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x32, 0x2e, 0x32, 0x35, 0x72, 0x65, 0x6d,
|
||||
0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x32, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x2e, 0x38, 0x35,
|
||||
0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x33, 0x20, 0x7b, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31,
|
||||
0x2e, 0x35, 0x35, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x68, 0x34, 0x20,
|
||||
0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65,
|
||||
0x3a, 0x20, 0x31, 0x2e, 0x32, 0x35, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a,
|
||||
0x68, 0x35, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73,
|
||||
0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a,
|
||||
0x68, 0x36, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73,
|
||||
0x69, 0x7a, 0x65, 0x3a, 0x20, 0x2e, 0x38, 0x37, 0x35, 0x72, 0x65, 0x6d, 0x0d, 0x0a, 0x7d, 0x0d,
|
||||
0x0a, 0x0d, 0x0a, 0x61, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
|
||||
0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x31,
|
||||
0x29, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x61, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20,
|
||||
0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61,
|
||||
0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x32, 0x29, 0x20, 0x21, 0x69, 0x6d,
|
||||
0x70, 0x6f, 0x72, 0x74, 0x61, 0x6e, 0x74, 0x3b, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x61,
|
||||
0x62, 0x62, 0x72, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x75, 0x72, 0x73, 0x6f,
|
||||
0x72, 0x3a, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x61, 0x62,
|
||||
0x62, 0x72, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x0d, 0x0a, 0x7d, 0x0d,
|
||||
0x0a, 0x0d, 0x0a, 0x61, 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x2c, 0x62, 0x75, 0x74, 0x74,
|
||||
0x6f, 0x6e, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x75,
|
||||
0x74, 0x74, 0x6f, 0x6e, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65,
|
||||
0x3d, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79,
|
||||
0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x72, 0x65,
|
||||
0x6d, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a,
|
||||
0x20, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x36, 0x70, 0x78,
|
||||
0x20, 0x31, 0x32, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74,
|
||||
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x64, 0x65, 0x63, 0x6f, 0x72, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x20, 0x6e, 0x6f,
|
||||
0x77, 0x72, 0x61, 0x70, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d,
|
||||
0x6c, 0x6b, 0x2d, 0x31, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
|
||||
0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74,
|
||||
0x78, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a,
|
||||
0x20, 0x30, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d,
|
||||
0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x34, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x62, 0x6f,
|
||||
0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63,
|
||||
0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74, 0x78, 0x29, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a,
|
||||
0x0d, 0x0a, 0x61, 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62,
|
||||
0x6c, 0x65, 0x64, 0x5d, 0x2c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5b, 0x64, 0x69, 0x73, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x64, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65,
|
||||
0x3d, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5d, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x64, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x72, 0x65,
|
||||
0x73, 0x65, 0x74, 0x5d, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5d, 0x2c, 0x69,
|
||||
0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74,
|
||||
0x5d, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5d, 0x20, 0x7b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75,
|
||||
0x6c, 0x74, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79,
|
||||
0x3a, 0x20, 0x2e, 0x35, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x75, 0x72, 0x73, 0x6f,
|
||||
0x72, 0x3a, 0x20, 0x6e, 0x6f, 0x74, 0x2d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x0d, 0x0a,
|
||||
0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x3a, 0x66, 0x6f, 0x63,
|
||||
0x75, 0x73, 0x2c, 0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72,
|
||||
0x2c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x3a, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2c, 0x62, 0x75,
|
||||
0x74, 0x74, 0x6f, 0x6e, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74,
|
||||
0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5d, 0x3a, 0x66, 0x6f,
|
||||
0x63, 0x75, 0x73, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62,
|
||||
0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5d, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x2c, 0x69, 0x6e, 0x70,
|
||||
0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5d, 0x3a, 0x66,
|
||||
0x6f, 0x63, 0x75, 0x73, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d,
|
||||
0x72, 0x65, 0x73, 0x65, 0x74, 0x5d, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x2c, 0x69, 0x6e, 0x70,
|
||||
0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x3a,
|
||||
0x66, 0x6f, 0x63, 0x75, 0x73, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65,
|
||||
0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64,
|
||||
0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x32, 0x29,
|
||||
0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x7b, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x63, 0x6f, 0x6c, 0x6c, 0x61,
|
||||
0x70, 0x73, 0x65, 0x3a, 0x20, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x3b, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0d,
|
||||
0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x64, 0x2c, 0x74, 0x68, 0x20, 0x7b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73,
|
||||
0x6f, 0x6c, 0x69, 0x64, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67,
|
||||
0x2d, 0x33, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61,
|
||||
0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x2e, 0x35, 0x72, 0x65, 0x6d, 0x0d,
|
||||
0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x68, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x29, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d,
|
||||
0x0a, 0x74, 0x72, 0x3a, 0x6e, 0x74, 0x68, 0x2d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x76,
|
||||
0x65, 0x6e, 0x29, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d,
|
||||
0x62, 0x67, 0x2d, 0x32, 0x29, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x65, 0x78, 0x74,
|
||||
0x61, 0x72, 0x65, 0x61, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d,
|
||||
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a,
|
||||
0x0d, 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x2c, 0x74,
|
||||
0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70,
|
||||
0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x36, 0x70, 0x78, 0x20, 0x31, 0x32, 0x70, 0x78,
|
||||
0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f,
|
||||
0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x2e, 0x35, 0x72, 0x65, 0x6d, 0x3b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61,
|
||||
0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x29, 0x3b, 0x0d, 0x0a, 0x20,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20,
|
||||
0x31, 0x2e, 0x30, 0x33, 0x72, 0x65, 0x6d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x6e,
|
||||
0x65, 0x2d, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x2e, 0x35, 0x0a, 0x7d, 0x0a,
|
||||
0x0a, 0x3a, 0x3a, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76,
|
||||
0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x31, 0x29, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d,
|
||||
0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x32, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62,
|
||||
0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64,
|
||||
0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x33, 0x29, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64,
|
||||
0x69, 0x75, 0x73, 0x3a, 0x20, 0x34, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62,
|
||||
0x6f, 0x78, 0x2d, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x69, 0x7a, 0x69, 0x6e, 0x67,
|
||||
0x3a, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78, 0x0d, 0x0a, 0x7d, 0x0d,
|
||||
0x0a, 0x0d, 0x0a, 0x69, 0x6d, 0x67, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61,
|
||||
0x78, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0d, 0x0a, 0x7d,
|
||||
0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x64, 0x3e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20,
|
||||
0x30, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62,
|
||||
0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x74,
|
||||
0x64, 0x3e, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74,
|
||||
0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x74, 0x64, 0x3e,
|
||||
0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61,
|
||||
0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a,
|
||||
0x20, 0x30, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x2e, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e,
|
||||
0x67, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20,
|
||||
0x72, 0x65, 0x64, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x40, 0x6d, 0x65, 0x64, 0x69, 0x61,
|
||||
0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x64,
|
||||
0x20, 0x28, 0x6d, 0x61, 0x78, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x36, 0x30, 0x30,
|
||||
0x70, 0x78, 0x29, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64, 0x61, 0x70,
|
||||
0x74, 0x20, 0x74, 0x64, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64, 0x61,
|
||||
0x70, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x74, 0x65,
|
||||
0x78, 0x74, 0x5d, 0x2c, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74,
|
||||
0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5d, 0x2c,
|
||||
0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70,
|
||||
0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x2c, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74,
|
||||
0x20, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x2c, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74,
|
||||
0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64,
|
||||
0x61, 0x70, 0x74, 0x20, 0x74, 0x64, 0x3a, 0x68, 0x61, 0x73, 0x28, 0x69, 0x6e, 0x70, 0x75, 0x74,
|
||||
0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x5d, 0x29,
|
||||
0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74,
|
||||
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64,
|
||||
0x61, 0x70, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x63,
|
||||
0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x5d, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x2e, 0x35, 0x65, 0x6d,
|
||||
0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68,
|
||||
0x74, 0x3a, 0x20, 0x31, 0x2e, 0x35, 0x65, 0x6d, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0d,
|
||||
0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x74, 0x61,
|
||||
0x62, 0x6c, 0x65, 0x20, 0x74, 0x64, 0x3a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x2d, 0x63, 0x68, 0x69,
|
||||
0x6c, 0x64, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f,
|
||||
0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64,
|
||||
0x61, 0x70, 0x74, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x64, 0x3a, 0x6c, 0x61, 0x73,
|
||||
0x74, 0x2d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x23,
|
||||
0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x3e, 0x73, 0x70, 0x61, 0x6e,
|
||||
0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d,
|
||||
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x34, 0x30, 0x70, 0x78, 0x0d, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x7d, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61,
|
||||
0x76, 0x20, 0x61, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
|
||||
0x72, 0x3a, 0x20, 0x30, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
|
||||
0x72, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f,
|
||||
0x6c, 0x69, 0x64, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61,
|
||||
0x79, 0x3a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x72, 0x65, 0x6d, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74,
|
||||
0x3a, 0x20, 0x62, 0x6f, 0x6c, 0x64, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64,
|
||||
0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x2e, 0x36, 0x72, 0x65, 0x6d, 0x20, 0x30, 0x3b, 0x0d, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a,
|
||||
0x20, 0x31, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20,
|
||||
0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x29, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x64, 0x65, 0x63, 0x6f, 0x72, 0x61,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x6c, 0x69, 0x6e,
|
||||
0x65, 0x61, 0x72, 0x2d, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x28, 0x74, 0x6f, 0x20,
|
||||
0x6c, 0x65, 0x66, 0x74, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
|
||||
0x20, 0x35, 0x30, 0x25, 0x2c, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x32, 0x35,
|
||||
0x35, 0x2c, 0x32, 0x35, 0x35, 0x2c, 0x30, 0x2e, 0x34, 0x29, 0x20, 0x35, 0x30, 0x25, 0x29, 0x20,
|
||||
0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x32, 0x30, 0x30,
|
||||
0x25, 0x20, 0x31, 0x30, 0x30, 0x25, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x61,
|
||||
0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x2e, 0x32, 0x73,
|
||||
0x20, 0x65, 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x23, 0x74, 0x62, 0x6c,
|
||||
0x6e, 0x61, 0x76, 0x20, 0x61, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63,
|
||||
0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2d,
|
||||
0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x28, 0x74, 0x6f, 0x20, 0x6c, 0x65, 0x66, 0x74,
|
||||
0x2c, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x29, 0x20,
|
||||
0x35, 0x30, 0x25, 0x2c, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x32, 0x35, 0x35,
|
||||
0x2c, 0x32, 0x35, 0x35, 0x2c, 0x30, 0x2e, 0x34, 0x29, 0x20, 0x35, 0x30, 0x25, 0x29, 0x20, 0x72,
|
||||
0x69, 0x67, 0x68, 0x74, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x25,
|
||||
0x20, 0x31, 0x30, 0x30, 0x25, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x23, 0x74, 0x62, 0x6c,
|
||||
0x6e, 0x61, 0x76, 0x20, 0x61, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x70, 0x6f,
|
||||
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61,
|
||||
0x6c, 0x6c, 0x20, 0x2e, 0x34, 0x35, 0x73, 0x20, 0x65, 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x7d, 0x0d,
|
||||
0x0a, 0x0d, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x3a, 0x61, 0x63, 0x74,
|
||||
0x69, 0x76, 0x65, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
||||
0x6e, 0x63, 0x2d, 0x61, 0x63, 0x2d, 0x74, 0x78, 0x29, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x31, 0x2c,
|
||||
0x68, 0x32, 0x2c, 0x68, 0x33, 0x2c, 0x68, 0x34, 0x2c, 0x68, 0x35, 0x2c, 0x68, 0x36, 0x20, 0x7b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
|
||||
0x3a, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20,
|
||||
0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x29, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x74, 0x6f, 0x70, 0x3a,
|
||||
0x20, 0x2e, 0x38, 0x37, 0x35, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x31, 0x2c, 0x68,
|
||||
0x32, 0x2c, 0x68, 0x33, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31, 0x29,
|
||||
0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x6f,
|
||||
0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d,
|
||||
0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x38, 0x70,
|
||||
0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f,
|
||||
0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20,
|
||||
0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x29, 0x0a, 0x7d,
|
||||
0x0a, 0x0a, 0x68, 0x34, 0x2c, 0x68, 0x35, 0x2c, 0x68, 0x36, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20,
|
||||
0x2e, 0x33, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x31, 0x20, 0x7b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x32, 0x2e, 0x32,
|
||||
0x35, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x32, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x2e, 0x38, 0x35,
|
||||
0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x33, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x2e, 0x35, 0x35, 0x72,
|
||||
0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x34, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66,
|
||||
0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x2e, 0x32, 0x35, 0x72, 0x65,
|
||||
0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x68, 0x35, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f,
|
||||
0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a,
|
||||
0x0a, 0x68, 0x36, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73,
|
||||
0x69, 0x7a, 0x65, 0x3a, 0x20, 0x2e, 0x38, 0x37, 0x35, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a,
|
||||
0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76,
|
||||
0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x31, 0x29, 0x0a, 0x7d, 0x0a,
|
||||
0x0a, 0x61, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63,
|
||||
0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c,
|
||||
0x6b, 0x2d, 0x32, 0x29, 0x20, 0x21, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6e, 0x74, 0x3b,
|
||||
0x0a, 0x7d, 0x0a, 0x0a, 0x61, 0x62, 0x62, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63,
|
||||
0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x0a, 0x7d, 0x0a, 0x0a, 0x61,
|
||||
0x62, 0x62, 0x72, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x0a, 0x7d, 0x0a, 0x0a,
|
||||
0x61, 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x2c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x2c,
|
||||
0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x75, 0x74, 0x74, 0x6f,
|
||||
0x6e, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x72, 0x65,
|
||||
0x73, 0x65, 0x74, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d,
|
||||
0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f,
|
||||
0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x72, 0x65, 0x6d, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x69, 0x6e, 0x6c, 0x69,
|
||||
0x6e, 0x65, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61,
|
||||
0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x36, 0x70, 0x78, 0x20, 0x31, 0x32, 0x70, 0x78, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a,
|
||||
0x20, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78,
|
||||
0x74, 0x2d, 0x64, 0x65, 0x63, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6e, 0x6f,
|
||||
0x6e, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x2d, 0x73, 0x70,
|
||||
0x61, 0x63, 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x77, 0x72, 0x61, 0x70, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72,
|
||||
0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x6c, 0x6b, 0x2d, 0x74, 0x78, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72,
|
||||
0x64, 0x65, 0x72, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64,
|
||||
0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x34, 0x70, 0x78, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x3a, 0x20,
|
||||
0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x6c, 0x6b, 0x2d, 0x74, 0x78, 0x29, 0x0a, 0x7d, 0x0a, 0x0a, 0x61,
|
||||
0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64,
|
||||
0x5d, 0x2c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x64, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x75,
|
||||
0x74, 0x74, 0x6f, 0x6e, 0x5d, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5d, 0x2c,
|
||||
0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x65, 0x74,
|
||||
0x5d, 0x5b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5d, 0x2c, 0x69, 0x6e, 0x70, 0x75,
|
||||
0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x5b, 0x64,
|
||||
0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x5d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63,
|
||||
0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x2e, 0x35, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x6e, 0x6f, 0x74,
|
||||
0x2d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x0a, 0x7d, 0x0a, 0x0a, 0x2e, 0x62, 0x75, 0x74,
|
||||
0x74, 0x6f, 0x6e, 0x3a, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2c, 0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f,
|
||||
0x6e, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x2c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x3a, 0x66,
|
||||
0x6f, 0x63, 0x75, 0x73, 0x2c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x3a, 0x68, 0x6f, 0x76, 0x65,
|
||||
0x72, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x75, 0x74,
|
||||
0x74, 0x6f, 0x6e, 0x5d, 0x3a, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74,
|
||||
0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x5d, 0x3a, 0x68, 0x6f,
|
||||
0x76, 0x65, 0x72, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x72,
|
||||
0x65, 0x73, 0x65, 0x74, 0x5d, 0x3a, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2c, 0x69, 0x6e, 0x70, 0x75,
|
||||
0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x65, 0x74, 0x5d, 0x3a, 0x68, 0x6f,
|
||||
0x76, 0x65, 0x72, 0x2c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x73,
|
||||
0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x3a, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x2c, 0x69, 0x6e, 0x70,
|
||||
0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x3a,
|
||||
0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x6c, 0x6b, 0x2d, 0x32, 0x29, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20,
|
||||
0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x63, 0x6f, 0x6c,
|
||||
0x6c, 0x61, 0x70, 0x73, 0x65, 0x3a, 0x20, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25,
|
||||
0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x64, 0x2c, 0x74, 0x68, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69,
|
||||
0x64, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x33, 0x29,
|
||||
0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e,
|
||||
0x3a, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64,
|
||||
0x69, 0x6e, 0x67, 0x3a, 0x20, 0x2e, 0x35, 0x72, 0x65, 0x6d, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x68,
|
||||
0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e,
|
||||
0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32,
|
||||
0x29, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x72, 0x3a, 0x6e, 0x74, 0x68, 0x2d, 0x63, 0x68, 0x69, 0x6c,
|
||||
0x64, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61,
|
||||
0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d,
|
||||
0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x29, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x65, 0x78, 0x74,
|
||||
0x61, 0x72, 0x65, 0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x77,
|
||||
0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0a, 0x7d, 0x0a, 0x0a, 0x69, 0x6e,
|
||||
0x70, 0x75, 0x74, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x61,
|
||||
0x72, 0x65, 0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e,
|
||||
0x67, 0x3a, 0x20, 0x36, 0x70, 0x78, 0x20, 0x31, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20,
|
||||
0x2e, 0x35, 0x72, 0x65, 0x6d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67,
|
||||
0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d,
|
||||
0x6c, 0x6b, 0x2d, 0x31, 0x29, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6e,
|
||||
0x62, 0x67, 0x2d, 0x32, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
|
||||
0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x32, 0x29,
|
||||
0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x70,
|
||||
0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x62, 0x67, 0x2d, 0x33, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64,
|
||||
0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x34, 0x70, 0x78, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x3a, 0x20,
|
||||
0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x69,
|
||||
0x7a, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78,
|
||||
0x0a, 0x7d, 0x0a, 0x0a, 0x69, 0x6d, 0x67, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61,
|
||||
0x78, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0a, 0x7d, 0x0a,
|
||||
0x0a, 0x74, 0x64, 0x3e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
|
||||
0x3a, 0x20, 0x30, 0x0a, 0x7d, 0x0a, 0x0a, 0x74, 0x64, 0x3e, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72,
|
||||
0x65, 0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d,
|
||||
0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67,
|
||||
0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x0a, 0x7d, 0x0a, 0x0a,
|
||||
0x74, 0x64, 0x3e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
|
||||
0x3a, 0x20, 0x30, 0x0a, 0x7d, 0x0a, 0x0a, 0x2e, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x20,
|
||||
0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x72, 0x65, 0x64,
|
||||
0x0a, 0x7d, 0x0a, 0x0a, 0x40, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20,
|
||||
0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x28, 0x6d, 0x61, 0x78, 0x2d,
|
||||
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x36, 0x30, 0x30, 0x70, 0x78, 0x29, 0x20, 0x7b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x74, 0x64, 0x20, 0x7b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a,
|
||||
0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79,
|
||||
0x70, 0x65, 0x3d, 0x74, 0x65, 0x78, 0x74, 0x5d, 0x2c, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20,
|
||||
0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x70, 0x61, 0x73, 0x73, 0x77,
|
||||
0x6f, 0x72, 0x64, 0x5d, 0x2c, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75,
|
||||
0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x5d, 0x2c, 0x2e,
|
||||
0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x2c, 0x2e,
|
||||
0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x7b, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30,
|
||||
0x30, 0x25, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61,
|
||||
0x64, 0x61, 0x70, 0x74, 0x20, 0x74, 0x64, 0x3a, 0x68, 0x61, 0x73, 0x28, 0x69, 0x6e, 0x70, 0x75,
|
||||
0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x5d,
|
||||
0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74,
|
||||
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74,
|
||||
0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x63, 0x68, 0x65, 0x63,
|
||||
0x6b, 0x62, 0x6f, 0x78, 0x5d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x2e, 0x35, 0x65, 0x6d, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x2e,
|
||||
0x35, 0x65, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2e,
|
||||
0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x64, 0x3a, 0x66,
|
||||
0x69, 0x72, 0x73, 0x74, 0x2d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x74, 0x74,
|
||||
0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x20, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x64,
|
||||
0x3a, 0x6c, 0x61, 0x73, 0x74, 0x2d, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x20, 0x7b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x74, 0x6f, 0x70,
|
||||
0x3a, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x23,
|
||||
0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x3e, 0x73, 0x70, 0x61, 0x6e,
|
||||
0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x77,
|
||||
0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x34, 0x30, 0x70, 0x78, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x7d, 0x0a, 0x7d, 0x0a, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x20, 0x7b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x30, 0x3b, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x74, 0x74, 0x6f,
|
||||
0x6d, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
|
||||
0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a,
|
||||
0x20, 0x31, 0x72, 0x65, 0x6d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d,
|
||||
0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x62, 0x6f, 0x6c, 0x64, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x2e, 0x36, 0x72, 0x65, 0x6d,
|
||||
0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x68, 0x65, 0x69,
|
||||
0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
|
||||
0x72, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x74, 0x78, 0x2d, 0x31,
|
||||
0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x64, 0x65, 0x63, 0x6f,
|
||||
0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x6c, 0x69,
|
||||
0x6e, 0x65, 0x61, 0x72, 0x2d, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x28, 0x74, 0x6f,
|
||||
0x20, 0x6c, 0x65, 0x66, 0x74, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e,
|
||||
0x74, 0x20, 0x35, 0x30, 0x25, 0x2c, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x32,
|
||||
0x35, 0x35, 0x2c, 0x32, 0x35, 0x35, 0x2c, 0x30, 0x2e, 0x34, 0x29, 0x20, 0x35, 0x30, 0x25, 0x29,
|
||||
0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x32, 0x30, 0x30,
|
||||
0x25, 0x20, 0x31, 0x30, 0x30, 0x25, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6e,
|
||||
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x2e, 0x32, 0x73, 0x20,
|
||||
0x65, 0x61, 0x73, 0x65, 0x0a, 0x7d, 0x0a, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20,
|
||||
0x61, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75,
|
||||
0x6e, 0x64, 0x3a, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2d, 0x67, 0x72, 0x61, 0x64, 0x69,
|
||||
0x65, 0x6e, 0x74, 0x28, 0x74, 0x6f, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x2c, 0x76, 0x61, 0x72, 0x28,
|
||||
0x2d, 0x2d, 0x6e, 0x63, 0x2d, 0x62, 0x67, 0x2d, 0x32, 0x29, 0x20, 0x35, 0x30, 0x25, 0x2c, 0x72,
|
||||
0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x32, 0x35, 0x35, 0x2c, 0x32, 0x35, 0x35, 0x2c,
|
||||
0x30, 0x2e, 0x34, 0x29, 0x20, 0x35, 0x30, 0x25, 0x29, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d,
|
||||
0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x25, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0a,
|
||||
0x7d, 0x0a, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x3a, 0x68, 0x6f, 0x76,
|
||||
0x65, 0x72, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
|
||||
0x75, 0x6e, 0x64, 0x2d, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6c, 0x65,
|
||||
0x66, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x2e, 0x34, 0x35, 0x73, 0x20, 0x65, 0x61, 0x73,
|
||||
0x65, 0x0a, 0x7d, 0x0a, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x3a, 0x61,
|
||||
0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b,
|
||||
0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x76, 0x61, 0x72, 0x28, 0x2d, 0x2d, 0x6e, 0x63,
|
||||
0x2d, 0x6c, 0x6b, 0x2d, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x72, 0x61, 0x6e,
|
||||
0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x2e, 0x31, 0x35, 0x73,
|
||||
0x20, 0x65, 0x61, 0x73, 0x65, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x23, 0x74, 0x62, 0x6c,
|
||||
0x6e, 0x61, 0x76, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x6c, 0x69, 0x73, 0x74, 0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65,
|
||||
0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20,
|
||||
0x2e, 0x35, 0x72, 0x65, 0x6d, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70,
|
||||
0x6c, 0x61, 0x79, 0x3a, 0x20, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x62, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31,
|
||||
0x30, 0x30, 0x25, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61,
|
||||
0x76, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x3e, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x7b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b,
|
||||
0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e,
|
||||
0x3a, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61,
|
||||
0x72, 0x67, 0x69, 0x6e, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x30, 0x70, 0x78,
|
||||
0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x23, 0x66,
|
||||
0x37, 0x30, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x77, 0x65,
|
||||
0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x65, 0x61, 0x73, 0x65, 0x0a, 0x7d, 0x0a, 0x0a, 0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76,
|
||||
0x20, 0x61, 0x20, 0x6c, 0x69, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x69, 0x73, 0x74,
|
||||
0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x20, 0x20,
|
||||
0x20, 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x2e, 0x35, 0x72, 0x65, 0x6d,
|
||||
0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x69,
|
||||
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0a, 0x7d, 0x0a, 0x0a,
|
||||
0x23, 0x74, 0x62, 0x6c, 0x6e, 0x61, 0x76, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x3e, 0x73, 0x70, 0x61,
|
||||
0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x20, 0x72,
|
||||
0x69, 0x67, 0x68, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61,
|
||||
0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31,
|
||||
0x30, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20,
|
||||
0x23, 0x66, 0x37, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x77,
|
||||
0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3a, 0x20, 0x69, 0x74, 0x61, 0x6c,
|
||||
0x69, 0x63, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
|
||||
0x3a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a, 0x0d, 0x0a, 0x2e, 0x74,
|
||||
0x64, 0x62, 0x74, 0x6e, 0x20, 0x7b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74,
|
||||
0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2d, 0x61, 0x6c,
|
||||
0x69, 0x67, 0x6e, 0x3a, 0x20, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x0d, 0x0a, 0x7d, 0x0d, 0x0a,
|
||||
0x0d, 0x0a, 0x2e, 0x6e, 0x61, 0x76, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x7b, 0x0d, 0x0a, 0x20,
|
||||
0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x0d,
|
||||
0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20,
|
||||
0x33, 0x37, 0x35, 0x70, 0x78, 0x3b, 0x0d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74,
|
||||
0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0d, 0x0a, 0x7d,
|
||||
0x69, 0x63, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a,
|
||||
0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2e, 0x74, 0x64, 0x62, 0x74, 0x6e,
|
||||
0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6c, 0x69, 0x67,
|
||||
0x6e, 0x3a, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76,
|
||||
0x65, 0x72, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x2d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3a, 0x20, 0x6d,
|
||||
0x69, 0x64, 0x64, 0x6c, 0x65, 0x0a, 0x7d, 0x0a, 0x0a, 0x2e, 0x6e, 0x61, 0x76, 0x65, 0x6e, 0x74,
|
||||
0x72, 0x79, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x20,
|
||||
0x6c, 0x65, 0x66, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x2d, 0x77, 0x69,
|
||||
0x64, 0x74, 0x68, 0x3a, 0x20, 0x33, 0x37, 0x35, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
|
||||
0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x25, 0x0a, 0x7d,
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user