aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
authorJeff Ames2008-08-28 14:41:54 +0000
committerJeff Ames2008-08-28 14:41:54 +0000
commit3bf88587277b83c0b6f058fabba7d46a3b5a6a00 (patch)
treeed4ad9dc27e649a6f52661665fb681984251f480 /OpenSim/Region/Environment/Modules
parentThannk you, Ralphos, for a patch the corrects an improper cast in (diff)
downloadopensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.zip
opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.gz
opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.bz2
opensim-SC_OLD-3bf88587277b83c0b6f058fabba7d46a3b5a6a00.tar.xz
Update svn properties, formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs138
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs6
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs2
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs32
8 files changed, 78 insertions, 122 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
index 77dd0f9..9f01ad8 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Currency/SampleMoney/SampleMoneyModule.cs
@@ -1537,7 +1537,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1537 { 1537 {
1538 GetClientFunds(client); 1538 GetClientFunds(client);
1539 1539
1540 lock(m_KnownClientFunds) 1540 lock (m_KnownClientFunds)
1541 { 1541 {
1542 if (!m_KnownClientFunds.ContainsKey(client.AgentId)) 1542 if (!m_KnownClientFunds.ContainsKey(client.AgentId))
1543 return 0; 1543 return 0;
@@ -1570,7 +1570,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1570 1570
1571 int funds = m_KnownClientFunds[remoteClient.AgentId]; 1571 int funds = m_KnownClientFunds[remoteClient.AgentId];
1572 1572
1573 if(salePrice != 0 && funds < salePrice) 1573 if (salePrice != 0 && funds < salePrice)
1574 { 1574 {
1575 remoteClient.SendAgentAlertMessage("Unable to buy now. You don't have sufficient funds.", false); 1575 remoteClient.SendAgentAlertMessage("Unable to buy now. You don't have sufficient funds.", false);
1576 return; 1576 return;
@@ -1584,7 +1584,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
1584 remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false); 1584 remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
1585 return; 1585 return;
1586 } 1586 }
1587 1587
1588 doMoneyTransfer(remoteClient.AgentId, part.OwnerID, salePrice, 5000, "Object buy"); 1588 doMoneyTransfer(remoteClient.AgentId, part.OwnerID, salePrice, 5000, "Object buy");
1589 1589
1590 s.PerformObjectBuy(remoteClient, categoryID, localID, saleType); 1590 s.PerformObjectBuy(remoteClient, categoryID, localID, saleType);
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
index 926e584..0c15637 100644
--- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
@@ -83,16 +83,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
83 public bool visible_to_parent; 83 public bool visible_to_parent;
84 } 84 }
85 85
86
87 public class OpenGridProtocolModule : IRegionModule 86 public class OpenGridProtocolModule : IRegionModule
88 { 87 {
89 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 88 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
90 private List<Scene> m_scene = new List<Scene>(); 89 private List<Scene> m_scene = new List<Scene>();
91 90
92 private Dictionary<string, AgentCircuitData> CapsLoginID = new Dictionary<string, AgentCircuitData>(); 91 private Dictionary<string, AgentCircuitData> CapsLoginID = new Dictionary<string, AgentCircuitData>();
93 private Dictionary<LLUUID, OGPState> m_OGPState = new Dictionary<LLUUID, OGPState>(); 92 private Dictionary<LLUUID, OGPState> m_OGPState = new Dictionary<LLUUID, OGPState>();
94
95
96 93
97 #region IRegionModule Members 94 #region IRegionModule Members
98 95
@@ -134,7 +131,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
134 m_log.Error("[OGP]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); 131 m_log.Error("[OGP]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions.");
135 } 132 }
136 } 133 }
137 134
138 } 135 }
139 136
140 if (!m_scene.Contains(scene)) 137 if (!m_scene.Contains(scene))
@@ -217,15 +214,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
217 m_log.WarnFormat("[REQUESTREZAVATAR]: {0}", request.ToString()); 214 m_log.WarnFormat("[REQUESTREZAVATAR]: {0}", request.ToString());
218 215
219 LLSDMap requestMap = (LLSDMap)request; 216 LLSDMap requestMap = (LLSDMap)request;
220 217
221 Scene homeScene = GetRootScene(); 218 Scene homeScene = GetRootScene();
222
223
224 219
225 if (homeScene == null) 220 if (homeScene == null)
226 return GenerateNoHandlerMessage(); 221 return GenerateNoHandlerMessage();
227 222
228
229 RegionInfo reg = homeScene.RegionInfo; 223 RegionInfo reg = homeScene.RegionInfo;
230 ulong regionhandle = GetOSCompatibleRegionHandle(reg); 224 ulong regionhandle = GetOSCompatibleRegionHandle(reg);
231 //string RegionURI = reg.ServerURI; 225 //string RegionURI = reg.ServerURI;
@@ -234,14 +228,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
234 LLUUID RemoteAgentID = requestMap["agent_id"].AsUUID(); 228 LLUUID RemoteAgentID = requestMap["agent_id"].AsUUID();
235 229
236 // will be used in the future. The client always connects with the aditi agentid currently 230 // will be used in the future. The client always connects with the aditi agentid currently
237 LLUUID LocalAgentID = RemoteAgentID; 231 LLUUID LocalAgentID = RemoteAgentID;
238 232
239 string FirstName = requestMap["first_name"].AsString(); 233 string FirstName = requestMap["first_name"].AsString();
240 string LastName = requestMap["last_name"].AsString(); 234 string LastName = requestMap["last_name"].AsString();
241 235
242
243 OGPState userState = GetOGPState(LocalAgentID); 236 OGPState userState = GetOGPState(LocalAgentID);
244 237
245 userState.first_name = requestMap["first_name"].AsString(); 238 userState.first_name = requestMap["first_name"].AsString();
246 userState.last_name = requestMap["last_name"].AsString(); 239 userState.last_name = requestMap["last_name"].AsString();
247 userState.age_verified = requestMap["age_verified"].AsBoolean(); 240 userState.age_verified = requestMap["age_verified"].AsBoolean();
@@ -268,7 +261,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
268 responseMap["region_Y"] = LLSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY 261 responseMap["region_Y"] = LLSD.FromInteger(reg.RegionLocY * (uint)Constants.RegionSize); // LLY
269 responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); 262 responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID);
270 responseMap["sim_access"] = LLSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG"); 263 responseMap["sim_access"] = LLSD.FromString((reg.RegionSettings.Maturity == 1) ? "Mature" : "PG");
271 264
272 // Generate a dummy agent for the user so we can get back a CAPS path 265 // Generate a dummy agent for the user so we can get back a CAPS path
273 AgentCircuitData agentData = new AgentCircuitData(); 266 AgentCircuitData agentData = new AgentCircuitData();
274 agentData.AgentID = LocalAgentID; 267 agentData.AgentID = LocalAgentID;
@@ -299,7 +292,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
299 useragent.SecureSessionID=agentData.SecureSessionID; 292 useragent.SecureSessionID=agentData.SecureSessionID;
300 useragent.SessionID = agentData.SessionID; 293 useragent.SessionID = agentData.SessionID;
301 294
302
303 UserProfileData userProfile = new UserProfileData(); 295 UserProfileData userProfile = new UserProfileData();
304 userProfile.AboutText = "OGP User"; 296 userProfile.AboutText = "OGP User";
305 userProfile.CanDoMask = (uint)0; 297 userProfile.CanDoMask = (uint)0;
@@ -338,15 +330,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
338 330
339 // Do caps registration 331 // Do caps registration
340 // get seed cap 332 // get seed cap
341 333
342
343 // Stick our data in the cache so the region will know something about us 334 // Stick our data in the cache so the region will know something about us
344 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile); 335 homeScene.CommsManager.UserProfileCacheService.PreloadUserCache(agentData.AgentID, userProfile);
345 336
346 // Call 'new user' event handler 337 // Call 'new user' event handler
347 homeScene.NewUserConnection(reg.RegionHandle, agentData); 338 homeScene.NewUserConnection(reg.RegionHandle, agentData);
348 339
349
350 //string raCap = string.Empty; 340 //string raCap = string.Empty;
351 341
352 LLUUID AvatarRezCapUUID = LLUUID.Random(); 342 LLUUID AvatarRezCapUUID = LLUUID.Random();
@@ -379,16 +369,16 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
379 public LLSD RezAvatarMethod(string path, LLSD request) 369 public LLSD RezAvatarMethod(string path, LLSD request)
380 { 370 {
381 m_log.WarnFormat("[REZAVATAR]: {0}", request.ToString()); 371 m_log.WarnFormat("[REZAVATAR]: {0}", request.ToString());
382 372
383 LLSDMap responseMap = new LLSDMap(); 373 LLSDMap responseMap = new LLSDMap();
384 374
385 AgentCircuitData userData = null; 375 AgentCircuitData userData = null;
386 376
387 // Only people we've issued a cap can go further 377 // Only people we've issued a cap can go further
388 if (TryGetAgentCircuitData(path,out userData)) 378 if (TryGetAgentCircuitData(path,out userData))
389 { 379 {
390 LLSDMap requestMap = (LLSDMap)request; 380 LLSDMap requestMap = (LLSDMap)request;
391 381
392 // take these values to start. There's a few more 382 // take these values to start. There's a few more
393 LLUUID SecureSessionID=requestMap["secure_session_id"].AsUUID(); 383 LLUUID SecureSessionID=requestMap["secure_session_id"].AsUUID();
394 LLUUID SessionID = requestMap["session_id"].AsUUID(); 384 LLUUID SessionID = requestMap["session_id"].AsUUID();
@@ -419,7 +409,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
419 if (item.ContainsKey("parent_estate_id")) 409 if (item.ContainsKey("parent_estate_id"))
420 { 410 {
421 parentEstateID = item["parent_estate_id"].AsInteger(); 411 parentEstateID = item["parent_estate_id"].AsInteger();
422 412
423 } 413 }
424 if (item.ContainsKey("region_id")) 414 if (item.ContainsKey("region_id"))
425 { 415 {
@@ -437,11 +427,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
437 427
438 // Locate a home scene suitable for the user. 428 // Locate a home scene suitable for the user.
439 Scene homeScene = GetRootScene(); 429 Scene homeScene = GetRootScene();
440 430
441 if (homeScene != null) 431 if (homeScene != null)
442 { 432 {
443 // Get a reference to their Cap object so we can pull out the capobjectroot 433 // Get a reference to their Cap object so we can pull out the capobjectroot
444 OpenSim.Framework.Communications.Capabilities.Caps userCap = 434 OpenSim.Framework.Communications.Capabilities.Caps userCap =
445 homeScene.GetCapsHandlerForUser(userData.AgentID); 435 homeScene.GetCapsHandlerForUser(userData.AgentID);
446 436
447 //Update the circuit data in the region so this user is authorized 437 //Update the circuit data in the region so this user is authorized
@@ -470,7 +460,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
470 userState.region_id = regionID; 460 userState.region_id = regionID;
471 userState.src_parent_estate_id = parentEstateID; 461 userState.src_parent_estate_id = parentEstateID;
472 userState.visible_to_parent = visibleToParent; 462 userState.visible_to_parent = visibleToParent;
473 463
474 // Save state changes 464 // Save state changes
475 UpdateOGPState(userData.AgentID, userState); 465 UpdateOGPState(userData.AgentID, userState);
476 466
@@ -481,8 +471,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
481 LLSDArray PositionArray = new LLSDArray(); 471 LLSDArray PositionArray = new LLSDArray();
482 PositionArray.Add(LLSD.FromInteger(128)); 472 PositionArray.Add(LLSD.FromInteger(128));
483 PositionArray.Add(LLSD.FromInteger(128)); 473 PositionArray.Add(LLSD.FromInteger(128));
484 PositionArray.Add(LLSD.FromInteger(40)); 474 PositionArray.Add(LLSD.FromInteger(40));
485 475
486 LLSDArray LookAtArray = new LLSDArray(); 476 LLSDArray LookAtArray = new LLSDArray();
487 LookAtArray.Add(LLSD.FromInteger(1)); 477 LookAtArray.Add(LLSD.FromInteger(1));
488 LookAtArray.Add(LLSD.FromInteger(1)); 478 LookAtArray.Add(LLSD.FromInteger(1));
@@ -503,44 +493,36 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
503 responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); 493 responseMap["seed_capability"] = LLSD.FromString("http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/");
504 responseMap["region"] = LLSD.FromUUID(reg.originRegionID); 494 responseMap["region"] = LLSD.FromUUID(reg.originRegionID);
505 responseMap["look_at"] = LookAtArray; 495 responseMap["look_at"] = LookAtArray;
506 496
507 responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port); 497 responseMap["sim_port"] = LLSD.FromInteger(reg.InternalEndPoint.Port);
508 responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());// + ":" + reg.InternalEndPoint.Port.ToString()); 498 responseMap["sim_host"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());// + ":" + reg.InternalEndPoint.Port.ToString());
509 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString()); 499 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(reg.ExternalHostName).ToString());
510 500
511 responseMap["session_id"] = LLSD.FromUUID(SessionID); 501 responseMap["session_id"] = LLSD.FromUUID(SessionID);
512 responseMap["secure_session_id"] = LLSD.FromUUID(SecureSessionID); 502 responseMap["secure_session_id"] = LLSD.FromUUID(SecureSessionID);
513 responseMap["circuit_code"] = LLSD.FromInteger(circuitcode); 503 responseMap["circuit_code"] = LLSD.FromInteger(circuitcode);
514 504
515 responseMap["position"] = PositionArray; 505 responseMap["position"] = PositionArray;
516 506
517 responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID); 507 responseMap["region_id"] = LLSD.FromUUID(reg.originRegionID);
518 508
519 responseMap["sim_access"] = LLSD.FromString("Mature"); 509 responseMap["sim_access"] = LLSD.FromString("Mature");
520 510
521 responseMap["connect"] = LLSD.FromBoolean(true); 511 responseMap["connect"] = LLSD.FromBoolean(true);
522 512
523 m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString()); 513 m_log.InfoFormat("[OGP]: host: {0}, IP {1}", responseMap["sim_host"].ToString(), responseMap["sim_ip"].ToString());
524
525 } 514 }
526
527 } 515 }
528 516
529 return responseMap; 517 return responseMap;
530 } 518 }
531 519
532
533
534 public LLSD DerezAvatarMethod(string path, LLSD request) 520 public LLSD DerezAvatarMethod(string path, LLSD request)
535 { 521 {
536
537
538 m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString()); 522 m_log.ErrorFormat("DerezPath: {0}, Request: {1}", path, request.ToString());
539 523
540 //LLSD llsdResponse = null; 524 //LLSD llsdResponse = null;
541 LLSDMap responseMap = new LLSDMap(); 525 LLSDMap responseMap = new LLSDMap();
542
543
544 526
545 string[] PathArray = path.Split('/'); 527 string[] PathArray = path.Split('/');
546 m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]); 528 m_log.InfoFormat("[OGP]: prefix {0}, uuid {1}, suffix {2}", PathArray[1], PathArray[2], PathArray[3]);
@@ -549,17 +531,15 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
549 LLUUID userUUID = LLUUID.Zero; 531 LLUUID userUUID = LLUUID.Zero;
550 if (Helpers.TryParse(uuidString, out userUUID)) 532 if (Helpers.TryParse(uuidString, out userUUID))
551 { 533 {
552
553 LLUUID RemoteID = uuidString; 534 LLUUID RemoteID = uuidString;
554 LLUUID LocalID = RemoteID; 535 LLUUID LocalID = RemoteID;
555 // FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds 536 // FIXME: TODO: Routine to map RemoteUUIDs to LocalUUIds
556 // would be done already.. but the client connects with the Aditi UUID 537 // would be done already.. but the client connects with the Aditi UUID
557 // regardless over the UDP stack 538 // regardless over the UDP stack
558 539
559 OGPState userState = GetOGPState(LocalID); 540 OGPState userState = GetOGPState(LocalID);
560 if (userState.agent_id != LLUUID.Zero) 541 if (userState.agent_id != LLUUID.Zero)
561 { 542 {
562
563 //LLSDMap outboundRequestMap = new LLSDMap(); 543 //LLSDMap outboundRequestMap = new LLSDMap();
564 LLSDMap inboundRequestMap = (LLSDMap)request; 544 LLSDMap inboundRequestMap = (LLSDMap)request;
565 string rezAvatarString = inboundRequestMap["rez_avatar"].AsString(); 545 string rezAvatarString = inboundRequestMap["rez_avatar"].AsString();
@@ -569,12 +549,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
569 LookAtArray.Add(LLSD.FromInteger(1)); 549 LookAtArray.Add(LLSD.FromInteger(1));
570 LookAtArray.Add(LLSD.FromInteger(1)); 550 LookAtArray.Add(LLSD.FromInteger(1));
571 551
572
573 LLSDArray PositionArray = new LLSDArray(); 552 LLSDArray PositionArray = new LLSDArray();
574 PositionArray.Add(LLSD.FromInteger(128)); 553 PositionArray.Add(LLSD.FromInteger(128));
575 PositionArray.Add(LLSD.FromInteger(128)); 554 PositionArray.Add(LLSD.FromInteger(128));
576 PositionArray.Add(LLSD.FromInteger(40)); 555 PositionArray.Add(LLSD.FromInteger(40));
577 556
578 LLSDArray lookArray = new LLSDArray(); 557 LLSDArray lookArray = new LLSDArray();
579 lookArray.Add(LLSD.FromInteger(128)); 558 lookArray.Add(LLSD.FromInteger(128));
580 lookArray.Add(LLSD.FromInteger(128)); 559 lookArray.Add(LLSD.FromInteger(128));
@@ -582,11 +561,11 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
582 561
583 responseMap["connect"] = LLSD.FromBoolean(true);// it's okay to give this user up 562 responseMap["connect"] = LLSD.FromBoolean(true);// it's okay to give this user up
584 responseMap["look_at"] = LookAtArray; 563 responseMap["look_at"] = LookAtArray;
585 564
586 m_log.WarnFormat("[OGP]: Invoking rez_avatar on host:{0} for avatar: {1} {2}", rezAvatarString, userState.first_name, userState.last_name); 565 m_log.WarnFormat("[OGP]: Invoking rez_avatar on host:{0} for avatar: {1} {2}", rezAvatarString, userState.first_name, userState.last_name);
587 566
588 LLSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState); 567 LLSDMap rezResponseMap = invokeRezAvatarCap(responseMap, rezAvatarString,userState);
589 568
590 // If invoking it returned an error, parse and end 569 // If invoking it returned an error, parse and end
591 if (rezResponseMap.ContainsKey("connect")) 570 if (rezResponseMap.ContainsKey("connect"))
592 { 571 {
@@ -599,17 +578,16 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
599 string rezRespSeedCap = rezResponseMap["seed_capability"].AsString(); 578 string rezRespSeedCap = rezResponseMap["seed_capability"].AsString();
600 string rezRespSim_ip = rezResponseMap["sim_ip"].AsString(); 579 string rezRespSim_ip = rezResponseMap["sim_ip"].AsString();
601 string rezRespSim_host = rezResponseMap["sim_host"].AsString(); 580 string rezRespSim_host = rezResponseMap["sim_host"].AsString();
602 581
603 int rrPort = rezResponseMap["sim_port"].AsInteger(); 582 int rrPort = rezResponseMap["sim_port"].AsInteger();
604 int rrX = rezResponseMap["region_x"].AsInteger(); 583 int rrX = rezResponseMap["region_x"].AsInteger();
605 int rrY = rezResponseMap["region_y"].AsInteger(); 584 int rrY = rezResponseMap["region_y"].AsInteger();
606 m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY); 585 m_log.ErrorFormat("X:{0}, Y:{1}", rrX, rrY);
607 LLUUID rrRID = rezResponseMap["region_id"].AsUUID(); 586 LLUUID rrRID = rezResponseMap["region_id"].AsUUID();
608 587
609 string rrAccess = rezResponseMap["sim_access"].AsString(); 588 string rrAccess = rezResponseMap["sim_access"].AsString();
610 589
611 LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"]; 590 LLSDArray RezResponsePositionArray = (LLSDArray)rezResponseMap["position"];
612
613 591
614 responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap); 592 responseMap["seed_capability"] = LLSD.FromString(rezRespSeedCap);
615 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString()); 593 responseMap["sim_ip"] = LLSD.FromString(Util.GetHostFromDNS(rezRespSim_ip).ToString());
@@ -619,23 +597,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
619 responseMap["region_y"] = LLSD.FromInteger(rrY ); 597 responseMap["region_y"] = LLSD.FromInteger(rrY );
620 responseMap["region_id"] = LLSD.FromUUID(rrRID); 598 responseMap["region_id"] = LLSD.FromUUID(rrRID);
621 responseMap["sim_access"] = LLSD.FromString(rrAccess); 599 responseMap["sim_access"] = LLSD.FromString(rrAccess);
622
623
624
625 responseMap["position"] = RezResponsePositionArray; 600 responseMap["position"] = RezResponsePositionArray;
626 responseMap["look_at"] = lookArray; 601 responseMap["look_at"] = lookArray;
627 responseMap["connect"] = LLSD.FromBoolean(true); 602 responseMap["connect"] = LLSD.FromBoolean(true);
628 603
629 ShutdownConnection(LocalID,this); 604 ShutdownConnection(LocalID,this);
630 605
631
632 m_log.Warn("RESPONSEDEREZ: " + responseMap.ToString()); 606 m_log.Warn("RESPONSEDEREZ: " + responseMap.ToString());
633 return responseMap; 607 return responseMap;
634
635 } 608 }
636 else 609 else
637 { 610 {
638
639 return GenerateNoHandlerMessage(); 611 return GenerateNoHandlerMessage();
640 } 612 }
641 } 613 }
@@ -649,20 +621,18 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
649 621
650 private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState) 622 private LLSDMap invokeRezAvatarCap(LLSDMap responseMap, string CapAddress, OGPState userState)
651 { 623 {
652
653 Scene reg = GetRootScene(); 624 Scene reg = GetRootScene();
654 625
655 WebRequest DeRezRequest = WebRequest.Create(CapAddress); 626 WebRequest DeRezRequest = WebRequest.Create(CapAddress);
656 DeRezRequest.Method = "POST"; 627 DeRezRequest.Method = "POST";
657 DeRezRequest.ContentType = "application/xml+llsd"; 628 DeRezRequest.ContentType = "application/xml+llsd";
658
659 629
660 LLSDMap RAMap = new LLSDMap(); 630 LLSDMap RAMap = new LLSDMap();
661 LLSDMap AgentParms = new LLSDMap(); 631 LLSDMap AgentParms = new LLSDMap();
662 LLSDMap RegionParms = new LLSDMap(); 632 LLSDMap RegionParms = new LLSDMap();
663 633
664 LLSDArray Parameter = new LLSDArray(2); 634 LLSDArray Parameter = new LLSDArray(2);
665 635
666 LLSDMap version = new LLSDMap(); 636 LLSDMap version = new LLSDMap();
667 version["version"] = LLSD.FromInteger(userState.src_version); 637 version["version"] = LLSD.FromInteger(userState.src_version);
668 Parameter.Add((LLSD)version); 638 Parameter.Add((LLSD)version);
@@ -673,7 +643,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
673 SrcData["region_id"] = LLSD.FromUUID(reg.RegionInfo.originRegionID); 643 SrcData["region_id"] = LLSD.FromUUID(reg.RegionInfo.originRegionID);
674 SrcData["visible_to_parent"] = LLSD.FromBoolean(userState.visible_to_parent); 644 SrcData["visible_to_parent"] = LLSD.FromBoolean(userState.visible_to_parent);
675 Parameter.Add((LLSD)SrcData); 645 Parameter.Add((LLSD)SrcData);
676 646
677 AgentParms["first_name"] = LLSD.FromString(userState.first_name); 647 AgentParms["first_name"] = LLSD.FromString(userState.first_name);
678 AgentParms["last_name"] = LLSD.FromString(userState.last_name); 648 AgentParms["last_name"] = LLSD.FromString(userState.last_name);
679 AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id); 649 AgentParms["agent_id"] = LLSD.FromUUID(userState.agent_id);
@@ -689,13 +659,12 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
689 AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified); 659 AgentParms["age_verified"] = LLSD.FromBoolean(userState.age_verified);
690 AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate); 660 AgentParms["limited_to_estate"] = LLSD.FromInteger(userState.limited_to_estate);
691 AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host); 661 AgentParms["inventory_host"] = LLSD.FromString(userState.inventory_host);
692 662
693 // version 1 663 // version 1
694 RAMap = AgentParms; 664 RAMap = AgentParms;
695 665
696 // Planned for version 2 666 // Planned for version 2
697 // RAMap["agent_params"] = AgentParms; 667 // RAMap["agent_params"] = AgentParms;
698
699 668
700 RAMap["region_params"] = RegionParms; 669 RAMap["region_params"] = RegionParms;
701 RAMap["parameter"] = Parameter; 670 RAMap["parameter"] = Parameter;
@@ -770,15 +739,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
770 return responseMap; 739 return responseMap;
771 } 740 }
772 741
773
774
775 public LLSD GenerateNoHandlerMessage() 742 public LLSD GenerateNoHandlerMessage()
776 { 743 {
777 LLSDMap map = new LLSDMap(); 744 LLSDMap map = new LLSDMap();
778 map["reason"] = LLSD.FromString("LLSDRequest"); 745 map["reason"] = LLSD.FromString("LLSDRequest");
779 map["message"] = LLSD.FromString("No handler registered for LLSD Requests"); 746 map["message"] = LLSD.FromString("No handler registered for LLSD Requests");
780 map["login"] = LLSD.FromString("false"); 747 map["login"] = LLSD.FromString("false");
781 748
782 return map; 749 return map;
783 } 750 }
784 751
@@ -802,7 +769,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
802 CapsLoginID.Remove(path); 769 CapsLoginID.Remove(path);
803 } 770 }
804 771
805
806 private Scene GetRootScene() 772 private Scene GetRootScene()
807 { 773 {
808 Scene ReturnScene = null; 774 Scene ReturnScene = null;
@@ -815,9 +781,8 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
815 } 781 }
816 782
817 return ReturnScene; 783 return ReturnScene;
818
819 } 784 }
820 785
821 private ulong GetOSCompatibleRegionHandle(RegionInfo reg) 786 private ulong GetOSCompatibleRegionHandle(RegionInfo reg)
822 { 787 {
823 return Util.UIntsToLong(reg.RegionLocX, reg.RegionLocY); 788 return Util.UIntsToLong(reg.RegionLocX, reg.RegionLocY);
@@ -849,7 +814,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
849 returnState.src_version = 1; 814 returnState.src_version = 1;
850 returnState.src_parent_estate_id = 1; 815 returnState.src_parent_estate_id = 1;
851 returnState.visible_to_parent = true; 816 returnState.visible_to_parent = true;
852 817
853 return returnState; 818 return returnState;
854 } 819 }
855 820
@@ -871,9 +836,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
871 public void DeleteOGPState(LLUUID agentId) 836 public void DeleteOGPState(LLUUID agentId)
872 { 837 {
873 lock (m_OGPState) 838 lock (m_OGPState)
839 {
874 if (m_OGPState.ContainsKey(agentId)) 840 if (m_OGPState.ContainsKey(agentId))
875 m_OGPState.Remove(agentId); 841 m_OGPState.Remove(agentId);
876 842 }
877 } 843 }
878 844
879 private void UpdateOGPState(LLUUID agentId, OGPState state) 845 private void UpdateOGPState(LLUUID agentId, OGPState state)
@@ -884,12 +850,13 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
884 { 850 {
885 m_OGPState[agentId] = state; 851 m_OGPState[agentId] = state;
886 } 852 }
887 else 853 else
888 { 854 {
889 m_OGPState.Add(agentId,state); 855 m_OGPState.Add(agentId,state);
890 } 856 }
891 } 857 }
892 } 858 }
859
893 public void ShutdownConnection(LLUUID avatarId, OpenGridProtocolModule mod) 860 public void ShutdownConnection(LLUUID avatarId, OpenGridProtocolModule mod)
894 { 861 {
895 Scene homeScene = GetRootScene(); 862 Scene homeScene = GetRootScene();
@@ -903,22 +870,17 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
903 ta.Start(); 870 ta.Start();
904 } 871 }
905 } 872 }
873
906 // Temporary hack to allow teleporting to and from Vaak 874 // Temporary hack to allow teleporting to and from Vaak
907 private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) 875 private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error)
908 { 876 {
909
910 //if (cert.Subject == "E=root@lindenlab.com, CN=*.vaak.lindenlab.com, O=\"Linden Lab, Inc.\", L=San Francisco, S=California, C=US") 877 //if (cert.Subject == "E=root@lindenlab.com, CN=*.vaak.lindenlab.com, O=\"Linden Lab, Inc.\", L=San Francisco, S=California, C=US")
911 //{ 878 //{
912
913 return true; 879 return true;
914
915 //} 880 //}
916 881
917 //return false; 882 //return false;
918
919 } 883 }
920
921
922 } 884 }
923 885
924 public class KillAUser 886 public class KillAUser
@@ -944,7 +906,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
944 avToBeKilled.ControllingClient.SendLogoutPacketWhenClosing = false; 906 avToBeKilled.ControllingClient.SendLogoutPacketWhenClosing = false;
945 907
946 Thread.Sleep(30000); 908 Thread.Sleep(30000);
947 909
948 // test for child agent because they might have come back 910 // test for child agent because they might have come back
949 if (avToBeKilled.IsChildAgent) 911 if (avToBeKilled.IsChildAgent)
950 { 912 {
@@ -953,12 +915,10 @@ namespace OpenSim.Region.Environment.Modules.InterGrid
953 } 915 }
954 } 916 }
955 } 917 }
956
957 } 918 }
919
958 public class MonoCert : ICertificatePolicy 920 public class MonoCert : ICertificatePolicy
959 { 921 {
960
961
962 #region ICertificatePolicy Members 922 #region ICertificatePolicy Members
963 923
964 public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) 924 public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem)
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
index 5e22e57..0b68c5f 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
59 /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. 59 /// Path for terrains. Technically these may be assets, but I think it's quite nice to split them out.
60 /// </summary> 60 /// </summary>
61 public static readonly string TERRAINS_PATH = "terrains/"; 61 public static readonly string TERRAINS_PATH = "terrains/";
62 62
63 /// <summary> 63 /// <summary>
64 /// The character the separates the uuid from extension information in an archived asset filename 64 /// The character the separates the uuid from extension information in an archived asset filename
65 /// </summary> 65 /// </summary>
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 201986e..89f5fd7 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -212,16 +212,16 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
212 // Right now we're nastily obtaining the lluuid from the filename 212 // Right now we're nastily obtaining the lluuid from the filename
213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length); 213 string filename = assetPath.Remove(0, ArchiveConstants.ASSETS_PATH.Length);
214 int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR); 214 int i = filename.LastIndexOf(ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
215 215
216 if (i == -1) 216 if (i == -1)
217 { 217 {
218 m_log.ErrorFormat( 218 m_log.ErrorFormat(
219 "[ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping", 219 "[ARCHIVER]: Could not find extension information in asset path {0} since it's missing the separator {1}. Skipping",
220 assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR); 220 assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR);
221 221
222 return false; 222 return false;
223 } 223 }
224 224
225 string extension = filename.Substring(i); 225 string extension = filename.Substring(i);
226 string uuid = filename.Remove(filename.Length - extension.Length); 226 string uuid = filename.Remove(filename.Length - extension.Length);
227 227
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 2d27b11..c1f5566 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -315,13 +315,13 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
315 public event RegionHandleRequest OnRegionHandleRequest; 315 public event RegionHandleRequest OnRegionHandleRequest;
316 public event ParcelInfoRequest OnParcelInfoRequest; 316 public event ParcelInfoRequest OnParcelInfoRequest;
317 317
318 public event ActivateGesture OnActivateGesture; 318 public event ActivateGesture OnActivateGesture;
319 public event DeactivateGesture OnDeactivateGesture; 319 public event DeactivateGesture OnDeactivateGesture;
320 320
321#pragma warning restore 67 321#pragma warning restore 67
322 322
323 #endregion 323 #endregion
324 324
325 public void ActivateGesture(LLUUID assetId, LLUUID gestureId) 325 public void ActivateGesture(LLUUID assetId, LLUUID gestureId)
326 { 326 {
327 } 327 }
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
index 2ae4174..bfb5016 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs
@@ -103,7 +103,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
103 103
104 Bitmap mapbmp = new Bitmap(256, 256); 104 Bitmap mapbmp = new Bitmap(256, 256);
105 //long t = System.Environment.TickCount; 105 //long t = System.Environment.TickCount;
106 //for(int i = 0; i < 10; ++i) { 106 //for (int i = 0; i < 10; ++i) {
107 terrainRenderer.TerrainToBitmap(mapbmp); 107 terrainRenderer.TerrainToBitmap(mapbmp);
108 //} 108 //}
109 //t = System.Environment.TickCount - t; 109 //t = System.Environment.TickCount - t;
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs
index 253a7f5..1ee86ba 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/ShadedMapTileRenderer.cs
@@ -97,8 +97,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
97 // No, that doesn't scale it: 97 // No, that doesn't scale it:
98 // heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue 98 // heightvalue = low + mid * (heightvalue - low) / mid; => low + (heightvalue - low) * mid / mid = low + (heightvalue - low) * 1 = low + heightvalue - low = heightvalue
99 99
100
101
102 if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue)) 100 if (Single.IsInfinity(heightvalue) || Single.IsNaN(heightvalue))
103 heightvalue = 0; 101 heightvalue = 0;
104 else if (heightvalue > 255f) 102 else if (heightvalue > 255f)
@@ -136,7 +134,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
136 int hfdiffi = 0; 134 int hfdiffi = 0;
137 int hfdiffihighlight = 0; 135 int hfdiffihighlight = 0;
138 float highlightfactor = 0.18f; 136 float highlightfactor = 0.18f;
139 137
140 try 138 try
141 { 139 {
142 // hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1; 140 // hfdiffi = Math.Abs((int)((hfdiff * 4) + (hfdiff * 0.5))) + 1;
@@ -146,7 +144,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
146 // hfdiffi = hfdiffi + Math.Abs((int)(((hfdiff % 1) * 0.5f) * 10f) - 1); 144 // hfdiffi = hfdiffi + Math.Abs((int)(((hfdiff % 1) * 0.5f) * 10f) - 1);
147 hfdiffi = hfdiffi + Math.Abs((int)((hfdiff % 1f) * 5f) - 1); 145 hfdiffi = hfdiffi + Math.Abs((int)((hfdiff % 1f) * 5f) - 1);
148 } 146 }
149 147
150 hfdiffihighlight = Math.Abs((int)((hfdiff * highlightfactor) * 4.5f)) + 1; 148 hfdiffihighlight = Math.Abs((int)((hfdiff * highlightfactor) * 4.5f)) + 1;
151 if (hfdiff % 1f != 0) 149 if (hfdiff % 1f != 0)
152 { 150 {
@@ -195,10 +193,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
195 color = Color.FromArgb((r - hfdiffi > 0) ? r - hfdiffi : 0, 193 color = Color.FromArgb((r - hfdiffi > 0) ? r - hfdiffi : 0,
196 (g - hfdiffi > 0) ? g - hfdiffi : 0, 194 (g - hfdiffi > 0) ? g - hfdiffi : 0,
197 (b - hfdiffi > 0) ? b - hfdiffi : 0); 195 (b - hfdiffi > 0) ? b - hfdiffi : 0);
198 196
199 mapbmp.SetPixel(x-1, yr+1, color); 197 mapbmp.SetPixel(x-1, yr+1, color);
200 } 198 }
201
202 } 199 }
203 } 200 }
204 } 201 }
@@ -213,7 +210,6 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
213 color = Color.Black; 210 color = Color.Black;
214 mapbmp.SetPixel(x, yr, color); 211 mapbmp.SetPixel(x, yr, color);
215 } 212 }
216
217 } 213 }
218 else 214 else
219 { 215 {
diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs
index 957a1df..615befc 100644
--- a/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs
+++ b/OpenSim/Region/Environment/Modules/World/WorldMap/TexturedMapTileRenderer.cs
@@ -82,10 +82,10 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
82 // (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV) 82 // (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV)
83 public Color toColor() 83 public Color toColor()
84 { 84 {
85 if(s < 0f) Console.WriteLine("S < 0: " + s); 85 if (s < 0f) Console.WriteLine("S < 0: " + s);
86 else if(s > 1f) Console.WriteLine("S > 1: " + s); 86 else if (s > 1f) Console.WriteLine("S > 1: " + s);
87 if(v < 0f) Console.WriteLine("V < 0: " + v); 87 if (v < 0f) Console.WriteLine("V < 0: " + v);
88 else if(v > 1f) Console.WriteLine("V > 1: " + v); 88 else if (v > 1f) Console.WriteLine("V > 1: " + v);
89 89
90 float f = h / 60f; 90 float f = h / 60f;
91 int sector = (int)f % 6; 91 int sector = (int)f % 6;
@@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
95 int ti = (int)(v * (1f - (1f - f) * s) * 255f); 95 int ti = (int)(v * (1f - (1f - f) * s) * 255f);
96 int vi = (int)(v * 255f); 96 int vi = (int)(v * 255f);
97 97
98 switch(sector) 98 switch (sector)
99 { 99 {
100 case 0: 100 case 0:
101 return Color.FromArgb(vi, ti, pi); 101 return Color.FromArgb(vi, ti, pi);
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
168 { 168 {
169 AssetBase asset = m_scene.AssetCache.GetAsset(id, true); 169 AssetBase asset = m_scene.AssetCache.GetAsset(id, true);
170 m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null); 170 m_log.DebugFormat("Fetched texture {0}, found: {1}", id, asset != null);
171 if(asset == null) return null; 171 if (asset == null) return null;
172 return new Bitmap(OpenJPEG.DecodeToImage(asset.Data)); 172 return new Bitmap(OpenJPEG.DecodeToImage(asset.Data));
173 } 173 }
174 174
@@ -179,9 +179,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
179 // color-channel, so 2^24 is the maximum value we can get, adding everything. 179 // color-channel, so 2^24 is the maximum value we can get, adding everything.
180 // int is be big enough for that. 180 // int is be big enough for that.
181 int r = 0, g = 0, b = 0; 181 int r = 0, g = 0, b = 0;
182 for(int y = 0; y < bmp.Height; ++y) 182 for (int y = 0; y < bmp.Height; ++y)
183 { 183 {
184 for(int x = 0; x < bmp.Width; ++x) 184 for (int x = 0; x < bmp.Width; ++x)
185 { 185 {
186 Color c = bmp.GetPixel(x, y); 186 Color c = bmp.GetPixel(x, y);
187 r += (int)c.R & 0xff; 187 r += (int)c.R & 0xff;
@@ -218,14 +218,14 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
218 218
219 // interpolate two colors in HSV space and return the resulting color 219 // interpolate two colors in HSV space and return the resulting color
220 private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) { 220 private HSV interpolateHSV(ref HSV c1, ref HSV c2, float ratio) {
221 if(ratio <= 0f) return c1; 221 if (ratio <= 0f) return c1;
222 if(ratio >= 1f) return c2; 222 if (ratio >= 1f) return c2;
223 223
224 // make sure we are on the same side on the hue-circle for interpolation 224 // make sure we are on the same side on the hue-circle for interpolation
225 // We change the hue of the parameters here, but we don't change the color 225 // We change the hue of the parameters here, but we don't change the color
226 // represented by that value 226 // represented by that value
227 if(c1.h - c2.h > 180f) c1.h -= 360f; 227 if (c1.h - c2.h > 180f) c1.h -= 360f;
228 else if(c2.h - c1.h > 180f) c1.h += 360f; 228 else if (c2.h - c1.h > 180f) c1.h += 360f;
229 229
230 return new HSV(c1.h * (1f - ratio) + c2.h * ratio, 230 return new HSV(c1.h * (1f - ratio) + c2.h * ratio,
231 c1.s * (1f - ratio) + c2.s * ratio, 231 c1.s * (1f - ratio) + c2.s * ratio,
@@ -321,16 +321,16 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
321 } 321 }
322 322
323 HSV hsv; 323 HSV hsv;
324 if(hmod <= low) hsv = hsv1; // too low 324 if (hmod <= low) hsv = hsv1; // too low
325 else if(hmod >= high) hsv = hsv4; // too high 325 else if (hmod >= high) hsv = hsv4; // too high
326 else 326 else
327 { 327 {
328 // HSV-interpolate along the colors 328 // HSV-interpolate along the colors
329 // first, rescale h to 0.0 - 1.0 329 // first, rescale h to 0.0 - 1.0
330 hmod = (hmod - low) / (high - low); 330 hmod = (hmod - low) / (high - low);
331 // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4 331 // now we have to split: 0.00 => color1, 0.33 => color2, 0.67 => color3, 1.00 => color4
332 if(hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f); 332 if (hmod < 1f/3f) hsv = interpolateHSV(ref hsv1, ref hsv2, hmod * 3f);
333 else if(hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f); 333 else if (hmod < 2f/3f) hsv = interpolateHSV(ref hsv2, ref hsv3, (hmod * 3f) - 1f);
334 else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f); 334 else hsv = interpolateHSV(ref hsv3, ref hsv4, (hmod * 3f) - 2f);
335 } 335 }
336 336