add desktop cm backend

This commit is contained in:
csf
2022-08-17 17:23:55 +08:00
parent fc061d2b49
commit 3063adc2fd
9 changed files with 425 additions and 222 deletions

View File

@@ -423,7 +423,7 @@ class ServerModel with ChangeNotifier {
void sendLoginResponse(Client client, bool res) async {
if (res) {
bind.serverLoginRes(connId: client.id, res: res);
bind.cmLoginRes(connId: client.id, res: res);
if (!client.isFileTransfer) {
parent.target?.invokeMethod("start_capture");
}
@@ -431,7 +431,7 @@ class ServerModel with ChangeNotifier {
_clients[client.id]?.authorized = true;
notifyListeners();
} else {
bind.serverLoginRes(connId: client.id, res: res);
bind.cmLoginRes(connId: client.id, res: res);
parent.target?.invokeMethod("cancel_notification", client.id);
_clients.remove(client.id);
}
@@ -463,7 +463,7 @@ class ServerModel with ChangeNotifier {
closeAll() {
_clients.forEach((id, client) {
bind.serverCloseConnection(connId: id);
bind.cmCloseConnection(connId: id);
});
_clients.clear();
}