aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
diff options
context:
space:
mode:
authordiva2009-01-03 07:05:33 +0000
committerdiva2009-01-03 07:05:33 +0000
commit158de95bde7cdee09334c40baee5122fd8f196e2 (patch)
tree8a8b1f41db53475cca08633cbeec09d5425a8745 /OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
parentPlumbing for moving InformRegionOfChildAgent over to RESTComms: pack and unpa... (diff)
downloadopensim-SC_OLD-158de95bde7cdee09334c40baee5122fd8f196e2.zip
opensim-SC_OLD-158de95bde7cdee09334c40baee5122fd8f196e2.tar.gz
opensim-SC_OLD-158de95bde7cdee09334c40baee5122fd8f196e2.tar.bz2
opensim-SC_OLD-158de95bde7cdee09334c40baee5122fd8f196e2.tar.xz
Another interregion comms change that will not work well with previous versions. This commit moves InformRegionOfChildAgent from OGS1 to RESTComms, effectively having the complete child agent life cycle over REST: create=POST, update=PUT, close=DELETE.
Additional changes include more functions in the IHyperlink interface, and some refactorings in the HG code for better reuse in RESTComms.
Diffstat (limited to 'OpenSim/Region/Communications/Hypergrid/HGGridServices.cs')
-rw-r--r--OpenSim/Region/Communications/Hypergrid/HGGridServices.cs55
1 files changed, 37 insertions, 18 deletions
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
index 691cd4a..fc68ba2 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
@@ -890,17 +890,8 @@ namespace OpenSim.Region.Communications.Hypergrid
890 890
891 public virtual bool ExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isFlying) { return false; } 891 public virtual bool ExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isFlying) { return false; }
892 892
893 public virtual bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 893 public bool SendUserInformation(RegionInfo regInfo, AgentCircuitData agentData)
894 { 894 {
895 // If we're here, it's because regionHandle is a remote, non-grided region
896 m_log.Info("[HGrid]: InformRegionOfChildAgent for " + regionHandle);
897
898 RegionInfo regInfo = GetHyperlinkRegion(regionHandle);
899 if (regInfo == null)
900 return false;
901
902 //ulong realHandle = regionHandle;
903
904 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID); 895 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID);
905 if ((uinfo == null) || !IsGoingHome(uinfo, regInfo)) 896 if ((uinfo == null) || !IsGoingHome(uinfo, regInfo))
906 { 897 {
@@ -914,6 +905,33 @@ namespace OpenSim.Region.Communications.Hypergrid
914 else 905 else
915 m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName); 906 m_log.Info("[HGrid]: User seems to be going home " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
916 907
908 // May need to change agent's name
909 if (IsLocalUser(uinfo))
910 {
911 agentData.firstname = agentData.firstname + "." + agentData.lastname;
912 agentData.lastname = "@" + serversInfo.UserURL.Replace("http://", ""); ; //HGNetworkServersInfo.Singleton.LocalUserServerURI;
913 }
914
915 return true;
916 }
917
918 public virtual bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
919 {
920 // If we're here, it's because regionHandle is a remote, non-grided region
921 m_log.Info("[HGrid]: InformRegionOfChildAgent for " + regionHandle);
922
923 RegionInfo regInfo = GetHyperlinkRegion(regionHandle);
924 if (regInfo == null)
925 return false;
926
927 //ulong realHandle = regionHandle;
928
929 if (!SendUserInformation(regInfo, agentData))
930 {
931 m_log.Warn("[HGrid]: Failed to inform remote region of user.");
932 //return false;
933 }
934
917 try 935 try
918 { 936 {
919 // ... and then 937 // ... and then
@@ -939,12 +957,14 @@ namespace OpenSim.Region.Communications.Hypergrid
939 if (remObject != null) 957 if (remObject != null)
940 { 958 {
941 sAgentCircuitData sag = new sAgentCircuitData(agentData); 959 sAgentCircuitData sag = new sAgentCircuitData(agentData);
942 // May need to change agent's name 960 //CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID);
943 if (IsLocalUser(uinfo)) 961
944 { 962 //// May need to change agent's name
945 sag.firstname = agentData.firstname + "." + agentData.lastname; 963 //if (IsLocalUser(uinfo))
946 sag.lastname = serversInfo.UserURL; //HGNetworkServersInfo.Singleton.LocalUserServerURI; 964 //{
947 } 965 // sag.firstname = agentData.firstname + "." + agentData.lastname;
966 // sag.lastname = serversInfo.UserURL; //HGNetworkServersInfo.Singleton.LocalUserServerURI;
967 //}
948 retValue = remObject.InformRegionOfChildAgent(regionHandle, sag); 968 retValue = remObject.InformRegionOfChildAgent(regionHandle, sag);
949 } 969 }
950 else 970 else
@@ -1158,7 +1178,7 @@ namespace OpenSim.Region.Communications.Hypergrid
1158 /// <param name="regionHandle"></param> 1178 /// <param name="regionHandle"></param>
1159 /// <param name="agentData"></param> 1179 /// <param name="agentData"></param>
1160 /// <returns></returns> 1180 /// <returns></returns>
1161 protected bool HGIncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) 1181 public void AdjustUserInformation(AgentCircuitData agentData)
1162 { 1182 {
1163 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID); 1183 CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID);
1164 if ((uinfo != null) && (uinfo.UserProfile != null) && 1184 if ((uinfo != null) && (uinfo.UserProfile != null) &&
@@ -1174,7 +1194,6 @@ namespace OpenSim.Region.Communications.Hypergrid
1174 } 1194 }
1175 //else 1195 //else
1176 // Console.WriteLine("---------------> Foreign User!"); 1196 // Console.WriteLine("---------------> Foreign User!");
1177 return true;
1178 } 1197 }
1179 #endregion 1198 #endregion
1180 1199