Добавил сайт

This commit is contained in:
2024-01-15 03:50:54 +03:00
parent 68e421b336
commit 3f65dd50d3
9 changed files with 355 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
class Dispatcher {
constructor() {
this.commands = {};
}
AddCommand(command_name, command) {
this.commands[command_name] = command;
}
Dispatch(response) {
if (response["status"] != "ok") {
alert(`Возникла ошибка. Пожалуйста, сообщите о ней разработчикам: ${response["error_message"]}`);
return;
}
let command = response["command"];
console.log("dispatching " + command);
this.commands[command].ProcessResponse(response);
}
commands;
}