Merge branch 'master' into httptests

httptests
UbitUmarov 2016-12-23 02:53:58 +00:00
commit 86cc02f33e
13 changed files with 600 additions and 197 deletions

View File

@ -89,6 +89,7 @@ what it is today.
* dmiles (Daxtron Labs) * dmiles (Daxtron Labs)
* Dong Jun Lan (IBM) * Dong Jun Lan (IBM)
* DoranZemlja * DoranZemlja
* Drake Arconis
* dr0b3rts * dr0b3rts
* dslake * dslake
* eeyore * eeyore
@ -107,6 +108,7 @@ what it is today.
* Flyte Xevious * Flyte Xevious
* Freaky Tech * Freaky Tech
* Garmin Kawaguichi * Garmin Kawaguichi
* Geir Noklebye
* Glenn Martin (MOSES) * Glenn Martin (MOSES)
* Gryc Ueusp * Gryc Ueusp
* H-H-H (ginge264) * H-H-H (ginge264)
@ -115,6 +117,7 @@ what it is today.
* Imaze Rhiano * Imaze Rhiano
* Intimidated * Intimidated
* Jak Daniels * Jak Daniels
* Jeff Kelly
* Jeremy Bongio (IBM) * Jeremy Bongio (IBM)
* jhurliman * jhurliman
* John R Sohn (XenReborn) * John R Sohn (XenReborn)
@ -136,6 +139,7 @@ what it is today.
* Magnuz Binder * Magnuz Binder
* maimedleech * maimedleech
* Mana Janus * Mana Janus
* Mandarinka Tasty
* MarcelEdward * MarcelEdward
* Matt Lehmann * Matt Lehmann
* Mic Bowman * Mic Bowman
@ -158,6 +162,7 @@ what it is today.
* openlifegrid.com * openlifegrid.com
* otakup0pe * otakup0pe
* Pixel Tomsen * Pixel Tomsen
* Quill Littlefeather
* ralphos * ralphos
* RemedyTomm * RemedyTomm
* Revolution * Revolution
@ -183,6 +188,7 @@ what it is today.
* TBG Renfold * TBG Renfold
* tglion * tglion
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud) * tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
* TomDataWorks
* TomTheDragon (muckwaddle) * TomTheDragon (muckwaddle)
* tyre * tyre
* Vegaslon <vegaslon@gmail.com> * Vegaslon <vegaslon@gmail.com>

View File

@ -27,6 +27,8 @@
using System; using System;
using OpenMetaverse; using OpenMetaverse;
using System.Collections.Generic;
namespace OpenSim.Framework namespace OpenSim.Framework
{ {
@ -122,5 +124,17 @@ namespace OpenSim.Framework
public string UserId = UUID.Zero.ToString(); public string UserId = UUID.Zero.ToString();
public string DataVal = string.Empty; public string DataVal = string.Empty;
} }
public class UserProfileCacheEntry
{
public Dictionary<UUID, string> picksList;
public Dictionary<UUID, UserProfilePick> picks;
public Dictionary<UUID, string> classifiedsLists;
public Dictionary<UUID, UserClassifiedAdd> classifieds;
public UserProfileProperties props;
public string born;
public byte[] membershipType;
public uint flags;
}
} }

View File

@ -348,13 +348,10 @@ namespace OpenSim
config.Set("meshing", "Meshmerizer"); config.Set("meshing", "Meshmerizer");
config.Set("physical_prim", true); config.Set("physical_prim", true);
config.Set("serverside_object_permissions", true); config.Set("serverside_object_permissions", true);
config.Set("storage_prim_inventories", true);
config.Set("startup_console_commands_file", String.Empty); config.Set("startup_console_commands_file", String.Empty);
config.Set("shutdown_console_commands_file", String.Empty); config.Set("shutdown_console_commands_file", String.Empty);
config.Set("DefaultScriptEngine", "XEngine"); config.Set("DefaultScriptEngine", "XEngine");
config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
// life doesn't really work without this
config.Set("EventQueue", true);
} }
{ {
@ -387,4 +384,4 @@ namespace OpenSim
m_networkServersInfo.loadFromConfiguration(m_config.Source); m_networkServersInfo.loadFromConfiguration(m_config.Source);
} }
} }
} }

View File

@ -70,7 +70,6 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
IConfigSource config = new IniConfigSource(); IConfigSource config = new IniConfigSource();
config.AddConfig("Startup"); config.AddConfig("Startup");
config.Configs["Startup"].Set("EventQueue", "true");
CapabilitiesModule capsModule = new CapabilitiesModule(); CapabilitiesModule capsModule = new CapabilitiesModule();
m_eqgMod = new EventQueueGetModule(); m_eqgMod = new EventQueueGetModule();
@ -195,4 +194,4 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.BadGateway)); Assert.That((int)eventsResponse["int_response_code"], Is.EqualTo((int)HttpStatusCode.BadGateway));
} }
} }
} }

View File

