GridService.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSimulator Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using System.Collections.Generic;
  29. using System.Net;
  30. using System.Reflection;
  31. using Nini.Config;
  32. using log4net;
  33. using OpenSim.Framework;
  34. using OpenSim.Framework.Console;
  35. using OpenSim.Data;
  36. using OpenSim.Server.Base;
  37. using OpenSim.Services.Interfaces;
  38. using GridRegion = OpenSim.Services.Interfaces.GridRegion;
  39. using OpenMetaverse;
  40. namespace OpenSim.Services.GridService
  41. {
  42. public class GridService : GridServiceBase, IGridService
  43. {
  44. private static readonly ILog m_log =
  45. LogManager.GetLogger(
  46. MethodBase.GetCurrentMethod().DeclaringType);
  47. private bool m_DeleteOnUnregister = true;
  48. private static GridService m_RootInstance = null;
  49. protected IConfigSource m_config;
  50. protected static HypergridLinker m_HypergridLinker;
  51. protected IAuthenticationService m_AuthenticationService = null;
  52. protected bool m_AllowDuplicateNames = false;
  53. protected bool m_AllowHypergridMapSearch = false;
  54. public GridService(IConfigSource config)
  55. : base(config)
  56. {
  57. m_log.DebugFormat("[GRID SERVICE]: Starting...");
  58. m_config = config;
  59. IConfig gridConfig = config.Configs["GridService"];
  60. if (gridConfig != null)
  61. {
  62. m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true);
  63. string authService = gridConfig.GetString("AuthenticationService", String.Empty);
  64. if (authService != String.Empty)
  65. {
  66. Object[] args = new Object[] { config };
  67. m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
  68. }
  69. m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames);
  70. m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch);
  71. }
  72. if (m_RootInstance == null)
  73. {
  74. m_RootInstance = this;
  75. if (MainConsole.Instance != null)
  76. {
  77. MainConsole.Instance.Commands.AddCommand("grid", true,
  78. "show region",
  79. "show region <Region name>",
  80. "Show details on a region",
  81. String.Empty,
  82. HandleShowRegion);
  83. MainConsole.Instance.Commands.AddCommand("grid", true,
  84. "set region flags",
  85. "set region flags <Region name> <flags>",
  86. "Set database flags for region",
  87. String.Empty,
  88. HandleSetFlags);
  89. }
  90. m_HypergridLinker = new HypergridLinker(m_config, this, m_Database);
  91. }
  92. }
  93. #region IGridService
  94. public string RegisterRegion(UUID scopeID, GridRegion regionInfos)
  95. {
  96. IConfig gridConfig = m_config.Configs["GridService"];
  97. // This needs better sanity testing. What if regionInfo is registering in
  98. // overlapping coords?
  99. RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
  100. if (region != null)
  101. {
  102. // There is a preexisting record
  103. //
  104. // Get it's flags
  105. //
  106. OpenSim.Data.RegionFlags rflags = (OpenSim.Data.RegionFlags)Convert.ToInt32(region.Data["flags"]);
  107. // Is this a reservation?
  108. //
  109. if ((rflags & OpenSim.Data.RegionFlags.Reservation) != 0)
  110. {
  111. // Regions reserved for the null key cannot be taken.
  112. if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString())
  113. return "Region location is reserved";
  114. // Treat it as an auth request
  115. //
  116. // NOTE: Fudging the flags value here, so these flags
  117. // should not be used elsewhere. Don't optimize
  118. // this with the later retrieval of the same flags!
  119. rflags |= OpenSim.Data.RegionFlags.Authenticate;
  120. }
  121. if ((rflags & OpenSim.Data.RegionFlags.Authenticate) != 0)
  122. {
  123. // Can we authenticate at all?
  124. //
  125. if (m_AuthenticationService == null)
  126. return "No authentication possible";
  127. if (!m_AuthenticationService.Verify(new UUID(region.Data["PrincipalID"].ToString()), regionInfos.Token, 30))
  128. return "Bad authentication";
  129. }
  130. }
  131. if ((region != null) && (region.RegionID != regionInfos.RegionID))
  132. {
  133. m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.",
  134. regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID);
  135. return "Region overlaps another region";
  136. }
  137. if ((region != null) && (region.RegionID == regionInfos.RegionID) &&
  138. ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY)))
  139. {
  140. if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Data.RegionFlags.NoMove) != 0)
  141. return "Can't move this region";
  142. // Region reregistering in other coordinates. Delete the old entry
  143. m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) was previously registered at {2}-{3}. Deleting old entry.",
  144. regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
  145. try
  146. {
  147. m_Database.Delete(regionInfos.RegionID);
  148. }
  149. catch (Exception e)
  150. {
  151. m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
  152. }
  153. }
  154. if (!m_AllowDuplicateNames)
  155. {
  156. List<RegionData> dupe = m_Database.Get(regionInfos.RegionName, scopeID);
  157. if (dupe != null && dupe.Count > 0)
  158. {
  159. foreach (RegionData d in dupe)
  160. {
  161. if (d.RegionID != regionInfos.RegionID)
  162. {
  163. m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register duplicate name with ID {1}.",
  164. regionInfos.RegionName, regionInfos.RegionID);
  165. return "Duplicate region name";
  166. }
  167. }
  168. }
  169. }
  170. // Everything is ok, let's register
  171. RegionData rdata = RegionInfo2RegionData(regionInfos);
  172. rdata.ScopeID = scopeID;
  173. if (region != null)
  174. {
  175. int oldFlags = Convert.ToInt32(region.Data["flags"]);
  176. if ((oldFlags & (int)OpenSim.Data.RegionFlags.LockedOut) != 0)
  177. return "Region locked out";
  178. oldFlags &= ~(int)OpenSim.Data.RegionFlags.Reservation;
  179. rdata.Data["flags"] = oldFlags.ToString(); // Preserve flags
  180. }
  181. else
  182. {
  183. rdata.Data["flags"] = "0";
  184. if ((gridConfig != null) && rdata.RegionName != string.Empty)
  185. {
  186. int newFlags = 0;
  187. string regionName = rdata.RegionName.Trim().Replace(' ', '_');
  188. newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty));
  189. newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty));
  190. newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty));
  191. rdata.Data["flags"] = newFlags.ToString();
  192. }
  193. }
  194. int flags = Convert.ToInt32(rdata.Data["flags"]);
  195. flags |= (int)OpenSim.Data.RegionFlags.RegionOnline;
  196. rdata.Data["flags"] = flags.ToString();
  197. try
  198. {
  199. rdata.Data["last_seen"] = Util.UnixTimeSinceEpoch();
  200. m_Database.Store(rdata);
  201. }
  202. catch (Exception e)
  203. {
  204. m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
  205. }
  206. m_log.DebugFormat("[GRID SERVICE]: Region {0} ({1}) registered successfully at {2}-{3}",
  207. regionInfos.RegionName, regionInfos.RegionID, regionInfos.RegionLocX, regionInfos.RegionLocY);
  208. return String.Empty;
  209. }
  210. public bool DeregisterRegion(UUID regionID)
  211. {
  212. m_log.DebugFormat("[GRID SERVICE]: Region {0} deregistered", regionID);
  213. RegionData region = m_Database.Get(regionID, UUID.Zero);
  214. if (region == null)
  215. return false;
  216. int flags = Convert.ToInt32(region.Data["flags"]);
  217. if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0)
  218. {
  219. flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline;
  220. region.Data["flags"] = flags.ToString();
  221. region.Data["last_seen"] = Util.UnixTimeSinceEpoch();
  222. try
  223. {
  224. m_Database.Store(region);
  225. }
  226. catch (Exception e)
  227. {
  228. m_log.DebugFormat("[GRID SERVICE]: Database exception: {0}", e);
  229. }
  230. return true;
  231. }
  232. return m_Database.Delete(regionID);
  233. }
  234. public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
  235. {
  236. List<GridRegion> rinfos = new List<GridRegion>();
  237. RegionData region = m_Database.Get(regionID, scopeID);
  238. if (region != null)
  239. {
  240. // Not really? Maybe?
  241. List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize - 1, region.posY - (int)Constants.RegionSize - 1,
  242. region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
  243. foreach (RegionData rdata in rdatas)
  244. {
  245. if (rdata.RegionID != regionID)
  246. {
  247. int flags = Convert.ToInt32(rdata.Data["flags"]);
  248. if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
  249. rinfos.Add(RegionData2RegionInfo(rdata));
  250. }
  251. }
  252. m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count);
  253. }
  254. else
  255. {
  256. m_log.WarnFormat(
  257. "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found",
  258. scopeID, regionID);
  259. }
  260. return rinfos;
  261. }
  262. public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
  263. {
  264. RegionData rdata = m_Database.Get(regionID, scopeID);
  265. if (rdata != null)
  266. return RegionData2RegionInfo(rdata);
  267. return null;
  268. }
  269. public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
  270. {
  271. int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize;
  272. int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize;
  273. RegionData rdata = m_Database.Get(snapX, snapY, scopeID);
  274. if (rdata != null)
  275. return RegionData2RegionInfo(rdata);
  276. return null;
  277. }
  278. public GridRegion GetRegionByName(UUID scopeID, string name)
  279. {
  280. List<RegionData> rdatas = m_Database.Get(name, scopeID);
  281. if ((rdatas != null) && (rdatas.Count > 0))
  282. return RegionData2RegionInfo(rdatas[0]); // get the first
  283. if (m_AllowHypergridMapSearch)
  284. {
  285. GridRegion r = GetHypergridRegionByName(scopeID, name);
  286. if (r != null)
  287. return r;
  288. }
  289. return null;
  290. }
  291. public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
  292. {
  293. // m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
  294. List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);
  295. int count = 0;
  296. List<GridRegion> rinfos = new List<GridRegion>();
  297. if (rdatas != null)
  298. {
  299. // m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
  300. foreach (RegionData rdata in rdatas)
  301. {
  302. if (count++ < maxNumber)
  303. rinfos.Add(RegionData2RegionInfo(rdata));
  304. }
  305. }
  306. if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)))
  307. {
  308. GridRegion r = GetHypergridRegionByName(scopeID, name);
  309. if (r != null)
  310. rinfos.Add(r);
  311. }
  312. return rinfos;
  313. }
  314. /// <summary>
  315. /// Get a hypergrid region.
  316. /// </summary>
  317. /// <param name="scopeID"></param>
  318. /// <param name="name"></param>
  319. /// <returns>null if no hypergrid region could be found.</returns>
  320. protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
  321. {
  322. if (name.Contains("."))
  323. return m_HypergridLinker.LinkRegion(scopeID, name);
  324. else
  325. return null;
  326. }
  327. public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
  328. {
  329. int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
  330. int xmaxSnap = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize;
  331. int yminSnap = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize;
  332. int ymaxSnap = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize;
  333. List<RegionData> rdatas = m_Database.Get(xminSnap, yminSnap, xmaxSnap, ymaxSnap, scopeID);
  334. List<GridRegion> rinfos = new List<GridRegion>();
  335. foreach (RegionData rdata in rdatas)
  336. rinfos.Add(RegionData2RegionInfo(rdata));
  337. return rinfos;
  338. }
  339. #endregion
  340. #region Data structure conversions
  341. public RegionData RegionInfo2RegionData(GridRegion rinfo)
  342. {
  343. RegionData rdata = new RegionData();
  344. rdata.posX = (int)rinfo.RegionLocX;
  345. rdata.posY = (int)rinfo.RegionLocY;
  346. rdata.RegionID = rinfo.RegionID;
  347. rdata.RegionName = rinfo.RegionName;
  348. rdata.Data = rinfo.ToKeyValuePairs();
  349. rdata.Data["regionHandle"] = Utils.UIntsToLong((uint)rdata.posX, (uint)rdata.posY);
  350. rdata.Data["owner_uuid"] = rinfo.EstateOwner.ToString();
  351. return rdata;
  352. }
  353. public GridRegion RegionData2RegionInfo(RegionData rdata)
  354. {
  355. GridRegion rinfo = new GridRegion(rdata.Data);
  356. rinfo.RegionLocX = rdata.posX;
  357. rinfo.RegionLocY = rdata.posY;
  358. rinfo.RegionID = rdata.RegionID;
  359. rinfo.RegionName = rdata.RegionName;
  360. rinfo.ScopeID = rdata.ScopeID;
  361. return rinfo;
  362. }
  363. #endregion
  364. public List<GridRegion> GetDefaultRegions(UUID scopeID)
  365. {
  366. List<GridRegion> ret = new List<GridRegion>();
  367. List<RegionData> regions = m_Database.GetDefaultRegions(scopeID);
  368. foreach (RegionData r in regions)
  369. {
  370. if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
  371. ret.Add(RegionData2RegionInfo(r));
  372. }
  373. m_log.DebugFormat("[GRID SERVICE]: GetDefaultRegions returning {0} regions", ret.Count);
  374. return ret;
  375. }
  376. public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
  377. {
  378. List<GridRegion> ret = new List<GridRegion>();
  379. List<RegionData> regions = m_Database.GetFallbackRegions(scopeID, x, y);
  380. foreach (RegionData r in regions)
  381. {
  382. if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
  383. ret.Add(RegionData2RegionInfo(r));
  384. }
  385. m_log.DebugFormat("[GRID SERVICE]: Fallback returned {0} regions", ret.Count);
  386. return ret;
  387. }
  388. public List<GridRegion> GetHyperlinks(UUID scopeID)
  389. {
  390. List<GridRegion> ret = new List<GridRegion>();
  391. List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
  392. foreach (RegionData r in regions)
  393. {
  394. if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
  395. ret.Add(RegionData2RegionInfo(r));
  396. }
  397. m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
  398. return ret;
  399. }
  400. public int GetRegionFlags(UUID scopeID, UUID regionID)
  401. {
  402. RegionData region = m_Database.Get(regionID, scopeID);
  403. if (region != null)
  404. {
  405. int flags = Convert.ToInt32(region.Data["flags"]);
  406. //m_log.DebugFormat("[GRID SERVICE]: Request for flags of {0}: {1}", regionID, flags);
  407. return flags;
  408. }
  409. else
  410. return -1;
  411. }
  412. private void HandleShowRegion(string module, string[] cmd)
  413. {
  414. if (cmd.Length != 3)
  415. {
  416. MainConsole.Instance.Output("Syntax: show region <region name>");
  417. return;
  418. }
  419. List<RegionData> regions = m_Database.Get(cmd[2], UUID.Zero);
  420. if (regions == null || regions.Count < 1)
  421. {
  422. MainConsole.Instance.Output("Region not found");
  423. return;
  424. }
  425. MainConsole.Instance.Output("Region Name Region UUID");
  426. MainConsole.Instance.Output("Location URI");
  427. MainConsole.Instance.Output("Owner ID Flags");
  428. MainConsole.Instance.Output("-------------------------------------------------------------------------------");
  429. foreach (RegionData r in regions)
  430. {
  431. OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
  432. MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
  433. r.RegionName, r.RegionID,
  434. String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize),
  435. r.Data["serverURI"],
  436. r.Data["owner_uuid"], flags));
  437. }
  438. return;
  439. }
  440. private int ParseFlags(int prev, string flags)
  441. {
  442. OpenSim.Data.RegionFlags f = (OpenSim.Data.RegionFlags)prev;
  443. string[] parts = flags.Split(new char[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries);
  444. foreach (string p in parts)
  445. {
  446. int val;
  447. try
  448. {
  449. if (p.StartsWith("+"))
  450. {
  451. val = (int)Enum.Parse(typeof(OpenSim.Data.RegionFlags), p.Substring(1));
  452. f |= (OpenSim.Data.RegionFlags)val;
  453. }
  454. else if (p.StartsWith("-"))
  455. {
  456. val = (int)Enum.Parse(typeof(OpenSim.Data.RegionFlags), p.Substring(1));
  457. f &= ~(OpenSim.Data.RegionFlags)val;
  458. }
  459. else
  460. {
  461. val = (int)Enum.Parse(typeof(OpenSim.Data.RegionFlags), p);
  462. f |= (OpenSim.Data.RegionFlags)val;
  463. }
  464. }
  465. catch (Exception)
  466. {
  467. MainConsole.Instance.Output("Error in flag specification: " + p);
  468. }
  469. }
  470. return (int)f;
  471. }
  472. private void HandleSetFlags(string module, string[] cmd)
  473. {
  474. if (cmd.Length < 5)
  475. {
  476. MainConsole.Instance.Output("Syntax: set region flags <region name> <flags>");
  477. return;
  478. }
  479. List<RegionData> regions = m_Database.Get(cmd[3], UUID.Zero);
  480. if (regions == null || regions.Count < 1)
  481. {
  482. MainConsole.Instance.Output("Region not found");
  483. return;
  484. }
  485. foreach (RegionData r in regions)
  486. {
  487. int flags = Convert.ToInt32(r.Data["flags"]);
  488. flags = ParseFlags(flags, cmd[4]);
  489. r.Data["flags"] = flags.ToString();
  490. OpenSim.Data.RegionFlags f = (OpenSim.Data.RegionFlags)flags;
  491. MainConsole.Instance.Output(String.Format("Set region {0} to {1}", r.RegionName, f));
  492. m_Database.Store(r);
  493. }
  494. }
  495. }
  496. }