This update has good news and bad news, first the bad.

* This update breaks inter-region communications, sorry.
* You will need to run prebuild.
Next, the good;
* This update solves the unexpected binary element when Linux simulators inform windows simulators and vice versa.  So Linux Simulators and Windows simulators are 100% compatible again.
* This update introduces an Integer in the prim crossing method to tell the receiving simulator which XML method to use to load the prim that crossed the border.   If the receiving prim doesn't support the method, the prim crossing fails and no prims are lost.
That being said, it's best to update all your simulators to this revision at once.
0.6.0-stable
Teravus Ovares 2008-03-30 08:01:47 +00:00
parent 2fddd775f4
commit fd2caf5f16
13 changed files with 155 additions and 36 deletions

View File

@ -35,7 +35,7 @@ namespace OpenSim.Framework.Communications
bool Available { get; }
void CheckRegion(string address, uint port);
bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData);
bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData);
bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod);
bool RegionUp(SearializableRegionInfo region, ulong regionhandle);
bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData);

View File

@ -302,6 +302,13 @@ namespace OpenSim.Framework
public delegate void ObjectDuplicate(uint localID, LLVector3 offset, uint dupeFlags, LLUUID AgentID, LLUUID GroupID);
public delegate void ObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates);
public delegate void StatusChange(bool status);
public delegate void NewAvatar(IClientAPI remoteClient, LLUUID agentID, bool status);
@ -463,6 +470,7 @@ namespace OpenSim.Framework
event GodKickUser OnGodKickUser;
event ObjectDuplicate OnObjectDuplicate;
event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
event UpdateVector OnGrabObject;
event ObjectSelect OnDeGrabObject;
event MoveObject OnGrabUpdate;

View File

@ -32,7 +32,7 @@ namespace OpenSim.Framework
{
public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent);
public delegate void ExpectPrimDelegate(ulong regionHandle, LLUUID primID, string objData);
public delegate bool ExpectPrimDelegate(ulong regionHandle, LLUUID primID, string objData, int XMLMethod);
public delegate void UpdateNeighbours(List<RegionInfo> neighbours);

View File

