diff options
author | Justin Clark-Casey (justincc) | 2012-10-09 01:35:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-10-09 01:35:27 +0100 |
commit | 73c9abf5f2e2017bf924d6183502e337d28a7232 (patch) | |
tree | 07fd1ab2e9aef88412f37d8023bb7a903bb79047 /OpenSim/Services/GridService/GridService.cs | |
parent | Merge branch 'master' of git://opensimulator.org/git/opensim (diff) | |
download | opensim-SC-73c9abf5f2e2017bf924d6183502e337d28a7232.zip opensim-SC-73c9abf5f2e2017bf924d6183502e337d28a7232.tar.gz opensim-SC-73c9abf5f2e2017bf924d6183502e337d28a7232.tar.bz2 opensim-SC-73c9abf5f2e2017bf924d6183502e337d28a7232.tar.xz |
Move OpenSim.Data.RegionFlags -> OpenSim.Framework.RegionFlags to make it easier for other code to use (e.g. LSL_Api) without having to reference OpenSim.Data just for this.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 5bdea06..ee3b858 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -151,11 +151,11 @@ namespace OpenSim.Services.GridService | |||
151 | // | 151 | // |
152 | // Get it's flags | 152 | // Get it's flags |
153 | // | 153 | // |
154 | OpenSim.Data.RegionFlags rflags = (OpenSim.Data.RegionFlags)Convert.ToInt32(region.Data["flags"]); | 154 | OpenSim.Framework.RegionFlags rflags = (OpenSim.Framework.RegionFlags)Convert.ToInt32(region.Data["flags"]); |
155 | 155 | ||
156 | // Is this a reservation? | 156 | // Is this a reservation? |
157 | // | 157 | // |
158 | if ((rflags & OpenSim.Data.RegionFlags.Reservation) != 0) | 158 | if ((rflags & OpenSim.Framework.RegionFlags.Reservation) != 0) |
159 | { | 159 | { |
160 | // Regions reserved for the null key cannot be taken. | 160 | // Regions reserved for the null key cannot be taken. |
161 | if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) | 161 | if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) |
@@ -166,10 +166,10 @@ namespace OpenSim.Services.GridService | |||
166 | // NOTE: Fudging the flags value here, so these flags | 166 | // NOTE: Fudging the flags value here, so these flags |
167 | // should not be used elsewhere. Don't optimize | 167 | // should not be used elsewhere. Don't optimize |
168 | // this with the later retrieval of the same flags! | 168 | // this with the later retrieval of the same flags! |
169 | rflags |= OpenSim.Data.RegionFlags.Authenticate; | 169 | rflags |= OpenSim.Framework.RegionFlags.Authenticate; |
170 | } | 170 | } |
171 | 171 | ||
172 | if ((rflags & OpenSim.Data.RegionFlags.Authenticate) != 0) | 172 | if ((rflags & OpenSim.Framework.RegionFlags.Authenticate) != 0) |
173 | { | 173 | { |
174 | // Can we authenticate at all? | 174 | // Can we authenticate at all? |
175 | // | 175 | // |
@@ -205,10 +205,10 @@ namespace OpenSim.Services.GridService | |||
205 | if ((region != null) && (region.RegionID == regionInfos.RegionID) && | 205 | if ((region != null) && (region.RegionID == regionInfos.RegionID) && |
206 | ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) | 206 | ((region.posX != regionInfos.RegionLocX) || (region.posY != regionInfos.RegionLocY))) |
207 | { | 207 | { |
208 | if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Data.RegionFlags.NoMove) != 0) | 208 | if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.NoMove) != 0) |
209 | return "Can't move this region"; | 209 | return "Can't move this region"; |
210 | 210 | ||
211 | if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Data.RegionFlags.LockedOut) != 0) | 211 | if ((Convert.ToInt32(region.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.LockedOut) != 0) |
212 | return "Region locked out"; | 212 | return "Region locked out"; |
213 | 213 | ||
214 | // Region reregistering in other coordinates. Delete the old entry | 214 | // Region reregistering in other coordinates. Delete the old entry |
@@ -233,7 +233,7 @@ namespace OpenSim.Services.GridService | |||
233 | { | 233 | { |
234 | int oldFlags = Convert.ToInt32(region.Data["flags"]); | 234 | int oldFlags = Convert.ToInt32(region.Data["flags"]); |
235 | 235 | ||
236 | oldFlags &= ~(int)OpenSim.Data.RegionFlags.Reservation; | 236 | oldFlags &= ~(int)OpenSim.Framework.RegionFlags.Reservation; |
237 | 237 | ||
238 | rdata.Data["flags"] = oldFlags.ToString(); // Preserve flags | 238 | rdata.Data["flags"] = oldFlags.ToString(); // Preserve flags |
239 | } | 239 | } |
@@ -252,7 +252,7 @@ namespace OpenSim.Services.GridService | |||
252 | } | 252 | } |
253 | 253 | ||
254 | int flags = Convert.ToInt32(rdata.Data["flags"]); | 254 | int flags = Convert.ToInt32(rdata.Data["flags"]); |
255 | flags |= (int)OpenSim.Data.RegionFlags.RegionOnline; | 255 | flags |= (int)OpenSim.Framework.RegionFlags.RegionOnline; |
256 | rdata.Data["flags"] = flags.ToString(); | 256 | rdata.Data["flags"] = flags.ToString(); |
257 | 257 | ||
258 | try | 258 | try |
@@ -283,9 +283,9 @@ namespace OpenSim.Services.GridService | |||
283 | 283 | ||
284 | int flags = Convert.ToInt32(region.Data["flags"]); | 284 | int flags = Convert.ToInt32(region.Data["flags"]); |
285 | 285 | ||
286 | if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Data.RegionFlags.Persistent) != 0) | 286 | if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) |
287 | { | 287 | { |
288 | flags &= ~(int)OpenSim.Data.RegionFlags.RegionOnline; | 288 | flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; |
289 | region.Data["flags"] = flags.ToString(); | 289 | region.Data["flags"] = flags.ToString(); |
290 | region.Data["last_seen"] = Util.UnixTimeSinceEpoch(); | 290 | region.Data["last_seen"] = Util.UnixTimeSinceEpoch(); |
291 | try | 291 | try |
@@ -320,7 +320,7 @@ namespace OpenSim.Services.GridService | |||
320 | if (rdata.RegionID != regionID) | 320 | if (rdata.RegionID != regionID) |
321 | { | 321 | { |
322 | int flags = Convert.ToInt32(rdata.Data["flags"]); | 322 | int flags = Convert.ToInt32(rdata.Data["flags"]); |
323 | if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours | 323 | if ((flags & (int)Framework.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours |
324 | rinfos.Add(RegionData2RegionInfo(rdata)); | 324 | rinfos.Add(RegionData2RegionInfo(rdata)); |
325 | } | 325 | } |
326 | } | 326 | } |
@@ -470,7 +470,7 @@ namespace OpenSim.Services.GridService | |||
470 | 470 | ||
471 | foreach (RegionData r in regions) | 471 | foreach (RegionData r in regions) |
472 | { | 472 | { |
473 | if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0) | 473 | if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.RegionOnline) != 0) |
474 | ret.Add(RegionData2RegionInfo(r)); | 474 | ret.Add(RegionData2RegionInfo(r)); |
475 | } | 475 | } |
476 | 476 | ||
@@ -486,7 +486,7 @@ namespace OpenSim.Services.GridService | |||
486 | 486 | ||
487 | foreach (RegionData r in regions) | 487 | foreach (RegionData r in regions) |
488 | { | 488 | { |
489 | if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0) | 489 | if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.RegionOnline) != 0) |
490 | ret.Add(RegionData2RegionInfo(r)); | 490 | ret.Add(RegionData2RegionInfo(r)); |
491 | } | 491 | } |
492 | 492 | ||
@@ -502,7 +502,7 @@ namespace OpenSim.Services.GridService | |||
502 | 502 | ||
503 | foreach (RegionData r in regions) | 503 | foreach (RegionData r in regions) |
504 | { | 504 | { |
505 | if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0) | 505 | if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.RegionOnline) != 0) |
506 | ret.Add(RegionData2RegionInfo(r)); | 506 | ret.Add(RegionData2RegionInfo(r)); |
507 | } | 507 | } |
508 | 508 | ||
@@ -629,7 +629,7 @@ namespace OpenSim.Services.GridService | |||
629 | 629 | ||
630 | private void OutputRegionToConsole(RegionData r) | 630 | private void OutputRegionToConsole(RegionData r) |
631 | { | 631 | { |
632 | OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); | 632 | OpenSim.Framework.RegionFlags flags = (OpenSim.Framework.RegionFlags)Convert.ToInt32(r.Data["flags"]); |
633 | 633 | ||
634 | ConsoleDisplayList dispList = new ConsoleDisplayList(); | 634 | ConsoleDisplayList dispList = new ConsoleDisplayList(); |
635 | dispList.AddRow("Region Name", r.RegionName); | 635 | dispList.AddRow("Region Name", r.RegionName); |
@@ -659,7 +659,7 @@ namespace OpenSim.Services.GridService | |||
659 | 659 | ||
660 | foreach (RegionData r in regions) | 660 | foreach (RegionData r in regions) |
661 | { | 661 | { |
662 | OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]); | 662 | OpenSim.Framework.RegionFlags flags = (OpenSim.Framework.RegionFlags)Convert.ToInt32(r.Data["flags"]); |
663 | dispTable.AddRow( | 663 | dispTable.AddRow( |
664 | r.RegionName, | 664 | r.RegionName, |
665 | r.RegionID.ToString(), | 665 | r.RegionID.ToString(), |
@@ -673,7 +673,7 @@ namespace OpenSim.Services.GridService | |||
673 | 673 | ||
674 | private int ParseFlags(int prev, string flags) | 674 | private int ParseFlags(int prev, string flags) |
675 | { | 675 | { |
676 | OpenSim.Data.RegionFlags f = (OpenSim.Data.RegionFlags)prev; | 676 | OpenSim.Framework.RegionFlags f = (OpenSim.Framework.RegionFlags)prev; |
677 | 677 | ||
678 | string[] parts = flags.Split(new char[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries); | 678 | string[] parts = flags.Split(new char[] {',', ' '}, StringSplitOptions.RemoveEmptyEntries); |
679 | 679 | ||
@@ -685,18 +685,18 @@ namespace OpenSim.Services.GridService | |||
685 | { | 685 | { |
686 | if (p.StartsWith("+")) | 686 | if (p.StartsWith("+")) |
687 | { | 687 | { |
688 | val = (int)Enum.Parse(typeof(OpenSim.Data.RegionFlags), p.Substring(1)); | 688 | val = (int)Enum.Parse(typeof(OpenSim.Framework.RegionFlags), p.Substring(1)); |
689 | f |= (OpenSim.Data.RegionFlags)val; | 689 | f |= (OpenSim.Framework.RegionFlags)val; |
690 | } | 690 | } |
691 | else if (p.StartsWith("-")) | 691 | else if (p.StartsWith("-")) |
692 | { | 692 | { |
693 | val = (int)Enum.Parse(typeof(OpenSim.Data.RegionFlags), p.Substring(1)); | 693 | val = (int)Enum.Parse(typeof(OpenSim.Framework.RegionFlags), p.Substring(1)); |
694 | f &= ~(OpenSim.Data.RegionFlags)val; | 694 | f &= ~(OpenSim.Framework.RegionFlags)val; |
695 | } | 695 | } |
696 | else | 696 | else |
697 | { | 697 | { |
698 | val = (int)Enum.Parse(typeof(OpenSim.Data.RegionFlags), p); | 698 | val = (int)Enum.Parse(typeof(OpenSim.Framework.RegionFlags), p); |
699 | f |= (OpenSim.Data.RegionFlags)val; | 699 | f |= (OpenSim.Framework.RegionFlags)val; |
700 | } | 700 | } |
701 | } | 701 | } |
702 | catch (Exception) | 702 | catch (Exception) |
@@ -728,7 +728,7 @@ namespace OpenSim.Services.GridService | |||
728 | int flags = Convert.ToInt32(r.Data["flags"]); | 728 | int flags = Convert.ToInt32(r.Data["flags"]); |
729 | flags = ParseFlags(flags, cmd[4]); | 729 | flags = ParseFlags(flags, cmd[4]); |
730 | r.Data["flags"] = flags.ToString(); | 730 | r.Data["flags"] = flags.ToString(); |
731 | OpenSim.Data.RegionFlags f = (OpenSim.Data.RegionFlags)flags; | 731 | OpenSim.Framework.RegionFlags f = (OpenSim.Framework.RegionFlags)flags; |
732 | 732 | ||
733 | MainConsole.Instance.Output(String.Format("Set region {0} to {1}", r.RegionName, f)); | 733 | MainConsole.Instance.Output(String.Format("Set region {0} to {1}", r.RegionName, f)); |
734 | m_Database.Store(r); | 734 | m_Database.Store(r); |