diff options
Diffstat (limited to 'OpenSim/Region/Environment')
11 files changed, 51 insertions, 56 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs index c7ee233..1b50bbd 100644 --- a/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/Xfer/XferModule.cs | |||
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer | |||
171 | { | 171 | { |
172 | if (Data.Length < 1000) | 172 | if (Data.Length < 1000) |
173 | { | 173 | { |
174 | // for now (testing ) we only support files under 1000 bytes | 174 | // for now (testing) we only support files under 1000 bytes |
175 | byte[] transferData = new byte[Data.Length + 4]; | 175 | byte[] transferData = new byte[Data.Length + 4]; |
176 | Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); | 176 | Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4); |
177 | Array.Copy(Data, 0, transferData, 4, Data.Length); | 177 | Array.Copy(Data, 0, transferData, 4, Data.Length); |
diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs index 0236e5f..b319370 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandObject.cs | |||
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land | |||
278 | list.Add(entry.AgentID); | 278 | list.Add(entry.AgentID); |
279 | } | 279 | } |
280 | } | 280 | } |
281 | if(list.Count == 0) | 281 | if (list.Count == 0) |
282 | { | 282 | { |
283 | list.Add(LLUUID.Zero); | 283 | list.Add(LLUUID.Zero); |
284 | } | 284 | } |
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 2900b8c..44f5c2d 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs | |||
@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
220 | } | 220 | } |
221 | protected void DebugPermissionInformation(string permissionCalled) | 221 | protected void DebugPermissionInformation(string permissionCalled) |
222 | { | 222 | { |
223 | if(m_debugPermissions) | 223 | if (m_debugPermissions) |
224 | m_log.Info("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); | 224 | m_log.Info("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName); |
225 | } | 225 | } |
226 | 226 | ||
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions | |||
240 | if (user != LLUUID.Zero) | 240 | if (user != LLUUID.Zero) |
241 | { | 241 | { |
242 | LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers; | 242 | LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers; |
243 | foreach(LLUUID estatemanager in estatemanagers) | 243 | foreach (LLUUID estatemanager in estatemanagers) |
244 | { | 244 | { |
245 | if (estatemanager == user) | 245 | if (estatemanager == user) |
246 | return true; | 246 | return true; |
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 0314562..beb74ce 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Modules | |||
65 | private double d_day_length = 4; // A VW day is 4 RW hours long | 65 | private double d_day_length = 4; // A VW day is 4 RW hours long |
66 | private int d_year_length = 60; // There are 60 VW days in a VW year | 66 | private int d_year_length = 60; // There are 60 VW days in a VW year |
67 | private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3 | 67 | private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3 |
68 | private double d_longitude = -73.53; | 68 | private double d_longitude = -73.53; |
69 | private double d_latitude = 41.29; | 69 | private double d_latitude = 41.29; |
70 | 70 | ||
71 | // Frame counter | 71 | // Frame counter |
@@ -155,48 +155,44 @@ namespace OpenSim.Region.Environment.Modules | |||
155 | m_longitude = d_longitude; | 155 | m_longitude = d_longitude; |
156 | } | 156 | } |
157 | 157 | ||
158 | switch(m_mode) | 158 | switch (m_mode) |
159 | { | 159 | { |
160 | case "T1": | ||
161 | default: | ||
162 | case "SL": | ||
163 | // Time taken to complete a cycle (day and season) | ||
160 | 164 | ||
161 | case "T1" : | 165 | SecondsPerSunCycle = (uint) (m_day_length * 60 * 60); |
166 | SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length); | ||
162 | 167 | ||
163 | default : | 168 | // Ration of real-to-virtual time |
164 | 169 | ||
165 | case "SL" : | 170 | VWTimeRatio = 24/m_day_length; |
166 | // Time taken to complete a cycle (day and season) | ||
167 | 171 | ||
168 | SecondsPerSunCycle = (uint) (m_day_length * 60 * 60); | 172 | // Speed of rotation needed to complete a cycle in the |
169 | SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length); | 173 | // designated period (day and season) |
170 | 174 | ||
171 | // Ration of real-to-virtual time | 175 | SunSpeed = SunCycle/SecondsPerSunCycle; |
176 | SeasonSpeed = SeasonalCycle/SecondsPerYear; | ||
172 | 177 | ||
173 | VWTimeRatio = 24/m_day_length; | 178 | // Horizon translation |
174 | 179 | ||
175 | // Speed of rotation needed to complete a cycle in the | 180 | HorizonShift = m_day_night; // Z axis translation |
176 | // designated period (day and season) | 181 | HoursToRadians = (SunCycle/24)*VWTimeRatio; |
177 | 182 | ||
178 | SunSpeed = SunCycle/SecondsPerSunCycle; | 183 | // Insert our event handling hooks |
179 | SeasonSpeed = SeasonalCycle/SecondsPerYear; | ||
180 | 184 | ||
181 | // Horizon translation | 185 | scene.EventManager.OnFrame += SunUpdate; |
186 | scene.EventManager.OnNewClient += SunToClient; | ||
182 | 187 | ||
183 | HorizonShift = m_day_night; // Z axis translation | 188 | ready = true; |
184 | HoursToRadians = (SunCycle/24)*VWTimeRatio; | ||
185 | 189 | ||
186 | // Insert our event handling hooks | 190 | m_log.Debug("[SUN] Mode is "+m_mode); |
187 | 191 | m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days"); | |
188 | scene.EventManager.OnFrame += SunUpdate; | 192 | m_log.Debug("[SUN] Axis offset is "+m_day_night); |
189 | scene.EventManager.OnNewClient += SunToClient; | 193 | m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames"); |
190 | |||
191 | ready = true; | ||
192 | |||
193 | m_log.Debug("[SUN] Mode is "+m_mode); | ||
194 | m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days"); | ||
195 | m_log.Debug("[SUN] Axis offset is "+m_day_night); | ||
196 | m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames"); | ||
197 | 194 | ||
198 | break; | 195 | break; |
199 | |||
200 | } | 196 | } |
201 | } | 197 | } |
202 | 198 | ||
@@ -224,21 +220,20 @@ namespace OpenSim.Region.Environment.Modules | |||
224 | 220 | ||
225 | public void SunToClient(IClientAPI client) | 221 | public void SunToClient(IClientAPI client) |
226 | { | 222 | { |
227 | if(m_mode != "T1") | 223 | if (m_mode != "T1") |
228 | { | 224 | { |
229 | if(ready) | 225 | if (ready) |
230 | { | 226 | { |
231 | GenSunPos(); // Generate shared values once | 227 | GenSunPos(); // Generate shared values once |
232 | client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); | 228 | client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); |
233 | m_log.Debug("[SUN] Initial update for new client"); | 229 | m_log.Debug("[SUN] Initial update for new client"); |
234 | } | 230 | } |
235 | } | 231 | } |
236 | } | 232 | } |
237 | 233 | ||
238 | public void SunUpdate() | 234 | public void SunUpdate() |
239 | { | 235 | { |
240 | 236 | if (((m_frame++%m_frame_mod) != 0) || !ready) | |
241 | if(((m_frame++%m_frame_mod) != 0) || !ready) | ||
242 | { | 237 | { |
243 | return; | 238 | return; |
244 | } | 239 | } |
@@ -253,7 +248,6 @@ namespace OpenSim.Region.Environment.Modules | |||
253 | 248 | ||
254 | // set estate settings for region access to sun position | 249 | // set estate settings for region access to sun position |
255 | m_scene.RegionInfo.EstateSettings.sunPosition = Position; | 250 | m_scene.RegionInfo.EstateSettings.sunPosition = Position; |
256 | |||
257 | } | 251 | } |
258 | 252 | ||
259 | /// <summary> | 253 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 49ce341..efd258d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -596,7 +596,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
596 | ScenePresence presence; | 596 | ScenePresence presence; |
597 | TryGetAvatar(remoteClient.AgentId, out presence); | 597 | TryGetAvatar(remoteClient.AgentId, out presence); |
598 | byte[] data = null; | 598 | byte[] data = null; |
599 | if(invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum | 599 | if (invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum |
600 | { | 600 | { |
601 | LLVector3 pos=presence.AbsolutePosition; | 601 | LLVector3 pos=presence.AbsolutePosition; |
602 | string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n", | 602 | string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n", |
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
996 | permissionToDelete = false; //Just taking copy! | 996 | permissionToDelete = false; //Just taking copy! |
997 | 997 | ||
998 | } | 998 | } |
999 | else if(DeRezPacket.AgentBlock.Destination == 4) //Take | 999 | else if (DeRezPacket.AgentBlock.Destination == 4) //Take |
1000 | { | 1000 | { |
1001 | // Take | 1001 | // Take |
1002 | permissionToTake = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); | 1002 | permissionToTake = ExternalChecks.ExternalChecksCanTakeObject(((SceneObjectGroup)selectedEnt).UUID, remoteClient.AgentId); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index c9274dd..f922f1f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -452,7 +452,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
452 | d); | 452 | d); |
453 | } | 453 | } |
454 | 454 | ||
455 | public delegate void SendCloseChildAgentDelegate( LLUUID agentID, List<ulong> regionlst); | 455 | public delegate void SendCloseChildAgentDelegate(LLUUID agentID, List<ulong> regionlst); |
456 | 456 | ||
457 | /// <summary> | 457 | /// <summary> |
458 | /// This Closes child agents on neighboring regions | 458 | /// This Closes child agents on neighboring regions |
@@ -568,7 +568,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
568 | // assume local regions are always up | 568 | // assume local regions are always up |
569 | destRegionUp = true; | 569 | destRegionUp = true; |
570 | } | 570 | } |
571 | if(destRegionUp) | 571 | |
572 | if (destRegionUp) | ||
572 | { | 573 | { |
573 | avatar.Close(); | 574 | avatar.Close(); |
574 | 575 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs index 285ee0d..99d19df 100644 --- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs +++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
51 | 51 | ||
52 | public void addCheckRezObject(CanRezObject delegateFunc) | 52 | public void addCheckRezObject(CanRezObject delegateFunc) |
53 | { | 53 | { |
54 | if(!CanRezObjectCheckFunctions.Contains(delegateFunc)) | 54 | if (!CanRezObjectCheckFunctions.Contains(delegateFunc)) |
55 | CanRezObjectCheckFunctions.Add(delegateFunc); | 55 | CanRezObjectCheckFunctions.Add(delegateFunc); |
56 | } | 56 | } |
57 | public void removeCheckRezObject(CanRezObject delegateFunc) | 57 | public void removeCheckRezObject(CanRezObject delegateFunc) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 8603ccc..1f1f39f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs | |||
@@ -313,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
313 | { | 313 | { |
314 | foreach (Scene mscene in m_localScenes) | 314 | foreach (Scene mscene in m_localScenes) |
315 | { | 315 | { |
316 | if((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && | 316 | if ((mscene.RegionInfo.InternalEndPoint.Equals(ipEndPoint.Address)) && |
317 | (mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)) | 317 | (mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)) |
318 | { | 318 | { |
319 | scene = mscene; | 319 | scene = mscene; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index 1dbac52..9a9314c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs | |||
@@ -263,7 +263,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
263 | { | 263 | { |
264 | foreach (TaskInventoryItem item in m_taskInventory.Values) | 264 | foreach (TaskInventoryItem item in m_taskInventory.Values) |
265 | { | 265 | { |
266 | if(item.Name == name) | 266 | if (item.Name == name) |
267 | return true; | 267 | return true; |
268 | } | 268 | } |
269 | return false; | 269 | return false; |
@@ -271,14 +271,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
271 | 271 | ||
272 | private string FindAvailableInventoryName(string name) | 272 | private string FindAvailableInventoryName(string name) |
273 | { | 273 | { |
274 | if(!InventoryContainsName(name)) | 274 | if (!InventoryContainsName(name)) |
275 | return name; | 275 | return name; |
276 | 276 | ||
277 | int suffix=1; | 277 | int suffix=1; |
278 | while(suffix < 256) | 278 | while (suffix < 256) |
279 | { | 279 | { |
280 | string tryName=String.Format("{0} {1}", name, suffix); | 280 | string tryName=String.Format("{0} {1}", name, suffix); |
281 | if(!InventoryContainsName(tryName)) | 281 | if (!InventoryContainsName(tryName)) |
282 | return tryName; | 282 | return tryName; |
283 | suffix++; | 283 | suffix++; |
284 | } | 284 | } |
@@ -296,7 +296,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
296 | item.ParentPartID = UUID; | 296 | item.ParentPartID = UUID; |
297 | 297 | ||
298 | string name=FindAvailableInventoryName(item.Name); | 298 | string name=FindAvailableInventoryName(item.Name); |
299 | if(name == String.Empty) | 299 | if (name == String.Empty) |
300 | return; | 300 | return; |
301 | 301 | ||
302 | item.Name=name; | 302 | item.Name=name; |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 9502627..6c5a68d 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -2049,7 +2049,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2049 | data[pos] = (byte)pTexAnim.SizeY; pos++; | 2049 | data[pos] = (byte)pTexAnim.SizeY; pos++; |
2050 | 2050 | ||
2051 | Helpers.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); | 2051 | Helpers.FloatToBytes(pTexAnim.Start).CopyTo(data, pos); |
2052 | Helpers.FloatToBytes(pTexAnim.Length ).CopyTo(data, pos + 4); | 2052 | Helpers.FloatToBytes(pTexAnim.Length).CopyTo(data, pos + 4); |
2053 | Helpers.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); | 2053 | Helpers.FloatToBytes(pTexAnim.Rate).CopyTo(data, pos + 8); |
2054 | 2054 | ||
2055 | m_TextureAnimation = data; | 2055 | m_TextureAnimation = data; |
@@ -2495,7 +2495,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2495 | (int) (color.x*0xff), | 2495 | (int) (color.x*0xff), |
2496 | (int) (color.y*0xff), | 2496 | (int) (color.y*0xff), |
2497 | (int) (color.z*0xff)); | 2497 | (int) (color.z*0xff)); |
2498 | SetText( text ); | 2498 | SetText(text); |
2499 | } | 2499 | } |
2500 | 2500 | ||
2501 | public int registerTargetWaypoint(LLVector3 target, float tolerance) | 2501 | public int registerTargetWaypoint(LLVector3 target, float tolerance) |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 6f0fbdf..2901a97 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -1263,7 +1263,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1263 | //bool colliding = (m_physicsActor.IsColliding==true); | 1263 | //bool colliding = (m_physicsActor.IsColliding==true); |
1264 | //if (controlland) | 1264 | //if (controlland) |
1265 | // m_log.Info("[AGENT]: landCommand"); | 1265 | // m_log.Info("[AGENT]: landCommand"); |
1266 | //if (colliding ) | 1266 | //if (colliding) |
1267 | // m_log.Info("[AGENT]: colliding"); | 1267 | // m_log.Info("[AGENT]: colliding"); |
1268 | //if (m_physicsActor.Flying && colliding && controlland) | 1268 | //if (m_physicsActor.Flying && colliding && controlland) |
1269 | //{ | 1269 | //{ |