@ -57,6 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UserProfilesModule")] [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UserProfilesModule")]
public class UserProfileModule : IProfileModule, INonSharedRegionModule public class UserProfileModule : IProfileModule, INonSharedRegionModule
{ {
const double PROFILECACHEEXPIRE = 300;
/// <summary> /// <summary>
/// Logging /// Logging
/// </summary> /// </summary>
@ -67,6 +68,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
// count. The entries are removed when the interest count reaches 0. // count. The entries are removed when the interest count reaches 0.
Dictionary<UUID, UUID> m_classifiedCache = new Dictionary<UUID, UUID>(); Dictionary<UUID, UUID> m_classifiedCache = new Dictionary<UUID, UUID>();
Dictionary<UUID, int> m_classifiedInterest = new Dictionary<UUID, int>(); Dictionary<UUID, int> m_classifiedInterest = new Dictionary<UUID, int>();
ExpiringCache<UUID, UserProfileCacheEntry> m_profilesCache = new ExpiringCache<UUID, UserProfileCacheEntry>();
IImprovedAssetCache m_assetCache;
private JsonRpcRequestManager rpc = new JsonRpcRequestManager(); private JsonRpcRequestManager rpc = new JsonRpcRequestManager();
private bool m_allowUserProfileWebURLs = true; private bool m_allowUserProfileWebURLs = true;
@ -128,7 +131,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
get; private set; get; private set;
} }
#region IRegionModuleBase implementation #region IRegionModuleBase implementation
/// <summary> /// <summary>
/// This is called to initialize the region module. For shared modules, this is called exactly once, after /// This is called to initialize the region module. For shared modules, this is called exactly once, after
@ -185,22 +187,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
Scene = scene; Scene = scene;
Scene.RegisterModuleInterface<IProfileModule>(this); Scene.RegisterModuleInterface<IProfileModule>(this);
Scene.EventManager.OnNewClient += OnNewClient; Scene.EventManager.OnNewClient += OnNewClient;
Scene.EventManager.OnMakeRootAgent += HandleOnMakeRootAgent; Scene.EventManager.OnClientClosed += OnClientClosed;
UserManagementModule = Scene.RequestModuleInterface<IUserManagement>(); UserManagementModule = Scene.RequestModuleInterface<IUserManagement>();
} }
void HandleOnMakeRootAgent (ScenePresence obj)
{
if(obj.PresenceType == PresenceType.Npc)
return;
Util.FireAndForget(delegate
{
GetImageAssets(((IScenePresence)obj).UUID);
}, null, "UserProfileModule.GetImageAssets");
}
/// <summary> /// <summary>
/// Removes the region. /// Removes the region.
/// </summary> /// </summary>
@ -211,6 +202,10 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
if(!Enabled) if(!Enabled)
return; return;
m_profilesCache.Clear();
m_classifiedCache.Clear();
m_classifiedInterest.Clear();
} }
/// <summary> /// <summary>
@ -226,6 +221,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
if(!Enabled) if(!Enabled)
return; return;
m_assetCache = Scene.RequestModuleInterface<IImprovedAssetCache>();
} }
/// <summary> /// <summary>
@ -297,6 +293,40 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
client.OnUserInfoRequest += UserPreferencesRequest; client.OnUserInfoRequest += UserPreferencesRequest;
client.OnUpdateUserInfo += UpdateUserPreferences; client.OnUpdateUserInfo += UpdateUserPreferences;
} }
void OnClientClosed(UUID AgentId, Scene scene)
{
ScenePresence sp = scene.GetScenePresence(AgentId);
IClientAPI client = sp.ControllingClient;
if (client == null)
return;
//Profile
client.OnRequestAvatarProperties -= RequestAvatarProperties;
client.OnUpdateAvatarProperties -= AvatarPropertiesUpdate;
client.OnAvatarInterestUpdate -= AvatarInterestsUpdate;
// Classifieds
// client.r GenericPacketHandler("avatarclassifiedsrequest", ClassifiedsRequest);
client.OnClassifiedInfoUpdate -= ClassifiedInfoUpdate;
client.OnClassifiedInfoRequest -= ClassifiedInfoRequest;
client.OnClassifiedDelete -= ClassifiedDelete;
// Picks
// client.AddGenericPacketHandler("avatarpicksrequest", PicksRequest);
// client.AddGenericPacketHandler("pickinforequest", PickInfoRequest);
client.OnPickInfoUpdate -= PickInfoUpdate;
client.OnPickDelete -= PickDelete;
// Notes
// client.AddGenericPacketHandler("avatarnotesrequest", NotesRequest);
client.OnAvatarNotesUpdate -= NotesUpdate;
// Preferences
client.OnUserInfoRequest -= UserPreferencesRequest;
client.OnUpdateUserInfo -= UpdateUserPreferences;
}
#endregion Region Event Handlers #endregion Region Event Handlers
#region Classified #region Classified
@ -332,6 +362,34 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return; return;
} }
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(targetID, out uce) && uce != null)
{
if(uce.classifiedsLists != null)
{
foreach(KeyValuePair<UUID,string> kvp in uce.classifiedsLists)
{
UUID kvpkey = kvp.Key;
classifieds[kvpkey] = kvp.Value;
lock (m_classifiedCache)
{
if (!m_classifiedCache.ContainsKey(kvpkey))
{
m_classifiedCache.Add(kvpkey,targetID);
m_classifiedInterest.Add(kvpkey, 0);
}
m_classifiedInterest[kvpkey]++;
}
}
remoteClient.SendAvatarClassifiedReply(targetID, uce.classifiedsLists);
return;
}
}
}
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI(targetID, out serverURI); GetUserProfileServerURI(targetID, out serverURI);
if(string.IsNullOrWhiteSpace(serverURI)) if(string.IsNullOrWhiteSpace(serverURI))
@ -380,6 +438,15 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
} }
} }
lock(m_profilesCache)
{
if(!m_profilesCache.TryGetValue(targetID, out uce) || uce == null)
uce = new UserProfileCacheEntry();
uce.classifiedsLists = classifieds;
m_profilesCache.AddOrUpdate(targetID, uce, PROFILECACHEEXPIRE);
}
remoteClient.SendAvatarClassifiedReply(targetID, classifieds); remoteClient.SendAvatarClassifiedReply(targetID, classifieds);
} }
@ -404,9 +471,29 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
} }
} }
} }
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(target, out uce) && uce != null)
{
if(uce.classifieds != null && uce.classifieds.ContainsKey(queryClassifiedID))
{
ad = uce.classifieds[queryClassifiedID];
Vector3 gPos = new Vector3();
Vector3.TryParse(ad.GlobalPos, out gPos);
remoteClient.SendClassifiedInfoReply(ad.ClassifiedId, ad.CreatorId, (uint)ad.CreationDate,
(uint)ad.ExpirationDate, (uint)ad.Category, ad.Name, ad.Description,
ad.ParcelId, (uint)ad.ParentEstate, ad.SnapshotId, ad.SimName,
gPos, ad.ParcelName, ad.Flags, ad.Price);
return;
}
}
}
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI(target, out serverURI); bool foreign = GetUserProfileServerURI(target, out serverURI);
if(string.IsNullOrWhiteSpace(serverURI)) if(string.IsNullOrWhiteSpace(serverURI))
{ {
return; return;
@ -424,6 +511,20 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
if(ad.CreatorId == UUID.Zero) if(ad.CreatorId == UUID.Zero)
return; return;
if(foreign)
cacheForeignImage(target, ad.SnapshotId);
lock(m_profilesCache)
{
if(!m_profilesCache.TryGetValue(target, out uce) || uce == null)
uce = new UserProfileCacheEntry();
if(uce.classifieds == null)
uce.classifieds = new Dictionary<UUID, UserClassifiedAdd>();
uce.classifieds[ad.ClassifiedId] = ad;
m_profilesCache.AddOrUpdate(target, uce, PROFILECACHEEXPIRE);
}
Vector3 globalPos = new Vector3(); Vector3 globalPos = new Vector3();
Vector3.TryParse(ad.GlobalPos, out globalPos); Vector3.TryParse(ad.GlobalPos, out globalPos);
@ -479,13 +580,25 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
UUID creatorId = remoteClient.AgentId; UUID creatorId = remoteClient.AgentId;
ScenePresence p = FindPresence(creatorId); ScenePresence p = FindPresence(creatorId);
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
m_profilesCache.TryGetValue(remoteClient.AgentId, out uce);
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI(remoteClient.AgentId, out serverURI); bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
if(string.IsNullOrWhiteSpace(serverURI)) if(string.IsNullOrWhiteSpace(serverURI))
{ {
return; return;
} }
if(foreign)
{
remoteClient.SendAgentAlertMessage("Please change classifieds on your home grid", true);
if(uce != null && uce.classifiedsLists != null)
remoteClient.SendAvatarClassifiedReply(remoteClient.AgentId, uce.classifiedsLists);
return;
}
OSDMap parameters = new OSDMap {{"creatorId", OSD.FromUUID(creatorId)}}; OSDMap parameters = new OSDMap {{"creatorId", OSD.FromUUID(creatorId)}};
OSD Params = (OSD)parameters; OSD Params = (OSD)parameters;
if (!rpc.JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString())) if (!rpc.JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString()))
@ -498,17 +611,20 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
bool exists = list.Cast<OSDMap>().Where(map => map.ContainsKey("classifieduuid")) bool exists = list.Cast<OSDMap>().Where(map => map.ContainsKey("classifieduuid"))
.Any(map => map["classifieduuid"].AsUUID().Equals(queryclassifiedID)); .Any(map => map["classifieduuid"].AsUUID().Equals(queryclassifiedID));
IMoneyModule money = null;
if (!exists) if (!exists)
{ {
IMoneyModule money = s.RequestModuleInterface<IMoneyModule>(); money = s.RequestModuleInterface<IMoneyModule>();
if (money != null) if (money != null)
{ {
if (!money.AmountCovered(remoteClient.AgentId, queryclassifiedPrice)) if (!money.AmountCovered(remoteClient.AgentId, queryclassifiedPrice))
{ {
remoteClient.SendAgentAlertMessage("You do not have enough money to create this classified.", false); remoteClient.SendAgentAlertMessage("You do not have enough money to create this classified.", false);
if(uce != null && uce.classifiedsLists != null)
remoteClient.SendAvatarClassifiedReply(remoteClient.AgentId, uce.classifiedsLists);
return; return;
} }
money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice, MoneyTransactionType.ClassifiedCharge); // money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice, MoneyTransactionType.ClassifiedCharge);
} }
} }
@ -535,7 +651,25 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
if(!rpc.JsonRpcRequest(ref Ad, "classified_update", serverURI, UUID.Random().ToString())) if(!rpc.JsonRpcRequest(ref Ad, "classified_update", serverURI, UUID.Random().ToString()))
{ {
remoteClient.SendAgentAlertMessage("Error updating classified", false); remoteClient.SendAgentAlertMessage("Error updating classified", false);
if(uce != null && uce.classifiedsLists != null)
remoteClient.SendAvatarClassifiedReply(remoteClient.AgentId, uce.classifiedsLists);
return;
} }
// only charge if it worked
if (money != null)
money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice, MoneyTransactionType.ClassifiedCharge);
// just flush cache for now
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
{
uce.classifieds = null;
uce.classifiedsLists = null;
}
}
} }
/// <summary> /// <summary>
@ -549,11 +683,18 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
/// </param> /// </param>
public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
{ {
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI(remoteClient.AgentId, out serverURI); bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
if(string.IsNullOrWhiteSpace(serverURI)) if(string.IsNullOrWhiteSpace(serverURI))
return; return;
if(foreign)
{
remoteClient.SendAgentAlertMessage("Please change classifieds on your home grid", true);
return;
}
UUID classifiedId; UUID classifiedId;
if(!UUID.TryParse(queryClassifiedID.ToString(), out classifiedId)) if(!UUID.TryParse(queryClassifiedID.ToString(), out classifiedId))
return; return;
@ -568,6 +709,17 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return; return;
} }
// flush cache
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
{
uce.classifieds = null;
uce.classifiedsLists = null;
}
}
parameters = (OSDMap)Params; parameters = (OSDMap)Params;
} }
#endregion Classified #endregion Classified
@ -605,6 +757,19 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return; return;
} }
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(targetId, out uce) && uce != null)
{
if(uce != null && uce.picksList != null)
{
remoteClient.SendAvatarPicksReply(targetId, uce.picksList);
return;
}
}
}
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI(targetId, out serverURI); GetUserProfileServerURI(targetId, out serverURI);
if(string.IsNullOrWhiteSpace(serverURI)) if(string.IsNullOrWhiteSpace(serverURI))
@ -637,6 +802,16 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
string name = m["name"].AsString(); string name = m["name"].AsString();
picks[cid] = name; picks[cid] = name;
} }
lock(m_profilesCache)
{
if(!m_profilesCache.TryGetValue(targetId, out uce) || uce == null)
uce = new UserProfileCacheEntry();
uce.picksList = picks;
m_profilesCache.AddOrUpdate(targetId, uce, PROFILECACHEEXPIRE);
}
remoteClient.SendAvatarPicksReply(targetId, picks); remoteClient.SendAvatarPicksReply(targetId, picks);
} }
@ -667,8 +842,27 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
if(!UUID.TryParse (args [1], out pick.PickId)) if(!UUID.TryParse (args [1], out pick.PickId))
return; return;
IClientAPI remoteClient = (IClientAPI)sender;
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(targetID, out uce) && uce != null)
{
if(uce != null && uce.picks != null && uce.picks.ContainsKey(pick.PickId))
{
pick = uce.picks[pick.PickId];
Vector3 gPos = new Vector3(Vector3.Zero);
Vector3.TryParse(pick.GlobalPos, out gPos);
remoteClient.SendPickInfoReply(pick.PickId,pick.CreatorId,pick.TopPick,pick.ParcelId,pick.Name,
pick.Desc,pick.SnapshotId,pick.ParcelName,pick.OriginalName,pick.SimName,
gPos,pick.SortOrder,pick.Enabled);
return;
}
}
}
string serverURI = string.Empty; string serverURI = string.Empty;
GetUserProfileServerURI (targetID, out serverURI); bool foreign = GetUserProfileServerURI (targetID, out serverURI);
if(string.IsNullOrWhiteSpace(serverURI)) if(string.IsNullOrWhiteSpace(serverURI))
{ {
return; return;
@ -676,8 +870,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
string theirGatekeeperURI; string theirGatekeeperURI;
GetUserGatekeeperURI(targetID, out theirGatekeeperURI); GetUserGatekeeperURI(targetID, out theirGatekeeperURI);
IClientAPI remoteClient = (IClientAPI)sender;
object Pick = (object)pick; object Pick = (object)pick;
if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) { if (!rpc.JsonRpcRequest (ref Pick, "pickinforequest", serverURI, UUID.Random ().ToString ())) {
@ -686,6 +878,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return; return;
} }
pick = (UserProfilePick)Pick; pick = (UserProfilePick)Pick;
if(foreign)
cacheForeignImage(targetID, pick.SnapshotId);
Vector3 globalPos = new Vector3(Vector3.Zero); Vector3 globalPos = new Vector3(Vector3.Zero);
Vector3.TryParse(pick.GlobalPos, out globalPos); Vector3.TryParse(pick.GlobalPos, out globalPos);
@ -716,6 +910,18 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
m_log.DebugFormat("[PROFILES]: PickInfoRequest: {0} : {1}", pick.Name.ToString(), pick.SnapshotId.ToString()); m_log.DebugFormat("[PROFILES]: PickInfoRequest: {0} : {1}", pick.Name.ToString(), pick.SnapshotId.ToString());
pick.GlobalPos = globalPos.ToString();
lock(m_profilesCache)
{
if(!m_profilesCache.TryGetValue(targetID, out uce) || uce == null)
uce = new UserProfileCacheEntry();
if(uce.picks == null)
uce.picks = new Dictionary<UUID, UserProfilePick>();
uce.picks[pick.PickId] = pick;
m_profilesCache.AddOrUpdate(targetID, uce, PROFILECACHEEXPIRE);
}
// Pull the rabbit out of the hat // Pull the rabbit out of the hat
remoteClient.SendPickInfoReply(pick.PickId,pick.CreatorId,pick.TopPick,pick.ParcelId,pick.Name, remoteClient.SendPickInfoReply(pick.PickId,pick.CreatorId,pick.TopPick,pick.ParcelId,pick.Name,
pick.Desc,pick.SnapshotId,pick.ParcelName,pick.OriginalName,pick.SimName, pick.Desc,pick.SnapshotId,pick.ParcelName,pick.OriginalName,pick.SimName,
@ -754,7 +960,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
/// </param> /// </param>
public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled) public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled)
{ {
//TODO: See how this works with NPC, May need to test
m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString());
UserProfilePick pick = new UserProfilePick(); UserProfilePick pick = new UserProfilePick();
@ -774,15 +979,19 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
avaPos.Z); avaPos.Z);
string landParcelName = "My Parcel"; string landParcelName = "My Parcel";
UUID landParcelID = p.currentParcelUUID; // UUID landParcelID = p.currentParcelUUID;
// to locate parcels we use a fake id that encodes the region handle
// since we do not have a global locator
// this fails on HG
UUID landParcelID = Util.BuildFakeParcelID(remoteClient.Scene.RegionInfo.RegionHandle, (uint)avaPos.X, (uint)avaPos.Y);
ILandObject land = p.Scene.LandChannel.GetLandObject(avaPos.X, avaPos.Y); ILandObject land = p.Scene.LandChannel.GetLandObject(avaPos.X, avaPos.Y);
if (land != null) if (land != null)
{ {
// If land found, use parcel uuid from here because the value from SP will be blank if the avatar hasnt moved // If land found, use parcel uuid from here because the value from SP will be blank if the avatar hasnt moved
landParcelName = land.LandData.Name; landParcelName = land.LandData.Name;
landParcelID = land.LandData.GlobalID; // landParcelID = land.LandData.GlobalID;
} }
else else
{ {
@ -791,7 +1000,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
avaPos.X, avaPos.Y, p.Scene.Name); avaPos.X, avaPos.Y, p.Scene.Name);
} }
pick.PickId = pickID; pick.PickId = pickID;
pick.CreatorId = creatorID; pick.CreatorId = creatorID;
pick.TopPick = topPick; pick.TopPick = topPick;
@ -814,6 +1022,24 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return; return;
} }
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(!m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) || uce == null)
uce = new UserProfileCacheEntry();
if(uce.picks == null)
uce.picks = new Dictionary<UUID, UserProfilePick>();
if(uce.picksList == null)
uce.picksList = new Dictionary<UUID, string>();
uce.picks[pick.PickId] = pick;
uce.picksList[pick.PickId] = pick.Name;
m_profilesCache.AddOrUpdate(remoteClient.AgentId, uce, PROFILECACHEEXPIRE);
}
remoteClient.SendAvatarPicksReply(remoteClient.AgentId, uce.picksList);
remoteClient.SendPickInfoReply(pick.PickId,pick.CreatorId,pick.TopPick,pick.ParcelId,pick.Name,
pick.Desc,pick.SnapshotId,pick.ParcelName,pick.OriginalName,pick.SimName,
posGlobal,pick.SortOrder,pick.Enabled);
m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString()); m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString());
} }
@ -844,6 +1070,23 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
"Error picks delete", false); "Error picks delete", false);
return; return;
} }
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
{
if(uce.picks != null && uce.picks.ContainsKey(queryPickID))
uce.picks.Remove(queryPickID);
if(uce.picksList != null && uce.picksList.ContainsKey(queryPickID))
uce.picksList.Remove(queryPickID);
m_profilesCache.AddOrUpdate(remoteClient.AgentId, uce, PROFILECACHEEXPIRE);
}
}
if(uce != null && uce.picksList != null)
remoteClient.SendAvatarPicksReply(remoteClient.AgentId, uce.picksList);
else
remoteClient.SendAvatarPicksReply(remoteClient.AgentId, new Dictionary<UUID, string>());
} }
#endregion Picks #endregion Picks
@ -1025,6 +1268,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
/// </param> /// </param>
public void AvatarInterestsUpdate(IClientAPI remoteClient, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages) public void AvatarInterestsUpdate(IClientAPI remoteClient, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages)
{ {
UserProfileProperties prop = new UserProfileProperties(); UserProfileProperties prop = new UserProfileProperties();
prop.UserId = remoteClient.AgentId; prop.UserId = remoteClient.AgentId;
@ -1046,6 +1290,17 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
"Error updating interests", false); "Error updating interests", false);
return; return;
} }
// flush cache
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
{
uce.props = null;
}
}
} }
public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) public void RequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
@ -1067,6 +1322,27 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
0, "Getting into trouble", "Droidspeak"); 0, "Getting into trouble", "Droidspeak");
return; return;
} }
UserProfileProperties props;
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(avatarID, out uce) && uce != null)
{
if(uce.props != null)
{
props = uce.props;
remoteClient.SendAvatarProperties(props.UserId, props.AboutText,
uce.born, uce.membershipType , props.FirstLifeText, uce.flags,
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask,
props.WantToText, (uint)props.SkillsMask,
props.SkillsText, props.Language);
return;
}
}
}
string serverURI = string.Empty; string serverURI = string.Empty;
bool foreign = GetUserProfileServerURI(avatarID, out serverURI); bool foreign = GetUserProfileServerURI(avatarID, out serverURI);
@ -1118,13 +1394,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
} }
} }
UserProfileProperties props = new UserProfileProperties(); props = new UserProfileProperties();
props.UserId = avatarID; props.UserId = avatarID;
string result = string.Empty; string result = string.Empty;
if(!GetProfileData(ref props, foreign, out result)) if(!GetProfileData(ref props, foreign, serverURI, out result))
{ {
props.AboutText ="Profile not avaible at this time. User may still be unknown to this grid"; props.AboutText ="Profile not available at this time. User may still be unknown to this grid";
} }
// if on same region force online // if on same region force online
@ -1134,10 +1410,21 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
if(!m_allowUserProfileWebURLs) if(!m_allowUserProfileWebURLs)
props.WebUrl =""; props.WebUrl ="";
lock(m_profilesCache)
{
if(!m_profilesCache.TryGetValue(props.UserId, out uce) || uce == null)
uce = new UserProfileCacheEntry();
uce.props = props;
uce.born = born;
uce.membershipType = membershipType;
uce.flags = flags;
m_profilesCache.AddOrUpdate(props.UserId, uce, PROFILECACHEEXPIRE);
}
remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags, remoteClient.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType , props.FirstLifeText, flags,
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId); props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText, (uint)props.SkillsMask, remoteClient.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText, (uint)props.SkillsMask,
props.SkillsText, props.Language); props.SkillsText, props.Language);
} }
@ -1155,6 +1442,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
{ {
if (remoteClient.AgentId == newProfile.ID) if (remoteClient.AgentId == newProfile.ID)
{ {
UserProfileProperties prop = new UserProfileProperties(); UserProfileProperties prop = new UserProfileProperties();
prop.UserId = remoteClient.AgentId; prop.UserId = remoteClient.AgentId;
@ -1179,6 +1467,16 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return; return;
} }
// flush cache
UserProfileCacheEntry uce = null;
lock(m_profilesCache)
{
if(m_profilesCache.TryGetValue(remoteClient.AgentId, out uce) && uce != null)
{
uce.props = null;
}
}
RequestAvatarProperties(remoteClient, newProfile.ID); RequestAvatarProperties(remoteClient, newProfile.ID);
} }
} }
@ -1189,24 +1487,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
/// <returns> /// <returns>
/// The profile data. /// The profile data.
/// </returns> /// </returns>
bool GetProfileData(ref UserProfileProperties properties, bool foreign, out string message) bool GetProfileData(ref UserProfileProperties properties, bool foreign, string serverURI, out string message)
{ {
// Can't handle NPC yet...
ScenePresence p = FindPresence(properties.UserId);
if (null != p)
{
if (p.PresenceType == PresenceType.Npc)
{
message = "Id points to NPC";
return false;
}
}
string serverURI = string.Empty;
GetUserProfileServerURI(properties.UserId, out serverURI);
// This is checking a friend on the home grid
// Not HG friend
if (String.IsNullOrEmpty(serverURI)) if (String.IsNullOrEmpty(serverURI))
{ {
message = "User profile service unknown at this time"; message = "User profile service unknown at this time";
@ -1247,10 +1529,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
return false; return false;
} }
// else, continue below
} }
properties = (UserProfileProperties)Prop; properties = (UserProfileProperties)Prop;
if(foreign)
{
cacheForeignImage(properties.UserId, properties.ImageId);
cacheForeignImage(properties.UserId, properties.FirstLifeImageId);
}
message = "Success"; message = "Success";
return true; return true;
@ -1258,49 +1544,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
#endregion Avatar Properties #endregion Avatar Properties
#region Utils #region Utils
bool GetImageAssets(UUID avatarId)
{
string profileServerURI = string.Empty;
string assetServerURI = string.Empty;
bool foreign = GetUserProfileServerURI(avatarId, out profileServerURI);
if(!foreign)
return true;
assetServerURI = UserManagementModule.GetUserServerURL(avatarId, "AssetServerURI");
if(string.IsNullOrEmpty(profileServerURI) || string.IsNullOrEmpty(assetServerURI))
return false;
OSDMap parameters= new OSDMap();
parameters.Add("avatarId", OSD.FromUUID(avatarId));
OSD Params = (OSD)parameters;
if(!rpc.JsonRpcRequest(ref Params, "image_assets_request", profileServerURI, UUID.Random().ToString()))
{
return false;
}
parameters = (OSDMap)Params;
if (parameters.ContainsKey("result"))
{
OSDArray list = (OSDArray)parameters["result"];
foreach (OSD asset in list)
{
OSDString assetId = (OSDString)asset;
Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, assetId.AsString()));
}
return true;
}
else
{
m_log.ErrorFormat("[PROFILES]: Problematic response for image_assets_request from {0}", profileServerURI);
return false;
}
}
/// <summary> /// <summary>
/// Gets the user account data. /// Gets the user account data.
@ -1451,6 +1694,27 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
} }
} }
void cacheForeignImage(UUID agent, UUID imageID)
{
if(imageID == null || imageID == UUID.Zero)
return;
string assetServerURI = UserManagementModule.GetUserServerURL(agent, "AssetServerURI");
if(string.IsNullOrWhiteSpace(assetServerURI))
return;
string imageIDstr = imageID.ToString();
if(m_assetCache != null && m_assetCache.Check(imageIDstr))
return;
if(Scene.AssetService.Get(imageIDstr) != null)
return;
Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, imageIDstr));
}
/// <summary> /// <summary>
/// Finds the presence. /// Finds the presence.
/// </summary> /// </summary>
@ -1519,9 +1783,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
webRequest.ContentType = "application/json-rpc"; webRequest.ContentType = "application/json-rpc";
webRequest.Method = "POST"; webRequest.Method = "POST";
Stream dataStream = webRequest.GetRequestStream(); using(Stream dataStream = webRequest.GetRequestStream())
dataStream.Write(content, 0, content.Length); dataStream.Write(content,0,content.Length);
dataStream.Close();
WebResponse webResponse = null; WebResponse webResponse = null;
try try
@ -1601,9 +1864,8 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
webRequest.ContentType = "application/json-rpc"; webRequest.ContentType = "application/json-rpc";
webRequest.Method = "POST"; webRequest.Method = "POST";
Stream dataStream = webRequest.GetRequestStream(); using(Stream dataStream = webRequest.GetRequestStream())
dataStream.Write(content, 0, content.Length); dataStream.Write(content,0,content.Length);
dataStream.Close();
WebResponse webResponse = null; WebResponse webResponse = null;
try try