@ -78,12 +78,12 @@ namespace OpenSim.Framework
}
public virtual bool TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
public virtual bool TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
{
handlerExpectPrim = OnExpectPrim;
if (handlerExpectPrim != null)
{
handlerExpectPrim(regionHandle, primID, objData);
handlerExpectPrim(regionHandle, primID, objData, XMLMethod);
return true;
}
return false;

View File

@ -101,6 +101,12 @@ namespace OpenSim.Framework
public bool m_allow_alternate_ports;
protected string m_serverURI;
public int getInternalEndPointPort()
{
return m_internalEndPoint.Port;
}
public string ServerURI
{
get
@ -279,6 +285,17 @@ namespace OpenSim.Framework
RegionID = LLUUID.Zero;
ServerURI = ConvertFrom.ServerURI;
}
public int getInternalEndPointPort()
{
return m_internalEndPoint.Port;
}
public void SetEndPoint(string ipaddr, int port)
{
IPAddress tmpIP = IPAddress.Parse(ipaddr);
IPEndPoint tmpEPE= new IPEndPoint(tmpIP, port);
m_internalEndPoint = tmpEPE;
}
//not in use, should swap to nini though.
public void LoadFromNiniSource(IConfigSource source)

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Framework
{
[Serializable]
public class RegionUpData
{
private uint m_X = 0;
private uint m_Y = 0;
private string m_ipaddr = "";
private int m_port = 0;
public RegionUpData(uint X, uint Y, string ipaddr, int port)
{
m_X = X;
m_Y = Y;
m_ipaddr = ipaddr;
m_port = port;
}
public uint X
{
get { return m_X; }
}
public uint Y
{
get { return m_Y; }
}
public string IPADDR
{
get { return m_ipaddr; }
}
public int PORT
{
get { return m_port; }
}
}
}

View File

@ -158,6 +158,7 @@ namespace OpenSim.Region.ClientStack
private UpdateShape handlerUpdatePrimShape = null; //null;
private ObjectExtraParams handlerUpdateExtraParams = null; //OnUpdateExtraParams;
private ObjectDuplicate handlerObjectDuplicate = null;
private ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null;
private ObjectSelect handlerObjectSelect = null;
private ObjectDeselect handlerObjectDeselect = null;
private UpdatePrimFlags handlerUpdatePrimFlags = null; //OnUpdatePrimFlags;
@ -675,6 +676,7 @@ namespace OpenSim.Region.ClientStack
public event UpdateVector OnGrabObject;
public event ObjectSelect OnDeGrabObject;
public event ObjectDuplicate OnObjectDuplicate;
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
public event MoveObject OnGrabUpdate;
public event AddNewPrim OnAddPrim;
public event RequestGodlikePowers OnRequestGodlikePowers;
@ -3590,7 +3592,26 @@ namespace OpenSim.Region.ClientStack
// That means multiple object perms may be updated in a single packet.
break;
case PacketType.ObjectDuplicateOnRay:
ObjectDuplicateOnRayPacket dupeOnRay = (ObjectDuplicateOnRayPacket)Pack;
handlerObjectDuplicateOnRay = null;
for (int i = 0; i < dupeOnRay.ObjectData.Length; i++)
{
handlerObjectDuplicateOnRay = OnObjectDuplicateOnRay;
if (handlerObjectDuplicateOnRay != null)
{
handlerObjectDuplicateOnRay(dupeOnRay.ObjectData[i].ObjectLocalID, dupeOnRay.AgentData.DuplicateFlags,
dupeOnRay.AgentData.AgentID, dupeOnRay.AgentData.GroupID, dupeOnRay.AgentData.RayTargetID, dupeOnRay.AgentData.RayEnd,
dupeOnRay.AgentData.RayStart, dupeOnRay.AgentData.BypassRaycast, dupeOnRay.AgentData.RayEndIsIntersection,
dupeOnRay.AgentData.CopyCenters, dupeOnRay.AgentData.CopyRotates);
}
}
break;
break;
case PacketType.RequestObjectPropertiesFamily:
//This powers the little tooltip that appears when you move your mouse over an object
RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket)Pack;

View File

@ -225,6 +225,12 @@ namespace OpenSim.Region.Communications.Local
public virtual bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle)
{
RegionInfo region = new RegionInfo(sregion);
//region.RegionLocX = sregion.X;
//region.RegionLocY = sregion.Y;
//region.SetEndPoint(sregion.IPADDR, sregion.PORT);
//sregion);
if (m_regionListeners.ContainsKey(regionhandle))
{
return m_regionListeners[regionhandle].TriggerRegionUp(region);
@ -316,11 +322,11 @@ namespace OpenSim.Region.Communications.Local
return false;
}
public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData);
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData, XMLMethod);
return true;
}
return false;
@ -408,11 +414,11 @@ namespace OpenSim.Region.Communications.Local
}
}
public void TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
public void TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData);
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData, XMLMethod);
}
}

View File

