Rework data structures, storing all front-end network data in Network objects
This commit is contained in:
@@ -8,14 +8,16 @@ class CmdCommand:
|
||||
def cmd(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
|
||||
if authed:
|
||||
if length > 4:
|
||||
if not spl[1] in main.relay.keys():
|
||||
failure("No such relay: %s" % spl[1])
|
||||
if not spl[1] in main.network.keys():
|
||||
failure("No such network: %s" % spl[1])
|
||||
return
|
||||
if not int(spl[2]) in main.network[spl[1]].relays.keys():
|
||||
failure("No such relay: %s on network: %s" % (spl[2], spl[1]))
|
||||
return
|
||||
|
||||
commands = {spl[3]: [" ".join(spl[4:])]}
|
||||
print(" ".join(spl[4:]))
|
||||
success("Sending commands to relay %s as user %s" % (spl[1], spl[2]))
|
||||
deliverRelayCommands(spl[1], commands, user=spl[2])
|
||||
commands = {spl[4]: [" ".join(spl[5:])]}
|
||||
success("Sending commands to relay %s as user %s" % (spl[2], spl[3]))
|
||||
deliverRelayCommands(main.network[spl[1]].relays[spl[2]], commands, user=spl[3]+"/"+spl[1])
|
||||
return
|
||||
else:
|
||||
incUsage("cmd")
|
||||
|
||||
Reference in New Issue
Block a user