aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs29
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs75
3 files changed, 52 insertions, 53 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 96beb05..4c04592 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -30,7 +30,6 @@ using Axiom.Math;
30using libsecondlife; 30using libsecondlife;
31using libsecondlife.Packets; 31using libsecondlife.Packets;
32using OpenSim.Framework.Communications.Cache; 32using OpenSim.Framework.Communications.Cache;
33using OpenSim.Framework.Communications.Caches;
34using OpenSim.Framework.Interfaces; 33using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
36using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 69c3f9e..e86562d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -50,6 +50,7 @@ using OpenSim.Region.Environment.Types;
50using OpenSim.Region.Physics.Manager; 50using OpenSim.Region.Physics.Manager;
51using OpenSim.Region.Terrain; 51using OpenSim.Region.Terrain;
52using Timer = System.Timers.Timer; 52using Timer = System.Timers.Timer;
53using OpenSim.Region.Environment.Modules;
53 54
54namespace OpenSim.Region.Environment.Scenes 55namespace OpenSim.Region.Environment.Scenes
55{ 56{
@@ -90,11 +91,11 @@ namespace OpenSim.Region.Environment.Scenes
90 91
91 public IXfer XferManager; 92 public IXfer XferManager;
92 93
93 private IHttpRequests m_httpRequestModule = null; 94 private IHttpRequests m_httpRequestModule;
94 private ISimChat m_simChatModule = null; 95 private ISimChat m_simChatModule;
95 private IXMLRPC m_xmlrpcModule = null; 96 private IXMLRPC m_xmlrpcModule;
96 private IWorldComm m_worldCommModule = null; 97 private IWorldComm m_worldCommModule;
97 98 private IAvatarFactory m_AvatarFactory;
98 99
99 // Central Update Loop 100 // Central Update Loop
100 101
@@ -165,7 +166,7 @@ namespace OpenSim.Region.Environment.Scenes
165 166
166 public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, 167 public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan,
167 AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, 168 AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
168 ModuleLoader moduleLoader) 169 ModuleLoader moduleLoader, bool dumpAssetsToFile)
169 { 170 {
170 updateLock = new Mutex(false); 171 updateLock = new Mutex(false);
171 172
@@ -205,6 +206,7 @@ namespace OpenSim.Region.Environment.Scenes
205 ScenePresence.LoadAnims(); 206 ScenePresence.LoadAnims();
206 207
207 httpListener = httpServer; 208 httpListener = httpServer;
209 m_dumpAssetsToFile = dumpAssetsToFile;
208 } 210 }
209 211
210 #endregion 212 #endregion
@@ -215,7 +217,6 @@ namespace OpenSim.Region.Environment.Scenes
215 m_httpRequestModule = RequestModuleInterface<IHttpRequests>(); 217 m_httpRequestModule = RequestModuleInterface<IHttpRequests>();
216 m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); 218 m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
217 m_worldCommModule = RequestModuleInterface<IWorldComm>(); 219 m_worldCommModule = RequestModuleInterface<IWorldComm>();
218
219 XferManager = RequestModuleInterface<IXfer>(); 220 XferManager = RequestModuleInterface<IXfer>();
220 } 221 }
221 222
@@ -855,7 +856,15 @@ namespace OpenSim.Region.Environment.Scenes
855 { 856 {
856 ScenePresence newAvatar = null; 857 ScenePresence newAvatar = null;
857 858
858 newAvatar = new ScenePresence(client, this, m_regInfo); 859 byte[] visualParams;
860 AvatarWearable[] wearables;
861
862 if( m_AvatarFactory == null || !m_AvatarFactory.TryGetIntialAvatarAppearance( client.AgentId, out wearables, out visualParams))
863 {
864 AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams);
865 }
866
867 newAvatar = new ScenePresence(client, this, m_regInfo, visualParams, wearables);
859 newAvatar.IsChildAgent = child; 868 newAvatar.IsChildAgent = child;
860 869
861 if (child) 870 if (child)
@@ -1096,7 +1105,8 @@ namespace OpenSim.Region.Environment.Scenes
1096 //Console.WriteLine("new user, so creating caps handler for it"); 1105 //Console.WriteLine("new user, so creating caps handler for it");
1097 Caps cap = 1106 Caps cap =
1098 new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, 1107 new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port,
1099 agent.CapsPath, agent.AgentID); 1108 agent.CapsPath, agent.AgentID, m_dumpAssetsToFile);
1109
1100 Util.SetCapsURL(agent.AgentID, 1110 Util.SetCapsURL(agent.AgentID,
1101 "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + 1111 "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() +
1102 "/CAPS/" + agent.CapsPath + "0000/"); 1112 "/CAPS/" + agent.CapsPath + "0000/");
@@ -1456,6 +1466,7 @@ namespace OpenSim.Region.Environment.Scenes
1456 #region Script Engine 1466 #region Script Engine
1457 1467
1458 private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>(); 1468 private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>();
1469 private bool m_dumpAssetsToFile;
1459 1470
1460 public void AddScriptEngine(ScriptEngineInterface ScriptEngine, LogBase m_logger) 1471 public void AddScriptEngine(ScriptEngineInterface ScriptEngine, LogBase m_logger)
1461 { 1472 {
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 99f78c9..256b6b5 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -53,8 +53,8 @@ namespace OpenSim.Region.Environment.Scenes
53 private short m_updateCount = 0; 53 private short m_updateCount = 0;
54 54
55 private Quaternion bodyRot; 55 private Quaternion bodyRot;
56 private byte[] visualParams; 56 private byte[] m_visualParams;
57 private AvatarWearable[] Wearables; 57 private AvatarWearable[] m_wearables;
58 private LLObject.TextureEntry m_textureEntry; 58 private LLObject.TextureEntry m_textureEntry;
59 59
60 public bool IsRestrictedToRegion = false; 60 public bool IsRestrictedToRegion = false;
@@ -90,10 +90,10 @@ namespace OpenSim.Region.Environment.Scenes
90 90
91 //public List<SceneObjectGroup> InterestList = new List<SceneObjectGroup>(); 91 //public List<SceneObjectGroup> InterestList = new List<SceneObjectGroup>();
92 92
93 // private string m_currentQuadNode = " "; 93 // private string m_currentQuadNode = " ";
94 94
95 // private Queue<SceneObjectPart> m_fullPartUpdates = new Queue<SceneObjectPart>(); 95 // private Queue<SceneObjectPart> m_fullPartUpdates = new Queue<SceneObjectPart>();
96 //private Queue<SceneObjectPart> m_tersePartUpdates = new Queue<SceneObjectPart>(); 96 //private Queue<SceneObjectPart> m_tersePartUpdates = new Queue<SceneObjectPart>();
97 97
98 private UpdateQueue m_partsUpdateQueue = new UpdateQueue(); 98 private UpdateQueue m_partsUpdateQueue = new UpdateQueue();
99 private Dictionary<LLUUID, ScenePartUpdate> m_updateTimes = new Dictionary<LLUUID, ScenePartUpdate>(); 99 private Dictionary<LLUUID, ScenePartUpdate> m_updateTimes = new Dictionary<LLUUID, ScenePartUpdate>();
@@ -173,8 +173,8 @@ namespace OpenSim.Region.Environment.Scenes
173 173
174 m_pos = value; 174 m_pos = value;
175 } 175 }
176 } 176 }
177 177
178 public override LLVector3 Velocity 178 public override LLVector3 Velocity
179 { 179 {
180 get 180 get
@@ -220,14 +220,7 @@ namespace OpenSim.Region.Environment.Scenes
220 220
221 #region Constructor(s) 221 #region Constructor(s)
222 222
223 /// <summary> 223 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, AvatarWearable[] wearables)
224 ///
225 /// </summary>
226 /// <param name="client"></param>
227 /// <param name="world"></param>
228 /// <param name="clientThreads"></param>
229 /// <param name="regionDat"></param>
230 public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
231 { 224 {
232 m_scene = world; 225 m_scene = world;
233 m_uuid = client.AgentId; 226 m_uuid = client.AgentId;
@@ -240,13 +233,9 @@ namespace OpenSim.Region.Environment.Scenes
240 m_localId = m_scene.NextLocalId; 233 m_localId = m_scene.NextLocalId;
241 AbsolutePosition = m_controllingClient.StartPos; 234 AbsolutePosition = m_controllingClient.StartPos;
242 235
243 visualParams = new byte[218]; 236 m_visualParams = visualParams;
244 for (int i = 0; i < 218; i++) 237 m_wearables = wearables;
245 {
246 visualParams[i] = 100;
247 }
248 238
249 Wearables = AvatarWearable.DefaultWearables;
250 Animations = new AvatarAnimations(); 239 Animations = new AvatarAnimations();
251 Animations.LoadAnims(); 240 Animations.LoadAnims();
252 241
@@ -351,7 +340,7 @@ namespace OpenSim.Region.Environment.Scenes
351 340
352 AbsolutePosition = pos; 341 AbsolutePosition = pos;
353 342
354 AddToPhysicalScene( ); 343 AddToPhysicalScene();
355 m_physicsActor.Flying = isFlying; 344 m_physicsActor.Flying = isFlying;
356 345
357 346
@@ -410,7 +399,7 @@ namespace OpenSim.Region.Environment.Scenes
410 399
411 for (int i = 0; i < visualParam.Length; i++) 400 for (int i = 0; i < visualParam.Length; i++)
412 { 401 {
413 visualParams[i] = visualParam[i].ParamValue; 402 m_visualParams[i] = visualParam[i].ParamValue;
414 } 403 }
415 404
416 SendAppearanceToAllOtherAgents(); 405 SendAppearanceToAllOtherAgents();
@@ -459,7 +448,7 @@ namespace OpenSim.Region.Environment.Scenes
459 Vector3 agent_control_v3 = new Vector3(0, 0, 0); 448 Vector3 agent_control_v3 = new Vector3(0, 0, 0);
460 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); 449 Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
461 bool oldflying = PhysicsActor.Flying; 450 bool oldflying = PhysicsActor.Flying;
462 PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); 451 PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
463 if (PhysicsActor.Flying != oldflying) 452 if (PhysicsActor.Flying != oldflying)
464 { 453 {
465 update_movementflag = true; 454 update_movementflag = true;
@@ -470,23 +459,23 @@ namespace OpenSim.Region.Environment.Scenes
470 bodyRot = q; 459 bodyRot = q;
471 update_rotation = true; 460 update_rotation = true;
472 } 461 }
473 foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags))) 462 foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof(Dir_ControlFlags)))
474 { 463 {
475 if ((flags & (uint) DCF) != 0) 464 if ((flags & (uint)DCF) != 0)
476 { 465 {
477 DCFlagKeyPressed = true; 466 DCFlagKeyPressed = true;
478 agent_control_v3 += Dir_Vectors[i]; 467 agent_control_v3 += Dir_Vectors[i];
479 if ((m_movementflag & (uint) DCF) == 0) 468 if ((m_movementflag & (uint)DCF) == 0)
480 { 469 {
481 m_movementflag += (byte) (uint) DCF; 470 m_movementflag += (byte)(uint)DCF;
482 update_movementflag = true; 471 update_movementflag = true;
483 } 472 }
484 } 473 }
485 else 474 else
486 { 475 {
487 if ((m_movementflag & (uint) DCF) != 0) 476 if ((m_movementflag & (uint)DCF) != 0)
488 { 477 {
489 m_movementflag -= (byte) (uint) DCF; 478 m_movementflag -= (byte)(uint)DCF;
490 update_movementflag = true; 479 update_movementflag = true;
491 } 480 }
492 } 481 }
@@ -531,10 +520,10 @@ namespace OpenSim.Region.Environment.Scenes
531 } 520 }
532 521
533 NewForce newVelocity = new NewForce(); 522 NewForce newVelocity = new NewForce();
534 Vector3 direc = rotation*vec; 523 Vector3 direc = rotation * vec;
535 direc.Normalize(); 524 direc.Normalize();
536 525
537 direc = direc*((0.03f)*128f); 526 direc = direc * ((0.03f) * 128f);
538 if (m_physicsActor.Flying) 527 if (m_physicsActor.Flying)
539 direc *= 4; 528 direc *= 4;
540 529
@@ -619,7 +608,7 @@ namespace OpenSim.Region.Environment.Scenes
619 /// </summary> 608 /// </summary>
620 public void SendTerseUpdateToAllClients() 609 public void SendTerseUpdateToAllClients()
621 { 610 {
622 m_scene.Broadcast( SendTerseUpdateToClient ); 611 m_scene.Broadcast(SendTerseUpdateToClient);
623 } 612 }
624 613
625 public void SendCoarseLocations() 614 public void SendCoarseLocations()
@@ -628,7 +617,7 @@ namespace OpenSim.Region.Environment.Scenes
628 List<ScenePresence> avatars = m_scene.GetAvatars(); 617 List<ScenePresence> avatars = m_scene.GetAvatars();
629 for (int i = 0; i < avatars.Count; i++) 618 for (int i = 0; i < avatars.Count; i++)
630 { 619 {
631 if (avatars[i] != this ) 620 if (avatars[i] != this)
632 { 621 {
633 CoarseLocations.Add(avatars[i].AbsolutePosition); 622 CoarseLocations.Add(avatars[i].AbsolutePosition);
634 } 623 }
@@ -642,7 +631,7 @@ namespace OpenSim.Region.Environment.Scenes
642 m_newCoarseLocations = true; 631 m_newCoarseLocations = true;
643 } 632 }
644 633
645 634
646 635
647 636
648 /// <summary> 637 /// <summary>
@@ -695,7 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
695 /// <param name="OurClient"></param> 684 /// <param name="OurClient"></param>
696 public void SendOurAppearance(IClientAPI OurClient) 685 public void SendOurAppearance(IClientAPI OurClient)
697 { 686 {
698 m_controllingClient.SendWearables(Wearables); 687 m_controllingClient.SendWearables(m_wearables);
699 688
700 //this.SendFullUpdateToAllClients(); 689 //this.SendFullUpdateToAllClients();
701 //this.SendAppearanceToAllOtherAgents(); 690 //this.SendAppearanceToAllOtherAgents();
@@ -734,7 +723,7 @@ namespace OpenSim.Region.Environment.Scenes
734 /// <param name="avatarInfo"></param> 723 /// <param name="avatarInfo"></param>
735 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) 724 public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
736 { 725 {
737 avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, visualParams, 726 avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams,
738 m_textureEntry.ToBytes()); 727 m_textureEntry.ToBytes());
739 } 728 }
740 729
@@ -793,9 +782,9 @@ namespace OpenSim.Region.Environment.Scenes
793 LLVector3 vel = Velocity; 782 LLVector3 vel = Velocity;
794 783
795 float timeStep = 0.1f; 784 float timeStep = 0.1f;
796 pos2.X = pos2.X + (vel.X*timeStep); 785 pos2.X = pos2.X + (vel.X * timeStep);
797 pos2.Y = pos2.Y + (vel.Y*timeStep); 786 pos2.Y = pos2.Y + (vel.Y * timeStep);
798 pos2.Z = pos2.Z + (vel.Z*timeStep); 787 pos2.Z = pos2.Z + (vel.Z * timeStep);
799 788
800 if ((pos2.X < 0) || (pos2.X > 256)) 789 if ((pos2.X < 0) || (pos2.X > 256))
801 { 790 {
@@ -840,7 +829,7 @@ namespace OpenSim.Region.Environment.Scenes
840 } 829 }
841 830
842 LLVector3 vel = m_velocity; 831 LLVector3 vel = m_velocity;
843 ulong neighbourHandle = Helpers.UIntsToLong((uint) (neighbourx*256), (uint) (neighboury*256)); 832 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
844 RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle); 833 RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
845 if (neighbourRegion != null) 834 if (neighbourRegion != null)
846 { 835 {
@@ -940,7 +929,7 @@ namespace OpenSim.Region.Environment.Scenes
940 throw new Exception("Can't set Text on avatar."); 929 throw new Exception("Can't set Text on avatar.");
941 } 930 }
942 931
943 public void AddToPhysicalScene( ) 932 public void AddToPhysicalScene()
944 { 933 {
945 PhysicsScene scene = m_scene.PhysScene; 934 PhysicsScene scene = m_scene.PhysScene;
946 935
@@ -948,7 +937,7 @@ namespace OpenSim.Region.Environment.Scenes
948 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y, 937 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
949 AbsolutePosition.Z); 938 AbsolutePosition.Z);
950 939
951 m_physicsActor = scene.AddAvatar(this.Firstname+"."+this.Lastname, pVec); 940 m_physicsActor = scene.AddAvatar(this.Firstname + "." + this.Lastname, pVec);
952 } 941 }
953 942
954 internal void Close() 943 internal void Close()