View File

@ -271,7 +271,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
IConfigSource configSource = new IniConfigSource(); IConfigSource configSource = new IniConfigSource();
IConfig config = configSource.AddConfig("Startup"); IConfig config = configSource.AddConfig("Startup");
config.Set("serverside_object_permissions", true); config.Set("serverside_object_permissions", true);
config.Set("EventQueue", true);
EntityTransferModule etm = new EntityTransferModule(); EntityTransferModule etm = new EntityTransferModule();

View File

@ -233,7 +233,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
protected int m_maxHitsPerPrimInCastRay = 16; protected int m_maxHitsPerPrimInCastRay = 16;
protected int m_maxHitsPerObjectInCastRay = 16; protected int m_maxHitsPerObjectInCastRay = 16;
protected bool m_detectExitsInCastRay = false; protected bool m_detectExitsInCastRay = false;
protected bool m_filterPartsInCastRay = false;
protected bool m_doAttachmentsInCastRay = false; protected bool m_doAttachmentsInCastRay = false;
protected int m_msThrottleInCastRay = 200; protected int m_msThrottleInCastRay = 200;
protected int m_msPerRegionInCastRay = 40; protected int m_msPerRegionInCastRay = 40;
@ -391,7 +390,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_maxHitsPerPrimInCastRay = lslConfig.GetInt("MaxHitsPerPrimInLlCastRay", m_maxHitsPerPrimInCastRay); m_maxHitsPerPrimInCastRay = lslConfig.GetInt("MaxHitsPerPrimInLlCastRay", m_maxHitsPerPrimInCastRay);
m_maxHitsPerObjectInCastRay = lslConfig.GetInt("MaxHitsPerObjectInLlCastRay", m_maxHitsPerObjectInCastRay); m_maxHitsPerObjectInCastRay = lslConfig.GetInt("MaxHitsPerObjectInLlCastRay", m_maxHitsPerObjectInCastRay);
m_detectExitsInCastRay = lslConfig.GetBoolean("DetectExitHitsInLlCastRay", m_detectExitsInCastRay); m_detectExitsInCastRay = lslConfig.GetBoolean("DetectExitHitsInLlCastRay", m_detectExitsInCastRay);
m_filterPartsInCastRay = lslConfig.GetBoolean("FilterPartsInLlCastRay", m_filterPartsInCastRay);
m_doAttachmentsInCastRay = lslConfig.GetBoolean("DoAttachmentsInLlCastRay", m_doAttachmentsInCastRay); m_doAttachmentsInCastRay = lslConfig.GetBoolean("DoAttachmentsInLlCastRay", m_doAttachmentsInCastRay);
m_msThrottleInCastRay = lslConfig.GetInt("ThrottleTimeInMsInLlCastRay", m_msThrottleInCastRay); m_msThrottleInCastRay = lslConfig.GetInt("ThrottleTimeInMsInLlCastRay", m_msThrottleInCastRay);
m_msPerRegionInCastRay = lslConfig.GetInt("AvailableTimeInMsPerRegionInLlCastRay", m_msPerRegionInCastRay); m_msPerRegionInCastRay = lslConfig.GetInt("AvailableTimeInMsPerRegionInLlCastRay", m_msPerRegionInCastRay);
@ -15063,8 +15061,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
if (isPhantom && notdetectPhantom) if (isPhantom && notdetectPhantom)
return; return;
if (m_filterPartsInCastRay)
return;
if (isAttachment && !m_doAttachmentsInCastRay) if (isAttachment && !m_doAttachmentsInCastRay)
return; return;
@ -15072,25 +15068,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// Iterate over all prims/parts in object/group // Iterate over all prims/parts in object/group
foreach(SceneObjectPart part in group.Parts) foreach(SceneObjectPart part in group.Parts)
{ {
// Check part filters if configured // ignore PhysicsShapeType.None as physics engines do
if (m_filterPartsInCastRay) // or we will get into trouble in future
{ if(part.PhysicsShapeType == (byte)PhysicsShapeType.None)
// ignore PhysicsShapeType.None as physics engines do continue;
// or we will get into trouble in future isPhysical = (part.PhysActor != null && part.PhysActor.IsPhysical);
if(part.PhysicsShapeType == (byte)PhysicsShapeType.None) isNonphysical = !isPhysical;
continue; isPhantom = ((part.Flags & PrimFlags.Phantom) != 0) ||
isPhysical = (part.PhysActor != null && part.PhysActor.IsPhysical); (part.VolumeDetectActive);
isNonphysical = !isPhysical;
isPhantom = ((part.Flags & PrimFlags.Phantom) != 0) ||
(part.VolumeDetectActive);
if (isPhysical && rejectPhysical) if (isPhysical && rejectPhysical)
continue; continue;
if (isNonphysical && rejectNonphysical) if (isNonphysical && rejectNonphysical)
continue; continue;
if (isPhantom && notdetectPhantom) if (isPhantom && notdetectPhantom)
continue; continue;
}
// Parse prim/part and project ray if passed filters // Parse prim/part and project ray if passed filters
Vector3 scalePart = part.Scale; Vector3 scalePart = part.Scale;

View File

@ -310,7 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
foreach (string id in ids) foreach (string id in ids)
{ {
string current = id.Trim(); string current = id.Trim();
if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER") if (current.ToUpper() == "PARCEL_GROUP_MEMBER" || current.ToUpper() == "PARCEL_OWNER" || current.ToUpper() == "ESTATE_MANAGER" || current.ToUpper() == "ESTATE_OWNER" || current.ToUpper() == "GRID_GOD")
{ {
if (!perms.AllowedOwnerClasses.Contains(current)) if (!perms.AllowedOwnerClasses.Contains(current))
perms.AllowedOwnerClasses.Add(current.ToUpper()); perms.AllowedOwnerClasses.Add(current.ToUpper());
@ -415,6 +415,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
//Only gods may use the function
if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("GRID_GOD"))
{
if (World.Permissions.IsGridGod(ownerID))
{
return String.Empty;
}
}
if (!m_FunctionPerms[function].AllowedCreators.Contains(m_item.CreatorID)) if (!m_FunctionPerms[function].AllowedCreators.Contains(m_item.CreatorID))
return( return(
String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.", String.Format("{0} permission denied. Script creator is not in the list of users allowed to execute this function and prim owner also has no permission.",

View File

@ -55,11 +55,7 @@ namespace OpenSim.Server.Base
// //
protected string[] m_Arguments; protected string[] m_Arguments;
public string ConfigDirectory protected string m_configDirectory = ".";
{
get;
private set;
}
// Run flag // Run flag
// //
@ -101,31 +97,24 @@ namespace OpenSim.Server.Base
logConfig =startupConfig.GetString("logconfig", logConfig); logConfig =startupConfig.GetString("logconfig", logConfig);
} }
// Find out of the file name is a URI and remote load it if possible. Config = ReadConfigSource(iniFile);
// Load it as a local file otherwise.
Uri configUri;
try List<string> sources = new List<string>();
sources.Add(iniFile);
int sourceIndex = 1;
while (AddIncludes(Config, sources))
{ {
if (Uri.TryCreate(iniFile, UriKind.Absolute, out configUri) && for ( ; sourceIndex < sources.Count ; ++sourceIndex)
configUri.Scheme == Uri.UriSchemeHttp)
{ {
XmlReader r = XmlReader.Create(iniFile); IConfigSource s = ReadConfigSource(sources[sourceIndex]);
Config = new XmlConfigSource(r); Config.Merge(s);
} }
else
{
Config = new IniConfigSource(iniFile);
}
}
catch (Exception e)
{
System.Console.WriteLine("Error reading from config source. {0}", e.Message);
Environment.Exit(1);
} }
// Merge OpSys env vars // Merge OpSys env vars
m_log.Info("[CONFIG]: Loading environment variables for Config"); Console.WriteLine("[CONFIG]: Loading environment variables for Config");
Util.MergeEnvironmentToConfig(Config); Util.MergeEnvironmentToConfig(Config);
// Merge the configuration from the command line into the loaded file // Merge the configuration from the command line into the loaded file
@ -141,7 +130,7 @@ namespace OpenSim.Server.Base
if (startupConfig != null) if (startupConfig != null)
{ {
ConfigDirectory = startupConfig.GetString("ConfigDirectory", "."); m_configDirectory = startupConfig.GetString("ConfigDirectory", m_configDirectory);
prompt = startupConfig.GetString("Prompt", prompt); prompt = startupConfig.GetString("Prompt", prompt);
} }
@ -241,5 +230,114 @@ namespace OpenSim.Server.Base
protected virtual void Initialise() protected virtual void Initialise()
{ {
} }
/// <summary>
/// Adds the included files as ini configuration files
/// </summary>
/// <param name="sources">List of URL strings or filename strings</param>
private bool AddIncludes(IConfigSource configSource, List<string> sources)
{
bool sourcesAdded = false;
//loop over config sources
foreach (IConfig config in configSource.Configs)
{
// Look for Include-* in the key name
string[] keys = config.GetKeys();
foreach (string k in keys)
{
if (k.StartsWith("Include-"))
{
// read the config file to be included.
string file = config.GetString(k);
if (IsUri(file))
{
if (!sources.Contains(file))
{
sourcesAdded = true;
sources.Add(file);
}
}
else
{
string basepath = Path.GetFullPath(m_configDirectory);
// Resolve relative paths with wildcards
string chunkWithoutWildcards = file;
string chunkWithWildcards = string.Empty;
int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' });
if (wildcardIndex != -1)
{
chunkWithoutWildcards = file.Substring(0, wildcardIndex);
chunkWithWildcards = file.Substring(wildcardIndex);
}
string path = Path.Combine(basepath, chunkWithoutWildcards);
path = Path.GetFullPath(path) + chunkWithWildcards;
string[] paths = Util.Glob(path);
// If the include path contains no wildcards, then warn the user that it wasn't found.
if (wildcardIndex == -1 && paths.Length == 0)
{
Console.WriteLine("[CONFIG]: Could not find include file {0}", path);
}
else
{
foreach (string p in paths)
{
if (!sources.Contains(p))
{
sourcesAdded = true;
sources.Add(p);
}
}
}
}
}
}
}
return sourcesAdded;
}
/// <summary>
/// Check if we can convert the string to a URI
/// </summary>
/// <param name="file">String uri to the remote resource</param>
/// <returns>true if we can convert the string to a Uri object</returns>
bool IsUri(string file)
{
Uri configUri;
return Uri.TryCreate(file, UriKind.Absolute,
out configUri) && configUri.Scheme == Uri.UriSchemeHttp;
}
IConfigSource ReadConfigSource(string iniFile)
{
// Find out of the file name is a URI and remote load it if possible.
// Load it as a local file otherwise.
Uri configUri;
IConfigSource s = null;
try
{
if (Uri.TryCreate(iniFile, UriKind.Absolute, out configUri) &&
configUri.Scheme == Uri.UriSchemeHttp)
{
XmlReader r = XmlReader.Create(iniFile);
s = new XmlConfigSource(r);
}
else
{
s = new IniConfigSource(iniFile);
}
}
catch (Exception e)
{
System.Console.WriteLine("Error reading from config source. {0}", e.Message);
Environment.Exit(1);
}
return s;
}
} }
} }

View File

@ -264,21 +264,17 @@ namespace OpenSim.Tools.Configger
config.Set("region_info_source", "filesystem"); config.Set("region_info_source", "filesystem");
config.Set("allow_regionless", false); config.Set("allow_regionless", false);
config.Set("gridmode", false);
config.Set("physics", "OpenDynamicsEngine"); config.Set("physics", "OpenDynamicsEngine");
config.Set("meshing", "Meshmerizer"); config.Set("meshing", "Meshmerizer");
config.Set("physical_prim", true); config.Set("physical_prim", true);
config.Set("serverside_object_permissions", true); config.Set("serverside_object_permissions", true);
config.Set("storage_prim_inventories", true);
config.Set("startup_console_commands_file", String.Empty); config.Set("startup_console_commands_file", String.Empty);
config.Set("shutdown_console_commands_file", String.Empty); config.Set("shutdown_console_commands_file", String.Empty);
config.Set("DefaultScriptEngine", "XEngine"); config.Set("DefaultScriptEngine", "XEngine");
config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); config.Set("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
// life doesn't really work without this
config.Set("EventQueue", true);
} }
return defaultConfig; return defaultConfig;
} }
} }
} }

