예제 #1
0
 private void ShowRegionsCmd(List <string> args, TTY io, UUID limitedToScene)
 {
     if (limitedToScene != UUID.Zero)
     {
         io.Write("Command not allowed on limited console");
     }
     else if (args[0] == "help" || args.Count != 3)
     {
         io.Write("show gridregions <searchkey>");
     }
     else
     {
         var sb = new StringBuilder("Regions:\n--------------------------------------------------\n");
         foreach (RegionInfo ri in m_GridService.SearchRegionsByName(args[2]))
         {
             sb.AppendFormat("Region {0}\n- ID: ({1})\n- Flags: {2}\n", ri.Name, ri.ID, ri.Flags.ToString());
         }
         io.Write(sb.ToString());
     }
 }
예제 #2
0
        private void HandleMapServerSearch(HttpRequest req, Map jsondata)
        {
            string searchkey;

            if (!jsondata.TryGetValue("query", out searchkey))
            {
                m_WebIF.ErrorResponse(req, AdminWebIfErrorResult.InvalidRequest);
                return;
            }

            List <RegionInfo> regions;

            try
            {
                regions = m_GridService.SearchRegionsByName(searchkey);
            }
            catch
            {
                m_WebIF.ErrorResponse(req, AdminWebIfErrorResult.NotPossible);
                return;
            }
            ReturnRegionsResult(req, regions);
        }