mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 03:45:35 +08:00
Resolve merge commits, stage 1
This commit is contained in:
@@ -83,7 +83,7 @@ namespace OpenSim.Services.AssetService
|
||||
|
||||
if (assetLoaderEnabled)
|
||||
{
|
||||
m_log.InfoFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
|
||||
m_log.DebugFormat("[ASSET]: Loading default asset set from {0}", loaderArgs);
|
||||
|
||||
m_AssetLoader.ForEachDefaultXmlAsset(
|
||||
loaderArgs,
|
||||
@@ -100,7 +100,7 @@ namespace OpenSim.Services.AssetService
|
||||
});
|
||||
}
|
||||
|
||||
m_log.Info("[ASSET SERVICE]: Local asset service enabled");
|
||||
m_log.Debug("[ASSET SERVICE]: Local asset service enabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,11 +174,20 @@ namespace OpenSim.Services.AssetService
|
||||
|
||||
public virtual string Store(AssetBase asset)
|
||||
{
|
||||
//m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID);
|
||||
if (!m_Database.StoreAsset(asset))
|
||||
if (!m_Database.ExistsAsset(asset.FullID))
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
|
||||
if (!m_Database.StoreAsset(asset))
|
||||
{
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET SERVICE]: Not storing asset {0} {1}, bytes {2} as it already exists", asset.Name, asset.FullID, asset.Data.Length);
|
||||
// }
|
||||
|
||||
return asset.ID;
|
||||
}
|
||||
|
||||
@@ -42,15 +42,13 @@ namespace OpenSim.Services.AuthenticationService
|
||||
public class WebkeyOrPasswordAuthenticationService : AuthenticationServiceBase, IAuthenticationService
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IConfigSource m_config;
|
||||
|
||||
private Dictionary<string, IAuthenticationService> m_svcChecks
|
||||
= new Dictionary<string, IAuthenticationService>();
|
||||
|
||||
public WebkeyOrPasswordAuthenticationService(IConfigSource config)
|
||||
: base(config)
|
||||
{
|
||||
this.m_config = config;
|
||||
m_svcChecks["web_login_key"] = new WebkeyAuthenticationService(config);
|
||||
m_svcChecks["password"] = new PasswordAuthenticationService(config);
|
||||
}
|
||||
|
||||
@@ -48,10 +48,11 @@ namespace OpenSim.Services.AuthorizationService
|
||||
m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled");
|
||||
}
|
||||
|
||||
public bool IsAuthorizedForRegion(string userID, string regionID, out string message)
|
||||
public bool IsAuthorizedForRegion(
|
||||
string userID, string firstName, string lastName, string regionID, out string message)
|
||||
{
|
||||
message = "Authorized";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace OpenSim.Services.AvatarService
|
||||
public AvatarAppearance GetAppearance(UUID principalID)
|
||||
{
|
||||
AvatarData avatar = GetAvatar(principalID);
|
||||
return avatar.ToAvatarAppearance(principalID);
|
||||
return avatar.ToAvatarAppearance();
|
||||
}
|
||||
|
||||
public bool SetAppearance(UUID principalID, AvatarAppearance appearance)
|
||||
@@ -109,7 +109,33 @@ namespace OpenSim.Services.AvatarService
|
||||
foreach (KeyValuePair<string,string> kvp in avatar.Data)
|
||||
{
|
||||
av.Data["Name"] = kvp.Key;
|
||||
av.Data["Value"] = kvp.Value;
|
||||
|
||||
// justincc 20110730. Yes, this is a hack to get around the fact that a bug in OpenSim is causing
|
||||
// various simulators on osgrid to inject bad values. Since these simulators might be around for a
|
||||
// long time, we are going to manually police the value.
|
||||
//
|
||||
// It should be possible to remove this in half a year if we don't want to police values server side.
|
||||
if (kvp.Key == "AvatarHeight")
|
||||
{
|
||||
float height;
|
||||
if (!float.TryParse(kvp.Value, out height) || height < 0 || height > 10)
|
||||
{
|
||||
string rawHeight = kvp.Value.Replace(",", ".");
|
||||
|
||||
if (!float.TryParse(rawHeight, out height) || height < 0 || height > 10)
|
||||
height = 1.771488f;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[AVATAR SERVICE]: Rectifying height of avatar {0} from {1} to {2}",
|
||||
principalID, kvp.Value, height);
|
||||
}
|
||||
|
||||
av.Data["Value"] = height.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
av.Data["Value"] = kvp.Value;
|
||||
}
|
||||
|
||||
if (!m_Database.Store(av))
|
||||
{
|
||||
|
||||
@@ -51,6 +51,13 @@ namespace OpenSim.Services.Connectors
|
||||
private int m_retryCounter;
|
||||
private Dictionary<int, List<AssetBase>> m_retryQueue = new Dictionary<int, List<AssetBase>>();
|
||||
private Timer m_retryTimer;
|
||||
private delegate void AssetRetrievedEx(AssetBase asset);
|
||||
|
||||
// Keeps track of concurrent requests for the same asset, so that it's only loaded once.
|
||||
// Maps: Asset ID -> Handlers which will be called when the asset has been loaded
|
||||
private Dictionary<string, AssetRetrievedEx> m_AssetHandlers = new Dictionary<string, AssetRetrievedEx>();
|
||||
|
||||
|
||||
public AssetServicesConnector()
|
||||
{
|
||||
}
|
||||
@@ -230,23 +237,56 @@ namespace OpenSim.Services.Connectors
|
||||
|
||||
if (asset == null || asset.Data == null || asset.Data.Length == 0)
|
||||
{
|
||||
bool result = false;
|
||||
lock (m_AssetHandlers)
|
||||
{
|
||||
AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); });
|
||||
|
||||
AsynchronousRestObjectRequester.
|
||||
MakeRequest<int, AssetBase>("GET", uri, 0,
|
||||
AssetRetrievedEx handlers;
|
||||
if (m_AssetHandlers.TryGetValue(id, out handlers))
|
||||
{
|
||||
// Someone else is already loading this asset. It will notify our handler when done.
|
||||
handlers += handlerEx;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Load the asset ourselves
|
||||
handlers += handlerEx;
|
||||
m_AssetHandlers.Add(id, handlers);
|
||||
}
|
||||
|
||||
bool success = false;
|
||||
try
|
||||
{
|
||||
AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0,
|
||||
delegate(AssetBase a)
|
||||
{
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(a);
|
||||
handler(id, sender, a);
|
||||
result = true;
|
||||
});
|
||||
|
||||
return result;
|
||||
AssetRetrievedEx handlers;
|
||||
lock (m_AssetHandlers)
|
||||
{
|
||||
handlers = m_AssetHandlers[id];
|
||||
m_AssetHandlers.Remove(id);
|
||||
}
|
||||
handlers.Invoke(a);
|
||||
});
|
||||
|
||||
success = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!success)
|
||||
{
|
||||
lock (m_AssetHandlers)
|
||||
{
|
||||
m_AssetHandlers.Remove(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Util.FireAndForget(delegate { handler(id, sender, asset); });
|
||||
handler(id, sender, asset);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace OpenSim.Services.Connectors
|
||||
public AvatarAppearance GetAppearance(UUID userID)
|
||||
{
|
||||
AvatarData avatar = GetAvatar(userID);
|
||||
return avatar.ToAvatarAppearance(userID);
|
||||
return avatar.ToAvatarAppearance();
|
||||
}
|
||||
|
||||
public bool SetAppearance(UUID userID, AvatarAppearance appearance)
|
||||
|
||||
@@ -242,6 +242,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
m_log.Debug("[USER AGENT CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
|
||||
}
|
||||
|
||||
// Add the input arguments
|
||||
args["gatekeeper_serveruri"] = OSD.FromString(gatekeeper.ServerURI);
|
||||
args["gatekeeper_host"] = OSD.FromString(gatekeeper.ExternalHostName);
|
||||
@@ -427,7 +428,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("status_notification", paramList);
|
||||
string reason = string.Empty;
|
||||
// string reason = string.Empty;
|
||||
|
||||
// Send and get reply
|
||||
List<UUID> friendsOnline = new List<UUID>();
|
||||
@@ -436,17 +437,17 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
response = request.Send(m_ServerURL, 6000);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
return friendsOnline;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
// reason = "XMLRPC Fault";
|
||||
return friendsOnline;
|
||||
}
|
||||
|
||||
@@ -458,7 +459,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
// reason = "Internal error 1";
|
||||
return friendsOnline;
|
||||
}
|
||||
|
||||
@@ -474,10 +475,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
}
|
||||
|
||||
return friendsOnline;
|
||||
@@ -498,7 +499,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("get_online_friends", paramList);
|
||||
string reason = string.Empty;
|
||||
// string reason = string.Empty;
|
||||
|
||||
// Send and get reply
|
||||
List<UUID> online = new List<UUID>();
|
||||
@@ -507,17 +508,17 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
response = request.Send(m_ServerURL, 10000);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
return online;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
// reason = "XMLRPC Fault";
|
||||
return online;
|
||||
}
|
||||
|
||||
@@ -529,7 +530,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetOnlineFriends Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
// reason = "Internal error 1";
|
||||
return online;
|
||||
}
|
||||
|
||||
@@ -545,10 +546,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
}
|
||||
|
||||
return online;
|
||||
@@ -563,7 +564,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("get_server_urls", paramList);
|
||||
string reason = string.Empty;
|
||||
// string reason = string.Empty;
|
||||
|
||||
// Send and get reply
|
||||
Dictionary<string, object> serverURLs = new Dictionary<string,object>();
|
||||
@@ -572,17 +573,17 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
response = request.Send(m_ServerURL, 10000);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
return serverURLs;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
// reason = "XMLRPC Fault";
|
||||
return serverURLs;
|
||||
}
|
||||
|
||||
@@ -594,7 +595,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetServerURLs Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
// reason = "Internal error 1";
|
||||
return serverURLs;
|
||||
}
|
||||
|
||||
@@ -609,10 +610,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetOnlineFriends response.");
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
}
|
||||
|
||||
return serverURLs;
|
||||
@@ -627,7 +628,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("locate_user", paramList);
|
||||
string reason = string.Empty;
|
||||
// string reason = string.Empty;
|
||||
|
||||
// Send and get reply
|
||||
string url = string.Empty;
|
||||
@@ -636,17 +637,17 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
response = request.Send(m_ServerURL, 10000);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
return url;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
// reason = "XMLRPC Fault";
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -658,7 +659,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: LocateUser Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
// reason = "Internal error 1";
|
||||
return url;
|
||||
}
|
||||
|
||||
@@ -667,10 +668,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
url = hash["URL"].ToString();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response.");
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
}
|
||||
|
||||
return url;
|
||||
@@ -686,7 +687,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("get_uui", paramList);
|
||||
string reason = string.Empty;
|
||||
// string reason = string.Empty;
|
||||
|
||||
// Send and get reply
|
||||
string uui = string.Empty;
|
||||
@@ -695,17 +696,17 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
{
|
||||
response = request.Send(m_ServerURL, 10000);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
return uui;
|
||||
}
|
||||
|
||||
if (response.IsFault)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
|
||||
reason = "XMLRPC Fault";
|
||||
// reason = "XMLRPC Fault";
|
||||
return uui;
|
||||
}
|
||||
|
||||
@@ -717,7 +718,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
if (hash == null)
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: GetUUI Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
|
||||
reason = "Internal error 1";
|
||||
// reason = "Internal error 1";
|
||||
return uui;
|
||||
}
|
||||
|
||||
@@ -726,10 +727,10 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
uui = hash["UUI"].ToString();
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on LocateUser response.");
|
||||
reason = "Exception: " + e.Message;
|
||||
// reason = "Exception: " + e.Message;
|
||||
}
|
||||
|
||||
return uui;
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace OpenSim.Services.Connectors
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private string m_ServerURI = String.Empty;
|
||||
private IImprovedAssetCache m_Cache = null;
|
||||
|
||||
public MapImageServicesConnector()
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName);
|
||||
m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
wearables[11] = new AvatarWearable(map["UnderpantsItem"].AsUUID(), map["UnderpantsAsset"].AsUUID());
|
||||
wearables[12] = new AvatarWearable(map["SkirtItem"].AsUUID(), map["SkirtAsset"].AsUUID());
|
||||
|
||||
AvatarAppearance appearance = new AvatarAppearance(userID);
|
||||
AvatarAppearance appearance = new AvatarAppearance();
|
||||
appearance.Wearables = wearables;
|
||||
appearance.AvatarHeight = (float)map["Height"].AsReal();
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
|
||||
if (avatar.AvatarType == 1) // LLAvatar
|
||||
{
|
||||
AvatarAppearance appearance = avatar.ToAvatarAppearance(userID);
|
||||
AvatarAppearance appearance = avatar.ToAvatarAppearance();
|
||||
|
||||
OSDMap map = new OSDMap();
|
||||
|
||||
|
||||
@@ -320,18 +320,25 @@ namespace OpenSim.Services.GridService
|
||||
return null;
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByName(UUID scopeID, string regionName)
|
||||
public GridRegion GetRegionByName(UUID scopeID, string name)
|
||||
{
|
||||
List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID);
|
||||
List<RegionData> rdatas = m_Database.Get(name, scopeID);
|
||||
if ((rdatas != null) && (rdatas.Count > 0))
|
||||
return RegionData2RegionInfo(rdatas[0]); // get the first
|
||||
|
||||
if (m_AllowHypergridMapSearch)
|
||||
{
|
||||
GridRegion r = GetHypergridRegionByName(scopeID, name);
|
||||
if (r != null)
|
||||
return r;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
{
|
||||
m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
|
||||
// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
|
||||
|
||||
List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);
|
||||
|
||||
@@ -340,7 +347,7 @@ namespace OpenSim.Services.GridService
|
||||
|
||||
if (rdatas != null)
|
||||
{
|
||||
m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
foreach (RegionData rdata in rdatas)
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
@@ -348,9 +355,9 @@ namespace OpenSim.Services.GridService
|
||||
}
|
||||
}
|
||||
|
||||
if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains("."))
|
||||
if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)))
|
||||
{
|
||||
GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name);
|
||||
GridRegion r = GetHypergridRegionByName(scopeID, name);
|
||||
if (r != null)
|
||||
rinfos.Add(r);
|
||||
}
|
||||
@@ -358,6 +365,20 @@ namespace OpenSim.Services.GridService
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a hypergrid region.
|
||||
/// </summary>
|
||||
/// <param name="scopeID"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <returns>null if no hypergrid region could be found.</returns>
|
||||
protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
|
||||
{
|
||||
if (name.Contains("."))
|
||||
return m_HypergridLinker.LinkRegion(scopeID, name);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
|
||||
{
|
||||
int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
|
||||
@@ -489,8 +510,9 @@ namespace OpenSim.Services.GridService
|
||||
OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
|
||||
MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
|
||||
r.RegionName, r.RegionID,
|
||||
String.Format("{0},{1}", r.posX, r.posY), r.Data["serverURI"],
|
||||
r.Data["owner_uuid"].ToString(), flags.ToString()));
|
||||
String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize),
|
||||
r.Data["serverURI"],
|
||||
r.Data["owner_uuid"], flags));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ namespace OpenSim.Services.HypergridService
|
||||
m_InGatekeeper = serverConfig.GetBoolean("InGatekeeper", false);
|
||||
m_log.DebugFormat("[HG IM SERVICE]: Starting... InRobust? {0}", m_InGatekeeper);
|
||||
|
||||
|
||||
if (gridService == string.Empty || presenceService == string.Empty)
|
||||
throw new Exception(String.Format("Incomplete specifications, InstantMessage Service cannot function."));
|
||||
|
||||
@@ -120,8 +119,8 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
public bool IncomingInstantMessage(GridInstantMessage im)
|
||||
{
|
||||
m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID);
|
||||
UUID toAgentID = new UUID(im.toAgentID);
|
||||
// m_log.DebugFormat("[HG IM SERVICE]: Received message from {0} to {1}", im.fromAgentID, im.toAgentID);
|
||||
// UUID toAgentID = new UUID(im.toAgentID);
|
||||
|
||||
bool success = false;
|
||||
if (m_IMSimConnector != null)
|
||||
@@ -142,7 +141,7 @@ namespace OpenSim.Services.HypergridService
|
||||
|
||||
public bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner)
|
||||
{
|
||||
m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url);
|
||||
// m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url);
|
||||
if (url != string.Empty)
|
||||
return TrySendInstantMessage(im, url, true, foreigner);
|
||||
else
|
||||
@@ -326,7 +325,6 @@ namespace OpenSim.Services.HypergridService
|
||||
// This is recursive!!!!!
|
||||
return TrySendInstantMessage(im, url, false, foreigner);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool UndeliveredMessage(GridInstantMessage im)
|
||||
@@ -334,16 +332,15 @@ namespace OpenSim.Services.HypergridService
|
||||
if (m_RestURL != string.Empty && (im.offline != 0)
|
||||
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
|
||||
{
|
||||
m_log.DebugFormat("[HG IM SERVICE]: Message saved");
|
||||
return SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
|
||||
// m_log.DebugFormat("[HG IM SERVICE]: Message saved");
|
||||
|
||||
return SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
|
||||
"POST", m_RestURL + "/SaveMessage/", im);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ namespace OpenSim.Services.Interfaces
|
||||
byte[] GetData(string id);
|
||||
|
||||
/// <summary>
|
||||
/// Synchronously fetches an asset from the local cache only
|
||||
/// Synchronously fetches an asset from the local cache only.
|
||||
/// </summary>
|
||||
/// <param name="id">Asset ID</param>
|
||||
/// <returns>The fetched asset, or null if it did not exist in the local cache</returns>
|
||||
@@ -75,7 +75,9 @@ namespace OpenSim.Services.Interfaces
|
||||
/// <summary>
|
||||
/// Creates a new asset
|
||||
/// </summary>
|
||||
/// Returns a random ID if none is passed into it
|
||||
/// <remarks>
|
||||
/// Returns a random ID if none is passed via the asset argument.
|
||||
/// </remarks>
|
||||
/// <param name="asset"></param>
|
||||
/// <returns></returns>
|
||||
string Store(AssetBase asset);
|
||||
@@ -83,7 +85,9 @@ namespace OpenSim.Services.Interfaces
|
||||
/// <summary>
|
||||
/// Update an asset's content
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Attachments and bare scripts need this!!
|
||||
/// </remarks>
|
||||
/// <param name="id"> </param>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -34,14 +34,21 @@ namespace OpenSim.Services.Interfaces
|
||||
|
||||
public interface IAuthorizationService
|
||||
{
|
||||
//////////////////////////////////////////////////////
|
||||
// Authorized
|
||||
//
|
||||
// This method returns a simple true false indicating
|
||||
// whether or not a user has access to the region
|
||||
//
|
||||
bool IsAuthorizedForRegion(string userID, string regionID, out string message);
|
||||
|
||||
/// <summary>
|
||||
/// Check whether the user should be given access to the region.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// We also supply user first name and last name for situations where the user does not have an account
|
||||
/// on the region (e.g. they're a visitor via Hypergrid).
|
||||
/// </remarks>
|
||||
/// <param name="userID"></param>
|
||||
/// <param name="firstName">/param>
|
||||
/// <param name="lastName"></param>
|
||||
/// <param name="regionID"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
bool IsAuthorizedForRegion(
|
||||
string userID, string firstName, string lastName, string regionID, out string message);
|
||||
}
|
||||
|
||||
public class AuthorizationRequest
|
||||
@@ -63,7 +70,8 @@ namespace OpenSim.Services.Interfaces
|
||||
m_regionID = RegionID;
|
||||
}
|
||||
|
||||
public AuthorizationRequest(string ID,string FirstName, string SurName, string Email, string RegionName, string RegionID)
|
||||
public AuthorizationRequest(
|
||||
string ID, string FirstName, string SurName, string Email, string RegionName, string RegionID)
|
||||
{
|
||||
m_userID = ID;
|
||||
m_firstname = FirstName;
|
||||
@@ -108,9 +116,6 @@ namespace OpenSim.Services.Interfaces
|
||||
get { return m_regionID; }
|
||||
set { m_regionID = value; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class AuthorizationResponse
|
||||
@@ -126,7 +131,6 @@ namespace OpenSim.Services.Interfaces
|
||||
{
|
||||
m_isAuthorized = isAuthorized;
|
||||
m_message = message;
|
||||
|
||||
}
|
||||
|
||||
public bool IsAuthorized
|
||||
@@ -141,4 +145,4 @@ namespace OpenSim.Services.Interfaces
|
||||
set { m_message = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,9 +180,9 @@ namespace OpenSim.Services.Interfaces
|
||||
}
|
||||
}
|
||||
|
||||
public AvatarAppearance ToAvatarAppearance(UUID owner)
|
||||
public AvatarAppearance ToAvatarAppearance()
|
||||
{
|
||||
AvatarAppearance appearance = new AvatarAppearance(owner);
|
||||
AvatarAppearance appearance = new AvatarAppearance();
|
||||
|
||||
if (Data.Count == 0)
|
||||
return appearance;
|
||||
|
||||
@@ -71,6 +71,12 @@ namespace OpenSim.Services.Interfaces
|
||||
/// <returns></returns>
|
||||
GridRegion GetRegionByPosition(UUID scopeID, int x, int y);
|
||||
|
||||
/// <summary>
|
||||
/// Get information about a region which exactly matches the name given.
|
||||
/// </summary>
|
||||
/// <param name="scopeID"></param>
|
||||
/// <param name="regionName"></param>
|
||||
/// <returns>Returns the region information if the name matched. Null otherwise.</returns>
|
||||
GridRegion GetRegionByName(UUID scopeID, string regionName);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -193,10 +193,11 @@ namespace OpenSim.Services.InventoryService
|
||||
item.Description = config.GetString("description", item.Name);
|
||||
item.InvType = config.GetInt("inventoryType", 0);
|
||||
item.AssetType = config.GetInt("assetType", item.InvType);
|
||||
item.CurrentPermissions = (uint)config.GetLong("currentPermissions", 0x7FFFFFFF);
|
||||
item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
|
||||
item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
|
||||
item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
|
||||
item.CurrentPermissions = (uint)config.GetLong("currentPermissions", (uint)PermissionMask.All);
|
||||
item.NextPermissions = (uint)config.GetLong("nextPermissions", (uint)PermissionMask.All);
|
||||
item.EveryOnePermissions
|
||||
= (uint)config.GetLong("everyonePermissions", (uint)PermissionMask.All - (uint)PermissionMask.Modify);
|
||||
item.BasePermissions = (uint)config.GetLong("basePermissions", (uint)PermissionMask.All);
|
||||
item.Flags = (uint)config.GetInt("flags", 0);
|
||||
|
||||
if (libraryFolders.ContainsKey(item.Folder))
|
||||
|
||||
@@ -188,6 +188,8 @@ namespace OpenSim.Services.LLLoginService
|
||||
|
||||
private BuddyList m_buddyList = null;
|
||||
|
||||
private string currency;
|
||||
|
||||
static LLLoginResponse()
|
||||
{
|
||||
// This is being set, but it's not used
|
||||
@@ -223,7 +225,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo,
|
||||
GridRegion destination, List<InventoryFolderBase> invSkel, FriendInfo[] friendsList, ILibraryService libService,
|
||||
string where, string startlocation, Vector3 position, Vector3 lookAt, List<InventoryItemBase> gestures, string message,
|
||||
GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL)
|
||||
GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL, string currency)
|
||||
: this()
|
||||
{
|
||||
FillOutInventoryData(invSkel, libService);
|
||||
@@ -241,6 +243,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
StartLocation = where;
|
||||
MapTileURL = mapTileURL;
|
||||
SearchURL = searchURL;
|
||||
Currency = currency;
|
||||
|
||||
FillOutHomeData(pinfo, home);
|
||||
LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z);
|
||||
@@ -388,6 +391,8 @@ namespace OpenSim.Services.LLLoginService
|
||||
initialOutfit.Add(InitialOutfitHash);
|
||||
mapTileURL = String.Empty;
|
||||
searchURL = String.Empty;
|
||||
|
||||
currency = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -462,6 +467,12 @@ namespace OpenSim.Services.LLLoginService
|
||||
responseData["buddy-list"] = m_buddyList.ToArray();
|
||||
}
|
||||
|
||||
if (currency != String.Empty)
|
||||
{
|
||||
// responseData["real_currency"] = currency;
|
||||
responseData["currency"] = currency;
|
||||
}
|
||||
|
||||
responseData["login"] = "true";
|
||||
|
||||
return responseData;
|
||||
@@ -946,6 +957,12 @@ namespace OpenSim.Services.LLLoginService
|
||||
set { m_buddyList = value; }
|
||||
}
|
||||
|
||||
public string Currency
|
||||
{
|
||||
get { return currency; }
|
||||
set { currency = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public class UserInfo
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
protected bool m_AllowRemoteSetLoginLevel;
|
||||
protected string m_MapTileURL;
|
||||
protected string m_SearchURL;
|
||||
protected string m_Currency;
|
||||
|
||||
protected string m_AllowedClients;
|
||||
protected string m_DeniedClients;
|
||||
@@ -108,6 +109,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
|
||||
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
|
||||
m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
|
||||
m_Currency = m_LoginServerConfig.GetString("Currency", string.Empty);
|
||||
|
||||
m_AllowedClients = m_LoginServerConfig.GetString("AllowedClients", string.Empty);
|
||||
m_DeniedClients = m_LoginServerConfig.GetString("DeniedClients", string.Empty);
|
||||
@@ -408,14 +410,14 @@ namespace OpenSim.Services.LLLoginService
|
||||
if (m_FriendsService != null)
|
||||
{
|
||||
friendsList = m_FriendsService.GetFriends(account.PrincipalID);
|
||||
m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
|
||||
// m_log.DebugFormat("[LLOGIN SERVICE]: Retrieved {0} friends", friendsList.Length);
|
||||
}
|
||||
|
||||
//
|
||||
// Finally, fill out the response and return it
|
||||
//
|
||||
LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService,
|
||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL);
|
||||
where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL, m_Currency);
|
||||
|
||||
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
|
||||
return response;
|
||||
@@ -792,7 +794,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
if (avatar != null)
|
||||
aCircuit.Appearance = new AvatarAppearance(avatar);
|
||||
else
|
||||
aCircuit.Appearance = new AvatarAppearance(account.PrincipalID);
|
||||
aCircuit.Appearance = new AvatarAppearance();
|
||||
|
||||
//aCircuit.BaseFolder = irrelevant
|
||||
aCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||
|
||||
Reference in New Issue
Block a user