View File

@ -1649,9 +1649,6 @@
; Report ray intersections with surfaces on exits from a prim as hits in llCastRay V3 if true ; Report ray intersections with surfaces on exits from a prim as hits in llCastRay V3 if true
DetectExitHitsInLlCastRay = false DetectExitHitsInLlCastRay = false
; Filter on parts instead of groups in llCastRay V3 if true
FilterPartsInLlCastRay = false
; Detect attachments in llCastRay V3 if true ; Detect attachments in llCastRay V3 if true
DoAttachmentsInLlCastRay = false DoAttachmentsInLlCastRay = false

View File

@ -58,7 +58,7 @@
; Modular configurations ; Modular configurations
; Set path to directory for modular ini files... ; Set path to directory for modular ini files...
; The Robust.exe process must have R/W access to the location ; The Robust.exe process must have R/W access to the location
ConfigDirectory = "." ConfigDirectory = "robust-include"
; Console commands can be saved to a file, so the command history persists after a restart. (default is true) ; Console commands can be saved to a file, so the command history persists after a restart. (default is true)
ConsoleHistoryFileEnabled = true ConsoleHistoryFileEnabled = true
@ -102,7 +102,13 @@
;; Uncomment this if you want Groups V2 to work ;; Uncomment this if you want Groups V2 to work
; GroupsServiceConnector = "${Const|PrivatePort}/OpenSim.Addons.Groups.dll:GroupsServiceRobustConnector" ; GroupsServiceConnector = "${Const|PrivatePort}/OpenSim.Addons.Groups.dll:GroupsServiceRobustConnector"
;; Uncomment to provide bakes caching ;; Uncomment to provide bakes caching
;BakedTextureService = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:XBakesConnector" ; BakedTextureService = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:XBakesConnector"
;; Uncomment for UserProfiles see [UserProfilesService] to configure...
; UserProfilesServiceConnector = "${Const|PublicPort}/OpenSim.Server.Handlers.dll:UserProfilesConnector"
;; Uncomment if you want to have centralized estate data
; EstateDataService = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:EstateDataRobustConnector"
;; Additions for Hypergrid ;; Additions for Hypergrid
@ -116,12 +122,6 @@
;; Uncomment this if you want Groups V2, HG to work ;; Uncomment this if you want Groups V2, HG to work
; HGGroupsServiceConnector = "${Const|PublicPort}/OpenSim.Addons.Groups.dll:HGGroupsServiceRobustConnector" ; HGGroupsServiceConnector = "${Const|PublicPort}/OpenSim.Addons.Groups.dll:HGGroupsServiceRobustConnector"
;; Uncomment for UserProfiles see [UserProfilesService] to configure...
; UserProfilesServiceConnector = "${Const|PublicPort}/OpenSim.Server.Handlers.dll:UserProfilesConnector"
;; Uncomment if you want to have centralized estate data
; EstateDataService = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:EstateDataRobustConnector"
; * This is common for all services, it's the network setup for the entire ; * This is common for all services, it's the network setup for the entire
; * server instance, if none is specified above ; * server instance, if none is specified above
; * ; *
@ -264,6 +264,18 @@
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "./assets/AssetSets.xml" AssetLoaderArgs = "./assets/AssetSets.xml"
; Allow maptile assets to remotely deleted by remote calls to the asset service.
; There is no harm in having this as false - it just means that historical maptile assets are not deleted.
; This only applies to maptiles served via the version 1 viewer mechanisms
; Default is false
AllowRemoteDelete = false
; Allow all assets to be remotely deleted.
; Only set this to true if you are operating a grid where you control all calls to the asset service
; (where a necessary condition is that you control all simulators) and you need this for admin purposes.
; If set to true, AllowRemoteDelete = true is required as well.
; Default is false.
AllowRemoteDeleteAllTypes = false
; * This configuration loads the inventory server modules. It duplicates ; * This configuration loads the inventory server modules. It duplicates
; * the function of the legacy inventory server ; * the function of the legacy inventory server
@ -315,6 +327,7 @@
;; ;;
;; Persistent When the simulator is shutdown, the region is signalled as offline but left registered on the grid. ;; Persistent When the simulator is shutdown, the region is signalled as offline but left registered on the grid.
;; ;;
;; Example specification:
; Region_Welcome_Area = "DefaultRegion, FallbackRegion" ; Region_Welcome_Area = "DefaultRegion, FallbackRegion"
; (replace spaces with underscore) ; (replace spaces with underscore)
@ -439,6 +452,9 @@
; for the server connector ; for the server connector
LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService" LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService"
; Set this to true to allow the use of advanced web services and multiple
; bots using one account
AllowDuplicatePresences = false;
[AvatarService] [AvatarService]
; for the server connector ; for the server connector
@ -470,14 +486,21 @@
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
SimulationService ="OpenSim.Services.Connectors.dll:SimulationServiceConnector" SimulationService ="OpenSim.Services.Connectors.dll:SimulationServiceConnector"
LibraryService = "OpenSim.Services.InventoryService.dll:LibraryService" LibraryService = "OpenSim.Services.InventoryService.dll:LibraryService"
UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService"
FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService" FriendsService = "OpenSim.Services.FriendsService.dll:FriendsService"
; The minimum user level required for a user to be able to login. 0 by default
; If you disable a particular user's account then you can set their login level below this number.
; You can also change this level from the console though these changes will not be persisted.
; MinLoginLevel = 0
;; for hypergrid
UserAgentService = "OpenSim.Services.HypergridService.dll:UserAgentService"
; This inventory service will be used to initialize the user's inventory ; This inventory service will be used to initialize the user's inventory
HGInventoryServicePlugin = "OpenSim.Services.HypergridService.dll:HGSuitcaseInventoryService" HGInventoryServicePlugin = "OpenSim.Services.HypergridService.dll:HGSuitcaseInventoryService"
HGInventoryServiceConstructorArg = "HGInventoryService" HGInventoryServiceConstructorArg = "HGInventoryService"
;; end hypergrid
;; Ask co-operative viewers to use a different currency name ; Ask co-operative viewers to use a different currency name
;Currency = "" ;Currency = ""
;; Set minimum fee to publish classified ;; Set minimum fee to publish classified
@ -525,6 +548,24 @@
;; 'America/Los_Angeles' is used on Linux/Mac systems whilst 'Pacific Standard Time' is used on Windows ;; 'America/Los_Angeles' is used on Linux/Mac systems whilst 'Pacific Standard Time' is used on Windows
DSTZone = "America/Los_Angeles;Pacific Standard Time" DSTZone = "America/Los_Angeles;Pacific Standard Time"
;Basic Login Service Dos Protection Tweaks
;;
;; Some Grids/Users use a transparent proxy that makes use of the X-Forwarded-For HTTP Header, If you do, set this to true
;; If you set this to true and you don't have a transparent proxy, it may allow attackers to put random things in the X-Forwarded-For header to
;; get around this basic DOS protection.
;DOSAllowXForwardedForHeader = false
;;
;; The protector adds up requests during this rolling period of time, default 10 seconds
;DOSRequestTimeFrameMS = 10000
;;
;; The amount of requests in the above timeframe from the same endpoint that triggers protection
;DOSMaxRequestsInTimeFrame = 5
;;
;; The amount of time that a specific endpoint is blocked. Default 2 minutes.
;DOSForgiveClientAfterMS = 120000
;;
;; To turn off basic dos protection, set the DOSMaxRequestsInTimeFrame to 0.
[MapImageService] [MapImageService]
LocalServiceModule = "OpenSim.Services.MapImageService.dll:MapImageService" LocalServiceModule = "OpenSim.Services.MapImageService.dll:MapImageService"
@ -757,6 +798,7 @@
;; What is the HomeURI of users associated with this grid? ;; What is the HomeURI of users associated with this grid?
;; Can overwrite the default in [Hypergrid], but probably shouldn't ;; Can overwrite the default in [Hypergrid], but probably shouldn't
; HomeURI = "${Const|BaseURL}:${Const|PublicPort}" ; HomeURI = "${Const|BaseURL}:${Const|PublicPort}"
;; end hypergrid
;; Sets the maximum number of groups an agent may join ;; Sets the maximum number of groups an agent may join
; MaxAgentGroups = 42 ; MaxAgentGroups = 42

