diff options
author | gareth | 2007-03-20 09:04:49 +0000 |
---|---|---|
committer | gareth | 2007-03-20 09:04:49 +0000 |
commit | b83efd49475782d7ce65136e7e72f418299cdca6 (patch) | |
tree | 435aa2e3bce972680c1473fc7f5d9bc26481b671 /src/RemoteServers/RemoteGridServers/RemoteGrid.cs | |
parent | Removed the AssemblyInfo.cs files from the Vs2005 projects (diff) | |
download | opensim-SC-b83efd49475782d7ce65136e7e72f418299cdca6.zip opensim-SC-b83efd49475782d7ce65136e7e72f418299cdca6.tar.gz opensim-SC-b83efd49475782d7ce65136e7e72f418299cdca6.tar.bz2 opensim-SC-b83efd49475782d7ce65136e7e72f418299cdca6.tar.xz |
Load XML for neighbourinfo from grid
Diffstat (limited to 'src/RemoteServers/RemoteGridServers/RemoteGrid.cs')
-rw-r--r-- | src/RemoteServers/RemoteGridServers/RemoteGrid.cs | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/RemoteServers/RemoteGridServers/RemoteGrid.cs b/src/RemoteServers/RemoteGridServers/RemoteGrid.cs index 4f5d3a9..adb3d0f 100644 --- a/src/RemoteServers/RemoteGridServers/RemoteGrid.cs +++ b/src/RemoteServers/RemoteGridServers/RemoteGrid.cs | |||
@@ -25,11 +25,13 @@ | |||
25 | * | 25 | * |
26 | */ | 26 | */ |
27 | using System; | 27 | using System; |
28 | using System.Collections; | ||
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Threading; | 30 | using System.Threading; |
30 | using System.Net; | 31 | using System.Net; |
31 | using System.Net.Sockets; | 32 | using System.Net.Sockets; |
32 | using System.IO; | 33 | using System.IO; |
34 | using System.Xml; | ||
33 | using libsecondlife; | 35 | using libsecondlife; |
34 | using OpenSim.GridServers; | 36 | using OpenSim.GridServers; |
35 | 37 | ||
@@ -116,7 +118,7 @@ namespace RemoteGridServers | |||
116 | 118 | ||
117 | public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) | 119 | public override bool LogoutSession(LLUUID sessionID, LLUUID agentID, uint circuitCode) |
118 | { | 120 | { |
119 | WebRequest DeleteSession = WebRequest.Create(GridServerUrl + "/usersessions/" + sessionID.ToString()); | 121 | WebRequest DeleteSession = WebRequest.Create(UserServerUrl + "/usersessions/" + sessionID.ToString()); |
120 | DeleteSession.Method="DELETE"; | 122 | DeleteSession.Method="DELETE"; |
121 | DeleteSession.ContentType="text/plaintext"; | 123 | DeleteSession.ContentType="text/plaintext"; |
122 | DeleteSession.ContentLength=0; | 124 | DeleteSession.ContentLength=0; |
@@ -137,16 +139,37 @@ namespace RemoteGridServers | |||
137 | return(uuidBlock); | 139 | return(uuidBlock); |
138 | } | 140 | } |
139 | 141 | ||
140 | public override neighbourinfo[] RequestNeighbours() | 142 | public override neighbourinfo[] RequestNeighbours(ulong regionhandle) |
141 | { | 143 | { |
142 | neighbourinfo[] neighbours= new neighbourinfo[8]; | 144 | ArrayList neighbourlist = new ArrayList(); |
143 | return neighbours; | 145 | |
146 | WebRequest FindNeighbours = WebRequest.Create(GridServerUrl + "/regions/" + regionhandle.ToString() + "/neighbours"); | ||
147 | FindNeighbours.ContentType="text/plaintext"; | ||
148 | FindNeighbours.ContentLength=0; | ||
149 | |||
150 | StreamWriter stOut = new StreamWriter (FindNeighbours.GetRequestStream(), System.Text.Encoding.ASCII); | ||
151 | stOut.Write(""); | ||
152 | stOut.Close(); | ||
153 | |||
154 | |||
155 | XmlDocument GridRespXml = new XmlDocument(); | ||
156 | GridRespXml.Load(FindNeighbours.GetResponse().GetResponseStream()); | ||
157 | |||
158 | |||
159 | XmlNode NeighboursRoot = GridRespXml.FirstChild; | ||
160 | if(NeighboursRoot.Name != "neighbours") { | ||
161 | return new neighbourinfo[0]; | ||
162 | } | ||
163 | |||
164 | FindNeighbours.GetResponse().GetResponseStream().Close(); | ||
165 | |||
166 | return new neighbourinfo[0]; | ||
144 | } | 167 | } |
145 | 168 | ||
146 | public override void SetServerInfo(string UserServerUrl, string UserSendKey, string UserRecvKey, string GridServerKey, string GridSendKey, string GridRecvKey) | 169 | public override void SetServerInfo(string UserServerUrl, string UserSendKey, string UserRecvKey, string GridServerUrl, string GridSendKey, string GridRecvKey) |
147 | { | 170 | { |
148 | this.UserServerUrl = UserServerUrl; | 171 | this.UserServerUrl = UserServerUrl; |
149 | this.UserSendKey = UserSendKey; | 172 | this.UserSendKey = UserSendKey; |
150 | this.UserRecvKey = UserRecvKey; | 173 | this.UserRecvKey = UserRecvKey; |
151 | this.GridServerUrl = GridServerUrl; | 174 | this.GridServerUrl = GridServerUrl; |
152 | this.GridSendKey = GridSendKey; | 175 | this.GridSendKey = GridSendKey; |