Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
commit
b776aa1665
|
@ -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)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
||||||
|
|
||||||
|
lock (RegionHandleRequests)
|
||||||
{
|
{
|
||||||
handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
|
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;
|
||||||
}
|
}
|
||||||
return 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)
|
||||||
|
|
Loading…
Reference in New Issue