@ -857,6 +857,8 @@ namespace OpenSim.Region.Communications.OGS1
// The region asking the grid services about itself..
// And, surprisingly, the reason is.. it doesn't know
// it's own remoting port! How special.
RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port);
region = new SearializableRegionInfo(RequestNeighbourInfo(region.RegionHandle));
region.RemotingAddress = region.ExternalHostName;
region.RemotingPort = NetworkServersInfo.RemotingListenerPort;
@ -885,7 +887,7 @@ namespace OpenSim.Region.Communications.OGS1
if (remObject != null)
{
retValue = remObject.RegionUp(region, regionhandle);
retValue = remObject.RegionUp(regiondata, regionhandle);
}
else
{
@ -962,7 +964,7 @@ namespace OpenSim.Region.Communications.OGS1
/// <param name="regionHandle"></param>
/// <param name="agentData"></param>
/// <returns></returns>
public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
{
int failures = 0;
lock (m_deadRegionCache)
@ -977,7 +979,7 @@ namespace OpenSim.Region.Communications.OGS1
RegionInfo regInfo = null;
try
{
if (m_localBackend.InformRegionOfPrimCrossing(regionHandle, primID, objData))
if (m_localBackend.InformRegionOfPrimCrossing(regionHandle, primID, objData, XMLMethod))
{
return true;
}
@ -996,7 +998,7 @@ namespace OpenSim.Region.Communications.OGS1
if (remObject != null)
{
retValue = remObject.InformRegionOfPrimCrossing(regionHandle, primID.UUID, objData);
retValue = remObject.InformRegionOfPrimCrossing(regionHandle, primID.UUID, objData, XMLMethod);
}
else
{
@ -1325,23 +1327,29 @@ namespace OpenSim.Region.Communications.OGS1
}
}
public bool TriggerRegionUp(SearializableRegionInfo regionData, ulong regionhandle)
public bool TriggerRegionUp(RegionUpData regionData, ulong regionhandle)
{
m_log.Info("[OGS1 GRID SERVICES]: " +
gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX +
"," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries");
gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.X +
"," + regionData.Y + "). Giving this region a fresh set of 'dead' tries");
RegionInfo nRegionInfo = new RegionInfo();
nRegionInfo.SetEndPoint("127.0.0.1", regionData.PORT);
nRegionInfo.ExternalHostName = regionData.IPADDR;
nRegionInfo.RegionLocX = regionData.X;
nRegionInfo.RegionLocY = regionData.Y;
try
{
lock (m_deadRegionCache)
{
if (m_deadRegionCache.ContainsKey(regionData.RegionHandle))
if (m_deadRegionCache.ContainsKey(nRegionInfo.RegionHandle))
{
m_deadRegionCache.Remove(regionData.RegionHandle);
m_deadRegionCache.Remove(nRegionInfo.RegionHandle);
}
}
return m_localBackend.TriggerRegionUp(new RegionInfo(regionData), regionhandle);
return m_localBackend.TriggerRegionUp(nRegionInfo, regionhandle);
}
catch (RemotingException e)
@ -1372,12 +1380,12 @@ namespace OpenSim.Region.Communications.OGS1
/// <param name="regionHandle"></param>
/// <param name="agentData"></param>
/// <returns></returns>
public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData)
public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
{
// Is this necessary?
try
{
m_localBackend.TriggerExpectPrim(regionHandle, primID, objData);
m_localBackend.TriggerExpectPrim(regionHandle, primID, objData, XMLMethod);
return true;
//m_localBackend.
}

View File

@ -38,9 +38,9 @@ namespace OpenSim.Region.Communications.OGS1
public delegate bool InformRegionPrimGroup(ulong regionHandle, LLUUID primID, LLVector3 Positon, bool isPhysical);
public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData);
public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData, int XMLMethod);
public delegate bool RegionUp(SearializableRegionInfo region, ulong regionhandle);
public delegate bool RegionUp(RegionUpData region, ulong regionhandle);
public delegate bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate childUpdate);
@ -90,7 +90,7 @@ namespace OpenSim.Region.Communications.OGS1
return false;
}
public bool RegionUp(SearializableRegionInfo sregion, ulong regionhandle)
public bool RegionUp(RegionUpData sregion, ulong regionhandle)
{
handlerRegionUp = OnRegionUp;
if (handlerRegionUp != null)
@ -130,12 +130,12 @@ namespace OpenSim.Region.Communications.OGS1
return false;
}
public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData, int XMLMethod)
{
handlerPrimGroupArrival = OnPrimGroupArrival;
if (handlerPrimGroupArrival != null)
{
return handlerPrimGroupArrival(regionHandle, primID, objData);
return handlerPrimGroupArrival(regionHandle, primID, objData, XMLMethod);
}
return false;
}
@ -173,7 +173,7 @@ namespace OpenSim.Region.Communications.OGS1
}
}
public bool RegionUp(SearializableRegionInfo region, ulong regionhandle)
public bool RegionUp(RegionUpData region, ulong regionhandle)
{
try
{
@ -232,11 +232,11 @@ namespace OpenSim.Region.Communications.OGS1
}
}
public bool InformRegionOfPrimCrossing(ulong regionHandle, Guid primID, string objData)
public bool InformRegionOfPrimCrossing(ulong regionHandle, Guid primID, string objData, int XMLMethod)
{
try
{
return InterRegionSingleton.Instance.ExpectPrimCrossing(regionHandle, new LLUUID(primID), objData);
return InterRegionSingleton.Instance.ExpectPrimCrossing(regionHandle, new LLUUID(primID), objData, XMLMethod);
}
catch (RemotingException e)
{

View File

@ -1242,6 +1242,9 @@ namespace OpenSim.Region.Environment.Scenes
m_log.Warn("Prim crossing: " + grp.UUID.ToString());
int thisx = (int)RegionInfo.RegionLocX;
int thisy = (int)RegionInfo.RegionLocY;
int primcrossingXMLmethod = 0;
ulong newRegionHandle = 0;
LLVector3 pos = position;
@ -1279,7 +1282,7 @@ namespace OpenSim.Region.Environment.Scenes
if (newRegionHandle != 0)
{
bool successYN = false;
successYN = m_sceneGridService.PrimCrossToNeighboringRegion(newRegionHandle, grp.UUID, m_sceneXmlLoader.SavePrimGroupToXML2String(grp));
successYN = m_sceneGridService.PrimCrossToNeighboringRegion(newRegionHandle, grp.UUID, m_sceneXmlLoader.SavePrimGroupToXML2String(grp), primcrossingXMLmethod);
if (successYN)
{
// We remove the object here
@ -1306,10 +1309,18 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void IncomingInterRegionPrimGroup(ulong regionHandle, LLUUID primID, string objXMLData)
public bool IncomingInterRegionPrimGroup(ulong regionHandle, LLUUID primID, string objXMLData, int XMLMethod)
{
m_log.Warn("{[INTERREGION]: A new prim arrived from a neighbor");
m_sceneXmlLoader.LoadGroupFromXml2String(objXMLData);
if (XMLMethod == 0)
{
m_sceneXmlLoader.LoadGroupFromXml2String(objXMLData);
return true;
}
else
{
return false;
}
}

View File

@ -168,12 +168,16 @@ namespace OpenSim.Region.Environment.Scenes
}
}
protected void IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData)
protected bool IncomingPrimCrossing(ulong regionHandle, LLUUID primID, String objXMLData, int XMLMethod)
{
handlerExpectPrim = OnExpectPrim;
if (handlerExpectPrim != null)
{
handlerExpectPrim(regionHandle, primID, objXMLData);
return handlerExpectPrim(regionHandle, primID, objXMLData, XMLMethod);
}
else
{
return false;
}
}
@ -342,8 +346,10 @@ namespace OpenSim.Region.Environment.Scenes
private void InformNeighboursThatRegionIsUpAsync(RegionInfo region, ulong regionhandle)
{
m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here");
//RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port);
bool regionAccepted =
m_commsProvider.InterRegion.RegionUp((new SearializableRegionInfo(region)), regionhandle);
m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region), regionhandle);
if (regionAccepted)
{
@ -605,9 +611,9 @@ namespace OpenSim.Region.Environment.Scenes
return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
}
public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, string objData)
public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, string objData, int XMLMethod)
{
return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData);
return m_commsProvider.InterRegion.InformRegionOfPrimCrossing(regionhandle, primID, objData, XMLMethod);
}

View File

@ -148,6 +148,8 @@ namespace OpenSim.Region.Examples.SimpleModule
public event RegionInfoRequest OnRegionInfoRequest;
public event EstateCovenantRequest OnEstateCovenantRequest;
public event ObjectDuplicateOnRay OnObjectDuplicateOnRay;
public event FriendActionDelegate OnApproveFriendRequest;
public event FriendActionDelegate OnDenyFriendRequest;
public event FriendshipTermination OnTerminateFriendship;