From 0ac68093433635652466a072d7057d956168dfe7 Mon Sep 17 00:00:00 2001
From: MW
Date: Fri, 13 Jul 2007 16:53:31 +0000
Subject: Think SceneObject/Primitive copying should now work, just need to
hook it up to a event and test.
---
OpenSim/Region/Environment/Scenes/Scene.cs | 20 ++++++++++----------
OpenSim/Region/Environment/Scenes/SceneObject.cs | 11 +++++------
2 files changed, 15 insertions(+), 16 deletions(-)
(limited to 'OpenSim/Region/Environment')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 417f817..c8714ae 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -355,7 +355,7 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- private void CreateTerrainTexture()
+ public void CreateTerrainTexture()
{
//create a texture asset of the terrain
byte[] data = this.Terrain.exportJpegImage("defaultstripe.png");
@@ -446,6 +446,15 @@ namespace OpenSim.Region.Environment.Scenes
///
public override void AddNewClient(IClientAPI client, bool child)
{
+ SubscribeToClientEvents(client);
+ this.estateManager.sendRegionHandshake(client);
+ CreateAndAddScenePresence(client);
+ this.parcelManager.sendParcelOverlay(client);
+
+ }
+
+ protected override void SubscribeToClientEvents(IClientAPI client)
+ {
client.OnRegionHandShakeReply += this.SendLayerData;
//remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims);
client.OnChatFromViewer += this.SimChat;
@@ -475,14 +484,6 @@ namespace OpenSim.Region.Environment.Scenes
client.OnParcelJoinRequest += new ParcelJoinRequest(parcelManager.handleParcelJoinRequest);
client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(parcelManager.handleParcelPropertiesUpdateRequest);
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(estateManager.handleEstateOwnerMessage);
-
-
- this.estateManager.sendRegionHandshake(client);
- CreateAndAddScenePresence(client);
-
- this.parcelManager.sendParcelOverlay(client);
-
- return;
}
protected void CreateAndAddScenePresence(IClientAPI client)
@@ -772,7 +773,6 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4));
}
- //remoteClient.SendTeleportCancel();
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs
index c586e9b..e979186 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObject.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs
@@ -115,13 +115,12 @@ namespace OpenSim.Region.Environment.Scenes
{
SceneObject dupe = new SceneObject();
+ dupe.m_world = this.m_world;
+ dupe.m_regionHandle = this.m_regionHandle;
Primitive newRoot = this.rootPrimitive.Copy((EntityBase)dupe, dupe);
-
- foreach (EntityBase child in this.children)
- {
- EntityBase newChild = child.Copy();
- dupe.children.Add(newChild);
- }
+ dupe.rootPrimitive = newRoot;
+ dupe.rootPrimitive.Pos =( this.Pos + new LLVector3(0,0,1));
+ dupe.Rotation = this.Rotation;
return dupe;
}
--
cgit v1.1