opensim – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | eva | 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 | |||
28 | using System.Collections.Generic; |
||
29 | using OpenMetaverse; |
||
30 | using OpenSim.Framework; |
||
31 | using OpenSim.Region.Framework.Interfaces; |
||
32 | using OpenSim.Region.Framework.Scenes; |
||
33 | |||
34 | namespace OpenSim.Region.CoreModules.World.Land |
||
35 | { |
||
36 | public class LandChannel : ILandChannel |
||
37 | { |
||
38 | #region Constants |
||
39 | |||
40 | //Land types set with flags in ParcelOverlay. |
||
41 | //Only one of these can be used. |
||
42 | public const float BAN_LINE_SAFETY_HIEGHT = 100; |
||
43 | public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 128; //Equals 10000000 |
||
44 | public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 64; //Equals 01000000 |
||
45 | |||
46 | //RequestResults (I think these are right, they seem to work): |
||
47 | public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land |
||
48 | public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land |
||
49 | |||
50 | //ParcelSelectObjects |
||
51 | public const int LAND_SELECT_OBJECTS_GROUP = 4; |
||
52 | public const int LAND_SELECT_OBJECTS_OTHER = 8; |
||
53 | public const int LAND_SELECT_OBJECTS_OWNER = 2; |
||
54 | public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101 |
||
55 | public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100 |
||
56 | public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010 |
||
57 | public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 |
||
58 | public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011 |
||
59 | public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 |
||
60 | |||
61 | //These are other constants. Yay! |
||
62 | public const int START_LAND_LOCAL_ID = 1; |
||
63 | |||
64 | #endregion |
||
65 | |||
66 | private readonly Scene m_scene; |
||
67 | private readonly LandManagementModule m_landManagementModule; |
||
68 | |||
69 | public LandChannel(Scene scene, LandManagementModule landManagementMod) |
||
70 | { |
||
71 | m_scene = scene; |
||
72 | m_landManagementModule = landManagementMod; |
||
73 | } |
||
74 | |||
75 | #region ILandChannel Members |
||
76 | |||
77 | public ILandObject GetLandObject(float x_float, float y_float) |
||
78 | { |
||
79 | if (m_landManagementModule != null) |
||
80 | { |
||
81 | return m_landManagementModule.GetLandObject(x_float, y_float); |
||
82 | } |
||
83 | |||
84 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
||
85 | obj.LandData.Name = "NO LAND"; |
||
86 | return obj; |
||
87 | } |
||
88 | |||
89 | public ILandObject GetLandObject(int localID) |
||
90 | { |
||
91 | if (m_landManagementModule != null) |
||
92 | { |
||
93 | return m_landManagementModule.GetLandObject(localID); |
||
94 | } |
||
95 | return null; |
||
96 | } |
||
97 | |||
98 | public ILandObject GetLandObject(Vector3 position) |
||
99 | { |
||
100 | return GetLandObject(position.X, position.Y); |
||
101 | } |
||
102 | |||
103 | public ILandObject GetLandObject(int x, int y) |
||
104 | { |
||
105 | if (m_landManagementModule != null) |
||
106 | { |
||
107 | return m_landManagementModule.GetLandObject(x, y); |
||
108 | } |
||
109 | |||
110 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
||
111 | obj.LandData.Name = "NO LAND"; |
||
112 | return obj; |
||
113 | } |
||
114 | |||
115 | public List<ILandObject> AllParcels() |
||
116 | { |
||
117 | if (m_landManagementModule != null) |
||
118 | { |
||
119 | return m_landManagementModule.AllParcels(); |
||
120 | } |
||
121 | |||
122 | return new List<ILandObject>(); |
||
123 | } |
||
124 | |||
125 | public void Clear(bool setupDefaultParcel) |
||
126 | { |
||
127 | if (m_landManagementModule != null) |
||
128 | m_landManagementModule.Clear(setupDefaultParcel); |
||
129 | } |
||
130 | |||
131 | public List<ILandObject> ParcelsNearPoint(Vector3 position) |
||
132 | { |
||
133 | if (m_landManagementModule != null) |
||
134 | { |
||
135 | return m_landManagementModule.ParcelsNearPoint(position); |
||
136 | } |
||
137 | |||
138 | return new List<ILandObject>(); |
||
139 | } |
||
140 | |||
141 | public bool IsForcefulBansAllowed() |
||
142 | { |
||
143 | if (m_landManagementModule != null) |
||
144 | { |
||
145 | return m_landManagementModule.AllowedForcefulBans; |
||
146 | } |
||
147 | |||
148 | return false; |
||
149 | } |
||
150 | |||
151 | public void UpdateLandObject(int localID, LandData data) |
||
152 | { |
||
153 | if (m_landManagementModule != null) |
||
154 | { |
||
155 | m_landManagementModule.UpdateLandObject(localID, data); |
||
156 | } |
||
157 | } |
||
158 | |||
159 | public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) |
||
160 | { |
||
161 | if (m_landManagementModule != null) |
||
162 | { |
||
163 | m_landManagementModule.Join(start_x, start_y, end_x, end_y, attempting_user_id); |
||
164 | } |
||
165 | } |
||
166 | |||
167 | public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) |
||
168 | { |
||
169 | if (m_landManagementModule != null) |
||
170 | { |
||
171 | m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); |
||
172 | } |
||
173 | } |
||
174 | |||
175 | public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) |
||
176 | { |
||
177 | if (m_landManagementModule != null) |
||
178 | { |
||
179 | m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); |
||
180 | } |
||
181 | } |
||
182 | |||
183 | public void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel) |
||
184 | { |
||
185 | if (m_landManagementModule != null) |
||
186 | { |
||
187 | m_landManagementModule.setParcelObjectMaxOverride(overrideDel); |
||
188 | } |
||
189 | } |
||
190 | |||
191 | public void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel) |
||
192 | { |
||
193 | if (m_landManagementModule != null) |
||
194 | { |
||
195 | m_landManagementModule.setSimulatorObjectMaxOverride(overrideDel); |
||
196 | } |
||
197 | } |
||
198 | |||
199 | public void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime) |
||
200 | { |
||
201 | if (m_landManagementModule != null) |
||
202 | { |
||
203 | m_landManagementModule.setParcelOtherCleanTime(remoteClient, localID, otherCleanTime); |
||
204 | } |
||
205 | } |
||
206 | |||
207 | #endregion |
||
208 | } |
||
209 | } |