@@ -892,7 +892,7 @@ void MyMesh::clearStats() {
892892
893893void MyMesh::handleCommand (uint32_t sender_timestamp, char *command, char *reply) {
894894 if (region_load_active) {
895- if (* command == 0 ) { // empty line, signal to terminate 'load' operation
895+ if (StrHelper::isBlank ( command)) { // empty/blank line, signal to terminate 'load' operation
896896 region_map = temp_map; // copy over the temp instance as new current map
897897 region_load_active = false ;
898898
@@ -908,7 +908,7 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
908908
909909 while (*ep && *ep != ' F' ) ep++; // look for (optional) flags
910910
911- if (indent > 0 && indent < 8 ) {
911+ if (indent > 0 && indent < 8 && strlen (np) > 0 ) {
912912 auto parent = load_stack[indent - 1 ];
913913 if (parent) {
914914 auto old = region_map.findByName (np);
@@ -985,15 +985,15 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
985985 bool success = region_map.save (_fs);
986986 strcpy (reply, success ? " OK" : " Err - save failed" );
987987 } else if (n >= 3 && strcmp (parts[1 ], " allowf" ) == 0 ) {
988- auto region = strcmp (parts[ 2 ], " * " ) == 0 ? ®ion_map. getWildcard () : region_map.findByNamePrefix (parts[2 ]);
988+ auto region = region_map.findByNamePrefix (parts[2 ]);
989989 if (region) {
990990 region->flags &= ~REGION_DENY_FLOOD;
991991 strcpy (reply, " OK" );
992992 } else {
993993 strcpy (reply, " Err - unknown region" );
994994 }
995995 } else if (n >= 3 && strcmp (parts[1 ], " denyf" ) == 0 ) {
996- auto region = strcmp (parts[ 2 ], " * " ) == 0 ? ®ion_map. getWildcard () : region_map.findByNamePrefix (parts[2 ]);
996+ auto region = region_map.findByNamePrefix (parts[2 ]);
997997 if (region) {
998998 region->flags |= REGION_DENY_FLOOD;
999999 strcpy (reply, " OK" );
@@ -1003,12 +1003,17 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
10031003 } else if (n >= 3 && strcmp (parts[1 ], " get" ) == 0 ) {
10041004 auto region = region_map.findByNamePrefix (parts[2 ]);
10051005 if (region) {
1006- sprintf (reply, " %s %s" , region->name , (region->flags & REGION_DENY_FLOOD) ? " " : " F" );
1006+ auto parent = region_map.findById (region->parent );
1007+ if (parent && parent->id != 0 ) {
1008+ sprintf (reply, " %s (%s) %s" , region->name , parent->name , (region->flags & REGION_DENY_FLOOD) ? " " : " F" );
1009+ } else {
1010+ sprintf (reply, " %s %s" , region->name , (region->flags & REGION_DENY_FLOOD) ? " " : " F" );
1011+ }
10071012 } else {
10081013 strcpy (reply, " Err - unknown region" );
10091014 }
10101015 } else if (n >= 3 && strcmp (parts[1 ], " home" ) == 0 ) {
1011- auto home = strcmp (parts[ 2 ], " * " ) == 0 ? ®ion_map. getWildcard () : region_map.findByNamePrefix (parts[2 ]);
1016+ auto home = region_map.findByNamePrefix (parts[2 ]);
10121017 if (home) {
10131018 region_map.setHomeRegion (home);
10141019 sprintf (reply, " home is now %s" , home->name );
0 commit comments