aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs138
1 files changed, 49 insertions, 89 deletions
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)