From 586088aad935ad0fa9bd4c80ff9ae67f6dd6970f Mon Sep 17 00:00:00 2001 From: Ahmed Zamil Date: Sat, 21 Mar 2020 12:52:20 +0300 Subject: [PATCH] 1.1.9 --- .gitignore | 3 + CHANGELOG.md | 3 + lib/src/Data/DC.dart | 4 +- lib/src/Net/Sockets/TCPSocket.dart | 6 +- lib/src/Resource/Instance.dart | 3 +- pubspec.lock | 124 ++++++++++++++++------------- pubspec.yaml | 6 +- test/main.dart | 44 +++++----- 8 files changed, 112 insertions(+), 81 deletions(-) diff --git a/.gitignore b/.gitignore index 9d7edcf..83efff2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ + +test/ + # Miscellaneous *.class *.log diff --git a/CHANGELOG.md b/CHANGELOG.md index fc45caf..ae04123 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.1.9] - Release. +Added new property event + ## [1.0.0] - Release. * Initial release. \ No newline at end of file diff --git a/lib/src/Data/DC.dart b/lib/src/Data/DC.dart index 2839792..1e751f2 100644 --- a/lib/src/Data/DC.dart +++ b/lib/src/Data/DC.dart @@ -587,10 +587,10 @@ class DC with IterableMixin _dv.setUint64(offset, value); } - setDateTime(offset, value) + setDateTime(offset, DateTime value) { // Unix Epoch - var ticks = 621355968000000000 + (value.getTime() * 10000); + var ticks = UNIX_EPOCH + (value.millisecondsSinceEpoch * 10000); this.setUint64(offset, ticks); } diff --git a/lib/src/Net/Sockets/TCPSocket.dart b/lib/src/Net/Sockets/TCPSocket.dart index 1042320..133b5f4 100644 --- a/lib/src/Net/Sockets/TCPSocket.dart +++ b/lib/src/Net/Sockets/TCPSocket.dart @@ -23,6 +23,8 @@ SOFTWARE. */ import 'dart:io'; +import 'package:esyur/esyur.dart'; + import 'ISocket.dart'; import '../../Data/DC.dart'; import '../NetworkBuffer.dart'; @@ -127,14 +129,14 @@ class TCPSocket extends ISocket }).catchError((ex){ close(); - rt.triggerError(ex); + rt.triggerError(AsyncException(ErrorType.Management, ExceptionCode.HostNotReachable.index, ex.toString())); }); } catch(ex) { - rt.triggerError(ex); + rt.triggerError(AsyncException(ErrorType.Management, ExceptionCode.HostNotReachable.index, ex.toString())); } return rt; diff --git a/lib/src/Resource/Instance.dart b/lib/src/Resource/Instance.dart index 8a824f1..8dbb8df 100644 --- a/lib/src/Resource/Instance.dart +++ b/lib/src/Resource/Instance.dart @@ -433,7 +433,8 @@ class Instance extends IEventHandler } emitArgs("resourceModified", [_resource, pt.name, value]); - _resource.emitArgs("modified", [pt.name, value]); + //_resource.emitArgs("modified", [pt.name, value]); + _resource.emitArgs(":${pt.name}", [value]); } /// diff --git a/pubspec.lock b/pubspec.lock index c391e7f..d79c016 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,48 +1,55 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.36.3" + version: "0.39.4" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "1.6.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.4.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.0.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.1.3" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.14.12" convert: dependency: transitive description: @@ -50,13 +57,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.9" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.1+1" + version: "2.1.4" csslib: dependency: transitive description: @@ -64,41 +78,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.16.1" - front_end: - dependency: transitive - description: - name: front_end - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.18" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "1.1.7" + version: "1.2.0" html: dependency: transitive description: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.14.0+2" + version: "0.14.0+3" http: dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.12.0+2" + version: "0.12.0+4" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.0" http_parser: dependency: transitive description: @@ -120,34 +127,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.6.1+1" - json_rpc_2: + logging: dependency: transitive description: - name: json_rpc_2 + name: logging url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" - kernel: - dependency: transitive - description: - name: kernel - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.18" + version: "0.11.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.5" + version: "0.12.6" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.7" + version: "1.1.8" mime: dependency: transitive description: @@ -162,27 +162,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" + node_interop: + dependency: transitive + description: + name: node_interop + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + node_io: + dependency: transitive + description: + name: node_io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1+2" node_preamble: dependency: transitive description: name: node_preamble url: "https://pub.dartlang.org" source: hosted - version: "1.4.6" + version: "1.4.8" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" - package_resolver: - dependency: transitive - description: - name: package_resolver - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.10" + version: "1.9.2" path: dependency: transitive description: @@ -196,7 +203,7 @@ packages: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.8.0+1" + version: "1.9.0" pool: dependency: transitive description: @@ -210,7 +217,7 @@ packages: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "1.4.2" + version: "1.4.4" shelf: dependency: transitive description: @@ -224,7 +231,7 @@ packages: name: shelf_packages_handler url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.0" shelf_static: dependency: transitive description: @@ -245,21 +252,21 @@ packages: name: source_map_stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.1.5" + version: "2.0.0" source_maps: dependency: transitive description: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.8" + version: "0.10.9" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.7.0" stack_trace: dependency: transitive description: @@ -294,21 +301,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.6.1" + version: "1.14.2" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.4" + version: "0.2.15" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.3.3" typed_data: dependency: transitive description: @@ -316,33 +323,40 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.6" - vm_service_client: + vm_service: dependency: transitive description: - name: vm_service_client + name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "0.2.6+3" + version: "4.0.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+12" + version: "0.9.7+14" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.0.14" + version: "1.1.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0+1" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "2.1.16" + version: "2.2.0" sdks: - dart: ">=2.1.1-dev.0.0 <3.0.0" + dart: ">=2.7.0 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index d422b38..120696b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,14 +1,14 @@ name: esyur description: Distributed Object Framework. -version: 1.1.5 -author: Ahmed Zamil +version: 1.1.9 +# author: Ahmed Zamil homepage: https://github.com/esyur/esyur-dart environment: sdk: ">=2.1.0 <3.0.0" dev_dependencies: - test: ^1.0.0 + test: ^1.14.2 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec diff --git a/test/main.dart b/test/main.dart index 14134b4..2c03a26 100644 --- a/test/main.dart +++ b/test/main.dart @@ -7,18 +7,28 @@ main() test("Connect to server", () async { // connect to the server - var x = await Warehouse.get("iip://localhost:5000/sys/su", {"username": "admin", "password": "1234" - , "domain": "example.com"}); + // var x = await Warehouse.get("iip://localhost:5000/sys/su", {"username": "admin", "password": "1234" + // , "domain": "example.com"}); + + + // desc(x); - x.instance.store.on("close", (x){ - print("Closed"); - }); + // List trackers = await x.getMyTrackers(); - x.on("modified", (peoperty, value){ + // for(var i = 0; i < trackers.length; i++) + // print(trackers[i].name); - }); + // var arc = await x.getObjectTracks(trackers[1], DateTime.now().subtract(Duration(days: 6)), DateTime.now()); + + // x.instance.store.on("close", (x){ + // print("Closed"); + // }); + + // x.on("modified", (peoperty, value){ + + // }); // var users = await x.Users.Slice(0, 10); @@ -26,13 +36,13 @@ main() // await sleep(Duration(seconds: 10)); // get property - print(x.Level); + //print(x.Level); // listen to event - x.on("LevelUp", (v,y,z)=>print("Level up ${v} ${y}${z}")); + //x.on("LevelUp", (v,y,z)=>print("Level up ${v} ${y}${z}")); // use await - print("Added successfully ${await x.Add(40)}"); + //print("Added successfully ${await x.Add(40)}"); // use named arguments - print(await x.Add(value: 20)); + //print(await x.Add(value: 20)); // test chunks //x.Stream(10).chunk((c)=>print(c)); // property setter @@ -41,7 +51,7 @@ main() //var msg = await stdin.readLineSync(); - print("Done"); + //print("Done"); }); @@ -62,22 +72,20 @@ main() var y = x.instance.template; print("Fucntions = ${y.functions.length}\n"); for (var i = 0; i < y.functions.length; i++) { - print("name = ${y.functions[i].name}"); - print("args = ${y.functions[i].expansion}"); + print("Function ${y.functions[i].name} ${y.functions[i].expansion}"); } print("------------------------------\n"); print("Events = ${y.events.length}\n"); for (var i = 0; i < y.events.length; i++) { - print("name = ${y.events[i].name}"); - print("args = ${y.events[i].expansion}"); + print("Events ${y.events[i].name} ${y.events[i].expansion}"); } print("------------------------------\n"); print("Properties = ${y.properties.length}\n"); for (var i = 0; i < y.properties.length; i++) { - print("name = ${y.properties[i].name}"); + print("Property ${y.properties[i].name} ${y.properties[i].readExpansion}"); // recursion - print("value = ${desc(x.get(y.properties[i].index))}"); + //print("value = ${desc(x.get(y.properties[i].index))}"); } } else