aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorBlueWall2011-12-05 15:29:00 -0500
committerBlueWall2011-12-05 15:29:00 -0500
commit2d3dda6db391d0b74459ba0b4d77e13078b76913 (patch)
treeb3391ff60a778b6809742cb0d1e53a67ece1b63c /OpenSim/Region
parentMerge branch 'master' of /home/opensim/var/repo/opensim (diff)
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-2d3dda6db391d0b74459ba0b4d77e13078b76913.zip
opensim-SC_OLD-2d3dda6db391d0b74459ba0b4d77e13078b76913.tar.gz
opensim-SC_OLD-2d3dda6db391d0b74459ba0b4d77e13078b76913.tar.bz2
opensim-SC_OLD-2d3dda6db391d0b74459ba0b4d77e13078b76913.tar.xz
Merge branch 'master' of /home/opensim/var/repo/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs1
-rw-r--r--OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs90
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs151
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs36
8 files changed, 150 insertions, 153 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 4b38a2e..8d98cc9 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -1039,7 +1039,7 @@ namespace OpenSim
1039 { 1039 {
1040 //this.HttpServer. 1040 //this.HttpServer.
1041 acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); 1041 acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
1042 foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.AgentCircuits.Values) 1042 foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values)
1043 acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root")); 1043 acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root"));
1044 } 1044 }
1045 ); 1045 );
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 99064c8..2f947fd 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1341,7 +1341,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1341 1341
1342 string reason = String.Empty; 1342 string reason = String.Empty;
1343 1343
1344
1345 bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason); 1344 bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
1346 1345
1347 if (regionAccepted && newAgent) 1346 if (regionAccepted && newAgent)
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
index f2c8b3d..18bd018 100644
--- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
355 // I'm pretty sure noone whats to set fullbright true if it wasn't true before. 355 // I'm pretty sure noone whats to set fullbright true if it wasn't true before.
356 // tmptex.DefaultTexture.Fullbright = true; 356 // tmptex.DefaultTexture.Fullbright = true;
357 357
358 part.UpdateTexture(tmptex); 358 part.UpdateTextureEntry(tmptex.GetBytes());
359 } 359 }
360 360
361 if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0)) 361 if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0))
@@ -437,4 +437,4 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
437 437
438 #endregion 438 #endregion
439 } 439 }
440} \ No newline at end of file 440}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
index cd7d6bc..b286d17 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
@@ -31,11 +31,10 @@ using System.IO;
31using System.Reflection; 31using System.Reflection;
32using System.Threading; 32using System.Threading;
33using log4net.Config; 33using log4net.Config;
34using Nini.Config;
34using NUnit.Framework; 35using NUnit.Framework;
35using OpenMetaverse; 36using OpenMetaverse;
36using OpenSim.Framework; 37using OpenSim.Framework;
37using Nini.Config;
38
39using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; 38using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
40using OpenSim.Region.Framework.Scenes; 39using OpenSim.Region.Framework.Scenes;
41using GridRegion = OpenSim.Services.Interfaces.GridRegion; 40using GridRegion = OpenSim.Services.Interfaces.GridRegion;
@@ -69,6 +68,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
69 [Test] 68 [Test]
70 public void TestRegisterRegion() 69 public void TestRegisterRegion()
71 { 70 {
71 TestHelpers.InMethod();
72// log4net.Config.XmlConfigurator.Configure();
73
72 SetUp(); 74 SetUp();
73 75
74 // Create 4 regions 76 // Create 4 regions
@@ -191,7 +193,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
191 results = m_LocalConnector.GetHyperlinks(UUID.Zero); 193 results = m_LocalConnector.GetHyperlinks(UUID.Zero);
192 Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); 194 Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
193 Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); 195 Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
194
195 } 196 }
196 } 197 }
197} 198} \ No newline at end of file
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 24322a1..c8b39a4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3178,7 +3178,10 @@ namespace OpenSim.Region.Framework.Scenes
3178 /// <param name="face"></param> 3178 /// <param name="face"></param>
3179 public void SetFaceColor(Vector3 color, int face) 3179 public void SetFaceColor(Vector3 color, int face)
3180 { 3180 {
3181 Primitive.TextureEntry tex = Shape.Textures; 3181 // The only way to get a deep copy/ If we don't do this, we can
3182 // mever detect color changes further down.
3183 Byte[] buf = Shape.Textures.GetBytes();
3184 Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
3182 Color4 texcolor; 3185 Color4 texcolor;
3183 if (face >= 0 && face < GetNumberOfSides()) 3186 if (face >= 0 && face < GetNumberOfSides())
3184 { 3187 {
@@ -3187,8 +3190,7 @@ namespace OpenSim.Region.Framework.Scenes
3187 texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f); 3190 texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
3188 texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); 3191 texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
3189 tex.FaceTextures[face].RGBA = texcolor; 3192 tex.FaceTextures[face].RGBA = texcolor;
3190 UpdateTexture(tex); 3193 UpdateTextureEntry(tex.GetBytes());
3191 TriggerScriptChangedEvent(Changed.COLOR);
3192 return; 3194 return;
3193 } 3195 }
3194 else if (face == ALL_SIDES) 3196 else if (face == ALL_SIDES)
@@ -3209,8 +3211,7 @@ namespace OpenSim.Region.Framework.Scenes
3209 texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); 3211 texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
3210 tex.DefaultTexture.RGBA = texcolor; 3212 tex.DefaultTexture.RGBA = texcolor;
3211 } 3213 }
3212 UpdateTexture(tex); 3214 UpdateTextureEntry(tex.GetBytes());
3213 TriggerScriptChangedEvent(Changed.COLOR);
3214 return; 3215 return;
3215 } 3216 }
3216 } 3217 }
@@ -3272,9 +3273,14 @@ namespace OpenSim.Region.Framework.Scenes
3272 if (hasHollow) ret += 1; 3273 if (hasHollow) ret += 1;
3273 break; 3274 break;
3274 case PrimType.SCULPT: 3275 case PrimType.SCULPT:
3275 ret = 1; 3276 // Special mesh handling
3277 if (Shape.SculptType == (byte)SculptType.Mesh)
3278 ret = 8; // if it's a mesh then max 8 faces
3279 else
3280 ret = 1; // if it's a sculpt then max 1 face
3276 break; 3281 break;
3277 } 3282 }
3283
3278 return ret; 3284 return ret;
3279 } 3285 }
3280 3286
@@ -3287,6 +3293,7 @@ namespace OpenSim.Region.Framework.Scenes
3287 { 3293 {
3288 if (Shape.SculptEntry) 3294 if (Shape.SculptEntry)
3289 return PrimType.SCULPT; 3295 return PrimType.SCULPT;
3296
3290 if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) 3297 if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
3291 { 3298 {
3292 if (Shape.PathCurve == (byte)Extrusion.Straight) 3299 if (Shape.PathCurve == (byte)Extrusion.Straight)
@@ -4532,48 +4539,49 @@ namespace OpenSim.Region.Framework.Scenes
4532 } 4539 }
4533 4540
4534 /// <summary> 4541 /// <summary>
4535 /// Update the textures on the part.
4536 /// </summary>
4537 /// <remarks>
4538 /// Added to handle bug in libsecondlife's TextureEntry.ToBytes()
4539 /// not handling RGBA properly. Cycles through, and "fixes" the color
4540 /// info
4541 /// </remarks>
4542 /// <param name="tex"></param>
4543 public void UpdateTexture(Primitive.TextureEntry tex)
4544 {
4545 //Color4 tmpcolor;
4546 //for (uint i = 0; i < 32; i++)
4547 //{
4548 // if (tex.FaceTextures[i] != null)
4549 // {
4550 // tmpcolor = tex.GetFace((uint) i).RGBA;
4551 // tmpcolor.A = tmpcolor.A*255;
4552 // tmpcolor.R = tmpcolor.R*255;
4553 // tmpcolor.G = tmpcolor.G*255;
4554 // tmpcolor.B = tmpcolor.B*255;
4555 // tex.FaceTextures[i].RGBA = tmpcolor;
4556 // }
4557 //}
4558 //tmpcolor = tex.DefaultTexture.RGBA;
4559 //tmpcolor.A = tmpcolor.A*255;
4560 //tmpcolor.R = tmpcolor.R*255;
4561 //tmpcolor.G = tmpcolor.G*255;
4562 //tmpcolor.B = tmpcolor.B*255;
4563 //tex.DefaultTexture.RGBA = tmpcolor;
4564 UpdateTextureEntry(tex.GetBytes());
4565 }
4566
4567 /// <summary>
4568 /// Update the texture entry for this part. 4542 /// Update the texture entry for this part.
4569 /// </summary> 4543 /// </summary>
4570 /// <param name="textureEntry"></param> 4544 /// <param name="textureEntry"></param>
4571 public void UpdateTextureEntry(byte[] textureEntry) 4545 public void UpdateTextureEntry(byte[] textureEntry)
4572 { 4546 {
4573 m_shape.TextureEntry = textureEntry; 4547 Primitive.TextureEntry newTex = new Primitive.TextureEntry(textureEntry, 0, textureEntry.Length);
4574 TriggerScriptChangedEvent(Changed.TEXTURE); 4548 Primitive.TextureEntry oldTex = Shape.Textures;
4575 4549
4550 Changed changeFlags = 0;
4551
4552 for (int i = 0 ; i < GetNumberOfSides(); i++)
4553 {
4554 Primitive.TextureEntryFace newFace = newTex.DefaultTexture;
4555 Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture;
4556
4557 if (oldTex.FaceTextures[i] != null)
4558 oldFace = oldTex.FaceTextures[i];
4559 if (newTex.FaceTextures[i] != null)
4560 newFace = newTex.FaceTextures[i];
4561
4562 Color4 oldRGBA = oldFace.RGBA;
4563 Color4 newRGBA = newFace.RGBA;
4564
4565 if (oldRGBA.R != newRGBA.R ||
4566 oldRGBA.G != newRGBA.G ||
4567 oldRGBA.B != newRGBA.B ||
4568 oldRGBA.A != newRGBA.A)
4569 changeFlags |= Changed.COLOR;
4570
4571 if (oldFace.TextureID != newFace.TextureID)
4572 changeFlags |= Changed.TEXTURE;
4573
4574 // Max change, skip the rest of testing
4575 if (changeFlags == (Changed.TEXTURE | Changed.COLOR))
4576 break;
4577 }
4578
4579 m_shape.TextureEntry = textureEntry;
4580 if (changeFlags != 0)
4581 TriggerScriptChangedEvent(changeFlags);
4582 UpdateFlag = UpdateRequired.FULL;
4576 ParentGroup.HasGroupChanged = true; 4583 ParentGroup.HasGroupChanged = true;
4584
4577 //This is madness.. 4585 //This is madness..
4578 //ParentGroup.ScheduleGroupForFullUpdate(); 4586 //ParentGroup.ScheduleGroupForFullUpdate();
4579 //This is sparta 4587 //This is sparta
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
index f0bbf0b..d4c299f 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs
@@ -31,7 +31,7 @@ using System.Reflection;
31using System.Text; 31using System.Text;
32using System.Threading; 32using System.Threading;
33using System.Timers; 33using System.Timers;
34using Timer=System.Timers.Timer; 34using Timer = System.Timers.Timer;
35using Nini.Config; 35using Nini.Config;
36using NUnit.Framework; 36using NUnit.Framework;
37using OpenMetaverse; 37using OpenMetaverse;
@@ -39,11 +39,13 @@ using OpenSim.Framework;
39using OpenSim.Framework.Communications; 39using OpenSim.Framework.Communications;
40using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.ClientStack.Linden;
42using OpenSim.Region.CoreModules.Framework.EntityTransfer; 43using OpenSim.Region.CoreModules.Framework.EntityTransfer;
43using OpenSim.Region.CoreModules.World.Serialiser; 44using OpenSim.Region.CoreModules.World.Serialiser;
44using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; 45using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
45using OpenSim.Tests.Common; 46using OpenSim.Tests.Common;
46using OpenSim.Tests.Common.Mock; 47using OpenSim.Tests.Common.Mock;
48using GridRegion = OpenSim.Services.Interfaces.GridRegion;
47 49
48namespace OpenSim.Region.Framework.Scenes.Tests 50namespace OpenSim.Region.Framework.Scenes.Tests
49{ 51{
@@ -103,21 +105,71 @@ namespace OpenSim.Region.Framework.Scenes.Tests
103 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1)); 105 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
104 106
105 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null); 107 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
108 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
106 109
107 scene.IncomingCloseAgent(sp.UUID); 110 scene.IncomingCloseAgent(sp.UUID);
108 111
109 Assert.That(scene.GetScenePresence(sp.UUID), Is.Null); 112 Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
110 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null); 113 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
114 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0));
115 }
116
117 [Test]
118 public void TestCreateChildScenePresence()
119 {
120 TestHelpers.InMethod();
121// log4net.Config.XmlConfigurator.Configure();
122
123 LocalSimulationConnectorModule lsc = new LocalSimulationConnectorModule();
124
125 IConfigSource configSource = new IniConfigSource();
126 IConfig config = configSource.AddConfig("Modules");
127 config.Set("SimulationServices", "LocalSimulationConnectorModule");
128
129 TestScene scene = SceneHelpers.SetupScene();
130 SceneHelpers.SetupSceneModules(scene, configSource, lsc);
131
132 UUID agentId = TestHelpers.ParseTail(0x01);
133 AgentCircuitData acd = SceneHelpers.GenerateAgentData(agentId);
134 acd.child = true;
135
136 GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName);
137 string reason;
138
139 // *** This is the first stage, when a neighbouring region is told that a viewer is about to try and
140 // establish a child scene presence. We pass in the circuit code that the client has to connect with ***
141 // XXX: ViaLogin may not be correct here.
142 scene.SimulationService.CreateAgent(region, acd, (uint)TeleportFlags.ViaLogin, out reason);
143
144 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
145 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
146
147 // There's no scene presence yet since only an agent circuit has been established.
148 Assert.That(scene.GetScenePresence(agentId), Is.Null);
149
150 // *** This is the second stage, where the client established a child agent/scene presence using the
151 // circuit code given to the scene in stage 1 ***
152 TestClient client = new TestClient(acd, scene);
153 scene.AddNewClient(client, PresenceType.User);
154
155 Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
156 Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
157
158 ScenePresence sp = scene.GetScenePresence(agentId);
159 Assert.That(sp, Is.Not.Null);
160 Assert.That(sp.UUID, Is.EqualTo(agentId));
161 Assert.That(sp.IsChildAgent, Is.True);
111 } 162 }
112 163
113 /// <summary> 164 /// <summary>
114 /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region 165 /// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
115 /// </summary> 166 /// </summary>
116 /// <remarks> 167 /// <remarks>
117 /// Please note that unlike the other tests here, this doesn't rely on structures 168 /// Please note that unlike the other tests here, this doesn't rely on anything set up in the instance fields.
169 /// INCOMPLETE
118 /// </remarks> 170 /// </remarks>
119 [Test] 171 [Test]
120 public void TestChildAgentEstablished() 172 public void TestChildAgentEstablishedInNeighbour()
121 { 173 {
122 TestHelpers.InMethod(); 174 TestHelpers.InMethod();
123// log4net.Config.XmlConfigurator.Configure(); 175// log4net.Config.XmlConfigurator.Configure();
@@ -125,18 +177,25 @@ namespace OpenSim.Region.Framework.Scenes.Tests
125 UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); 177 UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
126 178
127 TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); 179 TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
128// TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); 180 TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
129 181
130 IConfigSource configSource = new IniConfigSource(); 182 IConfigSource configSource = new IniConfigSource();
131 configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); 183 IConfig config = configSource.AddConfig("Startup");
184 config.Set("serverside_object_permissions", true);
185 config.Set("EventQueue", true);
186
132 EntityTransferModule etm = new EntityTransferModule(); 187 EntityTransferModule etm = new EntityTransferModule();
188
189 EventQueueGetModule eqgm1 = new EventQueueGetModule();
190 SceneHelpers.SetupSceneModules(myScene1, configSource, etm, eqgm1);
191
192 EventQueueGetModule eqgm2 = new EventQueueGetModule();
193 SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2);
133 194
134 SceneHelpers.SetupSceneModules(myScene1, configSource, etm); 195// SceneHelpers.AddScenePresence(myScene1, agent1Id);
135
136 SceneHelpers.AddScenePresence(myScene1, agent1Id);
137// ScenePresence childPresence = myScene2.GetScenePresence(agent1); 196// ScenePresence childPresence = myScene2.GetScenePresence(agent1);
138 197//
139 // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents 198// // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
140// Assert.That(childPresence, Is.Not.Null); 199// Assert.That(childPresence, Is.Not.Null);
141// Assert.That(childPresence.IsChildAgent, Is.True); 200// Assert.That(childPresence.IsChildAgent, Is.True);
142 } 201 }
@@ -194,48 +253,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
194// Assert.That(presence, Is.Null, "presence is not null"); 253// Assert.That(presence, Is.Null, "presence is not null");
195// } 254// }
196 255
197 [Test]
198 public void T012_TestAddNeighbourRegion()
199 {
200 TestHelpers.InMethod();
201
202 string reason;
203
204 if (acd1 == null)
205 fixNullPresence();
206
207 scene.NewUserConnection(acd1, 0, out reason);
208 if (testclient == null)
209 testclient = new TestClient(acd1, scene);
210 scene.AddNewClient(testclient, PresenceType.User);
211
212 ScenePresence presence = scene.GetScenePresence(agent1);
213 presence.MakeRootAgent(new Vector3(90,90,90),false);
214
215 string cap = presence.ControllingClient.RequestClientInfo().CapsPath;
216
217 presence.AddNeighbourRegion(region2, cap);
218 presence.AddNeighbourRegion(region3, cap);
219
220 Assert.That(presence.KnownRegionCount, Is.EqualTo(2));
221 }
222
223 [Test]
224 public void T013_TestRemoveNeighbourRegion()
225 {
226 TestHelpers.InMethod();
227
228 ScenePresence presence = scene.GetScenePresence(agent1);
229 presence.RemoveNeighbourRegion(region3);
230
231 Assert.That(presence.KnownRegionCount,Is.EqualTo(1));
232 /*
233 presence.MakeChildAgent;
234 presence.MakeRootAgent;
235 CompleteAvatarMovement
236 */
237 }
238
239 // I'm commenting this test because it does not represent 256 // I'm commenting this test because it does not represent
240 // crossings. The Thread.Sleep's in here are not meaningful mocks, 257 // crossings. The Thread.Sleep's in here are not meaningful mocks,
241 // and they sometimes fail in panda. 258 // and they sometimes fail in panda.
@@ -338,33 +355,5 @@ namespace OpenSim.Region.Framework.Scenes.Tests
338 Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected."); 355 Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected.");
339 Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again."); 356 Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again.");
340 } 357 }
341
342 public void fixNullPresence()
343 {
344 string firstName = "testfirstname";
345
346 AgentCircuitData agent = new AgentCircuitData();
347 agent.AgentID = agent1;
348 agent.firstname = firstName;
349 agent.lastname = "testlastname";
350 agent.SessionID = UUID.Zero;
351 agent.SecureSessionID = UUID.Zero;
352 agent.circuitcode = 123;
353 agent.BaseFolder = UUID.Zero;
354 agent.InventoryFolder = UUID.Zero;
355 agent.startpos = Vector3.Zero;
356 agent.CapsPath = GetRandomCapsObjectPath();
357 agent.Appearance = new AvatarAppearance();
358
359 acd1 = agent;
360 }
361
362 public static string GetRandomCapsObjectPath()
363 {
364 UUID caps = UUID.Random();
365 string capsPath = caps.ToString();
366 capsPath = capsPath.Remove(capsPath.Length - 4, 4);
367 return capsPath;
368 }
369 } 358 }
370} \ No newline at end of file 359} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs
index 0cba6af..cea738c 100644
--- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs
@@ -55,7 +55,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
55 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face); 55 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
56 texface.RGBA = new Color4(value.R,value.G,value.B,value.A); 56 texface.RGBA = new Color4(value.R,value.G,value.B,value.A);
57 tex.FaceTextures[m_face] = texface; 57 tex.FaceTextures[m_face] = texface;
58 m_parent.UpdateTexture(tex); 58 m_parent.UpdateTextureEntry(tex.GetBytes());
59 } 59 }
60 } 60 }
61 61
@@ -72,7 +72,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
72 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face); 72 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
73 texface.TextureID = value; 73 texface.TextureID = value;
74 tex.FaceTextures[m_face] = texface; 74 tex.FaceTextures[m_face] = texface;
75 m_parent.UpdateTexture(tex); 75 m_parent.UpdateTextureEntry(tex.GetBytes());
76 } 76 }
77 } 77 }
78 78
@@ -97,7 +97,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
97 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face); 97 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
98 texface.Fullbright = value; 98 texface.Fullbright = value;
99 tex.FaceTextures[m_face] = texface; 99 tex.FaceTextures[m_face] = texface;
100 m_parent.UpdateTexture(tex); 100 m_parent.UpdateTextureEntry(tex.GetBytes());
101 } 101 }
102 } 102 }
103 103
@@ -110,7 +110,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
110 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face); 110 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
111 texface.Glow = (float) value; 111 texface.Glow = (float) value;
112 tex.FaceTextures[m_face] = texface; 112 tex.FaceTextures[m_face] = texface;
113 m_parent.UpdateTexture(tex); 113 m_parent.UpdateTextureEntry(tex.GetBytes());
114 } 114 }
115 } 115 }
116 116
@@ -123,7 +123,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
123 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face); 123 Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
124 texface.Shiny = value ? Shininess.High : Shininess.None; 124 texface.Shiny = value ? Shininess.High : Shininess.None;
125 tex.FaceTextures[m_face] = texface; 125 tex.FaceTextures[m_face] = texface;
126 m_parent.UpdateTexture(tex); 126 m_parent.UpdateTextureEntry(tex.GetBytes());
127 } 127 }
128 } 128 }
129 129
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6c418df..6d067b0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1424,7 +1424,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1424 { 1424 {
1425 tex.CreateFace((uint) face); 1425 tex.CreateFace((uint) face);
1426 tex.FaceTextures[face].TexMapType = textype; 1426 tex.FaceTextures[face].TexMapType = textype;
1427 part.UpdateTexture(tex); 1427 part.UpdateTextureEntry(tex.GetBytes());
1428 return; 1428 return;
1429 } 1429 }
1430 else if (face == ScriptBaseClass.ALL_SIDES) 1430 else if (face == ScriptBaseClass.ALL_SIDES)
@@ -1437,7 +1437,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1437 } 1437 }
1438 tex.DefaultTexture.TexMapType = textype; 1438 tex.DefaultTexture.TexMapType = textype;
1439 } 1439 }
1440 part.UpdateTexture(tex); 1440 part.UpdateTextureEntry(tex.GetBytes());
1441 return; 1441 return;
1442 } 1442 }
1443 } 1443 }
@@ -1449,7 +1449,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1449 { 1449 {
1450 tex.CreateFace((uint) face); 1450 tex.CreateFace((uint) face);
1451 tex.FaceTextures[face].Glow = glow; 1451 tex.FaceTextures[face].Glow = glow;
1452 part.UpdateTexture(tex); 1452 part.UpdateTextureEntry(tex.GetBytes());
1453 return; 1453 return;
1454 } 1454 }
1455 else if (face == ScriptBaseClass.ALL_SIDES) 1455 else if (face == ScriptBaseClass.ALL_SIDES)
@@ -1462,7 +1462,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1462 } 1462 }
1463 tex.DefaultTexture.Glow = glow; 1463 tex.DefaultTexture.Glow = glow;
1464 } 1464 }
1465 part.UpdateTexture(tex); 1465 part.UpdateTextureEntry(tex.GetBytes());
1466 return; 1466 return;
1467 } 1467 }
1468 } 1468 }
@@ -1497,7 +1497,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1497 tex.CreateFace((uint) face); 1497 tex.CreateFace((uint) face);
1498 tex.FaceTextures[face].Shiny = sval; 1498 tex.FaceTextures[face].Shiny = sval;
1499 tex.FaceTextures[face].Bump = bump; 1499 tex.FaceTextures[face].Bump = bump;
1500 part.UpdateTexture(tex); 1500 part.UpdateTextureEntry(tex.GetBytes());
1501 return; 1501 return;
1502 } 1502 }
1503 else if (face == ScriptBaseClass.ALL_SIDES) 1503 else if (face == ScriptBaseClass.ALL_SIDES)
@@ -1512,7 +1512,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1512 tex.DefaultTexture.Shiny = sval; 1512 tex.DefaultTexture.Shiny = sval;
1513 tex.DefaultTexture.Bump = bump; 1513 tex.DefaultTexture.Bump = bump;
1514 } 1514 }
1515 part.UpdateTexture(tex); 1515 part.UpdateTextureEntry(tex.GetBytes());
1516 return; 1516 return;
1517 } 1517 }
1518 } 1518 }
@@ -1524,7 +1524,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1524 { 1524 {
1525 tex.CreateFace((uint) face); 1525 tex.CreateFace((uint) face);
1526 tex.FaceTextures[face].Fullbright = bright; 1526 tex.FaceTextures[face].Fullbright = bright;
1527 part.UpdateTexture(tex); 1527 part.UpdateTextureEntry(tex.GetBytes());
1528 return; 1528 return;
1529 } 1529 }
1530 else if (face == ScriptBaseClass.ALL_SIDES) 1530 else if (face == ScriptBaseClass.ALL_SIDES)
@@ -1537,7 +1537,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1537 } 1537 }
1538 } 1538 }
1539 tex.DefaultTexture.Fullbright = bright; 1539 tex.DefaultTexture.Fullbright = bright;
1540 part.UpdateTexture(tex); 1540 part.UpdateTextureEntry(tex.GetBytes());
1541 return; 1541 return;
1542 } 1542 }
1543 } 1543 }
@@ -1593,7 +1593,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1593 texcolor = tex.CreateFace((uint)face).RGBA; 1593 texcolor = tex.CreateFace((uint)face).RGBA;
1594 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f); 1594 texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
1595 tex.FaceTextures[face].RGBA = texcolor; 1595 tex.FaceTextures[face].RGBA = texcolor;
1596 part.UpdateTexture(tex); 1596 part.UpdateTextureEntry(tex.GetBytes());
1597 return; 1597 return;
1598 } 1598 }
1599 else if (face == ScriptBaseClass.ALL_SIDES) 1599 else if (face == ScriptBaseClass.ALL_SIDES)
@@ -1617,7 +1617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1617 tex.DefaultTexture.RGBA = texcolor; 1617 tex.DefaultTexture.RGBA = texcolor;
1618 } 1618 }
1619 1619
1620 part.UpdateTexture(tex); 1620 part.UpdateTextureEntry(tex.GetBytes());
1621 return; 1621 return;
1622 } 1622 }
1623 } 1623 }
@@ -1774,7 +1774,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1774 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); 1774 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
1775 texface.TextureID = textureID; 1775 texface.TextureID = textureID;
1776 tex.FaceTextures[face] = texface; 1776 tex.FaceTextures[face] = texface;
1777 part.UpdateTexture(tex); 1777 part.UpdateTextureEntry(tex.GetBytes());
1778 return; 1778 return;
1779 } 1779 }
1780 else if (face == ScriptBaseClass.ALL_SIDES) 1780 else if (face == ScriptBaseClass.ALL_SIDES)
@@ -1787,7 +1787,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1787 } 1787 }
1788 } 1788 }
1789 tex.DefaultTexture.TextureID = textureID; 1789 tex.DefaultTexture.TextureID = textureID;
1790 part.UpdateTexture(tex); 1790 part.UpdateTextureEntry(tex.GetBytes());
1791 return; 1791 return;
1792 } 1792 }
1793 } 1793 }
@@ -1809,7 +1809,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1809 texface.RepeatU = (float)u; 1809 texface.RepeatU = (float)u;
1810 texface.RepeatV = (float)v; 1810 texface.RepeatV = (float)v;
1811 tex.FaceTextures[face] = texface; 1811 tex.FaceTextures[face] = texface;
1812 part.UpdateTexture(tex); 1812 part.UpdateTextureEntry(tex.GetBytes());
1813 return; 1813 return;
1814 } 1814 }
1815 if (face == ScriptBaseClass.ALL_SIDES) 1815 if (face == ScriptBaseClass.ALL_SIDES)
@@ -1824,7 +1824,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1824 } 1824 }
1825 tex.DefaultTexture.RepeatU = (float)u; 1825 tex.DefaultTexture.RepeatU = (float)u;
1826 tex.DefaultTexture.RepeatV = (float)v; 1826 tex.DefaultTexture.RepeatV = (float)v;
1827 part.UpdateTexture(tex); 1827 part.UpdateTextureEntry(tex.GetBytes());
1828 return; 1828 return;
1829 } 1829 }
1830 } 1830 }
@@ -1845,7 +1845,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1845 texface.OffsetU = (float)u; 1845 texface.OffsetU = (float)u;
1846 texface.OffsetV = (float)v; 1846 texface.OffsetV = (float)v;
1847 tex.FaceTextures[face] = texface; 1847 tex.FaceTextures[face] = texface;
1848 part.UpdateTexture(tex); 1848 part.UpdateTextureEntry(tex.GetBytes());
1849 return; 1849 return;
1850 } 1850 }
1851 if (face == ScriptBaseClass.ALL_SIDES) 1851 if (face == ScriptBaseClass.ALL_SIDES)
@@ -1860,7 +1860,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1860 } 1860 }
1861 tex.DefaultTexture.OffsetU = (float)u; 1861 tex.DefaultTexture.OffsetU = (float)u;
1862 tex.DefaultTexture.OffsetV = (float)v; 1862 tex.DefaultTexture.OffsetV = (float)v;
1863 part.UpdateTexture(tex); 1863 part.UpdateTextureEntry(tex.GetBytes());
1864 return; 1864 return;
1865 } 1865 }
1866 } 1866 }
@@ -1880,7 +1880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1880 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face); 1880 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
1881 texface.Rotation = (float)rotation; 1881 texface.Rotation = (float)rotation;
1882 tex.FaceTextures[face] = texface; 1882 tex.FaceTextures[face] = texface;
1883 part.UpdateTexture(tex); 1883 part.UpdateTextureEntry(tex.GetBytes());
1884 return; 1884 return;
1885 } 1885 }
1886 if (face == ScriptBaseClass.ALL_SIDES) 1886 if (face == ScriptBaseClass.ALL_SIDES)
@@ -1893,7 +1893,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1893 } 1893 }
1894 } 1894 }
1895 tex.DefaultTexture.Rotation = (float)rotation; 1895 tex.DefaultTexture.Rotation = (float)rotation;
1896 part.UpdateTexture(tex); 1896 part.UpdateTextureEntry(tex.GetBytes());
1897 return; 1897 return;
1898 } 1898 }
1899 } 1899 }