aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenGridServices.GridServer/SimProfiles.cs4
-rw-r--r--OpenSim.Framework/IGridServer.cs3
-rw-r--r--OpenSim.Framework/RemoteGridBase.cs10
-rw-r--r--OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs2
-rw-r--r--OpenSim.GridInterfaces/Remote/RemoteGridServer.cs22
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs61
-rw-r--r--OpenSim.RegionServer/SimClient.cs32
-rw-r--r--OpenSim.RegionServer/world/AvatarUpdate.cs3
-rw-r--r--OpenSim.RegionServer/world/World.cs29
9 files changed, 129 insertions, 37 deletions
diff --git a/OpenGridServices.GridServer/SimProfiles.cs b/OpenGridServices.GridServer/SimProfiles.cs
index 7fcfb8c..bd91d5b 100644
--- a/OpenGridServices.GridServer/SimProfiles.cs
+++ b/OpenGridServices.GridServer/SimProfiles.cs
@@ -158,13 +158,15 @@ namespace OpenGridServices.GridServer
158 if (GetProfileByHandle(Helpers.UIntsToLong((uint)((TheSim.RegionLocX + x) * 256), (uint)(TheSim.RegionLocY + y) * 256)) != null) 158 if (GetProfileByHandle(Helpers.UIntsToLong((uint)((TheSim.RegionLocX + x) * 256), (uint)(TheSim.RegionLocY + y) * 256)) != null)
159 { 159 {
160 neighbour = GetProfileByHandle(Helpers.UIntsToLong((uint)((TheSim.RegionLocX + x) * 256), (uint)(TheSim.RegionLocY + y) * 256)); 160 neighbour = GetProfileByHandle(Helpers.UIntsToLong((uint)((TheSim.RegionLocX + x) * 256), (uint)(TheSim.RegionLocY + y) * 256));
161
161 NeighbourBlock = new Hashtable(); 162 NeighbourBlock = new Hashtable();
162 NeighbourBlock["sim_ip"] = neighbour.sim_ip; 163 NeighbourBlock["sim_ip"] = neighbour.sim_ip;
163 NeighbourBlock["sim_port"] = neighbour.sim_port.ToString(); 164 NeighbourBlock["sim_port"] = neighbour.sim_port.ToString();
164 NeighbourBlock["region_locx"] = neighbour.RegionLocX.ToString(); 165 NeighbourBlock["region_locx"] = neighbour.RegionLocX.ToString();
165 NeighbourBlock["region_locy"] = neighbour.RegionLocY.ToString(); 166 NeighbourBlock["region_locy"] = neighbour.RegionLocY.ToString();
166 NeighbourBlock["UUID"] = neighbour.UUID.ToString(); 167 NeighbourBlock["UUID"] = neighbour.UUID.ToString();
167 SimNeighboursData.Add(NeighbourBlock); 168
169 if(neighbour.UUID!=TheSim.UUID) SimNeighboursData.Add(NeighbourBlock);
168 } 170 }
169 } 171 }
170 172
diff --git a/OpenSim.Framework/IGridServer.cs b/OpenSim.Framework/IGridServer.cs
index 001ce3b..9c06a6b 100644
--- a/OpenSim.Framework/IGridServer.cs
+++ b/OpenSim.Framework/IGridServer.cs
@@ -27,6 +27,7 @@
27 27
28 28
29using System; 29using System;
30using System.Collections;
30using System.Collections.Generic; 31using System.Collections.Generic;
31using System.Net; 32using System.Net;
32using System.Net.Sockets; 33using System.Net.Sockets;
@@ -50,7 +51,7 @@ namespace OpenSim.Framework.Interfaces
50 string GetName(); 51 string GetName();
51 bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port); 52 bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
52 void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); 53 void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
53 void Close(); 54 void Close();
54 } 55 }
55 56
56 public struct UUIDBlock 57 public struct UUIDBlock
diff --git a/OpenSim.Framework/RemoteGridBase.cs b/OpenSim.Framework/RemoteGridBase.cs
index e1f0b9b..0b72b9f 100644
--- a/OpenSim.Framework/RemoteGridBase.cs
+++ b/OpenSim.Framework/RemoteGridBase.cs
@@ -1,4 +1,5 @@
1using System; 1using System;
2using System.Collections;
2using System.Collections.Generic; 3using System.Collections.Generic;
3using System.Text; 4using System.Text;
4using libsecondlife; 5using libsecondlife;
@@ -21,5 +22,14 @@ namespace OpenSim.Framework.Interfaces
21 public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port); 22 public abstract bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port);
22 public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey); 23 public abstract void SetServerInfo(string ServerUrl, string SendKey, string RecvKey);
23 public abstract void Close(); 24 public abstract void Close();
25 public abstract Hashtable GridData {
26 get;
27 set;
28 }
29
30 public abstract ArrayList neighbours {
31 get;
32 set;
33 }
24 } 34 }
25} 35}
diff --git a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs
index 528e9fa..71fca57 100644
--- a/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs
+++ b/OpenSim.GridInterfaces/Remote/RemoteAssetServer.cs
@@ -65,7 +65,7 @@ namespace OpenSim.GridInterfaces.Remote
65 //we need to add support for the asset server not knowing about a requested asset 65 //we need to add support for the asset server not knowing about a requested asset
66 ARequest req = this._assetRequests.Dequeue(); 66 ARequest req = this._assetRequests.Dequeue();
67 LLUUID assetID = req.AssetID; 67 LLUUID assetID = req.AssetID;
68 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it"); 68 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(" RemoteAssetServer- Got a AssetServer request, processing it - " + this.AssetServerUrl + "getasset/" + AssetSendKey + "/" + assetID + "/data");
69 WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "getasset/" + AssetSendKey + "/" + assetID + "/data"); 69 WebRequest AssetLoad = WebRequest.Create(this.AssetServerUrl + "getasset/" + AssetSendKey + "/" + assetID + "/data");
70 WebResponse AssetResponse = AssetLoad.GetResponse(); 70 WebResponse AssetResponse = AssetLoad.GetResponse();
71 byte[] idata = new byte[(int)AssetResponse.ContentLength]; 71 byte[] idata = new byte[(int)AssetResponse.ContentLength];
diff --git a/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs b/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs
index d51d212..7cd68df 100644
--- a/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs
+++ b/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs
@@ -44,13 +44,28 @@ namespace OpenSim.GridInterfaces.Remote
44 private string GridSendKey; 44 private string GridSendKey;
45 private string GridRecvKey; 45 private string GridRecvKey;
46 private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); 46 private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
47 private ArrayList simneighbours = new ArrayList();
48 private Hashtable griddatahash;
47 49
48 public override Dictionary<uint, AgentCircuitData> agentcircuits 50 public override Dictionary<uint, AgentCircuitData> agentcircuits
49 { 51 {
50 get { return AgentCircuits; } 52 get { return AgentCircuits; }
51 set { AgentCircuits = value; } 53 set { AgentCircuits = value; }
52 } 54 }
55
56 public override ArrayList neighbours
57 {
58 get { return simneighbours; }
59 set { simneighbours = value; }
60 }
53 61
62 public override Hashtable GridData
63 {
64 get { return griddatahash; }
65 set { griddatahash = value; }
66 }
67
68
54 public RemoteGridServer() 69 public RemoteGridServer()
55 { 70 {
56 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Remote Grid Server class created"); 71 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Remote Grid Server class created");
@@ -69,13 +84,16 @@ namespace OpenSim.GridInterfaces.Remote
69 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); 84 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
70 XmlRpcResponse GridResp = GridReq.Send(this.GridServerUrl, 3000); 85 XmlRpcResponse GridResp = GridReq.Send(this.GridServerUrl, 3000);
71 Hashtable GridRespData = (Hashtable)GridResp.Value; 86 Hashtable GridRespData = (Hashtable)GridResp.Value;
72 87 this.griddatahash=GridRespData;
88
73 if(GridRespData.ContainsKey("error")) { 89 if(GridRespData.ContainsKey("error")) {
74 string errorstring = (string)GridRespData["error"]; 90 string errorstring = (string)GridRespData["error"];
75 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Error connecting to grid:"); 91 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Error connecting to grid:");
76 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(errorstring); 92 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(errorstring);
77 return false; 93 return false;
78 } 94 }
95 this.neighbours = (ArrayList)GridRespData["neighbours"];
96 Console.WriteLine(simneighbours.Count);
79 return true; 97 return true;
80 } 98 }
81 99
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index 8c93128..f10ca34 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -48,7 +48,7 @@ using OpenSim.Framework.Console;
48using OpenSim.Physics.Manager; 48using OpenSim.Physics.Manager;
49using Nwc.XmlRpc; 49using Nwc.XmlRpc;
50using OpenSim.Servers; 50using OpenSim.Servers;
51using OpenSim.GenericConfig; 51using OpenSim.GenericConfig;
52 52
53namespace OpenSim 53namespace OpenSim
54{ 54{
@@ -164,6 +164,18 @@ namespace OpenSim
164 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); 164 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
165 IGridServer gridServer = GridServers.GridServer; 165 IGridServer gridServer = GridServers.GridServer;
166 gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey); 166 gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey);
167
168 if(!m_sandbox) {
169 if(GridServers.GridServer.RequestConnection(regionData.SimUUID,regionData.IPListenAddr,(uint)regionData.IPListenPort)) {
170 m_console.WriteLine("Main.cs:Startup() - Got a grid connection OK!");
171 } else {
172 m_console.WriteLine("AAAAAAAAAAAAARRRRRRRRRRGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!");
173 m_console.WriteLine("I LOST MY GRID!!!!!!!!!!!!! AAAAAAAARRRRRRRRGGGGGGGGHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!");
174 Shutdown();
175 }
176 }
177
178 GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]);
167 179
168 LocalWorld.LoadPrimsFromStorage(); 180 LocalWorld.LoadPrimsFromStorage();
169 181
@@ -190,9 +202,11 @@ namespace OpenSim
190 agent_data.firstname = (string)requestData["firstname"]; 202 agent_data.firstname = (string)requestData["firstname"];
191 agent_data.lastname = (string)requestData["lastname"]; 203 agent_data.lastname = (string)requestData["lastname"];
192 agent_data.AgentID = new LLUUID((string)requestData["agent_id"]); 204 agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
193 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); 205 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
194 206 if(requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) {
195 ((RemoteGridBase)gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data); 207 agent_data.child=true;
208 }
209 ((RemoteGridBase)gridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
196 210
197 return new XmlRpcResponse(); 211 return new XmlRpcResponse();
198 }); 212 });
@@ -288,15 +302,52 @@ namespace OpenSim
288 } 302 }
289 else if (packet.Type == PacketType.UseCircuitCode) 303 else if (packet.Type == PacketType.UseCircuitCode)
290 { // new client 304 { // new client
305
291 UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet; 306 UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;
292 this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code); 307 this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
293 SimClient newuser = new SimClient(epSender, useCircuit, LocalWorld, _packetServer.ClientThreads, AssetCache, GridServers.GridServer, this, InventoryCache, m_sandbox); 308 SimClient newuser = new SimClient(epSender, useCircuit, LocalWorld, _packetServer.ClientThreads, AssetCache, GridServers.GridServer, this, InventoryCache, m_sandbox,((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].child);
294 if ((this.GridServers.UserServer != null) && (user_accounts)) 309 if ((this.GridServers.UserServer != null) && (user_accounts))
295 { 310 {
296 newuser.UserServer = this.GridServers.UserServer; 311 newuser.UserServer = this.GridServers.UserServer;
297 } 312 }
298 //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser); 313 //OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser);
299 this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser); 314 this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
315
316 if(!((RemoteGridBase)GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].child) {
317 Hashtable SimParams;
318 ArrayList SendParams;
319 XmlRpcRequest GridReq;
320 XmlRpcResponse GridResp;
321 foreach (Hashtable neighbour in ((RemoteGridBase)this.GridServers.GridServer).neighbours) {
322 m_console.WriteLine("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"]);
323 SimParams = new Hashtable();
324 SimParams["session_id"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].SessionID.ToString();
325 SimParams["secure_session_id"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].SecureSessionID.ToString();
326 SimParams["firstname"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].firstname;
327 SimParams["lastname"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].lastname;
328 SimParams["agent_id"] = ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[useCircuit.CircuitCode.Code].AgentID.ToString();
329 SimParams["circuit_code"] = (Int32)useCircuit.CircuitCode.Code;
330 SimParams["child_agent"]="1";
331 SendParams = new ArrayList();
332 SendParams.Add(SimParams);
333
334 GridReq = new XmlRpcRequest("expect_user", SendParams);
335 GridResp = GridReq.Send("http://" + neighbour["sim_ip"] + ":" + neighbour["sim_port"], 3000);
336 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
337 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
338 enablesimpacket.SimulatorInfo.Handle=Helpers.UIntsToLong((uint)(Convert.ToInt32(neighbour["region_locx"]) * 256), (uint)(Convert.ToInt32(neighbour["region_locy"]) * 256));
339 System.Net.IPAddress neighbourIP = System.Net.IPAddress.Parse((string)neighbour["sim_ip"]);
340 byte[] byteIP = neighbourIP.GetAddressBytes();
341 enablesimpacket.SimulatorInfo.IP=(uint)byteIP[3]<<24;
342 enablesimpacket.SimulatorInfo.IP+=(uint)byteIP[2]<<16;
343 enablesimpacket.SimulatorInfo.IP+=(uint)byteIP[1]<<8;
344 enablesimpacket.SimulatorInfo.IP+=(uint)byteIP[0];
345 enablesimpacket.SimulatorInfo.Port=(ushort)Convert.ToInt32(neighbour["sim_port"]);
346 Thread.Sleep(3000);
347 _packetServer.ClientThreads[useCircuit.CircuitCode.Code].OutPacket(enablesimpacket);
348 }
349 }
350
300 } 351 }
301 else 352 else
302 { // invalid client 353 { // invalid client
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index 6d174c8..c478d92 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -54,6 +54,7 @@ namespace OpenSim
54 public LLUUID AgentID; 54 public LLUUID AgentID;
55 public LLUUID SessionID; 55 public LLUUID SessionID;
56 public LLUUID SecureSessionID = LLUUID.Zero; 56 public LLUUID SecureSessionID = LLUUID.Zero;
57 public bool m_child;
57 public uint CircuitCode; 58 public uint CircuitCode;
58 public world.Avatar ClientAvatar; 59 public world.Avatar ClientAvatar;
59 private UseCircuitCodePacket cirpack; 60 private UseCircuitCodePacket cirpack;
@@ -94,7 +95,7 @@ namespace OpenSim
94 } 95 }
95 } 96 }
96 97
97 public SimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary<uint, SimClient> clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimNetworkHandler application, InventoryCache inventoryCache, bool sandboxMode) 98 public SimClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary<uint, SimClient> clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimNetworkHandler application, InventoryCache inventoryCache, bool sandboxMode, bool child)
98 { 99 {
99 m_world = world; 100 m_world = world;
100 m_clientThreads = clientThreads; 101 m_clientThreads = clientThreads;
@@ -103,6 +104,7 @@ namespace OpenSim
103 m_application = application; 104 m_application = application;
104 m_inventoryCache = inventoryCache; 105 m_inventoryCache = inventoryCache;
105 m_sandboxMode = sandboxMode; 106 m_sandboxMode = sandboxMode;
107 m_child=child;
106 108
107 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request"); 109 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenSimClient.cs - Started up new client thread to handle incoming request");
108 cirpack = initialcirpack; 110 cirpack = initialcirpack;
@@ -228,8 +230,10 @@ namespace OpenSim
228 switch (Pack.Type) 230 switch (Pack.Type)
229 { 231 {
230 case PacketType.CompleteAgentMovement: 232 case PacketType.CompleteAgentMovement:
231 ClientAvatar.CompleteMovement(m_world); 233 if(!m_child) {
232 ClientAvatar.SendInitialPosition(); 234 ClientAvatar.CompleteMovement(m_world);
235 ClientAvatar.SendInitialPosition();
236 }
233 break; 237 break;
234 case PacketType.RegionHandshakeReply: 238 case PacketType.RegionHandshakeReply:
235 m_world.SendLayerData(this); 239 m_world.SendLayerData(this);
@@ -476,16 +480,18 @@ namespace OpenSim
476 } 480 }
477 break; 481 break;
478 case PacketType.AgentAnimation: 482 case PacketType.AgentAnimation:
479 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; 483 if(!m_child) {
480 for (int i = 0; i < AgentAni.AnimationList.Length; i++) 484 AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack;
481 { 485 for (int i = 0; i < AgentAni.AnimationList.Length; i++)
482 if (AgentAni.AnimationList[i].StartAnim) 486 {
483 { 487 if (AgentAni.AnimationList[i].StartAnim)
484 ClientAvatar.current_anim = AgentAni.AnimationList[i].AnimID; 488 {
485 ClientAvatar.anim_seq = 1; 489 ClientAvatar.current_anim = AgentAni.AnimationList[i].AnimID;
486 ClientAvatar.SendAnimPack(); 490 ClientAvatar.anim_seq = 1;
487 } 491 ClientAvatar.SendAnimPack();
488 } 492 }
493 }
494 }
489 break; 495 break;
490 case PacketType.ObjectSelect: 496 case PacketType.ObjectSelect:
491 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; 497 ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack;
diff --git a/OpenSim.RegionServer/world/AvatarUpdate.cs b/OpenSim.RegionServer/world/AvatarUpdate.cs
index d315de7..453f419 100644
--- a/OpenSim.RegionServer/world/AvatarUpdate.cs
+++ b/OpenSim.RegionServer/world/AvatarUpdate.cs
@@ -89,7 +89,8 @@ namespace OpenSim.world
89 { 89 {
90 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 90 System.Text.Encoding _enc = System.Text.Encoding.ASCII;
91 //send a objectupdate packet with information about the clients avatar 91 //send a objectupdate packet with information about the clients avatar
92 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 92
93 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
93 objupdate.RegionData.RegionHandle = m_regionHandle; 94 objupdate.RegionData.RegionHandle = m_regionHandle;
94 objupdate.RegionData.TimeDilation = 64096; 95 objupdate.RegionData.TimeDilation = 64096;
95 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 96 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index a973c6c..425a135 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -371,19 +371,22 @@ namespace OpenSim.world
371 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); 371 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world");
372 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); 372 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake ");
373 newAvatar.SendRegionHandshake(this); 373 newAvatar.SendRegionHandshake(this);
374 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); 374 if(!agentClient.m_child) {
375 lock (this.LockPhysicsEngine) 375 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
376 { 376 lock (this.LockPhysicsEngine)
377 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); 377 {
378 } 378 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
379 lock (Entities) 379 }
380 { 380 }
381 this.Entities.Add(agentClient.AgentID, newAvatar); 381 lock (Entities)
382 } 382 {
383 lock (Avatars) 383 this.Entities.Add(agentClient.AgentID, newAvatar);
384 { 384 }
385 this.Avatars.Add(agentClient.AgentID, newAvatar); 385 lock (Avatars)
386 } 386 {
387 this.Avatars.Add(agentClient.AgentID, newAvatar);
388 }
389
387 } 390 }
388 391
389 public void RemoveViewerAgent(SimClient agentClient) 392 public void RemoveViewerAgent(SimClient agentClient)