Remove the old remoting-type interregion code for prim/script crossing
parent
88842edc95
commit
05fc504ff3
|
@ -32,7 +32,6 @@ namespace OpenSim.Framework
|
||||||
{
|
{
|
||||||
public delegate void ExpectUserDelegate(AgentCircuitData agent);
|
public delegate void ExpectUserDelegate(AgentCircuitData agent);
|
||||||
|
|
||||||
public delegate bool ExpectPrimDelegate(UUID primID, string objData, int XMLMethod);
|
|
||||||
|
|
||||||
public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
|
public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
|
||||||
|
|
||||||
|
@ -55,7 +54,6 @@ namespace OpenSim.Framework
|
||||||
public interface IRegionCommsListener
|
public interface IRegionCommsListener
|
||||||
{
|
{
|
||||||
event ExpectUserDelegate OnExpectUser;
|
event ExpectUserDelegate OnExpectUser;
|
||||||
event ExpectPrimDelegate OnExpectPrim;
|
|
||||||
event GenericCall2 OnExpectChildAgent;
|
event GenericCall2 OnExpectChildAgent;
|
||||||
event AgentCrossing OnAvatarCrossingIntoRegion;
|
event AgentCrossing OnAvatarCrossingIntoRegion;
|
||||||
event PrimCrossing OnPrimCrossingIntoRegion;
|
event PrimCrossing OnPrimCrossingIntoRegion;
|
||||||
|
|
|
@ -43,7 +43,6 @@ namespace OpenSim.Framework
|
||||||
private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
|
private ChildAgentUpdate handlerChildAgentUpdate = null; // OnChildAgentUpdate;
|
||||||
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
||||||
private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent;
|
private GenericCall2 handlerExpectChildAgent = null; // OnExpectChildAgent;
|
||||||
private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim;
|
|
||||||
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
|
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
|
||||||
private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
|
private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
|
||||||
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
||||||
|
@ -53,7 +52,6 @@ namespace OpenSim.Framework
|
||||||
#region IRegionCommsListener Members
|
#region IRegionCommsListener Members
|
||||||
|
|
||||||
public event ExpectUserDelegate OnExpectUser;
|
public event ExpectUserDelegate OnExpectUser;
|
||||||
public event ExpectPrimDelegate OnExpectPrim;
|
|
||||||
public event GenericCall2 OnExpectChildAgent;
|
public event GenericCall2 OnExpectChildAgent;
|
||||||
public event AgentCrossing OnAvatarCrossingIntoRegion;
|
public event AgentCrossing OnAvatarCrossingIntoRegion;
|
||||||
public event PrimCrossing OnPrimCrossingIntoRegion;
|
public event PrimCrossing OnPrimCrossingIntoRegion;
|
||||||
|
@ -95,17 +93,6 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool TriggerExpectPrim(UUID primID, string objData, int XMLMethod)
|
|
||||||
{
|
|
||||||
handlerExpectPrim = OnExpectPrim;
|
|
||||||
if (handlerExpectPrim != null)
|
|
||||||
{
|
|
||||||
handlerExpectPrim(primID, objData, XMLMethod);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
|
public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
|
||||||
{
|
{
|
||||||
handlerChildAgentUpdate = OnChildAgentUpdate;
|
handlerChildAgentUpdate = OnChildAgentUpdate;
|
||||||
|
@ -128,18 +115,6 @@ namespace OpenSim.Framework
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool TriggerExpectPrimCrossing(UUID primID, Vector3 position,
|
|
||||||
bool isPhysical)
|
|
||||||
{
|
|
||||||
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
|
|
||||||
if (handlerPrimCrossingIntoRegion != null)
|
|
||||||
{
|
|
||||||
handlerPrimCrossingIntoRegion(primID, position, isPhysical);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID)
|
public virtual bool TriggerAcknowledgeAgentCrossed(UUID agentID)
|
||||||
{
|
{
|
||||||
handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed;
|
handlerAcknowledgeAgentCrossed = OnAcknowledgeAgentCrossed;
|
||||||
|
|
|
@ -2381,103 +2381,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return successYN;
|
return successYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Handle a scene object that is crossing into this region from another.
|
|
||||||
/// NOTE: Unused as of 2009-02-09. Soon to be deleted.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="regionHandle"></param>
|
|
||||||
/// <param name="primID"></param>
|
|
||||||
/// <param name="objXMLData"></param>
|
|
||||||
/// <param name="XMLMethod"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool IncomingInterRegionPrimGroup(UUID primID, string objXMLData, int XMLMethod)
|
|
||||||
{
|
|
||||||
if (XMLMethod == 0)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[INTERREGION]: A new prim {0} arrived from a neighbor", primID);
|
|
||||||
SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
|
|
||||||
if (sceneObject.IsAttachment)
|
|
||||||
sceneObject.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom;
|
|
||||||
|
|
||||||
return AddSceneObject(sceneObject);
|
|
||||||
}
|
|
||||||
else if ((XMLMethod == 100) && m_allowScriptCrossings)
|
|
||||||
{
|
|
||||||
m_log.Warn("[INTERREGION]: Prim state data arrived from a neighbor");
|
|
||||||
|
|
||||||
XmlDocument doc = new XmlDocument();
|
|
||||||
doc.LoadXml(objXMLData);
|
|
||||||
|
|
||||||
XmlNodeList rootL = doc.GetElementsByTagName("ScriptData");
|
|
||||||
if (rootL.Count == 1)
|
|
||||||
{
|
|
||||||
XmlNode rootNode = rootL[0];
|
|
||||||
if (rootNode != null)
|
|
||||||
{
|
|
||||||
XmlNodeList partL = rootNode.ChildNodes;
|
|
||||||
|
|
||||||
foreach (XmlNode part in partL)
|
|
||||||
{
|
|
||||||
XmlNodeList nodeL = part.ChildNodes;
|
|
||||||
|
|
||||||
switch (part.Name)
|
|
||||||
{
|
|
||||||
case "Assemblies":
|
|
||||||
foreach (XmlNode asm in nodeL)
|
|
||||||
{
|
|
||||||
string fn = asm.Attributes.GetNamedItem("Filename").Value;
|
|
||||||
|
|
||||||
Byte[] filedata = Convert.FromBase64String(asm.InnerText);
|
|
||||||
string path = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString());
|
|
||||||
path = Path.Combine(path, fn);
|
|
||||||
|
|
||||||
if (!File.Exists(path))
|
|
||||||
{
|
|
||||||
FileStream fs = File.Create(path);
|
|
||||||
fs.Write(filedata, 0, filedata.Length);
|
|
||||||
fs.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "ScriptStates":
|
|
||||||
foreach (XmlNode st in nodeL)
|
|
||||||
{
|
|
||||||
string id = st.Attributes.GetNamedItem("UUID").Value;
|
|
||||||
UUID uuid = new UUID(id);
|
|
||||||
XmlNode state = st.ChildNodes[0];
|
|
||||||
|
|
||||||
XmlDocument sdoc = new XmlDocument();
|
|
||||||
XmlNode sxmlnode = sdoc.CreateNode(
|
|
||||||
XmlNodeType.XmlDeclaration,
|
|
||||||
"", "");
|
|
||||||
sdoc.AppendChild(sxmlnode);
|
|
||||||
|
|
||||||
XmlNode newnode = sdoc.ImportNode(state, true);
|
|
||||||
sdoc.AppendChild(newnode);
|
|
||||||
|
|
||||||
string spath = Path.Combine("ScriptEngines", RegionInfo.RegionID.ToString());
|
|
||||||
spath = Path.Combine(spath, uuid.ToString());
|
|
||||||
FileStream sfs = File.Create(spath + ".state");
|
|
||||||
ASCIIEncoding enc = new ASCIIEncoding();
|
|
||||||
Byte[] buf = enc.GetBytes(sdoc.InnerXml);
|
|
||||||
sfs.Write(buf, 0, buf.Length);
|
|
||||||
sfs.Close();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SceneObjectPart RootPrim = GetSceneObjectPart(primID);
|
|
||||||
RootPrim.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IncomingCreateObject(ISceneObject sog)
|
public bool IncomingCreateObject(ISceneObject sog)
|
||||||
{
|
{
|
||||||
//m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
|
//m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted);
|
||||||
|
@ -3350,7 +3253,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
|
m_sceneGridService.OnCloseAgentConnection += IncomingCloseAgent;
|
||||||
//m_eventManager.OnRegionUp += OtherRegionUp;
|
//m_eventManager.OnRegionUp += OtherRegionUp;
|
||||||
//m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
|
//m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
|
||||||
m_sceneGridService.OnExpectPrim += IncomingInterRegionPrimGroup;
|
|
||||||
//m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
|
//m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
|
||||||
m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
|
m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
|
||||||
m_sceneGridService.KiPrimitive += SendKillObject;
|
m_sceneGridService.KiPrimitive += SendKillObject;
|
||||||
|
@ -3374,7 +3276,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_sceneGridService.KiPrimitive -= SendKillObject;
|
m_sceneGridService.KiPrimitive -= SendKillObject;
|
||||||
m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
|
m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
|
||||||
//m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
|
//m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
|
||||||
m_sceneGridService.OnExpectPrim -= IncomingInterRegionPrimGroup;
|
|
||||||
//m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
|
//m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
|
||||||
//m_eventManager.OnRegionUp -= OtherRegionUp;
|
//m_eventManager.OnRegionUp -= OtherRegionUp;
|
||||||
m_sceneGridService.OnExpectUser -= HandleNewUserConnection;
|
m_sceneGridService.OnExpectUser -= HandleNewUserConnection;
|
||||||
|
|
|
@ -85,7 +85,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A Prim will arrive shortly
|
/// A Prim will arrive shortly
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event ExpectPrimDelegate OnExpectPrim;
|
|
||||||
public event CloseAgentConnection OnCloseAgentConnection;
|
public event CloseAgentConnection OnCloseAgentConnection;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -116,7 +115,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion;
|
private AgentCrossing handlerAvatarCrossingIntoRegion = null; // OnAvatarCrossingIntoRegion;
|
||||||
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser;
|
private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser;
|
||||||
private ExpectPrimDelegate handlerExpectPrim = null; // OnExpectPrim;
|
|
||||||
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
private CloseAgentConnection handlerCloseAgentConnection = null; // OnCloseAgentConnection;
|
||||||
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
|
||||||
//private RegionUp handlerRegionUp = null; // OnRegionUp;
|
//private RegionUp handlerRegionUp = null; // OnRegionUp;
|
||||||
|
@ -147,30 +145,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <exception cref="System.Exception">Thrown if region registration fails.</exception>
|
/// <exception cref="System.Exception">Thrown if region registration fails.</exception>
|
||||||
public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
|
public void RegisterRegion(IInterregionCommsOut comms_out, RegionInfo regionInfos)
|
||||||
{
|
{
|
||||||
//m_interregionCommsOut = comms_out;
|
|
||||||
|
|
||||||
//m_regionInfo = regionInfos;
|
|
||||||
//m_commsProvider.GridService.gdebugRegionName = regionInfos.RegionName;
|
|
||||||
//regionCommsHost = m_commsProvider.GridService.RegisterRegion(m_regionInfo);
|
|
||||||
|
|
||||||
//if (regionCommsHost != null)
|
|
||||||
//{
|
|
||||||
// //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
|
|
||||||
|
|
||||||
// regionCommsHost.debugRegionName = regionInfos.RegionName;
|
|
||||||
// regionCommsHost.OnExpectPrim += IncomingPrimCrossing;
|
|
||||||
// regionCommsHost.OnExpectUser += NewUserConnection;
|
|
||||||
// regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
|
|
||||||
// regionCommsHost.OnCloseAgentConnection += CloseConnection;
|
|
||||||
// regionCommsHost.OnRegionUp += newRegionUp;
|
|
||||||
// regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
|
|
||||||
// regionCommsHost.OnLogOffUser += GridLogOffUser;
|
|
||||||
// regionCommsHost.OnGetLandData += FetchLandData;
|
|
||||||
//}
|
|
||||||
//else
|
|
||||||
//{
|
|
||||||
// //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -179,31 +153,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
|
|
||||||
//if (regionCommsHost != null)
|
|
||||||
//{
|
|
||||||
// regionCommsHost.OnLogOffUser -= GridLogOffUser;
|
|
||||||
// regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate;
|
|
||||||
// regionCommsHost.OnRegionUp -= newRegionUp;
|
|
||||||
// regionCommsHost.OnExpectUser -= NewUserConnection;
|
|
||||||
// regionCommsHost.OnExpectPrim -= IncomingPrimCrossing;
|
|
||||||
// regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
|
|
||||||
// regionCommsHost.OnCloseAgentConnection -= CloseConnection;
|
|
||||||
// regionCommsHost.OnGetLandData -= FetchLandData;
|
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
|
|
||||||
// }
|
|
||||||
// catch (Exception e)
|
|
||||||
// {
|
|
||||||
// m_log.ErrorFormat(
|
|
||||||
// "[GRID]: Deregistration of region {0} from the grid failed - {1}. Continuing",
|
|
||||||
// m_regionInfo.RegionName, e);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// regionCommsHost = null;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region CommsManager Event handlers
|
#region CommsManager Event handlers
|
||||||
|
@ -263,27 +212,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// We have a new prim from a neighbor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="primID">unique ID for the primative</param>
|
|
||||||
/// <param name="objXMLData">XML2 encoded data of the primative</param>
|
|
||||||
/// <param name="XMLMethod">An Int that represents the version of the XMLMethod</param>
|
|
||||||
/// <returns>True if the prim was accepted, false if it was not</returns>
|
|
||||||
protected bool IncomingPrimCrossing(UUID primID, String objXMLData, int XMLMethod)
|
|
||||||
{
|
|
||||||
handlerExpectPrim = OnExpectPrim;
|
|
||||||
if (handlerExpectPrim != null)
|
|
||||||
{
|
|
||||||
return handlerExpectPrim(primID, objXMLData, XMLMethod);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
|
protected void PrimCrossing(UUID primID, Vector3 position, bool isPhysical)
|
||||||
{
|
{
|
||||||
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
|
handlerPrimCrossingIntoRegion = OnPrimCrossingIntoRegion;
|
||||||
|
|
Loading…
Reference in New Issue