Merge branch 'ubitwork' into avination
commit
d734c1985c
|
@ -8751,16 +8751,61 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
#region Parcel related packets
|
#region Parcel related packets
|
||||||
|
|
||||||
|
// acumulate several HandleRegionHandleRequest consecutive overlaping requests
|
||||||
|
// to be done with minimal resources as possible
|
||||||
|
// variables temporary here while in test
|
||||||
|
|
||||||
|
Queue<UUID> RegionHandleRequests = new Queue<UUID>();
|
||||||
|
bool RegionHandleRequestsInService = false;
|
||||||
|
|
||||||
private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack)
|
private bool HandleRegionHandleRequest(IClientAPI sender, Packet Pack)
|
||||||
{
|
{
|
||||||
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
UUID currentUUID;
|
||||||
|
|
||||||
RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
|
RegionHandleRequest handlerRegionHandleRequest = OnRegionHandleRequest;
|
||||||
if (handlerRegionHandleRequest != null)
|
|
||||||
{
|
if (handlerRegionHandleRequest == null)
|
||||||
handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
||||||
|
|
||||||
|
lock (RegionHandleRequests)
|
||||||
|
{
|
||||||
|
if (RegionHandleRequestsInService)
|
||||||
|
{
|
||||||
|
// we are already busy doing a previus request
|
||||||
|
// so enqueue it
|
||||||
|
RegionHandleRequests.Enqueue(rhrPack.RequestBlock.RegionID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// else do it
|
||||||
|
currentUUID = rhrPack.RequestBlock.RegionID;
|
||||||
|
RegionHandleRequestsInService = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
handlerRegionHandleRequest(this, currentUUID);
|
||||||
|
|
||||||
|
lock (RegionHandleRequests)
|
||||||
|
{
|
||||||
|
// exit condition, nothing to do or closed
|
||||||
|
// current code seems to assume we may loose the handler at anytime,
|
||||||
|
// so keep checking it
|
||||||
|
handlerRegionHandleRequest = OnRegionHandleRequest;
|
||||||
|
|
||||||
|
if (RegionHandleRequests.Count == 0 || !IsActive || handlerRegionHandleRequest == null)
|
||||||
|
{
|
||||||
|
RegionHandleRequests.Clear();
|
||||||
|
RegionHandleRequestsInService = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
currentUUID = RegionHandleRequests.Dequeue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true; // actually unreached
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack)
|
private bool HandleParcelInfoRequest(IClientAPI sender, Packet Pack)
|
||||||
|
|
|
@ -401,11 +401,14 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
|
|
||||||
public void SendLandUpdate(ScenePresence avatar, bool force)
|
public void SendLandUpdate(ScenePresence avatar, bool force)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/* stop sendind same data twice
|
||||||
ILandObject over = GetLandObject((int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
|
ILandObject over = GetLandObject((int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
|
||||||
(int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
|
(int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
|
||||||
|
|
||||||
if (over != null)
|
if (over != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (force)
|
if (force)
|
||||||
{
|
{
|
||||||
if (!avatar.IsChildAgent)
|
if (!avatar.IsChildAgent)
|
||||||
|
@ -426,6 +429,24 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||||
m_scene.RegionInfo.RegionID);
|
m_scene.RegionInfo.RegionID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
if (avatar.IsChildAgent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ILandObject over = GetLandObject((int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))),
|
||||||
|
(int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y))));
|
||||||
|
|
||||||
|
if (over != null)
|
||||||
|
{
|
||||||
|
bool NotsameID = (avatar.currentParcelUUID != over.LandData.GlobalID);
|
||||||
|
if (force || NotsameID)
|
||||||
|
{
|
||||||
|
over.SendLandUpdateToClient(avatar.ControllingClient);
|
||||||
|
if (NotsameID)
|
||||||
|
avatar.currentParcelUUID = over.LandData.GlobalID;
|
||||||
|
m_scene.EventManager.TriggerAvatarEnteringNewParcel(avatar, over.LandData.LocalID,
|
||||||
|
m_scene.RegionInfo.RegionID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2890,9 +2890,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
EventManager.TriggerOnClientLogin(client);
|
EventManager.TriggerOnClientLogin(client);
|
||||||
// Send initial parcel data
|
// Send initial parcel data
|
||||||
|
/* this is done on TriggerOnNewClient by landmanegement respective event handler
|
||||||
Vector3 pos = sp.AbsolutePosition;
|
Vector3 pos = sp.AbsolutePosition;
|
||||||
ILandObject land = LandChannel.GetLandObject(pos.X, pos.Y);
|
ILandObject land = LandChannel.GetLandObject(pos.X, pos.Y);
|
||||||
land.SendLandUpdateToClient(client);
|
land.SendLandUpdateToClient(client);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return sp;
|
return sp;
|
||||||
|
|
|
@ -1315,13 +1315,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// Create child agents in neighbouring regions
|
// Create child agents in neighbouring regions
|
||||||
if (openChildAgents && !IsChildAgent)
|
if (openChildAgents && !IsChildAgent)
|
||||||
{
|
{
|
||||||
|
|
||||||
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
||||||
if (m_agentTransfer != null)
|
if (m_agentTransfer != null)
|
||||||
Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); });
|
m_agentTransfer.EnableChildAgents(this);
|
||||||
|
|
||||||
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||||
if (friendsModule != null)
|
if (friendsModule != null)
|
||||||
friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
|
friendsModule.SendFriendsOnlineIfNeeded(ControllingClient);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
|
|
Loading…
Reference in New Issue