diff options
author | Melanie | 2010-01-15 21:35:10 +0000 |
---|---|---|
committer | Melanie | 2010-01-15 21:35:10 +0000 |
commit | d49cc7ca905a54f72707e5fa728c4dfa68a514fb (patch) | |
tree | 00ec04c293d103d5fec264294ac6432705f234fb /OpenSim/Services | |
parent | Implement the NoMove behavior. Cause Reservation flag to be reset on (diff) | |
download | opensim-SC-d49cc7ca905a54f72707e5fa728c4dfa68a514fb.zip opensim-SC-d49cc7ca905a54f72707e5fa728c4dfa68a514fb.tar.gz opensim-SC-d49cc7ca905a54f72707e5fa728c4dfa68a514fb.tar.bz2 opensim-SC-d49cc7ca905a54f72707e5fa728c4dfa68a514fb.tar.xz |
Implement "Reservation" flag behavior.
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 6e2c0d7..6826940 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -90,6 +90,40 @@ namespace OpenSim.Services.GridService | |||
90 | // This needs better sanity testing. What if regionInfo is registering in | 90 | // This needs better sanity testing. What if regionInfo is registering in |
91 | // overlapping coords? | 91 | // overlapping coords? |
92 | RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); | 92 | RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); |
93 | if (region != null) | ||
94 | { | ||
95 | // There is a preexisting record | ||
96 | // | ||
97 | // Get it's flags | ||
98 | // | ||
99 | OpenSim.Data.RegionFlags rflags = (OpenSim.Data.RegionFlags)Convert.ToInt32(region.Data["Flags"]); | ||
100 | |||
101 | // Is this a reservation? | ||
102 | // | ||
103 | if ((rflags & OpenSim.Data.RegionFlags.Reservation) != 0) | ||
104 | { | ||
105 | // Regions reserved for the null key cannot be taken. | ||
106 | // | ||
107 | if (region.Data["PrincipalID"] == UUID.Zero.ToString()) | ||
108 | return false; | ||
109 | |||
110 | // Treat it as an auth request | ||
111 | // | ||
112 | // NOTE: Fudging the flags value here, so these flags | ||
113 | // should not be used elsewhere. Don't optimize | ||
114 | // this with the later retrieval of the same flags! | ||
115 | // | ||
116 | rflags |= OpenSim.Data.RegionFlags.Authenticate; | ||
117 | } | ||
118 | |||
119 | if ((rflags & OpenSim.Data.RegionFlags.Authenticate) != 0) | ||
120 | { | ||
121 | // TODO: Authenticate the principal | ||
122 | |||
123 | return false; | ||
124 | } | ||
125 | } | ||
126 | |||
93 | if ((region != null) && (region.RegionID != regionInfos.RegionID)) | 127 | if ((region != null) && (region.RegionID != regionInfos.RegionID)) |
94 | { | 128 | { |
95 | m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.", | 129 | m_log.WarnFormat("[GRID SERVICE]: Region {0} tried to register in coordinates {1}, {2} which are already in use in scope {3}.", |