aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs38
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs18
-rw-r--r--OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs30
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs46
5 files changed, 104 insertions, 32 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 1427516..ae46d8e 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -57,7 +57,7 @@ namespace OpenSim.Framework
57 public enum ThrottleOutPacketType : int 57 public enum ThrottleOutPacketType : int
58 { 58 {
59 Resend = 0, 59 Resend = 0,
60 Land = 1, 60 Land = 1,
61 Wind = 2, 61 Wind = 2,
62 Cloud = 3, 62 Cloud = 3,
63 Task = 4, 63 Task = 4,
@@ -172,8 +172,33 @@ namespace OpenSim.Framework
172 } 172 }
173 } 173 }
174 174
175 public class AvatarWearingArgs : EventArgs
176 {
177 private List<Wearable> m_nowWearing = new List<Wearable>();
178
179 public List<Wearable> NowWearing
180 {
181 get { return m_nowWearing; }
182 set { m_nowWearing = value; }
183 }
184
185 public class Wearable
186 {
187 public LLUUID ItemID = new LLUUID("00000000-0000-0000-0000-000000000000");
188 public byte Type = 0;
189
190 public Wearable(LLUUID itemId, byte type)
191 {
192 ItemID = itemId;
193 Type = type;
194 }
195 }
196 }
197
175 public delegate void TextureRequest(Object sender, TextureRequestArgs e); 198 public delegate void TextureRequest(Object sender, TextureRequestArgs e);
176 199
200 public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e);
201
177 public delegate void ImprovedInstantMessage( 202 public delegate void ImprovedInstantMessage(
178 LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, 203 LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp,
179 string fromAgentName, string message, byte dialog); // Cut down from full list 204 string fromAgentName, string message, byte dialog); // Cut down from full list
@@ -187,7 +212,7 @@ namespace OpenSim.Framework
187 public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID, int seq); 212 public delegate void StartAnim(IClientAPI remoteClient, LLUUID animID, int seq);
188 213
189 public delegate void LinkObjects(uint parent, List<uint> children); 214 public delegate void LinkObjects(uint parent, List<uint> children);
190 215
191 public delegate void DelinkObjects(List<uint> primIds); 216 public delegate void DelinkObjects(List<uint> primIds);
192 217
193 public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY); 218 public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY);
@@ -200,7 +225,7 @@ namespace OpenSim.Framework
200 public delegate void DisconnectUser(); 225 public delegate void DisconnectUser();
201 226
202 public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID); 227 public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID);
203 public delegate void SetAlwaysRun (IClientAPI remoteClient, bool SetAlwaysRun); 228 public delegate void SetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun);
204 229
205 public delegate void GenericCall2(); 230 public delegate void GenericCall2();
206 231
@@ -217,7 +242,7 @@ namespace OpenSim.Framework
217 242
218 public delegate void ObjectSelect(uint localID, IClientAPI remoteClient); 243 public delegate void ObjectSelect(uint localID, IClientAPI remoteClient);
219 244
220 public delegate void RequestObjectPropertiesFamily(IClientAPI remoteClient,LLUUID AgentID, uint RequestFlags, LLUUID TaskID); 245 public delegate void RequestObjectPropertiesFamily(IClientAPI remoteClient, LLUUID AgentID, uint RequestFlags, LLUUID TaskID);
221 246
222 public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient); 247 public delegate void ObjectDeselect(uint localID, IClientAPI remoteClient);
223 248
@@ -268,7 +293,7 @@ namespace OpenSim.Framework
268 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape); 293 public delegate void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape);
269 294
270 public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client); 295 public delegate void RequestGodlikePowers(LLUUID AgentID, LLUUID SessionID, LLUUID token, IClientAPI remote_client);
271 296
272 public delegate void GodKickUser(LLUUID GodAgentID, LLUUID GodSessionID, LLUUID AgentID, uint kickflags, byte[] reason); 297 public delegate void GodKickUser(LLUUID GodAgentID, LLUUID GodSessionID, LLUUID AgentID, uint kickflags, byte[] reason);
273 298
274 public delegate void CreateInventoryFolder( 299 public delegate void CreateInventoryFolder(
@@ -314,6 +339,7 @@ namespace OpenSim.Framework
314 event RezObject OnRezObject; 339 event RezObject OnRezObject;
315 event ModifyTerrain OnModifyTerrain; 340 event ModifyTerrain OnModifyTerrain;
316 event SetAppearance OnSetAppearance; 341 event SetAppearance OnSetAppearance;
342 event AvatarNowWearing OnAvatarNowWearing;
317 event StartAnim OnStartAnim; 343 event StartAnim OnStartAnim;
318 event LinkObjects OnLinkObjects; 344 event LinkObjects OnLinkObjects;
319 event DelinkObjects OnDelinkObjects; 345 event DelinkObjects OnDelinkObjects;
@@ -447,7 +473,7 @@ namespace OpenSim.Framework
447 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, 473 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
448 LLQuaternion rotation); 474 LLQuaternion rotation);
449 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, 475 void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
450 LLQuaternion rotation,LLVector3 velocity, LLVector3 rotationalvelocity); 476 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity);
451 477
452 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, int subFoldersCount); 478 void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items, int subFoldersCount);
453 void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item); 479 void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item);
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 86efac1..e3a40ea 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -568,6 +568,7 @@ namespace OpenSim.Region.ClientStack
568 public event Action<IClientAPI> OnRegionHandShakeReply; 568 public event Action<IClientAPI> OnRegionHandShakeReply;
569 public event GenericCall2 OnRequestWearables; 569 public event GenericCall2 OnRequestWearables;
570 public event SetAppearance OnSetAppearance; 570 public event SetAppearance OnSetAppearance;
571 public event AvatarNowWearing OnAvatarNowWearing;
571 public event GenericCall2 OnCompleteMovementToRegion; 572 public event GenericCall2 OnCompleteMovementToRegion;
572 public event UpdateAgent OnAgentUpdate; 573 public event UpdateAgent OnAgentUpdate;
573 public event AgentRequestSit OnAgentRequestSit; 574 public event AgentRequestSit OnAgentRequestSit;
@@ -2662,6 +2663,19 @@ namespace OpenSim.Region.ClientStack
2662 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam); 2663 OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam);
2663 } 2664 }
2664 break; 2665 break;
2666 case PacketType.AgentIsNowWearing:
2667 if (OnAvatarNowWearing != null)
2668 {
2669 AgentIsNowWearingPacket nowWearing = (AgentIsNowWearingPacket)Pack;
2670 AvatarWearingArgs wearingArgs = new AvatarWearingArgs();
2671 for (int i = 0; i < nowWearing.WearableData.Length; i++)
2672 {
2673 AvatarWearingArgs.Wearable wearable = new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID, nowWearing.WearableData[i].WearableType);
2674 wearingArgs.NowWearing.Add(wearable);
2675 }
2676 OnAvatarNowWearing(this, wearingArgs);
2677 }
2678 break;
2665 case PacketType.SetAlwaysRun: 2679 case PacketType.SetAlwaysRun:
2666 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; 2680 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack;
2667 2681
@@ -3606,10 +3620,6 @@ namespace OpenSim.Region.ClientStack
3606 3620
3607 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString()); 3621 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString());
3608 break; 3622 break;
3609 case PacketType.AgentIsNowWearing:
3610 // AgentIsNowWearingPacket wear = (AgentIsNowWearingPacket)Pack;
3611 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString());
3612 break;
3613 case PacketType.ObjectScale: 3623 case PacketType.ObjectScale:
3614 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString()); 3624 OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "unhandled packet " + Pack.ToString());
3615 break; 3625 break;
diff --git a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
index 4bb0638..d8a90c5 100644
--- a/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Environment/Modules/AvatarFactoryModule.cs
@@ -1,3 +1,4 @@
1using System;
1using libsecondlife; 2using libsecondlife;
2using Nini.Config; 3using Nini.Config;
3using OpenSim.Framework; 4using OpenSim.Framework;
@@ -8,6 +9,8 @@ namespace OpenSim.Region.Environment.Modules
8{ 9{
9 public class AvatarFactoryModule : IAvatarFactory 10 public class AvatarFactoryModule : IAvatarFactory
10 { 11 {
12 private Scene m_scene = null;
13
11 public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables, 14 public bool TryGetIntialAvatarAppearance(LLUUID avatarId, out AvatarWearable[] wearables,
12 out byte[] visualParams) 15 out byte[] visualParams)
13 { 16 {
@@ -18,6 +21,12 @@ namespace OpenSim.Region.Environment.Modules
18 public void Initialise(Scene scene, IConfigSource source) 21 public void Initialise(Scene scene, IConfigSource source)
19 { 22 {
20 scene.RegisterModuleInterface<IAvatarFactory>(this); 23 scene.RegisterModuleInterface<IAvatarFactory>(this);
24 // scene.EventManager.OnNewClient += NewClient;
25
26 if (m_scene == null)
27 {
28 m_scene = scene;
29 }
21 } 30 }
22 31
23 public void PostInitialise() 32 public void PostInitialise()
@@ -38,6 +47,27 @@ namespace OpenSim.Region.Environment.Modules
38 get { return true; } 47 get { return true; }
39 } 48 }
40 49
50 public void NewClient(IClientAPI client)
51 {
52 // client.OnAvatarNowWearing += AvatarIsWearing;
53 }
54
55 public void RemoveClient(IClientAPI client)
56 {
57 // client.OnAvatarNowWearing -= AvatarIsWearing;
58 }
59
60 public void AvatarIsWearing(Object sender, AvatarWearingArgs e)
61 {
62 IClientAPI clientView = (IClientAPI) sender;
63 //Todo look up the assetid from the inventory cache (or something) for each itemId that is in AvatarWearingArgs
64 // then store assetid and itemId and wearable type in a database
65 foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
66 {
67 LLUUID assetID = m_scene.CommsManager.UserProfileCache.GetUserDetails(clientView.AgentId).RootFolder.HasItem(wear.ItemID).assetID;
68 }
69 }
70
41 public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) 71 public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams)
42 { 72 {
43 visualParams = new byte[218]; 73 visualParams = new byte[218];
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 877bfe5..5b6b9cb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
362 /// </summary> 362 /// </summary>
363 /// <param name="packet"></param> 363 /// <param name="packet"></param>
364 /// <param name="simClient"></param> 364 /// <param name="simClient"></param>
365 public void DeRezObject(Packet packet, IClientAPI remoteClient) 365 public virtual void DeRezObject(Packet packet, IClientAPI remoteClient)
366 { 366 {
367 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet; 367 DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) packet;
368 368
@@ -443,7 +443,7 @@ namespace OpenSim.Region.Environment.Scenes
443 group.DeleteParts(); 443 group.DeleteParts();
444 } 444 }
445 445
446 public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) 446 public virtual void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos)
447 { 447 {
448 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); 448 CachedUserInfo userInfo = CommsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId);
449 if (userInfo != null) 449 if (userInfo != null)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index f2eb486..39f1620 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -96,11 +96,11 @@ namespace OpenSim.Region.Environment.Scenes
96 96
97 public IXfer XferManager; 97 public IXfer XferManager;
98 98
99 private IHttpRequests m_httpRequestModule; 99 protected IHttpRequests m_httpRequestModule;
100 private ISimChat m_simChatModule; 100 protected ISimChat m_simChatModule;
101 private IXMLRPC m_xmlrpcModule; 101 protected IXMLRPC m_xmlrpcModule;
102 private IWorldComm m_worldCommModule; 102 protected IWorldComm m_worldCommModule;
103 private IAvatarFactory m_AvatarFactory; 103 protected IAvatarFactory m_AvatarFactory;
104 104
105 // Central Update Loop 105 // Central Update Loop
106 106
@@ -128,14 +128,14 @@ namespace OpenSim.Region.Environment.Scenes
128 get { return m_authenticateHandler; } 128 get { return m_authenticateHandler; }
129 } 129 }
130 130
131 private readonly LandManager m_LandManager; 131 protected readonly LandManager m_LandManager;
132 132
133 public LandManager LandManager 133 public LandManager LandManager
134 { 134 {
135 get { return m_LandManager; } 135 get { return m_LandManager; }
136 } 136 }
137 137
138 private readonly EstateManager m_estateManager; 138 protected readonly EstateManager m_estateManager;
139 139
140 public PhysicsScene PhysicsScene 140 public PhysicsScene PhysicsScene
141 { 141 {
@@ -158,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes
158 get { return m_timedilation; } 158 get { return m_timedilation; }
159 } 159 }
160 160
161 private readonly PermissionManager m_permissionManager; 161 protected readonly PermissionManager m_permissionManager;
162 162
163 public PermissionManager PermissionsMngr 163 public PermissionManager PermissionsMngr
164 { 164 {
@@ -267,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes
267 267
268 public override bool OtherRegionUp(RegionInfo otherRegion) 268 public override bool OtherRegionUp(RegionInfo otherRegion)
269 { 269 {
270 // Another region is up. We have to tell all our ScenePresences about it 270 /* // Another region is up. We have to tell all our ScenePresences about it
271 // This fails to get the desired effect and needs further work. 271 // This fails to get the desired effect and needs further work.
272 272
273 if (RegionInfo.RegionHandle != otherRegion.RegionHandle) 273 if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
@@ -289,7 +289,7 @@ namespace OpenSim.Region.Environment.Scenes
289 MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client"); 289 MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client");
290 } 290 }
291 291
292 } 292 }*/
293 return true; 293 return true;
294 } 294 }
295 295
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Scenes
366 } 366 }
367 } 367 }
368 // Reset list to nothing. 368 // Reset list to nothing.
369 m_regionRestartNotifyList = new List<RegionInfo>(); 369 m_regionRestartNotifyList.Clear();
370 } 370 }
371 371
372 public override void Close() 372 public override void Close()
@@ -397,7 +397,7 @@ namespace OpenSim.Region.Environment.Scenes
397 m_innerScene.Close(); 397 m_innerScene.Close();
398 UnRegisterReginWithComms(); 398 UnRegisterReginWithComms();
399 399
400 foreach (IRegionModule module in this.Modules.Values) 400 foreach (IRegionModule module in Modules.Values)
401 { 401 {
402 if (!module.IsSharedModule) 402 if (!module.IsSharedModule)
403 { 403 {
@@ -427,6 +427,7 @@ namespace OpenSim.Region.Environment.Scenes
427 m_xmlrpcModule = RequestModuleInterface<IXMLRPC>(); 427 m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
428 m_worldCommModule = RequestModuleInterface<IWorldComm>(); 428 m_worldCommModule = RequestModuleInterface<IWorldComm>();
429 XferManager = RequestModuleInterface<IXfer>(); 429 XferManager = RequestModuleInterface<IXfer>();
430 m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
430 } 431 }
431 432
432 #endregion 433 #endregion
@@ -792,7 +793,7 @@ namespace OpenSim.Region.Environment.Scenes
792 /// </summary> 793 /// </summary>
793 /// <param name="addPacket"></param> 794 /// <param name="addPacket"></param>
794 /// <param name="ownerID"></param> 795 /// <param name="ownerID"></param>
795 public void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape) 796 public virtual void AddNewPrim(LLUUID ownerID, LLVector3 pos, LLQuaternion rot, PrimitiveBaseShape shape)
796 { 797 {
797 798
798 // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision 799 // What we're *supposed* to do is raytrace from the camera position given by the client to the nearest collision
@@ -1015,18 +1016,13 @@ namespace OpenSim.Region.Environment.Scenes
1015 EventManager.TriggerOnNewClient(client); 1016 EventManager.TriggerOnNewClient(client);
1016 } 1017 }
1017 1018
1018 protected ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child) 1019 protected virtual ScenePresence CreateAndAddScenePresence(IClientAPI client, bool child)
1019 { 1020 {
1020 ScenePresence avatar = null; 1021 ScenePresence avatar = null;
1021 1022
1022 byte[] visualParams; 1023 byte[] visualParams;
1023 AvatarWearable[] wearables; 1024 AvatarWearable[] wearables;
1024 1025 LoadAvatarAppearance(client, out visualParams, out wearables);
1025 if (m_AvatarFactory == null ||
1026 !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams))
1027 {
1028 AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams);
1029 }
1030 1026
1031 avatar = m_innerScene.CreateAndAddScenePresence(client, child, wearables, visualParams); 1027 avatar = m_innerScene.CreateAndAddScenePresence(client, child, wearables, visualParams);
1032 1028
@@ -1038,6 +1034,15 @@ namespace OpenSim.Region.Environment.Scenes
1038 return avatar; 1034 return avatar;
1039 } 1035 }
1040 1036
1037 protected void LoadAvatarAppearance(IClientAPI client, out byte[] visualParams, out AvatarWearable[] wearables)
1038 {
1039 if (m_AvatarFactory == null ||
1040 !m_AvatarFactory.TryGetIntialAvatarAppearance(client.AgentId, out wearables, out visualParams))
1041 {
1042 AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams);
1043 }
1044 }
1045
1041 1046
1042 /// <summary> 1047 /// <summary>
1043 /// 1048 ///
@@ -1145,6 +1150,7 @@ namespace OpenSim.Region.Environment.Scenes
1145 m_sceneGridService.KillObject = SendKillObject; 1150 m_sceneGridService.KillObject = SendKillObject;
1146 } 1151 }
1147 1152
1153
1148 public void UnRegisterReginWithComms() 1154 public void UnRegisterReginWithComms()
1149 { 1155 {
1150 m_sceneGridService.OnRegionUp -= OtherRegionUp; 1156 m_sceneGridService.OnRegionUp -= OtherRegionUp;