View File

@ -50,7 +50,7 @@
; Modular configurations ; Modular configurations
; Set path to directory for modular ini files... ; Set path to directory for modular ini files...
; The Robust.exe process must have R/W access to the location ; The Robust.exe process must have R/W access to the location
ConfigDirectory = "." ConfigDirectory = "robust-include"
; Console commands can be saved to a file, so the command history persists after a restart. (default is true) ; Console commands can be saved to a file, so the command history persists after a restart. (default is true)
ConsoleHistoryFileEnabled = true ConsoleHistoryFileEnabled = true
@ -89,11 +89,11 @@
MapAddServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:MapAddServiceConnector" MapAddServiceConnector = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:MapAddServiceConnector"
MapGetServiceConnector = "${Const|PublicPort}/OpenSim.Server.Handlers.dll:MapGetServiceConnector" MapGetServiceConnector = "${Const|PublicPort}/OpenSim.Server.Handlers.dll:MapGetServiceConnector"
;; Uncomment this if you want offline IM to work ;; Uncomment this if you want offline IM to work
;OfflineIMServiceConnector = "${Const|PrivatePort}/OpenSim.Addons.OfflineIM.dll:OfflineIMServiceRobustConnector" ; OfflineIMServiceConnector = "${Const|PrivatePort}/OpenSim.Addons.OfflineIM.dll:OfflineIMServiceRobustConnector"
;; Uncomment this if you want Groups V2 to work ;; Uncomment this if you want Groups V2 to work
;GroupsServiceConnector = "${Const|PrivatePort}/OpenSim.Addons.Groups.dll:GroupsServiceRobustConnector" ; GroupsServiceConnector = "${Const|PrivatePort}/OpenSim.Addons.Groups.dll:GroupsServiceRobustConnector"
;; Uncomment to provide bakes caching ;; Uncomment to provide bakes caching
;BakedTextureService = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:XBakesConnector" ; BakedTextureService = "${Const|PrivatePort}/OpenSim.Server.Handlers.dll:XBakesConnector"
;; Uncomment for UserProfiles see [UserProfilesService] to configure... ;; Uncomment for UserProfiles see [UserProfilesService] to configure...
; UserProfilesServiceConnector = "${Const|PublicPort}/OpenSim.Server.Handlers.dll:UserProfilesConnector" ; UserProfilesServiceConnector = "${Const|PublicPort}/OpenSim.Server.Handlers.dll:UserProfilesConnector"
@ -222,7 +222,7 @@
;; The following are common to both the default asset service and FSAsset service ;; The following are common to both the default asset service and FSAsset service
;; Default loader for loading default assets from XML on first run ;; Common asset service options
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "./assets/AssetSets.xml" AssetLoaderArgs = "./assets/AssetSets.xml"
@ -332,6 +332,7 @@
[AuthenticationService] [AuthenticationService]
; for the server connector ; for the server connector
LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
; Realm = "useraccounts"
;; Allow the service to process HTTP getauthinfo calls. ;; Allow the service to process HTTP getauthinfo calls.
;; Default is false. ;; Default is false.
@ -352,8 +353,8 @@
UserAccountServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAccountServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService"
; * This is the new style authentication service. Currently, only MySQL ; * This is the new style user service.
; * is implemented. "Realm" is the table that is used for user lookup. ; * "Realm" is the table that is used for user lookup.
; * It defaults to "useraccounts", which uses the new style. ; * It defaults to "useraccounts", which uses the new style.
; * Realm = "users" will use the legacy tables as an authentication source ; * Realm = "users" will use the legacy tables as an authentication source
; * ; *
@ -463,15 +464,6 @@
; If you run this login server behind a proxy, set this to true ; If you run this login server behind a proxy, set this to true
; HasProxy = false ; HasProxy = false
;# {DSTZone} {} {Override Daylight Saving Time rules} {* none local} "America/Los_Angeles;Pacific Standard Time"
;; Viewers do not listen to timezone sent by the server. They use Pacific Standard Time instead,
;; but rely on the server to calculate Daylight Saving Time. Sending another DST than US Pacific
;; would result in time inconsistencies between grids (during summer and around DST transition period)
;; default let OpenSim calculate US Pacific DST
;; "none" disable DST (equivallent to "local" with system set to GMT)
;; "local" force legacy behaviour (using local system time to calculate DST)
; DSTZone = "America/Los_Angeles;Pacific Standard Time"
;# {DSTZone} {} {Override Daylight Saving Time rules} {* none local} "America/Los_Angeles;Pacific Standard Time" ;# {DSTZone} {} {Override Daylight Saving Time rules} {* none local} "America/Los_Angeles;Pacific Standard Time"
;; Viewers do not receive timezone information from the server - almost all (?) default to Pacific Standard Time ;; Viewers do not receive timezone information from the server - almost all (?) default to Pacific Standard Time
;; However, they do rely on the server to tell them whether it's Daylight Saving Time or not. ;; However, they do rely on the server to tell them whether it's Daylight Saving Time or not.
@ -517,16 +509,6 @@
; HasProxy = false ; HasProxy = false
[Messaging]
; OfflineIM
OfflineIMService = "OpenSim.Addons.OfflineIM.dll:OfflineIMService"
[Groups]
;; Sets the maximum number of groups an agent may join
; MaxAgentGroups = 42
[GridInfoService] [GridInfoService]
; These settings are used to return information on a get_grid_info call. ; These settings are used to return information on a get_grid_info call.
; Client launcher scripts and third-party clients make use of this to ; Client launcher scripts and third-party clients make use of this to
@ -567,6 +549,16 @@
;password = ${Const|BaseURL}/password ;password = ${Const|BaseURL}/password
[Messaging]
; OfflineIM
OfflineIMService = "OpenSim.Addons.OfflineIM.dll:OfflineIMService"
[Groups]
;; Sets the maximum number of groups an agent may join
; MaxAgentGroups = 42
[UserProfilesService] [UserProfilesService]
LocalServiceModule = "OpenSim.Services.UserProfilesService.dll:UserProfilesService" LocalServiceModule = "OpenSim.Services.UserProfilesService.dll:UserProfilesService"
Enabled = false Enabled = false