Merge branch 'master' of /home/opensim/var/repo/opensim
commit
2d3dda6db3
|
@ -111,6 +111,10 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
m_log.Warn("[GETTEXTURE]: Failed to parse a texture_id from GetTexture request: " + httpRequest.Url);
|
m_log.Warn("[GETTEXTURE]: Failed to parse a texture_id from GetTexture request: " + httpRequest.Url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}",
|
||||||
|
// textureID, httpResponse.StatusCode, httpResponse.ContentLength);
|
||||||
|
|
||||||
httpResponse.Send();
|
httpResponse.Send();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -210,7 +214,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
private void WriteTextureData(OSHttpRequest request, OSHttpResponse response, AssetBase texture, string format)
|
private void WriteTextureData(OSHttpRequest request, OSHttpResponse response, AssetBase texture, string format)
|
||||||
{
|
{
|
||||||
string range = request.Headers.GetOne("Range");
|
string range = request.Headers.GetOne("Range");
|
||||||
//m_log.DebugFormat("[GETTEXTURE]: Range {0}", range);
|
|
||||||
if (!String.IsNullOrEmpty(range)) // JP2's only
|
if (!String.IsNullOrEmpty(range)) // JP2's only
|
||||||
{
|
{
|
||||||
// Range request
|
// Range request
|
||||||
|
@ -222,23 +226,27 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
if (start >= texture.Data.Length)
|
if (start >= texture.Data.Length)
|
||||||
{
|
{
|
||||||
response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
|
||||||
|
start = Utils.Clamp(start, 0, end);
|
||||||
|
int len = end - start + 1;
|
||||||
|
|
||||||
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
|
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||||
start = Utils.Clamp(start, 0, end);
|
|
||||||
int len = end - start + 1;
|
|
||||||
|
|
||||||
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
// Always return PartialContent, even if the range covered the entire data length
|
||||||
|
// We were accidentally sending back 404 before in this situation
|
||||||
if (len < texture.Data.Length)
|
// https://issues.apache.org/bugzilla/show_bug.cgi?id=51878 supports sending 206 even if the
|
||||||
|
// entire range is requested, and viewer 3.2.2 (and very probably earlier) seems fine with this.
|
||||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||||
|
|
||||||
response.ContentLength = len;
|
response.ContentLength = len;
|
||||||
response.ContentType = texture.Metadata.ContentType;
|
response.ContentType = texture.Metadata.ContentType;
|
||||||
response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
|
response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
|
||||||
|
|
||||||
response.Body.Write(texture.Data, start, len);
|
response.Body.Write(texture.Data, start, len);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -257,6 +265,10 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
response.ContentType = "image/" + format;
|
response.ContentType = "image/" + format;
|
||||||
response.Body.Write(texture.Data, 0, texture.Data.Length);
|
response.Body.Write(texture.Data, 0, texture.Data.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[GETTEXTURE]: For texture {0} requested range {1} responded {2} with content length {3} (actual {4})",
|
||||||
|
// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryParseRange(string header, out int start, out int end)
|
private bool TryParseRange(string header, out int start, out int end)
|
||||||
|
@ -275,7 +287,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private byte[] ConvertTextureData(AssetBase texture, string format)
|
private byte[] ConvertTextureData(AssetBase texture, string format)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format);
|
m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format);
|
||||||
|
|
|
@ -40,24 +40,40 @@ namespace OpenSim.Data.Null
|
||||||
{
|
{
|
||||||
private static NullRegionData Instance = null;
|
private static NullRegionData Instance = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Should we use the static instance for all invocations?
|
||||||
|
/// </summary>
|
||||||
|
private bool m_useStaticInstance = true;
|
||||||
|
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
Dictionary<UUID, RegionData> m_regionData = new Dictionary<UUID, RegionData>();
|
Dictionary<UUID, RegionData> m_regionData = new Dictionary<UUID, RegionData>();
|
||||||
|
|
||||||
public NullRegionData(string connectionString, string realm)
|
public NullRegionData(string connectionString, string realm)
|
||||||
{
|
{
|
||||||
if (Instance == null)
|
// m_log.DebugFormat(
|
||||||
|
// "[NULL REGION DATA]: Constructor got connectionString {0}, realm {1}", connectionString, realm);
|
||||||
|
|
||||||
|
// The !static connection string is a hack so that regression tests can use this module without a high degree of fragility
|
||||||
|
// in having to deal with the static reference in the once-loaded NullRegionData class.
|
||||||
|
//
|
||||||
|
// In standalone operation, we have to use only one instance of this class since the login service and
|
||||||
|
// simulator have no other way of using a common data store.
|
||||||
|
if (connectionString == "!static")
|
||||||
|
m_useStaticInstance = false;
|
||||||
|
else if (Instance == null)
|
||||||
Instance = this;
|
Instance = this;
|
||||||
//Console.WriteLine("[XXX] NullRegionData constructor");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private delegate bool Matcher(string value);
|
private delegate bool Matcher(string value);
|
||||||
|
|
||||||
public List<RegionData> Get(string regionName, UUID scopeID)
|
public List<RegionData> Get(string regionName, UUID scopeID)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.Get(regionName, scopeID);
|
return Instance.Get(regionName, scopeID);
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[NULL REGION DATA]: Getting region {0}, scope {1}", regionName, scopeID);
|
||||||
|
|
||||||
string cleanName = regionName.ToLower();
|
string cleanName = regionName.ToLower();
|
||||||
|
|
||||||
// Handle SQL wildcards
|
// Handle SQL wildcards
|
||||||
|
@ -82,6 +98,7 @@ namespace OpenSim.Data.Null
|
||||||
cleanName = cleanName.Remove(cleanName.Length - 1);
|
cleanName = cleanName.Remove(cleanName.Length - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Matcher queryMatch;
|
Matcher queryMatch;
|
||||||
if (wildcardPrefix && wildcardSuffix)
|
if (wildcardPrefix && wildcardSuffix)
|
||||||
queryMatch = delegate(string s) { return s.Contains(cleanName); };
|
queryMatch = delegate(string s) { return s.Contains(cleanName); };
|
||||||
|
@ -110,7 +127,7 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
public RegionData Get(int posX, int posY, UUID scopeID)
|
public RegionData Get(int posX, int posY, UUID scopeID)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.Get(posX, posY, scopeID);
|
return Instance.Get(posX, posY, scopeID);
|
||||||
|
|
||||||
List<RegionData> ret = new List<RegionData>();
|
List<RegionData> ret = new List<RegionData>();
|
||||||
|
@ -129,7 +146,7 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
public RegionData Get(UUID regionID, UUID scopeID)
|
public RegionData Get(UUID regionID, UUID scopeID)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.Get(regionID, scopeID);
|
return Instance.Get(regionID, scopeID);
|
||||||
|
|
||||||
if (m_regionData.ContainsKey(regionID))
|
if (m_regionData.ContainsKey(regionID))
|
||||||
|
@ -140,7 +157,7 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
public List<RegionData> Get(int startX, int startY, int endX, int endY, UUID scopeID)
|
public List<RegionData> Get(int startX, int startY, int endX, int endY, UUID scopeID)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.Get(startX, startY, endX, endY, scopeID);
|
return Instance.Get(startX, startY, endX, endY, scopeID);
|
||||||
|
|
||||||
List<RegionData> ret = new List<RegionData>();
|
List<RegionData> ret = new List<RegionData>();
|
||||||
|
@ -156,9 +173,12 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
public bool Store(RegionData data)
|
public bool Store(RegionData data)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.Store(data);
|
return Instance.Store(data);
|
||||||
|
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[NULL REGION DATA]: Storing region {0} {1}, scope {2}", data.RegionName, data.RegionID, data.ScopeID);
|
||||||
|
|
||||||
m_regionData[data.RegionID] = data;
|
m_regionData[data.RegionID] = data;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -166,7 +186,7 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
public bool SetDataItem(UUID regionID, string item, string value)
|
public bool SetDataItem(UUID regionID, string item, string value)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.SetDataItem(regionID, item, value);
|
return Instance.SetDataItem(regionID, item, value);
|
||||||
|
|
||||||
if (!m_regionData.ContainsKey(regionID))
|
if (!m_regionData.ContainsKey(regionID))
|
||||||
|
@ -179,9 +199,11 @@ namespace OpenSim.Data.Null
|
||||||
|
|
||||||
public bool Delete(UUID regionID)
|
public bool Delete(UUID regionID)
|
||||||
{
|
{
|
||||||
if (Instance != this)
|
if (m_useStaticInstance && Instance != this)
|
||||||
return Instance.Delete(regionID);
|
return Instance.Delete(regionID);
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[NULL REGION DATA]: Deleting region {0}", regionID);
|
||||||
|
|
||||||
if (!m_regionData.ContainsKey(regionID))
|
if (!m_regionData.ContainsKey(regionID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -35,22 +35,36 @@ namespace OpenSim.Framework
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class AgentCircuitManager
|
public class AgentCircuitManager
|
||||||
{
|
{
|
||||||
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
|
/// <summary>
|
||||||
public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
|
/// Agent circuits indexed by circuit code.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// We lock this for operations both on this dictionary and on m_agentCircuitsByUUID
|
||||||
|
/// </remarks>
|
||||||
|
private Dictionary<uint, AgentCircuitData> m_agentCircuits = new Dictionary<uint, AgentCircuitData>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Agent circuits indexed by agent UUID.
|
||||||
|
/// </summary>
|
||||||
|
private Dictionary<UUID, AgentCircuitData> m_agentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
|
||||||
|
|
||||||
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
|
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
|
||||||
{
|
{
|
||||||
AgentCircuitData validcircuit = null;
|
AgentCircuitData validcircuit = null;
|
||||||
if (AgentCircuits.ContainsKey(circuitcode))
|
|
||||||
|
lock (m_agentCircuits)
|
||||||
{
|
{
|
||||||
validcircuit = AgentCircuits[circuitcode];
|
if (m_agentCircuits.ContainsKey(circuitcode))
|
||||||
|
validcircuit = m_agentCircuits[circuitcode];
|
||||||
}
|
}
|
||||||
|
|
||||||
AuthenticateResponse user = new AuthenticateResponse();
|
AuthenticateResponse user = new AuthenticateResponse();
|
||||||
|
|
||||||
if (validcircuit == null)
|
if (validcircuit == null)
|
||||||
{
|
{
|
||||||
//don't have this circuit code in our list
|
//don't have this circuit code in our list
|
||||||
user.Authorised = false;
|
user.Authorised = false;
|
||||||
return (user);
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
|
if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
|
||||||
|
@ -72,7 +86,7 @@ namespace OpenSim.Framework
|
||||||
user.Authorised = false;
|
user.Authorised = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (user);
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -82,73 +96,93 @@ namespace OpenSim.Framework
|
||||||
/// <param name="agentData"></param>
|
/// <param name="agentData"></param>
|
||||||
public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
|
public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
|
||||||
{
|
{
|
||||||
lock (AgentCircuits)
|
lock (m_agentCircuits)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey(circuitCode))
|
if (m_agentCircuits.ContainsKey(circuitCode))
|
||||||
{
|
{
|
||||||
AgentCircuits[circuitCode] = agentData;
|
m_agentCircuits[circuitCode] = agentData;
|
||||||
AgentCircuitsByUUID[agentData.AgentID] = agentData;
|
m_agentCircuitsByUUID[agentData.AgentID] = agentData;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AgentCircuits.Add(circuitCode, agentData);
|
m_agentCircuits.Add(circuitCode, agentData);
|
||||||
AgentCircuitsByUUID[agentData.AgentID] = agentData;
|
m_agentCircuitsByUUID[agentData.AgentID] = agentData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void RemoveCircuit(uint circuitCode)
|
public virtual void RemoveCircuit(uint circuitCode)
|
||||||
{
|
{
|
||||||
lock (AgentCircuits)
|
lock (m_agentCircuits)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey(circuitCode))
|
if (m_agentCircuits.ContainsKey(circuitCode))
|
||||||
{
|
{
|
||||||
UUID agentID = AgentCircuits[circuitCode].AgentID;
|
UUID agentID = m_agentCircuits[circuitCode].AgentID;
|
||||||
AgentCircuits.Remove(circuitCode);
|
m_agentCircuits.Remove(circuitCode);
|
||||||
AgentCircuitsByUUID.Remove(agentID);
|
m_agentCircuitsByUUID.Remove(agentID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void RemoveCircuit(UUID agentID)
|
public virtual void RemoveCircuit(UUID agentID)
|
||||||
{
|
{
|
||||||
lock (AgentCircuits)
|
lock (m_agentCircuits)
|
||||||
{
|
{
|
||||||
if (AgentCircuitsByUUID.ContainsKey(agentID))
|
if (m_agentCircuitsByUUID.ContainsKey(agentID))
|
||||||
{
|
{
|
||||||
uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode;
|
uint circuitCode = m_agentCircuitsByUUID[agentID].circuitcode;
|
||||||
AgentCircuits.Remove(circuitCode);
|
m_agentCircuits.Remove(circuitCode);
|
||||||
AgentCircuitsByUUID.Remove(agentID);
|
m_agentCircuitsByUUID.Remove(agentID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AgentCircuitData GetAgentCircuitData(uint circuitCode)
|
public AgentCircuitData GetAgentCircuitData(uint circuitCode)
|
||||||
{
|
{
|
||||||
AgentCircuitData agentCircuit = null;
|
AgentCircuitData agentCircuit = null;
|
||||||
AgentCircuits.TryGetValue(circuitCode, out agentCircuit);
|
|
||||||
|
lock (m_agentCircuits)
|
||||||
|
m_agentCircuits.TryGetValue(circuitCode, out agentCircuit);
|
||||||
|
|
||||||
return agentCircuit;
|
return agentCircuit;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AgentCircuitData GetAgentCircuitData(UUID agentID)
|
public AgentCircuitData GetAgentCircuitData(UUID agentID)
|
||||||
{
|
{
|
||||||
AgentCircuitData agentCircuit = null;
|
AgentCircuitData agentCircuit = null;
|
||||||
AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
|
|
||||||
|
lock (m_agentCircuits)
|
||||||
|
m_agentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
|
||||||
|
|
||||||
return agentCircuit;
|
return agentCircuit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all current agent circuits indexed by agent UUID.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Dictionary<UUID, AgentCircuitData> GetAgentCircuits()
|
||||||
|
{
|
||||||
|
lock (m_agentCircuits)
|
||||||
|
return new Dictionary<UUID, AgentCircuitData>(m_agentCircuitsByUUID);
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateAgentData(AgentCircuitData agentData)
|
public void UpdateAgentData(AgentCircuitData agentData)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
|
lock (m_agentCircuits)
|
||||||
{
|
{
|
||||||
AgentCircuits[(uint) agentData.circuitcode].firstname = agentData.firstname;
|
if (m_agentCircuits.ContainsKey((uint) agentData.circuitcode))
|
||||||
AgentCircuits[(uint) agentData.circuitcode].lastname = agentData.lastname;
|
{
|
||||||
AgentCircuits[(uint) agentData.circuitcode].startpos = agentData.startpos;
|
m_agentCircuits[(uint) agentData.circuitcode].firstname = agentData.firstname;
|
||||||
|
m_agentCircuits[(uint) agentData.circuitcode].lastname = agentData.lastname;
|
||||||
|
m_agentCircuits[(uint) agentData.circuitcode].startpos = agentData.startpos;
|
||||||
|
|
||||||
// Updated for when we don't know them before calling Scene.NewUserConnection
|
// Updated for when we don't know them before calling Scene.NewUserConnection
|
||||||
AgentCircuits[(uint) agentData.circuitcode].SecureSessionID = agentData.SecureSessionID;
|
m_agentCircuits[(uint) agentData.circuitcode].SecureSessionID = agentData.SecureSessionID;
|
||||||
AgentCircuits[(uint) agentData.circuitcode].SessionID = agentData.SessionID;
|
m_agentCircuits[(uint) agentData.circuitcode].SessionID = agentData.SessionID;
|
||||||
|
|
||||||
// m_log.Debug("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
|
// m_log.Debug("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,38 +193,37 @@ namespace OpenSim.Framework
|
||||||
/// <param name="newcircuitcode"></param>
|
/// <param name="newcircuitcode"></param>
|
||||||
public bool TryChangeCiruitCode(uint circuitcode, uint newcircuitcode)
|
public bool TryChangeCiruitCode(uint circuitcode, uint newcircuitcode)
|
||||||
{
|
{
|
||||||
lock (AgentCircuits)
|
lock (m_agentCircuits)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey((uint)circuitcode) && !AgentCircuits.ContainsKey((uint)newcircuitcode))
|
if (m_agentCircuits.ContainsKey((uint)circuitcode) && !m_agentCircuits.ContainsKey((uint)newcircuitcode))
|
||||||
{
|
{
|
||||||
AgentCircuitData agentData = AgentCircuits[(uint)circuitcode];
|
AgentCircuitData agentData = m_agentCircuits[(uint)circuitcode];
|
||||||
|
|
||||||
agentData.circuitcode = newcircuitcode;
|
agentData.circuitcode = newcircuitcode;
|
||||||
|
|
||||||
AgentCircuits.Remove((uint)circuitcode);
|
m_agentCircuits.Remove((uint)circuitcode);
|
||||||
AgentCircuits.Add(newcircuitcode, agentData);
|
m_agentCircuits.Add(newcircuitcode, agentData);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
|
public void UpdateAgentChildStatus(uint circuitcode, bool childstatus)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey(circuitcode))
|
lock (m_agentCircuits)
|
||||||
{
|
if (m_agentCircuits.ContainsKey(circuitcode))
|
||||||
AgentCircuits[circuitcode].child = childstatus;
|
m_agentCircuits[circuitcode].child = childstatus;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool GetAgentChildStatus(uint circuitcode)
|
public bool GetAgentChildStatus(uint circuitcode)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey(circuitcode))
|
lock (m_agentCircuits)
|
||||||
{
|
if (m_agentCircuits.ContainsKey(circuitcode))
|
||||||
return AgentCircuits[circuitcode].child;
|
return m_agentCircuits[circuitcode].child;
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -194,8 +194,6 @@ namespace OpenSim.Framework.Tests
|
||||||
|
|
||||||
resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId2, circuitcode2);
|
resp = agentCircuitManager.AuthenticateSession(SessionId2, AgentId2, circuitcode2);
|
||||||
Assert.That(!resp.Authorised);
|
Assert.That(!resp.Authorised);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,8 +87,6 @@ namespace OpenSim.Framework.Tests
|
||||||
anim4.SequenceNum = anim2.SequenceNum;
|
anim4.SequenceNum = anim2.SequenceNum;
|
||||||
|
|
||||||
Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly.");
|
Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly.");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1039,7 +1039,7 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
//this.HttpServer.
|
//this.HttpServer.
|
||||||
acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
|
acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
|
||||||
foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.AgentCircuits.Values)
|
foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values)
|
||||||
acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root"));
|
acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root"));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1341,7 +1341,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
|
|
||||||
string reason = String.Empty;
|
string reason = String.Empty;
|
||||||
|
|
||||||
|
|
||||||
bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
|
bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason);
|
||||||
|
|
||||||
if (regionAccepted && newAgent)
|
if (regionAccepted && newAgent)
|
||||||
|
|
|
@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||||
// I'm pretty sure noone whats to set fullbright true if it wasn't true before.
|
// I'm pretty sure noone whats to set fullbright true if it wasn't true before.
|
||||||
// tmptex.DefaultTexture.Fullbright = true;
|
// tmptex.DefaultTexture.Fullbright = true;
|
||||||
|
|
||||||
part.UpdateTexture(tmptex);
|
part.UpdateTextureEntry(tmptex.GetBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0))
|
if (oldID != UUID.Zero && ((Disp & DISP_EXPIRE) != 0))
|
||||||
|
@ -437,4 +437,4 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,11 +31,10 @@ using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using log4net.Config;
|
using log4net.Config;
|
||||||
|
using Nini.Config;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using Nini.Config;
|
|
||||||
|
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||||
|
@ -69,6 +68,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestRegisterRegion()
|
public void TestRegisterRegion()
|
||||||
{
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
SetUp();
|
SetUp();
|
||||||
|
|
||||||
// Create 4 regions
|
// Create 4 regions
|
||||||
|
@ -191,7 +193,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||||
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
|
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
|
||||||
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
|
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
|
||||||
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
|
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3178,7 +3178,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="face"></param>
|
/// <param name="face"></param>
|
||||||
public void SetFaceColor(Vector3 color, int face)
|
public void SetFaceColor(Vector3 color, int face)
|
||||||
{
|
{
|
||||||
Primitive.TextureEntry tex = Shape.Textures;
|
// The only way to get a deep copy/ If we don't do this, we can
|
||||||
|
// mever detect color changes further down.
|
||||||
|
Byte[] buf = Shape.Textures.GetBytes();
|
||||||
|
Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
|
||||||
Color4 texcolor;
|
Color4 texcolor;
|
||||||
if (face >= 0 && face < GetNumberOfSides())
|
if (face >= 0 && face < GetNumberOfSides())
|
||||||
{
|
{
|
||||||
|
@ -3187,8 +3190,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
|
texcolor.G = Util.Clip((float)color.Y, 0.0f, 1.0f);
|
||||||
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
||||||
tex.FaceTextures[face].RGBA = texcolor;
|
tex.FaceTextures[face].RGBA = texcolor;
|
||||||
UpdateTexture(tex);
|
UpdateTextureEntry(tex.GetBytes());
|
||||||
TriggerScriptChangedEvent(Changed.COLOR);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ALL_SIDES)
|
else if (face == ALL_SIDES)
|
||||||
|
@ -3209,8 +3211,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
||||||
tex.DefaultTexture.RGBA = texcolor;
|
tex.DefaultTexture.RGBA = texcolor;
|
||||||
}
|
}
|
||||||
UpdateTexture(tex);
|
UpdateTextureEntry(tex.GetBytes());
|
||||||
TriggerScriptChangedEvent(Changed.COLOR);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3272,9 +3273,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (hasHollow) ret += 1;
|
if (hasHollow) ret += 1;
|
||||||
break;
|
break;
|
||||||
case PrimType.SCULPT:
|
case PrimType.SCULPT:
|
||||||
ret = 1;
|
// Special mesh handling
|
||||||
|
if (Shape.SculptType == (byte)SculptType.Mesh)
|
||||||
|
ret = 8; // if it's a mesh then max 8 faces
|
||||||
|
else
|
||||||
|
ret = 1; // if it's a sculpt then max 1 face
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3287,6 +3293,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
if (Shape.SculptEntry)
|
if (Shape.SculptEntry)
|
||||||
return PrimType.SCULPT;
|
return PrimType.SCULPT;
|
||||||
|
|
||||||
if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
|
if ((Shape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
|
||||||
{
|
{
|
||||||
if (Shape.PathCurve == (byte)Extrusion.Straight)
|
if (Shape.PathCurve == (byte)Extrusion.Straight)
|
||||||
|
@ -4531,49 +4538,50 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update the textures on the part.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Added to handle bug in libsecondlife's TextureEntry.ToBytes()
|
|
||||||
/// not handling RGBA properly. Cycles through, and "fixes" the color
|
|
||||||
/// info
|
|
||||||
/// </remarks>
|
|
||||||
/// <param name="tex"></param>
|
|
||||||
public void UpdateTexture(Primitive.TextureEntry tex)
|
|
||||||
{
|
|
||||||
//Color4 tmpcolor;
|
|
||||||
//for (uint i = 0; i < 32; i++)
|
|
||||||
//{
|
|
||||||
// if (tex.FaceTextures[i] != null)
|
|
||||||
// {
|
|
||||||
// tmpcolor = tex.GetFace((uint) i).RGBA;
|
|
||||||
// tmpcolor.A = tmpcolor.A*255;
|
|
||||||
// tmpcolor.R = tmpcolor.R*255;
|
|
||||||
// tmpcolor.G = tmpcolor.G*255;
|
|
||||||
// tmpcolor.B = tmpcolor.B*255;
|
|
||||||
// tex.FaceTextures[i].RGBA = tmpcolor;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//tmpcolor = tex.DefaultTexture.RGBA;
|
|
||||||
//tmpcolor.A = tmpcolor.A*255;
|
|
||||||
//tmpcolor.R = tmpcolor.R*255;
|
|
||||||
//tmpcolor.G = tmpcolor.G*255;
|
|
||||||
//tmpcolor.B = tmpcolor.B*255;
|
|
||||||
//tex.DefaultTexture.RGBA = tmpcolor;
|
|
||||||
UpdateTextureEntry(tex.GetBytes());
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the texture entry for this part.
|
/// Update the texture entry for this part.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="textureEntry"></param>
|
/// <param name="textureEntry"></param>
|
||||||
public void UpdateTextureEntry(byte[] textureEntry)
|
public void UpdateTextureEntry(byte[] textureEntry)
|
||||||
{
|
{
|
||||||
m_shape.TextureEntry = textureEntry;
|
Primitive.TextureEntry newTex = new Primitive.TextureEntry(textureEntry, 0, textureEntry.Length);
|
||||||
TriggerScriptChangedEvent(Changed.TEXTURE);
|
Primitive.TextureEntry oldTex = Shape.Textures;
|
||||||
|
|
||||||
|
Changed changeFlags = 0;
|
||||||
|
|
||||||
|
for (int i = 0 ; i < GetNumberOfSides(); i++)
|
||||||
|
{
|
||||||
|
Primitive.TextureEntryFace newFace = newTex.DefaultTexture;
|
||||||
|
Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture;
|
||||||
|
|
||||||
|
if (oldTex.FaceTextures[i] != null)
|
||||||
|
oldFace = oldTex.FaceTextures[i];
|
||||||
|
if (newTex.FaceTextures[i] != null)
|
||||||
|
newFace = newTex.FaceTextures[i];
|
||||||
|
|
||||||
|
Color4 oldRGBA = oldFace.RGBA;
|
||||||
|
Color4 newRGBA = newFace.RGBA;
|
||||||
|
|
||||||
|
if (oldRGBA.R != newRGBA.R ||
|
||||||
|
oldRGBA.G != newRGBA.G ||
|
||||||
|
oldRGBA.B != newRGBA.B ||
|
||||||
|
oldRGBA.A != newRGBA.A)
|
||||||
|
changeFlags |= Changed.COLOR;
|
||||||
|
|
||||||
|
if (oldFace.TextureID != newFace.TextureID)
|
||||||
|
changeFlags |= Changed.TEXTURE;
|
||||||
|
|
||||||
|
// Max change, skip the rest of testing
|
||||||
|
if (changeFlags == (Changed.TEXTURE | Changed.COLOR))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_shape.TextureEntry = textureEntry;
|
||||||
|
if (changeFlags != 0)
|
||||||
|
TriggerScriptChangedEvent(changeFlags);
|
||||||
|
UpdateFlag = UpdateRequired.FULL;
|
||||||
ParentGroup.HasGroupChanged = true;
|
ParentGroup.HasGroupChanged = true;
|
||||||
|
|
||||||
//This is madness..
|
//This is madness..
|
||||||
//ParentGroup.ScheduleGroupForFullUpdate();
|
//ParentGroup.ScheduleGroupForFullUpdate();
|
||||||
//This is sparta
|
//This is sparta
|
||||||
|
|
|
@ -31,7 +31,7 @@ using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using Timer=System.Timers.Timer;
|
using Timer = System.Timers.Timer;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
|
@ -39,11 +39,13 @@ using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
using OpenSim.Region.ClientStack.Linden;
|
||||||
using OpenSim.Region.CoreModules.Framework.EntityTransfer;
|
using OpenSim.Region.CoreModules.Framework.EntityTransfer;
|
||||||
using OpenSim.Region.CoreModules.World.Serialiser;
|
using OpenSim.Region.CoreModules.World.Serialiser;
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
|
||||||
using OpenSim.Tests.Common;
|
using OpenSim.Tests.Common;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Scenes.Tests
|
namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
{
|
{
|
||||||
|
@ -103,21 +105,71 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
|
|
||||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Not.Null);
|
||||||
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
|
||||||
|
|
||||||
scene.IncomingCloseAgent(sp.UUID);
|
scene.IncomingCloseAgent(sp.UUID);
|
||||||
|
|
||||||
Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
|
Assert.That(scene.GetScenePresence(sp.UUID), Is.Null);
|
||||||
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(sp.UUID), Is.Null);
|
||||||
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestCreateChildScenePresence()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
LocalSimulationConnectorModule lsc = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
IConfig config = configSource.AddConfig("Modules");
|
||||||
|
config.Set("SimulationServices", "LocalSimulationConnectorModule");
|
||||||
|
|
||||||
|
TestScene scene = SceneHelpers.SetupScene();
|
||||||
|
SceneHelpers.SetupSceneModules(scene, configSource, lsc);
|
||||||
|
|
||||||
|
UUID agentId = TestHelpers.ParseTail(0x01);
|
||||||
|
AgentCircuitData acd = SceneHelpers.GenerateAgentData(agentId);
|
||||||
|
acd.child = true;
|
||||||
|
|
||||||
|
GridRegion region = scene.GridService.GetRegionByName(UUID.Zero, scene.RegionInfo.RegionName);
|
||||||
|
string reason;
|
||||||
|
|
||||||
|
// *** This is the first stage, when a neighbouring region is told that a viewer is about to try and
|
||||||
|
// establish a child scene presence. We pass in the circuit code that the client has to connect with ***
|
||||||
|
// XXX: ViaLogin may not be correct here.
|
||||||
|
scene.SimulationService.CreateAgent(region, acd, (uint)TeleportFlags.ViaLogin, out reason);
|
||||||
|
|
||||||
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
|
||||||
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
|
||||||
|
|
||||||
|
// There's no scene presence yet since only an agent circuit has been established.
|
||||||
|
Assert.That(scene.GetScenePresence(agentId), Is.Null);
|
||||||
|
|
||||||
|
// *** This is the second stage, where the client established a child agent/scene presence using the
|
||||||
|
// circuit code given to the scene in stage 1 ***
|
||||||
|
TestClient client = new TestClient(acd, scene);
|
||||||
|
scene.AddNewClient(client, PresenceType.User);
|
||||||
|
|
||||||
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuitData(agentId), Is.Not.Null);
|
||||||
|
Assert.That(scene.AuthenticateHandler.GetAgentCircuits().Count, Is.EqualTo(1));
|
||||||
|
|
||||||
|
ScenePresence sp = scene.GetScenePresence(agentId);
|
||||||
|
Assert.That(sp, Is.Not.Null);
|
||||||
|
Assert.That(sp.UUID, Is.EqualTo(agentId));
|
||||||
|
Assert.That(sp.IsChildAgent, Is.True);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
|
/// Test that if a root agent logs into a region, a child agent is also established in the neighbouring region
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Please note that unlike the other tests here, this doesn't rely on structures
|
/// Please note that unlike the other tests here, this doesn't rely on anything set up in the instance fields.
|
||||||
|
/// INCOMPLETE
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[Test]
|
[Test]
|
||||||
public void TestChildAgentEstablished()
|
public void TestChildAgentEstablishedInNeighbour()
|
||||||
{
|
{
|
||||||
TestHelpers.InMethod();
|
TestHelpers.InMethod();
|
||||||
// log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
@ -125,18 +177,25 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
||||||
|
|
||||||
TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
TestScene myScene1 = SceneHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
||||||
// TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
TestScene myScene2 = SceneHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
||||||
|
|
||||||
IConfigSource configSource = new IniConfigSource();
|
|
||||||
configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
|
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
|
||||||
|
|
||||||
SceneHelpers.SetupSceneModules(myScene1, configSource, etm);
|
|
||||||
|
|
||||||
SceneHelpers.AddScenePresence(myScene1, agent1Id);
|
|
||||||
// ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
|
||||||
|
|
||||||
// TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
IConfig config = configSource.AddConfig("Startup");
|
||||||
|
config.Set("serverside_object_permissions", true);
|
||||||
|
config.Set("EventQueue", true);
|
||||||
|
|
||||||
|
EntityTransferModule etm = new EntityTransferModule();
|
||||||
|
|
||||||
|
EventQueueGetModule eqgm1 = new EventQueueGetModule();
|
||||||
|
SceneHelpers.SetupSceneModules(myScene1, configSource, etm, eqgm1);
|
||||||
|
|
||||||
|
EventQueueGetModule eqgm2 = new EventQueueGetModule();
|
||||||
|
SceneHelpers.SetupSceneModules(myScene2, configSource, etm, eqgm2);
|
||||||
|
|
||||||
|
// SceneHelpers.AddScenePresence(myScene1, agent1Id);
|
||||||
|
// ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
||||||
|
//
|
||||||
|
// // TODO: Need to do a fair amount of work to allow synchronous establishment of child agents
|
||||||
// Assert.That(childPresence, Is.Not.Null);
|
// Assert.That(childPresence, Is.Not.Null);
|
||||||
// Assert.That(childPresence.IsChildAgent, Is.True);
|
// Assert.That(childPresence.IsChildAgent, Is.True);
|
||||||
}
|
}
|
||||||
|
@ -194,48 +253,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
// Assert.That(presence, Is.Null, "presence is not null");
|
// Assert.That(presence, Is.Null, "presence is not null");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void T012_TestAddNeighbourRegion()
|
|
||||||
{
|
|
||||||
TestHelpers.InMethod();
|
|
||||||
|
|
||||||
string reason;
|
|
||||||
|
|
||||||
if (acd1 == null)
|
|
||||||
fixNullPresence();
|
|
||||||
|
|
||||||
scene.NewUserConnection(acd1, 0, out reason);
|
|
||||||
if (testclient == null)
|
|
||||||
testclient = new TestClient(acd1, scene);
|
|
||||||
scene.AddNewClient(testclient, PresenceType.User);
|
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
|
||||||
presence.MakeRootAgent(new Vector3(90,90,90),false);
|
|
||||||
|
|
||||||
string cap = presence.ControllingClient.RequestClientInfo().CapsPath;
|
|
||||||
|
|
||||||
presence.AddNeighbourRegion(region2, cap);
|
|
||||||
presence.AddNeighbourRegion(region3, cap);
|
|
||||||
|
|
||||||
Assert.That(presence.KnownRegionCount, Is.EqualTo(2));
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void T013_TestRemoveNeighbourRegion()
|
|
||||||
{
|
|
||||||
TestHelpers.InMethod();
|
|
||||||
|
|
||||||
ScenePresence presence = scene.GetScenePresence(agent1);
|
|
||||||
presence.RemoveNeighbourRegion(region3);
|
|
||||||
|
|
||||||
Assert.That(presence.KnownRegionCount,Is.EqualTo(1));
|
|
||||||
/*
|
|
||||||
presence.MakeChildAgent;
|
|
||||||
presence.MakeRootAgent;
|
|
||||||
CompleteAvatarMovement
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// I'm commenting this test because it does not represent
|
// I'm commenting this test because it does not represent
|
||||||
// crossings. The Thread.Sleep's in here are not meaningful mocks,
|
// crossings. The Thread.Sleep's in here are not meaningful mocks,
|
||||||
// and they sometimes fail in panda.
|
// and they sometimes fail in panda.
|
||||||
|
@ -338,33 +355,5 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected.");
|
Assert.That(presence2.IsChildAgent, Is.True, "Did not return from region as expected.");
|
||||||
Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again.");
|
Assert.That(presence.IsChildAgent, Is.False, "Presence was not made root in old region again.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fixNullPresence()
|
|
||||||
{
|
|
||||||
string firstName = "testfirstname";
|
|
||||||
|
|
||||||
AgentCircuitData agent = new AgentCircuitData();
|
|
||||||
agent.AgentID = agent1;
|
|
||||||
agent.firstname = firstName;
|
|
||||||
agent.lastname = "testlastname";
|
|
||||||
agent.SessionID = UUID.Zero;
|
|
||||||
agent.SecureSessionID = UUID.Zero;
|
|
||||||
agent.circuitcode = 123;
|
|
||||||
agent.BaseFolder = UUID.Zero;
|
|
||||||
agent.InventoryFolder = UUID.Zero;
|
|
||||||
agent.startpos = Vector3.Zero;
|
|
||||||
agent.CapsPath = GetRandomCapsObjectPath();
|
|
||||||
agent.Appearance = new AvatarAppearance();
|
|
||||||
|
|
||||||
acd1 = agent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetRandomCapsObjectPath()
|
|
||||||
{
|
|
||||||
UUID caps = UUID.Random();
|
|
||||||
string capsPath = caps.ToString();
|
|
||||||
capsPath = capsPath.Remove(capsPath.Length - 4, 4);
|
|
||||||
return capsPath;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -55,7 +55,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
||||||
texface.RGBA = new Color4(value.R,value.G,value.B,value.A);
|
texface.RGBA = new Color4(value.R,value.G,value.B,value.A);
|
||||||
tex.FaceTextures[m_face] = texface;
|
tex.FaceTextures[m_face] = texface;
|
||||||
m_parent.UpdateTexture(tex);
|
m_parent.UpdateTextureEntry(tex.GetBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
||||||
texface.TextureID = value;
|
texface.TextureID = value;
|
||||||
tex.FaceTextures[m_face] = texface;
|
tex.FaceTextures[m_face] = texface;
|
||||||
m_parent.UpdateTexture(tex);
|
m_parent.UpdateTextureEntry(tex.GetBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
||||||
texface.Fullbright = value;
|
texface.Fullbright = value;
|
||||||
tex.FaceTextures[m_face] = texface;
|
tex.FaceTextures[m_face] = texface;
|
||||||
m_parent.UpdateTexture(tex);
|
m_parent.UpdateTextureEntry(tex.GetBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
||||||
texface.Glow = (float) value;
|
texface.Glow = (float) value;
|
||||||
tex.FaceTextures[m_face] = texface;
|
tex.FaceTextures[m_face] = texface;
|
||||||
m_parent.UpdateTexture(tex);
|
m_parent.UpdateTextureEntry(tex.GetBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)m_face);
|
||||||
texface.Shiny = value ? Shininess.High : Shininess.None;
|
texface.Shiny = value ? Shininess.High : Shininess.None;
|
||||||
tex.FaceTextures[m_face] = texface;
|
tex.FaceTextures[m_face] = texface;
|
||||||
m_parent.UpdateTexture(tex);
|
m_parent.UpdateTextureEntry(tex.GetBytes());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1424,7 +1424,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
tex.CreateFace((uint) face);
|
tex.CreateFace((uint) face);
|
||||||
tex.FaceTextures[face].TexMapType = textype;
|
tex.FaceTextures[face].TexMapType = textype;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ScriptBaseClass.ALL_SIDES)
|
else if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1437,7 +1437,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.TexMapType = textype;
|
tex.DefaultTexture.TexMapType = textype;
|
||||||
}
|
}
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1449,7 +1449,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
tex.CreateFace((uint) face);
|
tex.CreateFace((uint) face);
|
||||||
tex.FaceTextures[face].Glow = glow;
|
tex.FaceTextures[face].Glow = glow;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ScriptBaseClass.ALL_SIDES)
|
else if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1462,7 +1462,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.Glow = glow;
|
tex.DefaultTexture.Glow = glow;
|
||||||
}
|
}
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1497,7 +1497,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
tex.CreateFace((uint) face);
|
tex.CreateFace((uint) face);
|
||||||
tex.FaceTextures[face].Shiny = sval;
|
tex.FaceTextures[face].Shiny = sval;
|
||||||
tex.FaceTextures[face].Bump = bump;
|
tex.FaceTextures[face].Bump = bump;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ScriptBaseClass.ALL_SIDES)
|
else if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1512,7 +1512,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
tex.DefaultTexture.Shiny = sval;
|
tex.DefaultTexture.Shiny = sval;
|
||||||
tex.DefaultTexture.Bump = bump;
|
tex.DefaultTexture.Bump = bump;
|
||||||
}
|
}
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1524,7 +1524,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
tex.CreateFace((uint) face);
|
tex.CreateFace((uint) face);
|
||||||
tex.FaceTextures[face].Fullbright = bright;
|
tex.FaceTextures[face].Fullbright = bright;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ScriptBaseClass.ALL_SIDES)
|
else if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1537,7 +1537,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.Fullbright = bright;
|
tex.DefaultTexture.Fullbright = bright;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1593,7 +1593,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
texcolor = tex.CreateFace((uint)face).RGBA;
|
texcolor = tex.CreateFace((uint)face).RGBA;
|
||||||
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
|
texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
|
||||||
tex.FaceTextures[face].RGBA = texcolor;
|
tex.FaceTextures[face].RGBA = texcolor;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ScriptBaseClass.ALL_SIDES)
|
else if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1617,7 +1617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
tex.DefaultTexture.RGBA = texcolor;
|
tex.DefaultTexture.RGBA = texcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1774,7 +1774,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
|
||||||
texface.TextureID = textureID;
|
texface.TextureID = textureID;
|
||||||
tex.FaceTextures[face] = texface;
|
tex.FaceTextures[face] = texface;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (face == ScriptBaseClass.ALL_SIDES)
|
else if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1787,7 +1787,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.TextureID = textureID;
|
tex.DefaultTexture.TextureID = textureID;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1809,7 +1809,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
texface.RepeatU = (float)u;
|
texface.RepeatU = (float)u;
|
||||||
texface.RepeatV = (float)v;
|
texface.RepeatV = (float)v;
|
||||||
tex.FaceTextures[face] = texface;
|
tex.FaceTextures[face] = texface;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (face == ScriptBaseClass.ALL_SIDES)
|
if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1824,7 +1824,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.RepeatU = (float)u;
|
tex.DefaultTexture.RepeatU = (float)u;
|
||||||
tex.DefaultTexture.RepeatV = (float)v;
|
tex.DefaultTexture.RepeatV = (float)v;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1845,7 +1845,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
texface.OffsetU = (float)u;
|
texface.OffsetU = (float)u;
|
||||||
texface.OffsetV = (float)v;
|
texface.OffsetV = (float)v;
|
||||||
tex.FaceTextures[face] = texface;
|
tex.FaceTextures[face] = texface;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (face == ScriptBaseClass.ALL_SIDES)
|
if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1860,7 +1860,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.OffsetU = (float)u;
|
tex.DefaultTexture.OffsetU = (float)u;
|
||||||
tex.DefaultTexture.OffsetV = (float)v;
|
tex.DefaultTexture.OffsetV = (float)v;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1880,7 +1880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
|
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
|
||||||
texface.Rotation = (float)rotation;
|
texface.Rotation = (float)rotation;
|
||||||
tex.FaceTextures[face] = texface;
|
tex.FaceTextures[face] = texface;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (face == ScriptBaseClass.ALL_SIDES)
|
if (face == ScriptBaseClass.ALL_SIDES)
|
||||||
|
@ -1893,7 +1893,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tex.DefaultTexture.Rotation = (float)rotation;
|
tex.DefaultTexture.Rotation = (float)rotation;
|
||||||
part.UpdateTexture(tex);
|
part.UpdateTextureEntry(tex.GetBytes());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,9 +45,11 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
base(config, server, configName)
|
base(config, server, configName)
|
||||||
{
|
{
|
||||||
server.AddStreamHandler(new HeloServerGetHandler("opensim-robust"));
|
server.AddStreamHandler(new HeloServerGetHandler("opensim-robust"));
|
||||||
|
server.AddStreamHandler(new HeloServerHeadHandler("opensim-robust"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete]
|
||||||
public class HeloServerGetHandler : BaseStreamHandler
|
public class HeloServerGetHandler : BaseStreamHandler
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -68,7 +70,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
|
|
||||||
private byte[] OKResponse(OSHttpResponse httpResponse)
|
private byte[] OKResponse(OSHttpResponse httpResponse)
|
||||||
{
|
{
|
||||||
m_log.Debug("[HELO]: hi, I was called");
|
m_log.Debug("[HELO]: hi, GET was called");
|
||||||
httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
|
httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
|
||||||
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||||
httpResponse.StatusDescription = "OK";
|
httpResponse.StatusDescription = "OK";
|
||||||
|
@ -76,4 +78,34 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class HeloServerHeadHandler : BaseStreamHandler
|
||||||
|
{
|
||||||
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
private string m_HandlersType;
|
||||||
|
|
||||||
|
public HeloServerHeadHandler(string handlersType) :
|
||||||
|
base("HEAD", "/helo")
|
||||||
|
{
|
||||||
|
m_HandlersType = handlersType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte[] Handle(string path, Stream requestData,
|
||||||
|
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
|
{
|
||||||
|
return OKResponse(httpResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
private byte[] OKResponse(OSHttpResponse httpResponse)
|
||||||
|
{
|
||||||
|
m_log.Debug("[HELO]: hi, HEAD was called");
|
||||||
|
httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType);
|
||||||
|
httpResponse.StatusCode = (int)HttpStatusCode.OK;
|
||||||
|
httpResponse.StatusDescription = "OK";
|
||||||
|
return new byte[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
||||||
UUID.TryParse(sessionID_str, out sessionID);
|
UUID.TryParse(sessionID_str, out sessionID);
|
||||||
string gridName = (string)requestData["externalName"];
|
string gridName = (string)requestData["externalName"];
|
||||||
|
|
||||||
bool success = m_HomeUsersService.AgentIsComingHome(sessionID, gridName);
|
bool success = m_HomeUsersService.IsAgentComingHome(sessionID, gridName);
|
||||||
|
|
||||||
Hashtable hash = new Hashtable();
|
Hashtable hash = new Hashtable();
|
||||||
hash["result"] = success.ToString();
|
hash["result"] = success.ToString();
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace OpenSim.Services.Connectors
|
||||||
public virtual string Helo()
|
public virtual string Helo()
|
||||||
{
|
{
|
||||||
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo");
|
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo");
|
||||||
|
// Eventually we need to switch to HEAD
|
||||||
|
/* req.Method = "HEAD"; */
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AgentIsComingHome(UUID sessionID, string thisGridExternalName)
|
public bool IsAgentComingHome(UUID sessionID, string thisGridExternalName)
|
||||||
{
|
{
|
||||||
Hashtable hash = new Hashtable();
|
Hashtable hash = new Hashtable();
|
||||||
hash["sessionID"] = sessionID.ToString();
|
hash["sessionID"] = sessionID.ToString();
|
||||||
|
|
|
@ -243,7 +243,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
// Make sure this is the user coming home, and not a foreign user with same UUID as a local user
|
// Make sure this is the user coming home, and not a foreign user with same UUID as a local user
|
||||||
if (m_UserAgentService != null)
|
if (m_UserAgentService != null)
|
||||||
{
|
{
|
||||||
if (!m_UserAgentService.AgentIsComingHome(aCircuit.SessionID, m_ExternalName))
|
if (!m_UserAgentService.IsAgentComingHome(aCircuit.SessionID, m_ExternalName))
|
||||||
{
|
{
|
||||||
// Can't do, sorry
|
// Can't do, sorry
|
||||||
reason = "Unauthorized";
|
reason = "Unauthorized";
|
||||||
|
|
|
@ -281,7 +281,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to prevent foreign users with the same UUID as a local user
|
// We need to prevent foreign users with the same UUID as a local user
|
||||||
public bool AgentIsComingHome(UUID sessionID, string thisGridExternalName)
|
public bool IsAgentComingHome(UUID sessionID, string thisGridExternalName)
|
||||||
{
|
{
|
||||||
if (!m_TravelingAgents.ContainsKey(sessionID))
|
if (!m_TravelingAgents.ContainsKey(sessionID))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
List<UUID> StatusNotification(List<string> friends, UUID userID, bool online);
|
List<UUID> StatusNotification(List<string> friends, UUID userID, bool online);
|
||||||
//List<UUID> GetOnlineFriends(UUID userID, List<string> friends);
|
//List<UUID> GetOnlineFriends(UUID userID, List<string> friends);
|
||||||
|
|
||||||
bool AgentIsComingHome(UUID sessionID, string thisGridExternalName);
|
bool IsAgentComingHome(UUID sessionID, string thisGridExternalName);
|
||||||
bool VerifyAgent(UUID sessionID, string token);
|
bool VerifyAgent(UUID sessionID, string token);
|
||||||
bool VerifyClient(UUID sessionID, string reportedIP);
|
bool VerifyClient(UUID sessionID, string reportedIP);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
using OpenSim.Tests.Common.Mock;
|
using OpenSim.Tests.Common.Mock;
|
||||||
|
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||||
|
|
||||||
namespace OpenSim.Tests.Common
|
namespace OpenSim.Tests.Common
|
||||||
{
|
{
|
||||||
|
@ -139,6 +140,7 @@ namespace OpenSim.Tests.Common
|
||||||
|
|
||||||
testScene.RegionInfo.EstateSettings = new EstateSettings();
|
testScene.RegionInfo.EstateSettings = new EstateSettings();
|
||||||
testScene.LoginsDisabled = false;
|
testScene.LoginsDisabled = false;
|
||||||
|
testScene.RegisterRegionWithGrid();
|
||||||
|
|
||||||
return testScene;
|
return testScene;
|
||||||
}
|
}
|
||||||
|
@ -222,6 +224,7 @@ namespace OpenSim.Tests.Common
|
||||||
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
|
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
|
||||||
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
|
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
|
||||||
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
|
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
|
||||||
|
config.Configs["GridService"].Set("ConnectionString", "!static");
|
||||||
|
|
||||||
LocalGridServicesConnector gridService = new LocalGridServicesConnector();
|
LocalGridServicesConnector gridService = new LocalGridServicesConnector();
|
||||||
gridService.Initialise(config);
|
gridService.Initialise(config);
|
||||||
|
@ -393,27 +396,42 @@ namespace OpenSim.Tests.Common
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData)
|
public static ScenePresence AddScenePresence(Scene scene, AgentCircuitData agentData)
|
||||||
{
|
{
|
||||||
string reason;
|
|
||||||
|
|
||||||
// We emulate the proper login sequence here by doing things in four stages
|
// We emulate the proper login sequence here by doing things in four stages
|
||||||
|
|
||||||
// Stage 0: log the presence
|
// Stage 0: login
|
||||||
scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);
|
scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);
|
||||||
|
|
||||||
// Stage 1: simulate login by telling the scene to expect a new user connection
|
// Stages 1 & 2
|
||||||
if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason))
|
ScenePresence sp = IntroduceClientToScene(scene, agentData, TeleportFlags.ViaLogin);
|
||||||
|
|
||||||
|
// Stage 3: Complete the entrance into the region. This converts the child agent into a root agent.
|
||||||
|
sp.CompleteMovement(sp.ControllingClient, true);
|
||||||
|
|
||||||
|
return sp;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ScenePresence IntroduceClientToScene(Scene scene, AgentCircuitData agentData, TeleportFlags tf)
|
||||||
|
{
|
||||||
|
string reason;
|
||||||
|
|
||||||
|
// Stage 1: tell the scene to expect a new user connection
|
||||||
|
if (!scene.NewUserConnection(agentData, (uint)tf, out reason))
|
||||||
Console.WriteLine("NewUserConnection failed: " + reason);
|
Console.WriteLine("NewUserConnection failed: " + reason);
|
||||||
|
|
||||||
// Stage 2: add the new client as a child agent to the scene
|
// Stage 2: add the new client as a child agent to the scene
|
||||||
TestClient client = new TestClient(agentData, scene);
|
TestClient client = new TestClient(agentData, scene);
|
||||||
scene.AddNewClient(client, PresenceType.User);
|
scene.AddNewClient(client, PresenceType.User);
|
||||||
|
|
||||||
// Stage 3: Complete the entrance into the region. This converts the child agent into a root agent.
|
return scene.GetScenePresence(agentData.AgentID);
|
||||||
ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
|
}
|
||||||
scp.CompleteMovement(client, true);
|
|
||||||
//scp.MakeRootAgent(new Vector3(90, 90, 90), true);
|
|
||||||
|
|
||||||
return scp;
|
public static ScenePresence AddChildScenePresence(Scene scene, UUID agentId)
|
||||||
|
{
|
||||||
|
AgentCircuitData acd = GenerateAgentData(agentId);
|
||||||
|
acd.child = true;
|
||||||
|
|
||||||
|
// XXX: ViaLogin may not be correct for child agents
|
||||||
|
return IntroduceClientToScene(scene, acd, TeleportFlags.ViaLogin);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -3016,6 +3016,7 @@
|
||||||
<Reference name="OpenSim.Framework.Servers"/>
|
<Reference name="OpenSim.Framework.Servers"/>
|
||||||
<Reference name="OpenSim.Framework.Statistics"/>
|
<Reference name="OpenSim.Framework.Statistics"/>
|
||||||
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
|
||||||
|
<Reference name="OpenSim.Region.ClientStack.LindenCaps"/>
|
||||||
<Reference name="OpenSim.Region.Framework"/>
|
<Reference name="OpenSim.Region.Framework"/>
|
||||||
<Reference name="OpenSim.Region.CoreModules"/>
|
<Reference name="OpenSim.Region.CoreModules"/>
|
||||||
<Reference name="OpenSim.Region.OptionalModules"/>
|
<Reference name="OpenSim.Region.OptionalModules"/>
|
||||||
|
|
Loading…
Reference in New Issue