1. Ada Young
  2. AdaCode

Commits

Ada Young  committed e9996d0

Added endpoints <area name> alias

  • Participants
  • Parent commits f80e8eb
  • Branches master

Comments (0)

Files changed (1)

File warpdb.xml

View file
 The following aliases are available:
 
     WarpDB:sources - Check for warps in your area and add them to database
+
     WarpDB:endpoints - Display a list of all areas you can reach from your location
     WarpDB:toarea <area name> - Check for warps leading to the specified area from your location
 
+    WarpDB:endpoints <area name> - Display a list of all areas you can reach from the specified area
+
     WarpDB:export [<area name>] - Export all outgoing warps optionally specifying an area
     WarpDB:import - Import a list of warps exported by the above alias
 
   </send>
   </alias>
   <alias
+   match="^WarpDB:endpoints (.+)$"
+   enabled="y"
+   group="WarpDB"
+   regexp="y"
+   send_to="12"
+   ignore_case="y"
+   sequence="100"
+  >
+  <send>
+OtherEndPoints("%1")
+  </send>
+  </alias>
+  <alias
    match="^WarpDB:export (.+)$"
    enabled="y"
    group="WarpDB"
     else:
         Note("WarpDB: No recorded warps lead from here to [%s], try WarpDB:sources here and in the destination area to link the two." % areaname)
 
+def OtherEndPoints(o_areaname):
+    o_areaname = ValidateArea(o_areaname)
+    if o_areaname is None: # bail out
+        return
+
+    global areaname
+    areaname = o_areaname
+    DisplayEndPoints(EndPoints(o_areaname))
+
 def DisplayOrphans(areaname):
     cursor.execute("SELECT id FROM arealist WHERE areaname=?", (areaname, ))
     results = cursor.fetchall()