diff options
author | UbitUmarov | 2016-08-04 01:19:52 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-04 01:19:52 +0100 |
commit | 721d5ed145b01ae2f4ef753372e98379fcdeea72 (patch) | |
tree | f0069a2a3ae4ad35e1b7c903e7431b2a4fe22b59 /OpenSim/Region/CoreModules/ServiceConnectorsOut | |
parent | no need to place normal size regions on the inner lookup table (HANDLEMASH ? ... (diff) | |
download | opensim-SC-721d5ed145b01ae2f4ef753372e98379fcdeea72.zip opensim-SC-721d5ed145b01ae2f4ef753372e98379fcdeea72.tar.gz opensim-SC-721d5ed145b01ae2f4ef753372e98379fcdeea72.tar.bz2 opensim-SC-721d5ed145b01ae2f4ef753372e98379fcdeea72.tar.xz |
well then also no need to remove them :)
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs index 221ec67..9fd4cd5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionInfoCache.cs | |||
@@ -292,8 +292,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
292 | 292 | ||
293 | public class RegionInfoForScope | 293 | public class RegionInfoForScope |
294 | { | 294 | { |
295 | public const ulong HANDLEMASH = 0xffffff00ffffff00ul; | 295 | public const ulong HANDLEMASK = 0xffffff00ffffff00ul; |
296 | public const ulong HANDLECOORDMASH = 0xffffff00ul; | 296 | public const ulong HANDLECOORDMASK = 0xffffff00ul; |
297 | 297 | ||
298 | private Dictionary<ulong, GridRegion> storage; | 298 | private Dictionary<ulong, GridRegion> storage; |
299 | private Dictionary<ulong, DateTime> expires; | 299 | private Dictionary<ulong, DateTime> expires; |
@@ -317,7 +317,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
317 | byname = new Dictionary<string, ulong>(); | 317 | byname = new Dictionary<string, ulong>(); |
318 | byuuid = new Dictionary<UUID, ulong>(); | 318 | byuuid = new Dictionary<UUID, ulong>(); |
319 | 319 | ||
320 | ulong handle = region.RegionHandle & HANDLEMASH; | 320 | ulong handle = region.RegionHandle & HANDLEMASK; |
321 | storage[handle] = region; | 321 | storage[handle] = region; |
322 | expires[handle] = expire; | 322 | expires[handle] = expire; |
323 | byname[region.RegionName] = handle; | 323 | byname[region.RegionName] = handle; |
@@ -327,7 +327,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
327 | 327 | ||
328 | public void Add(GridRegion region, DateTime expire) | 328 | public void Add(GridRegion region, DateTime expire) |
329 | { | 329 | { |
330 | ulong handle = region.RegionHandle & HANDLEMASH; | 330 | ulong handle = region.RegionHandle & HANDLEMASK; |
331 | 331 | ||
332 | if(storage != null && storage.ContainsKey(handle)) | 332 | if(storage != null && storage.ContainsKey(handle)) |
333 | return; | 333 | return; |
@@ -360,7 +360,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
360 | if(byuuid == null) | 360 | if(byuuid == null) |
361 | byuuid = new Dictionary<UUID, ulong>(); | 361 | byuuid = new Dictionary<UUID, ulong>(); |
362 | 362 | ||
363 | ulong handle = region.RegionHandle & HANDLEMASH; | 363 | ulong handle = region.RegionHandle & HANDLEMASK; |
364 | 364 | ||
365 | if(expires.ContainsKey(handle)) | 365 | if(expires.ContainsKey(handle)) |
366 | { | 366 | { |
@@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
398 | if(byuuid != null) | 398 | if(byuuid != null) |
399 | byuuid.Remove(region.RegionID); | 399 | byuuid.Remove(region.RegionID); |
400 | 400 | ||
401 | ulong handle = region.RegionHandle & HANDLEMASH; | 401 | ulong handle = region.RegionHandle & HANDLEMASK; |
402 | if(storage != null) | 402 | if(storage != null) |
403 | storage.Remove(handle); | 403 | storage.Remove(handle); |
404 | if(expires != null) | 404 | if(expires != null) |
@@ -411,7 +411,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
411 | 411 | ||
412 | public void Remove(ulong handle) | 412 | public void Remove(ulong handle) |
413 | { | 413 | { |
414 | handle &= HANDLEMASH; | 414 | handle &= HANDLEMASK; |
415 | 415 | ||
416 | if(storage != null) | 416 | if(storage != null) |
417 | { | 417 | { |
@@ -458,7 +458,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
458 | if(region == null) | 458 | if(region == null) |
459 | return false; | 459 | return false; |
460 | 460 | ||
461 | ulong handle = region.RegionHandle & HANDLEMASH; | 461 | ulong handle = region.RegionHandle & HANDLEMASK; |
462 | return storage.ContainsKey(handle); | 462 | return storage.ContainsKey(handle); |
463 | } | 463 | } |
464 | 464 | ||
@@ -467,7 +467,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
467 | if(storage == null) | 467 | if(storage == null) |
468 | return false; | 468 | return false; |
469 | 469 | ||
470 | handle &= HANDLEMASH; | 470 | handle &= HANDLEMASK; |
471 | return storage.ContainsKey(handle); | 471 | return storage.ContainsKey(handle); |
472 | } | 472 | } |
473 | 473 | ||
@@ -476,7 +476,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
476 | if(storage == null) | 476 | if(storage == null) |
477 | return null; | 477 | return null; |
478 | 478 | ||
479 | handle &= HANDLEMASH; | 479 | handle &= HANDLEMASK; |
480 | if(storage.ContainsKey(handle)) | 480 | if(storage.ContainsKey(handle)) |
481 | return storage[handle]; | 481 | return storage[handle]; |
482 | 482 | ||
@@ -511,9 +511,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
511 | return null; | 511 | return null; |
512 | 512 | ||
513 | // look for a handle first this should find normal size regions | 513 | // look for a handle first this should find normal size regions |
514 | ulong handle = (ulong)x & HANDLECOORDMASH; | 514 | ulong handle = (ulong)x & HANDLECOORDMASK; |
515 | handle <<= 32; | 515 | handle <<= 32; |
516 | handle |= ((ulong)y & HANDLECOORDMASH); | 516 | handle |= ((ulong)y & HANDLECOORDMASK); |
517 | 517 | ||
518 | if(storage.ContainsKey(handle)) | 518 | if(storage.ContainsKey(handle)) |
519 | return storage[handle]; | 519 | return storage[handle]; |
@@ -640,7 +640,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
640 | rsx >>= 8; | 640 | rsx >>= 8; |
641 | rsy >>= 8; | 641 | rsy >>= 8; |
642 | 642 | ||
643 | ulong handle = region.RegionHandle & HANDLEMASH; | 643 | ulong handle = region.RegionHandle & HANDLEMASK; |
644 | fastRegionHandle fh = new fastRegionHandle(handle); | 644 | fastRegionHandle fh = new fastRegionHandle(handle); |
645 | uint startY = fh.y; | 645 | uint startY = fh.y; |
646 | for(int i = 0; i < rsx; i++) | 646 | for(int i = 0; i < rsx; i++) |
@@ -658,9 +658,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
658 | 658 | ||
659 | private void removeFromInner(GridRegion region) | 659 | private void removeFromInner(GridRegion region) |
660 | { | 660 | { |
661 | int rsx = region.RegionSizeX >> 8; | 661 | int rsx = region.RegionSizeX; |
662 | int rsy = region.RegionSizeY >> 8; | 662 | int rsy = region.RegionSizeY; |
663 | ulong handle = region.RegionHandle & HANDLEMASH; | 663 | |
664 | if(rsx < 512 && rsy < 512) | ||
665 | return; | ||
666 | |||
667 | rsx >>= 8; | ||
668 | rsy >>= 8; | ||
669 | ulong handle = region.RegionHandle & HANDLEMASK; | ||
664 | fastRegionHandle fh = new fastRegionHandle(handle); | 670 | fastRegionHandle fh = new fastRegionHandle(handle); |
665 | uint startY = fh.y; | 671 | uint startY = fh.y; |
666 | for(int i = 0; i < rsx; i++) | 672 | for(int i = 0; i < rsx; i++) |