From f7e1f2d221939ce44a467d4155208145de0de72a Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 1 Nov 2020 03:37:29 +0000 Subject: [PATCH] Implement registration at net-level --- commands/reg.py | 10 +++++++++- conf/help.json | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/commands/reg.py b/commands/reg.py index 406dda4..1e3c272 100644 --- a/commands/reg.py +++ b/commands/reg.py @@ -7,7 +7,15 @@ class RegCommand: def reg(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length): if authed: - if length == 3: + if length == 2: + if not spl[1] in main.network.keys(): + failure("No such network: %s" % spl[1]) + return + if for i in main.network[spl[1]].relays.keys(): + regproc.registerAccount(spl[1], int(spl[2])) + success("Requested registration for all relays on %s" % spl[1]) + return + elif length == 3: if not spl[1] in main.network.keys(): failure("No such network: %s" % spl[1]) return diff --git a/conf/help.json b/conf/help.json index b8f9ad7..704d979 100644 --- a/conf/help.json +++ b/conf/help.json @@ -28,9 +28,9 @@ "swho": "swho []", "list": "list []", "exec": "exec ", - "reg": "reg ", + "reg": "reg []", "confirm": "confirm ", "pending": "pending []", "authcheck": "authcheck []", "recheckauth": "recheckauth []" -} \ No newline at end of file +}