OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
LandChannel.cs
Go to the documentation of this file.
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  public const float BAN_LINE_SAFETY_HEIGHT = 100;
41  //Land types set with flags in ParcelOverlay.
42  //Only one of these can be used.
43 
44 
45  //RequestResults (I think these are right, they seem to work):
46  public const int LAND_RESULT_MULTIPLE = 1; // The request they made contained more than a single peice of land
47  public const int LAND_RESULT_SINGLE = 0; // The request they made contained only a single piece of land
48 
49  //ParcelSelectObjects
50  public const int LAND_SELECT_OBJECTS_OWNER = 2;
51  public const int LAND_SELECT_OBJECTS_GROUP = 4;
52  public const int LAND_SELECT_OBJECTS_OTHER = 8;
53 
54 
55  public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000
56  // types 1 to 7 are exclusive
57  public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001
58  public const byte LAND_TYPE_OWNED_BY_GROUP = 2; //Equals 00000010
59  public const byte LAND_TYPE_OWNED_BY_REQUESTER = 3; //Equals 00000011
60  public const byte LAND_TYPE_IS_FOR_SALE = 4; //Equals 00000100
61  public const byte LAND_TYPE_IS_BEING_AUCTIONED = 5; //Equals 00000101
62  public const byte LAND_TYPE_unused6 = 6;
63  public const byte LAND_TYPE_unused7 = 7;
64  // next are flags
65  public const byte LAND_FLAG_unused8 = 0x08; // this may become excluside in future
66  public const byte LAND_FLAG_HIDEAVATARS = 0x10;
67  public const byte LAND_FLAG_LOCALSOUND = 0x20;
68  public const byte LAND_FLAG_PROPERTY_BORDER_WEST = 0x40; //Equals 01000000
69  public const byte LAND_FLAG_PROPERTY_BORDER_SOUTH = 0x80; //Equals 10000000
70 
71 
72  //These are other constants. Yay!
73  public const int START_LAND_LOCAL_ID = 1;
74 
75  #endregion
76 
77  private readonly Scene m_scene;
78  private readonly LandManagementModule m_landManagementModule;
79 
80  public LandChannel(Scene scene, LandManagementModule landManagementMod)
81  {
82  m_scene = scene;
83  m_landManagementModule = landManagementMod;
84  }
85 
86  #region ILandChannel Members
87 
88  public ILandObject GetLandObject(float x_float, float y_float)
89  {
90  if (m_landManagementModule != null)
91  {
92  return m_landManagementModule.GetLandObject(x_float, y_float);
93  }
94 
95  ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
96  obj.LandData.Name = "NO LAND";
97  return obj;
98  }
99 
100  public ILandObject GetLandObject(int localID)
101  {
102  if (m_landManagementModule != null)
103  {
104  return m_landManagementModule.GetLandObject(localID);
105  }
106  return null;
107  }
108 
109  public ILandObject GetLandObject(Vector3 position)
110  {
111  return GetLandObject(position.X, position.Y);
112  }
113 
114  public ILandObject GetLandObject(int x, int y)
115  {
116  if (m_landManagementModule != null)
117  {
118  return m_landManagementModule.GetLandObject(x, y);
119  }
120 
121  ILandObject obj = new LandObject(UUID.Zero, false, m_scene);
122  obj.LandData.Name = "NO LAND";
123  return obj;
124  }
125 
126  public List<ILandObject> AllParcels()
127  {
128  if (m_landManagementModule != null)
129  {
130  return m_landManagementModule.AllParcels();
131  }
132 
133  return new List<ILandObject>();
134  }
135 
136  public void Clear(bool setupDefaultParcel)
137  {
138  if (m_landManagementModule != null)
139  m_landManagementModule.Clear(setupDefaultParcel);
140  }
141 
142  public List<ILandObject> ParcelsNearPoint(Vector3 position)
143  {
144  if (m_landManagementModule != null)
145  {
146  return m_landManagementModule.ParcelsNearPoint(position);
147  }
148 
149  return new List<ILandObject>();
150  }
151 
152  public bool IsForcefulBansAllowed()
153  {
154  if (m_landManagementModule != null)
155  {
156  return m_landManagementModule.AllowedForcefulBans;
157  }
158 
159  return false;
160  }
161 
162  public void UpdateLandObject(int localID, LandData data)
163  {
164  if (m_landManagementModule != null)
165  {
166  m_landManagementModule.UpdateLandObject(localID, data);
167  }
168  }
169 
170  public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id)
171  {
172  if (m_landManagementModule != null)
173  {
174  m_landManagementModule.Join(start_x, start_y, end_x, end_y, attempting_user_id);
175  }
176  }
177 
178  public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id)
179  {
180  if (m_landManagementModule != null)
181  {
182  m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id);
183  }
184  }
185 
186  public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
187  {
188  if (m_landManagementModule != null)
189  {
190  m_landManagementModule.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient);
191  }
192  }
193 
195  {
196  if (m_landManagementModule != null)
197  {
198  m_landManagementModule.setParcelObjectMaxOverride(overrideDel);
199  }
200  }
201 
203  {
204  if (m_landManagementModule != null)
205  {
206  m_landManagementModule.setSimulatorObjectMaxOverride(overrideDel);
207  }
208  }
209 
210  public void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime)
211  {
212  if (m_landManagementModule != null)
213  {
214  m_landManagementModule.setParcelOtherCleanTime(remoteClient, localID, otherCleanTime);
215  }
216  }
217  public void sendClientInitialLandInfo(IClientAPI remoteClient)
218  {
219  if (m_landManagementModule != null)
220  {
221  m_landManagementModule.sendClientInitialLandInfo(remoteClient);
222  }
223  }
224  #endregion
225  }
226 }
ILandObject GetLandObject(int x, int y)
Get the parcel at the specified point
Definition: LandChannel.cs:114
ILandObject GetLandObject(int localID)
Get the parcel given the land's local id.
Definition: LandChannel.cs:100
void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id)
Definition: LandChannel.cs:178
void setParcelObjectMaxOverride(overrideParcelMaxPrimCountDelegate overrideDel)
Definition: LandChannel.cs:194
void SetParcelOtherCleanTime(IClientAPI remoteClient, int localID, int otherCleanTime)
Definition: LandChannel.cs:210
void setSimulatorObjectMaxOverride(overrideSimulatorMaxPrimCountDelegate overrideDel)
Definition: LandChannel.cs:202
void sendClientInitialLandInfo(IClientAPI remoteClient)
Definition: LandChannel.cs:217
ILandObject GetLandObject(Vector3 position)
Get the parcel at the specified point
Definition: LandChannel.cs:109
void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id)
Definition: LandChannel.cs:170
Keeps track of a specific piece of land's information
Definition: LandObject.cs:43
ILandObject GetLandObject(float x_float, float y_float)
Get the parcel at the specified point
Definition: LandChannel.cs:88
Details of a Parcel of land
Definition: LandData.cs:47
LandChannel(Scene scene, LandManagementModule landManagementMod)
Definition: LandChannel.cs:80
delegate int overrideParcelMaxPrimCountDelegate(ILandObject obj)
void UpdateLandObject(int localID, LandData data)
Definition: LandChannel.cs:162
delegate int overrideSimulatorMaxPrimCountDelegate(ILandObject obj)
void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
Definition: LandChannel.cs:186
List< ILandObject > AllParcels()
Get all parcels
Definition: LandChannel.cs:126
List< ILandObject > ParcelsNearPoint(Vector3 position)
Get the parcels near the specified point
Definition: LandChannel.cs:142
void Clear(bool setupDefaultParcel)
Clear the land channel of all parcels.
Definition: LandChannel.cs:136