aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
diff options
context:
space:
mode:
authordiva2009-02-20 00:18:18 +0000
committerdiva2009-02-20 00:18:18 +0000
commite725e485fa72bcdba03df9ed7d0b007b6e548eb3 (patch)
tree170e838680340bd28e831f2735fe25cf3ec63157 /OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
parent* Fixed erroneously reverted xmlns (diff)
downloadopensim-SC_OLD-e725e485fa72bcdba03df9ed7d0b007b6e548eb3.zip
opensim-SC_OLD-e725e485fa72bcdba03df9ed7d0b007b6e548eb3.tar.gz
opensim-SC_OLD-e725e485fa72bcdba03df9ed7d0b007b6e548eb3.tar.bz2
opensim-SC_OLD-e725e485fa72bcdba03df9ed7d0b007b6e548eb3.tar.xz
This moves the 2 friends-related interregion messages out of OGS1 and into the FriendsModule. No functional changes. Those messages were sent over XMLRPC, and that's how it continues to be for now. Just moving this couple of interregion messages out of OGS1, in preparation for the big shlep ahead.
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1GridServices.cs')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs78
1 files changed, 0 insertions, 78 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 1da7621..660e684 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -1810,83 +1810,5 @@ namespace OpenSim.Region.Communications.OGS1
1810 return null; 1810 return null;
1811 } 1811 }
1812 } 1812 }
1813
1814 public List<UUID> InformFriendsInOtherRegion(UUID agentId, ulong destRegionHandle, List<UUID> friends, bool online)
1815 {
1816 List<UUID> tpdAway = new List<UUID>();
1817
1818 // destRegionHandle is a region on another server
1819 RegionInfo info = RequestNeighbourInfo(destRegionHandle);
1820 if (info != null)
1821 {
1822 string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk";
1823
1824 Hashtable reqParams = new Hashtable();
1825 reqParams["agentID"] = agentId.ToString();
1826 reqParams["agentOnline"] = online;
1827 int count = 0;
1828 foreach (UUID uuid in friends)
1829 {
1830 reqParams["friendID_" + count++] = uuid.ToString();
1831 }
1832 reqParams["friendCount"] = count;
1833
1834 IList parameters = new ArrayList();
1835 parameters.Add(reqParams);
1836 try
1837 {
1838 XmlRpcRequest request = new XmlRpcRequest("presence_update_bulk", parameters);
1839 XmlRpcResponse response = request.Send(httpServer, 5000);
1840 Hashtable respData = (Hashtable)response.Value;
1841
1842 count = (int)respData["friendCount"];
1843 for (int i = 0; i < count; ++i)
1844 {
1845 UUID uuid;
1846 if (UUID.TryParse((string)respData["friendID_" + i], out uuid)) tpdAway.Add(uuid);
1847 }
1848 }
1849 catch (Exception e)
1850 {
1851 m_log.Error("[OGS1 GRID SERVICES]: InformFriendsInOtherRegion XMLRPC failure: ", e);
1852 }
1853 }
1854 else m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}???", destRegionHandle);
1855
1856 return tpdAway;
1857 }
1858
1859 public bool TriggerTerminateFriend(ulong destRegionHandle, UUID agentID, UUID exFriendID)
1860 {
1861 // destRegionHandle is a region on another server
1862 RegionInfo info = RequestNeighbourInfo(destRegionHandle);
1863 if (info == null)
1864 {
1865 m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}", destRegionHandle);
1866 return false; // region not found???
1867 }
1868
1869 string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk";
1870
1871 Hashtable reqParams = new Hashtable();
1872 reqParams["agentID"] = agentID.ToString();
1873 reqParams["friendID"] = exFriendID.ToString();
1874
1875 IList parameters = new ArrayList();
1876 parameters.Add(reqParams);
1877 try
1878 {
1879 XmlRpcRequest request = new XmlRpcRequest("terminate_friend", parameters);
1880 XmlRpcResponse response = request.Send(httpServer, 5000);
1881 Hashtable respData = (Hashtable)response.Value;
1882
1883 return (bool)respData["success"];
1884 }
1885 catch (Exception e)
1886 {
1887 m_log.Error("[OGS1 GRID SERVICES]: InformFriendsInOtherRegion XMLRPC failure: ", e);
1888 return false;
1889 }
1890 }
1891 } 1813 }
1892} 1814}