delegate.BeginInvoke is a dead end

This commit is contained in:
UbitUmarov
2021-09-09 19:23:24 +01:00
parent 095b46d193
commit b3f9217d27
2 changed files with 12 additions and 19 deletions

View File

@@ -1599,11 +1599,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
public bool Cross(ScenePresence agent, bool isFlying)
{
agent.IsInLocalTransit = true;
agent.IsInTransit = true;
ScenePresence ag = agent;
ag.IsInLocalTransit = true;
ag.IsInTransit = true;
WorkManager.RunInThreadPool(delegate
{
ScenePresence ag = agent;
CrossAsync(ag, isFlying);
if (ag.IsDeleted)
return;
@@ -1616,7 +1616,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", ag.Firstname, ag.Lastname);
ag.IsInTransit = false;
}, null,"AgentRegionCross-"+agent.UUID.ToString());
}, null,"AgentRegionCross-"+ag.UUID.ToString());
return true;
}
@@ -1972,10 +1972,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
IPEndPoint external = region.ExternalEndPoint;
if (external != null)
{
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
d.BeginInvoke(sp, agent, region, external, true,
InformClientOfNeighbourCompleted,
d);
ScenePresence avatar = sp;
GridRegion reg = region;
WorkManager.RunInThreadPool(delegate
{
InformClientOfNeighbourAsync(avatar, agent, reg, external, true);
},"InformClientOfNeighbourAsync" + avatar.UUID.ToString());
}
}
@@ -1983,9 +1985,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
#region Enable Child Agents
private delegate void InformClientOfNeighbourDelegate(
ScenePresence avatar, AgentCircuitData a, GridRegion reg, IPEndPoint endPoint, bool newAgent);
List<GridRegion> RegionsInView(Vector3 pos, RegionInfo curregion, List<GridRegion> fullneighbours, float viewrange)
{
List<GridRegion> ret = new List<GridRegion>();
@@ -2542,13 +2541,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return null;
}
private void InformClientOfNeighbourCompleted(IAsyncResult iar)
{
InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
icon.EndInvoke(iar);
//m_log.WarnFormat(" --> InformClientOfNeighbourCompleted");
}
/// <summary>
/// Async component for informing client of which neighbours exist
/// </summary>

View File

@@ -266,7 +266,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
// this user is going to another grid
// for local users, check if HyperGrid teleport is allowed, based on user level
if (Scene.UserManagementModule.IsLocalGridUser(sp.UUID) && sp.GodController.UserLevel < m_levelHGTeleport)
bool isLocal = Scene.UserManagementModule.IsLocalGridUser(sp.UUID);
if (isLocal && sp.GodController.UserLevel < m_levelHGTeleport)
{
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel.");
reason = "Hypergrid teleport not allowed";