aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-20 19:25:52 -0400
committerTeravus Ovares (Dan Olivares)2009-08-20 19:25:52 -0400
commit181b992b4a8dab3423b52f705e20dcb63e7fdb47 (patch)
tree309f2255464873944a5478472596cbc24b130b27 /OpenSim/Region
parent* Deal with git thinking that file was changed even though it wasn't and it's... (diff)
parentMerge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-181b992b4a8dab3423b52f705e20dcb63e7fdb47.zip
opensim-SC_OLD-181b992b4a8dab3423b52f705e20dcb63e7fdb47.tar.gz
opensim-SC_OLD-181b992b4a8dab3423b52f705e20dcb63e7fdb47.tar.bz2
opensim-SC_OLD-181b992b4a8dab3423b52f705e20dcb63e7fdb47.tar.xz
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs9
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs64
8 files changed, 83 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 6969a3d..a7a5aa3 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2177,7 +2177,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2177 bulkUpdate.AgentData.AgentID = AgentId; 2177 bulkUpdate.AgentData.AgentID = AgentId;
2178 bulkUpdate.AgentData.TransactionID = transactionId; 2178 bulkUpdate.AgentData.TransactionID = transactionId;
2179 bulkUpdate.FolderData = folderDataBlocks.ToArray(); 2179 bulkUpdate.FolderData = folderDataBlocks.ToArray();
2180 2180 List<BulkUpdateInventoryPacket.ItemDataBlock> foo = new List<BulkUpdateInventoryPacket.ItemDataBlock>();
2181 bulkUpdate.ItemData = foo.ToArray();
2182
2181 //m_log.Debug("SendBulkUpdateInventory :" + bulkUpdate); 2183 //m_log.Debug("SendBulkUpdateInventory :" + bulkUpdate);
2182 OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); 2184 OutPacket(bulkUpdate, ThrottleOutPacketType.Asset);
2183 } 2185 }
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 5e7cf4b..4495303 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -56,7 +56,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
56 if (cnf != null && cnf.GetString( 56 if (cnf != null && cnf.GetString(
57 "MessageTransferModule", "MessageTransferModule") != 57 "MessageTransferModule", "MessageTransferModule") !=
58 "MessageTransferModule") 58 "MessageTransferModule")
59 {
60 m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration");
59 return; 61 return;
62 }
60 63
61 cnf = config.Configs["Startup"]; 64 cnf = config.Configs["Startup"];
62 if (cnf != null) 65 if (cnf != null)
@@ -72,6 +75,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
72 "grid_instant_message", processXMLRPCGridInstantMessage); 75 "grid_instant_message", processXMLRPCGridInstantMessage);
73 } 76 }
74 77
78 m_log.Debug("[MESSAGE TRANSFER]: Message transfer module active");
75 scene.RegisterModuleInterface<IMessageTransferModule>(this); 79 scene.RegisterModuleInterface<IMessageTransferModule>(this);
76 m_Scenes.Add(scene); 80 m_Scenes.Add(scene);
77 } 81 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 5afbf68..75976e2 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -67,13 +67,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
67 67
68 if (!m_Scenelist.Contains(scene)) 68 if (!m_Scenelist.Contains(scene))
69 { 69 {
70 if (m_Scenelist.Count == 0)
71 {
72 m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule>();
73 if (m_TransferModule == null)
74 m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only");
75 }
76
77 m_Scenelist.Add(scene); 70 m_Scenelist.Add(scene);
78 71
79 scene.RegisterModuleInterface<IInventoryTransferModule>(this); 72 scene.RegisterModuleInterface<IInventoryTransferModule>(this);
@@ -86,6 +79,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
86 79
87 public void PostInitialise() 80 public void PostInitialise()
88 { 81 {
82 if (m_Scenelist.Count > 0)
83 {
84 m_TransferModule = m_Scenelist[0].RequestModuleInterface<IMessageTransferModule>();
85 if (m_TransferModule == null)
86 m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only");
87 }
89 } 88 }
90 89
91 public void Close() 90 public void Close()
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
index 562c5dd..e6edcf2 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
191 191
192 public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) 192 public override Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
193 { 193 {
194 InventoryFolderBase root = GetRootFolder(userID); 194 InventoryFolderBase root = m_InventoryService.GetRootFolder(userID);
195 if (root != null) 195 if (root != null)
196 { 196 {
197 InventoryCollection content = GetFolderContent(userID, root.ID); 197 InventoryCollection content = GetFolderContent(userID, root.ID);
@@ -202,13 +202,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
202 { 202 {
203 if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) 203 if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown))
204 { 204 {
205 m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type); 205 //m_log.InfoFormat("[INVENTORY CONNECTOR]: folder type {0} ", folder.Type);
206 folders[(AssetType)folder.Type] = folder; 206 folders[(AssetType)folder.Type] = folder;
207 } 207 }
208 } 208 }
209 // Put the root folder there, as type Folder 209 // Put the root folder there, as type Folder
210 folders[AssetType.Folder] = root; 210 folders[AssetType.Folder] = root;
211 m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type); 211 //m_log.InfoFormat("[INVENTORY CONNECTOR]: root folder is type {0} ", root.Type);
212 212
213 return folders; 213 return folders;
214 } 214 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index a119efc..a9d361b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -179,8 +179,8 @@ namespace OpenSim.Region.Framework.Scenes
179 else 179 else
180 { 180 {
181 m_log.ErrorFormat( 181 m_log.ErrorFormat(
182 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", 182 "[AGENT INVENTORY]: Could not find item {0} for caps inventory update",
183 remoteClient.AgentId); 183 itemID);
184 } 184 }
185 185
186 return UUID.Zero; 186 return UUID.Zero;
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 77b980c..d722e23 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -519,7 +519,7 @@ namespace OpenSim.Region.Framework.Scenes
519// m_log.DebugFormat( 519// m_log.DebugFormat(
520// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId); 520// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
521 521
522 InventoryFolderBase folder = new InventoryFolderBase(folderID); 522 InventoryFolderBase folder = new InventoryFolderBase(folderID, remoteClient.AgentId);
523 folder = InventoryService.GetFolder(folder); 523 folder = InventoryService.GetFolder(folder);
524 if (folder != null) 524 if (folder != null)
525 { 525 {
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
index ce6f3d6..3ee6007 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs
@@ -225,7 +225,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
225 Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered"); 225 Assert.That(presence.AbsolutePosition, Is.EqualTo(pos), "Position is not the same one entered");
226 } 226 }
227 227
228 [Test] 228 // I'm commenting this test because it does not represent
229 // crossings. The Thread.Sleep's in here are not meaningful mocks,
230 // and they sometimes fail in panda.
231 // We need to talk in order to develop a test
232 // that really tests region crossings. There are 3 async components,
233 // but things are synchronous among them. So there should be
234 // 3 threads in here.
235 //[Test]
229 public void T021_TestCrossToNewRegion() 236 public void T021_TestCrossToNewRegion()
230 { 237 {
231 TestHelper.InMethod(); 238 TestHelper.InMethod();
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 8c9717c..a3cefc9 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -25,26 +25,74 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Collections.Generic;
28using OpenMetaverse; 29using OpenMetaverse;
29using Nini.Config; 30using Nini.Config;
30using OpenSim.Region.Framework.Interfaces; 31using OpenSim.Region.Framework.Interfaces;
31using OpenSim.Region.Framework.Scenes; 32using OpenSim.Region.Framework.Scenes;
33using OpenSim.Framework;
32 34
33namespace OpenSim.Region.OptionalModules.World.NPC 35namespace OpenSim.Region.OptionalModules.World.NPC
34{ 36{
35 public class NPCModule : IRegionModule 37 public interface INPCModule
38 {
39 UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom);
40 void Autopilot(UUID agentID, Scene scene, Vector3 pos);
41 void Say(UUID agentID, Scene scene, string text);
42 void DeleteNPC(UUID agentID, Scene scene);
43 }
44
45 public class NPCModule : IRegionModule, INPCModule
36 { 46 {
37 // private const bool m_enabled = false; 47 // private const bool m_enabled = false;
38 48
49 private Dictionary<UUID,NPCAvatar> m_avatars = new Dictionary<UUID, NPCAvatar>();
50
51 public UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom)
52 {
53 NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, scene);
54 scene.AddNewClient(npcAvatar);
55
56 ScenePresence sp;
57 if(scene.TryGetAvatar(npcAvatar.AgentId, out sp))
58 {
59 AvatarAppearance x = scene.CommsManager.AvatarService.GetUserAppearance(cloneAppearanceFrom);
60
61 List<byte> wearbyte = new List<byte>();
62 for (int i = 0; i < x.VisualParams.Length; i++)
63 {
64 wearbyte.Add(x.VisualParams[i]);
65 }
66
67 sp.SetAppearance(x.Texture.GetBytes(), wearbyte);
68 }
69
70 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
71
72 return npcAvatar.AgentId;
73 }
74
75 public void Autopilot(UUID agentID, Scene scene, Vector3 pos)
76 {
77 ScenePresence sp;
78 scene.TryGetAvatar(agentID, out sp);
79 sp.DoAutoPilot(0,pos,m_avatars[agentID]);
80 }
81
82 public void Say(UUID agentID, Scene scene, string text)
83 {
84 m_avatars[agentID].Say(text);
85 }
86
87 public void DeleteNPC(UUID agentID, Scene scene)
88 {
89 scene.RemoveClient(agentID);
90 }
91
92
39 public void Initialise(Scene scene, IConfigSource source) 93 public void Initialise(Scene scene, IConfigSource source)
40 { 94 {
41 // if (m_enabled) 95 scene.RegisterModuleInterface<INPCModule>(this);
42 // {
43 // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new Vector3(128, 128, 40), scene);
44 // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new Vector3(136, 128, 40), scene);
45 // scene.AddNewClient(testAvatar);
46 // scene.AddNewClient(testAvatar2);
47 // }
48 } 96 }
49 97
50 public void PostInitialise() 98 public void PostInitialise()