aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2010-07-29 16:20:59 +0100
committerMelanie2010-07-29 16:20:59 +0100
commit7a9e246ccd0936932794782fdce2aa548145d859 (patch)
treed462708caddc4929cc7018d2eb9fe564521f0b6b
parentAllow gods and estate managers/owners to be unaffected by parcel bans (diff)
parentAllow gods and estate managers/owners to be unaffected by parcel bans (diff)
downloadopensim-SC-7a9e246ccd0936932794782fdce2aa548145d859.zip
opensim-SC-7a9e246ccd0936932794782fdce2aa548145d859.tar.gz
opensim-SC-7a9e246ccd0936932794782fdce2aa548145d859.tar.bz2
opensim-SC-7a9e246ccd0936932794782fdce2aa548145d859.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r--.nant/local.include3
-rwxr-xr-xOpenSim/Framework/Console/ConsoleBase.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs35
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs40
-rw-r--r--bin/config-include/SimianGrid.ini3
5 files changed, 79 insertions, 4 deletions
diff --git a/.nant/local.include b/.nant/local.include
index 0b6f9fe..0279f25 100644
--- a/.nant/local.include
+++ b/.nant/local.include
@@ -20,6 +20,7 @@
20 <delete dir="${distbindir}/.nant"/> 20 <delete dir="${distbindir}/.nant"/>
21 <delete> 21 <delete>
22 <fileset basedir="${distbindir}"> 22 <fileset basedir="${distbindir}">
23 <include name="compile.bat"/>
23 <include name="BUILDING.txt"/> 24 <include name="BUILDING.txt"/>
24 <include name="Makefile"/> 25 <include name="Makefile"/>
25 <include name="nant-color"/> 26 <include name="nant-color"/>
@@ -29,7 +30,7 @@
29 <include name="TESTING.txt"/> 30 <include name="TESTING.txt"/>
30 <include name="TestResult.xml"/> 31 <include name="TestResult.xml"/>
31 <include name="bin/OpenSim.Server.ini"/> 32 <include name="bin/OpenSim.Server.ini"/>
32 <include name="bin/Regions/*"/> 33 <include name="bin/Regions/Regions.ini"/>
33 <include name="bin/*.db"/> 34 <include name="bin/*.db"/>
34 <include name="**/.git/**"/> 35 <include name="**/.git/**"/>
35 <include name=".gitignore"/> 36 <include name=".gitignore"/>
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index b70d1db..aab920b 100755
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console
118 // (Done with no echo and suitable for passwords) 118 // (Done with no echo and suitable for passwords)
119 public string PasswdPrompt(string p) 119 public string PasswdPrompt(string p)
120 { 120 {
121 return ReadLine(p, false, false); 121 return ReadLine(String.Format("{0}: ", p), false, false);
122 } 122 }
123 123
124 public virtual string ReadLine(string p, bool isCommand, bool e) 124 public virtual string ReadLine(string p, bool isCommand, bool e)
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
index fbf4648..704790e 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
88 88
89 public void Initialise(IConfigSource source) 89 public void Initialise(IConfigSource source)
90 { 90 {
91 if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) 91 if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector"))
92 { 92 {
93 IConfig gridConfig = source.Configs["UserAccountService"]; 93 IConfig gridConfig = source.Configs["UserAccountService"];
94 if (gridConfig == null) 94 if (gridConfig == null)
@@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
108 serviceUrl = serviceUrl + '/'; 108 serviceUrl = serviceUrl + '/';
109 109
110 m_serverUrl = serviceUrl; 110 m_serverUrl = serviceUrl;
111 IConfig profilesConfig = source.Configs["Profiles"];
112 if (profilesConfig == null)
113 {
114 // Do not run this module by default.
115 return;
116 }
117 else
118 {
119 // if profiles aren't enabled, we're not needed.
120 // if we're not specified as the connector to use, then we're not wanted
121 if (profilesConfig.GetString("Module", String.Empty) != Name)
122 {
123
124 return;
125 }
126 m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Initializing {0}", this.Name);
127 }
111 } 128 }
112 } 129 }
113 130
@@ -135,6 +152,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
135 152
136 // Profiles 153 // Profiles
137 client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; 154 client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler;
155
138 client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; 156 client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler;
139 client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; 157 client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler;
140 client.OnUserInfoRequest += UserInfoRequestHandler; 158 client.OnUserInfoRequest += UserInfoRequestHandler;
@@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
302 System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, 320 System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
303 about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); 321 about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID());
304 322
323 OSDMap interests = null;
324 if (user.ContainsKey("LLInterests"))
325 {
326 try
327 {
328 interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap;
329 client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["languages"].AsString());
330 }
331 catch { }
332 }
333
334 if (about == null)
335 about = new OSDMap(0);
305 } 336 }
306 else 337 else
307 { 338 {
308 m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); 339 m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
309 client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, 340 client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes,
310 String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); 341 String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
311 } 342 }
312 } 343 }
313 344
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index bb24292..f581f76 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService
45 MethodBase.GetCurrentMethod().DeclaringType); 45 MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 protected IXInventoryData m_Database; 47 protected IXInventoryData m_Database;
48 protected bool m_AllowDelete = true;
48 49
49 public XInventoryService(IConfigSource config) : base(config) 50 public XInventoryService(IConfigSource config) : base(config)
50 { 51 {
@@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService
60 { 61 {
61 dllName = authConfig.GetString("StorageProvider", dllName); 62 dllName = authConfig.GetString("StorageProvider", dllName);
62 connString = authConfig.GetString("ConnectionString", connString); 63 connString = authConfig.GetString("ConnectionString", connString);
64 m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
63 // realm = authConfig.GetString("Realm", realm); 65 // realm = authConfig.GetString("Realm", realm);
64 } 66 }
65 67
@@ -304,10 +306,15 @@ namespace OpenSim.Services.InventoryService
304 // 306 //
305 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) 307 public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
306 { 308 {
309 if (!m_AllowDelete)
310 return false;
311
307 // Ignore principal ID, it's bogus at connector level 312 // Ignore principal ID, it's bogus at connector level
308 // 313 //
309 foreach (UUID id in folderIDs) 314 foreach (UUID id in folderIDs)
310 { 315 {
316 if (!ParentIsTrash(id))
317 continue;
311 InventoryFolderBase f = new InventoryFolderBase(); 318 InventoryFolderBase f = new InventoryFolderBase();
312 f.ID = id; 319 f.ID = id;
313 PurgeFolder(f); 320 PurgeFolder(f);
@@ -319,6 +326,12 @@ namespace OpenSim.Services.InventoryService
319 326
320 public virtual bool PurgeFolder(InventoryFolderBase folder) 327 public virtual bool PurgeFolder(InventoryFolderBase folder)
321 { 328 {
329 if (!m_AllowDelete)
330 return false;
331
332 if (!ParentIsTrash(folder.ID))
333 return false;
334
322 XInventoryFolder[] subFolders = m_Database.GetFolders( 335 XInventoryFolder[] subFolders = m_Database.GetFolders(
323 new string[] { "parentFolderID" }, 336 new string[] { "parentFolderID" },
324 new string[] { folder.ID.ToString() }); 337 new string[] { folder.ID.ToString() });
@@ -358,6 +371,9 @@ namespace OpenSim.Services.InventoryService
358 371
359 public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) 372 public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
360 { 373 {
374 if (!m_AllowDelete)
375 return false;
376
361 // Just use the ID... *facepalms* 377 // Just use the ID... *facepalms*
362 // 378 //
363 foreach (UUID id in itemIDs) 379 foreach (UUID id in itemIDs)
@@ -519,5 +535,29 @@ namespace OpenSim.Services.InventoryService
519 535
520 return newItem; 536 return newItem;
521 } 537 }
538
539 private bool ParentIsTrash(UUID folderID)
540 {
541 XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()});
542 if (folder.Length < 1)
543 return false;
544
545 UUID parentFolder = folder[0].parentFolderID;
546
547 while (parentFolder != UUID.Zero)
548 {
549 XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
550 if (parent.Length < 1)
551 return false;
552
553 if (parent[0].type == (int)AssetType.TrashFolder)
554 return true;
555 if (parent[0].type == (int)AssetType.RootFolder)
556 return false;
557
558 parentFolder = parent[0].parentFolderID;
559 }
560 return false;
561 }
522 } 562 }
523} 563}
diff --git a/bin/config-include/SimianGrid.ini b/bin/config-include/SimianGrid.ini
index 41deb92..65d4ea6 100644
--- a/bin/config-include/SimianGrid.ini
+++ b/bin/config-include/SimianGrid.ini
@@ -65,3 +65,6 @@
65 MessagingModule = GroupsMessagingModule 65 MessagingModule = GroupsMessagingModule
66 MessagingEnabled = true 66 MessagingEnabled = true
67 ServicesConnectorModule = SimianGroupsServicesConnector 67 ServicesConnectorModule = SimianGroupsServicesConnector
68
69[Profiles]
70 Module = SimianProfiles