* Hooked up the GridComm event ChildDataUpdate to the scene.

* Added List<RegionInfo> m_neighbours to Scene 
* Hooked up the OnRegionUp event to m_neighbours list 
* Modified RegionInfo to have a bool commFailTF value so that we can skip neighbors that fail.  (when the region comes up, this gets reset to false and the region will try again.
* Added SetChildAgentThrottle(byte[]) to IClientAPI 
* Several other insignificant changes related to passing child pertanant agent data from sim to sim.
This commit is contained in:
Teravus Ovares
2007-12-10 00:46:56 +00:00
parent be5d8811be
commit e595f82489
8 changed files with 117 additions and 7 deletions

View File

@@ -23,6 +23,7 @@ namespace OpenSim.Region.Environment.Scenes
public event CloseAgentConnection OnCloseAgentConnection;
public event PrimCrossing OnPrimCrossingIntoRegion;
public event RegionUp OnRegionUp;
public event ChildAgentUpdate OnChildAgentUpdate;
public KillObjectDelegate KillObject;
public string _debugRegionName = "";
@@ -59,6 +60,8 @@ namespace OpenSim.Region.Environment.Scenes
regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing;
regionCommsHost.OnCloseAgentConnection += CloseConnection;
regionCommsHost.OnRegionUp += newRegionUp;
regionCommsHost.OnChildAgentUpdate += ChildAgentUpdate;
}
else
{
@@ -70,6 +73,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (regionCommsHost != null)
{
regionCommsHost.OnChildAgentUpdate -= ChildAgentUpdate;
regionCommsHost.OnRegionUp -= newRegionUp;
regionCommsHost.OnExpectUser -= NewUserConnection;
regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
@@ -105,6 +109,14 @@ namespace OpenSim.Region.Environment.Scenes
}
return true;
}
protected bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
{
if (OnChildAgentUpdate != null)
OnChildAgentUpdate(regionHandle, cAgentData);
return true;
}
protected void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
{
@@ -262,6 +274,37 @@ namespace OpenSim.Region.Environment.Scenes
//bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region));
}
public delegate void SendChildAgentDataUpdateDelegate(ulong regionHandle, ChildAgentDataUpdate cAgentData);
private void SendChildAgentDataUpdateAsync(ulong regionHandle, ChildAgentDataUpdate cAgentData)
{
MainLog.Instance.Notice("INTERGRID", "Informing a neighbor about my agent.");
bool regionAccepted = m_commsProvider.InterRegion.ChildAgentUpdate(regionHandle,cAgentData);
if (regionAccepted)
{
MainLog.Instance.Notice("INTERGRID", "Completed sending a neighbor an update about my agent");
}
else
{
MainLog.Instance.Notice("INTERGRID", "Failed sending a neighbor an update about my agent");
}
}
private void SendChildAgentDataUpdateCompleted(IAsyncResult iar)
{
SendChildAgentDataUpdateDelegate icon = (SendChildAgentDataUpdateDelegate)iar.AsyncState;
icon.EndInvoke(iar);
}
public void SendChildAgentDataUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
{
// This assumes that we know what our neighbors are.
SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync;
d.BeginInvoke(regionHandle, cAgentData,
SendChildAgentDataUpdateCompleted,
d);
}
/// <summary>
///