aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services')
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs24
-rw-r--r--OpenSim/Services/Connectors/InstantMessage/InstantMessageServiceConnector.cs2
-rw-r--r--OpenSim/Services/HypergridService/HGInstantMessageService.cs26
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs7
-rw-r--r--OpenSim/Services/Interfaces/IHypergridServices.cs2
5 files changed, 32 insertions, 29 deletions
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
index 08f1dc3..c5ae0c0 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
@@ -161,19 +161,8 @@ namespace OpenSim.Services.Connectors.Friends
161 161
162 public bool StoreFriend(string PrincipalID, string Friend, int flags) 162 public bool StoreFriend(string PrincipalID, string Friend, int flags)
163 { 163 {
164 FriendInfo finfo = new FriendInfo();
165 try
166 {
167 finfo.PrincipalID = new UUID(PrincipalID);
168 }
169 catch
170 {
171 return false;
172 }
173 finfo.Friend = Friend;
174 finfo.MyFlags = flags;
175 164
176 Dictionary<string, object> sendData = finfo.ToKeyValuePairs(); 165 Dictionary<string, object> sendData = ToKeyValuePairs(PrincipalID, Friend, flags);
177 166
178 sendData["METHOD"] = "storefriend"; 167 sendData["METHOD"] = "storefriend";
179 168
@@ -267,5 +256,16 @@ namespace OpenSim.Services.Connectors.Friends
267 } 256 }
268 257
269 #endregion 258 #endregion
259
260 public Dictionary<string, object> ToKeyValuePairs(string principalID, string friend, int flags)
261 {
262 Dictionary<string, object> result = new Dictionary<string, object>();
263 result["PrincipalID"] = principalID;
264 result["Friend"] = friend;
265 result["MyFlags"] = flags;
266
267 return result;
268 }
269
270 } 270 }
271} \ No newline at end of file 271} \ No newline at end of file
diff --git a/OpenSim/Services/Connectors/InstantMessage/InstantMessageServiceConnector.cs b/OpenSim/Services/Connectors/InstantMessage/InstantMessageServiceConnector.cs
index 161be02..dbce9f6 100644
--- a/OpenSim/Services/Connectors/InstantMessage/InstantMessageServiceConnector.cs
+++ b/OpenSim/Services/Connectors/InstantMessage/InstantMessageServiceConnector.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Services.Connectors.InstantMessage
61 try 61 try
62 { 62 {
63 63
64 XmlRpcResponse GridResp = GridReq.Send(url, 3000); 64 XmlRpcResponse GridResp = GridReq.Send(url, 10000);
65 65
66 Hashtable responseData = (Hashtable)GridResp.Value; 66 Hashtable responseData = (Hashtable)GridResp.Value;
67 67
diff --git a/OpenSim/Services/HypergridService/HGInstantMessageService.cs b/OpenSim/Services/HypergridService/HGInstantMessageService.cs
index dd5fd71..4f68e55 100644
--- a/OpenSim/Services/HypergridService/HGInstantMessageService.cs
+++ b/OpenSim/Services/HypergridService/HGInstantMessageService.cs
@@ -115,23 +115,23 @@ namespace OpenSim.Services.HypergridService
115 return m_IMSimConnector.SendInstantMessage(im); 115 return m_IMSimConnector.SendInstantMessage(im);
116 } 116 }
117 else 117 else
118 return TrySendInstantMessage(im, "", true); 118 return TrySendInstantMessage(im, "", true, false);
119 } 119 }
120 120
121 public bool OutgoingInstantMessage(GridInstantMessage im, string url) 121 public bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner)
122 { 122 {
123 m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url); 123 m_log.DebugFormat("[HG IM SERVICE]: Sending message from {0} to {1}@{2}", im.fromAgentID, im.toAgentID, url);
124 if (url != string.Empty) 124 if (url != string.Empty)
125 return TrySendInstantMessage(im, url, true); 125 return TrySendInstantMessage(im, url, true, foreigner);
126 else 126 else
127 { 127 {
128 PresenceInfo upd = new PresenceInfo(); 128 PresenceInfo upd = new PresenceInfo();
129 upd.RegionID = UUID.Zero; 129 upd.RegionID = UUID.Zero;
130 return TrySendInstantMessage(im, upd, true); 130 return TrySendInstantMessage(im, upd, true, foreigner);
131 } 131 }
132 } 132 }
133 133
134 protected bool TrySendInstantMessage(GridInstantMessage im, object previousLocation, bool firstTime) 134 protected bool TrySendInstantMessage(GridInstantMessage im, object previousLocation, bool firstTime, bool foreigner)
135 { 135 {
136 UUID toAgentID = new UUID(im.toAgentID); 136 UUID toAgentID = new UUID(im.toAgentID);
137 137
@@ -185,7 +185,7 @@ namespace OpenSim.Services.HypergridService
185 } 185 }
186 } 186 }
187 187
188 if (upd == null) 188 if (upd == null && !foreigner)
189 { 189 {
190 // Let's check with the UAS if the user is elsewhere 190 // Let's check with the UAS if the user is elsewhere
191 m_log.DebugFormat("[HG IM SERVICE]: User is not present. Checking location with User Agent service"); 191 m_log.DebugFormat("[HG IM SERVICE]: User is not present. Checking location with User Agent service");
@@ -213,25 +213,25 @@ namespace OpenSim.Services.HypergridService
213 // ok, the user is around somewhere. Let's send back the reply with "success" 213 // ok, the user is around somewhere. Let's send back the reply with "success"
214 // even though the IM may still fail. Just don't keep the caller waiting for 214 // even though the IM may still fail. Just don't keep the caller waiting for
215 // the entire time we're trying to deliver the IM 215 // the entire time we're trying to deliver the IM
216 return SendIMToRegion(upd, im, toAgentID); 216 return SendIMToRegion(upd, im, toAgentID, foreigner);
217 } 217 }
218 else if (url != string.Empty) 218 else if (url != string.Empty)
219 { 219 {
220 // ok, the user is around somewhere. Let's send back the reply with "success" 220 // ok, the user is around somewhere. Let's send back the reply with "success"
221 // even though the IM may still fail. Just don't keep the caller waiting for 221 // even though the IM may still fail. Just don't keep the caller waiting for
222 // the entire time we're trying to deliver the IM 222 // the entire time we're trying to deliver the IM
223 return ForwardIMToGrid(url, im, toAgentID); 223 return ForwardIMToGrid(url, im, toAgentID, foreigner);
224 } 224 }
225 else if (firstTime && previousLocation is string && (string)previousLocation != string.Empty) 225 else if (firstTime && previousLocation is string && (string)previousLocation != string.Empty)
226 { 226 {
227 return ForwardIMToGrid((string)previousLocation, im, toAgentID); 227 return ForwardIMToGrid((string)previousLocation, im, toAgentID, foreigner);
228 } 228 }
229 else 229 else
230 m_log.DebugFormat("[HG IM SERVICE]: Unable to locate user {0}", toAgentID); 230 m_log.DebugFormat("[HG IM SERVICE]: Unable to locate user {0}", toAgentID);
231 return false; 231 return false;
232 } 232 }
233 233
234 bool SendIMToRegion(PresenceInfo upd, GridInstantMessage im, UUID toAgentID) 234 bool SendIMToRegion(PresenceInfo upd, GridInstantMessage im, UUID toAgentID, bool foreigner)
235 { 235 {
236 bool imresult = false; 236 bool imresult = false;
237 GridRegion reginfo = null; 237 GridRegion reginfo = null;
@@ -277,11 +277,11 @@ namespace OpenSim.Services.HypergridService
277 // The version that spawns the thread is SendGridInstantMessageViaXMLRPC 277 // The version that spawns the thread is SendGridInstantMessageViaXMLRPC
278 278
279 // This is recursive!!!!! 279 // This is recursive!!!!!
280 return TrySendInstantMessage(im, upd, false); 280 return TrySendInstantMessage(im, upd, false, foreigner);
281 } 281 }
282 } 282 }
283 283
284 bool ForwardIMToGrid(string url, GridInstantMessage im, UUID toAgentID) 284 bool ForwardIMToGrid(string url, GridInstantMessage im, UUID toAgentID, bool foreigner)
285 { 285 {
286 if (InstantMessageServiceConnector.SendInstantMessage(url, im)) 286 if (InstantMessageServiceConnector.SendInstantMessage(url, im))
287 { 287 {
@@ -309,7 +309,7 @@ namespace OpenSim.Services.HypergridService
309 // The version that spawns the thread is SendGridInstantMessageViaXMLRPC 309 // The version that spawns the thread is SendGridInstantMessageViaXMLRPC
310 310
311 // This is recursive!!!!! 311 // This is recursive!!!!!
312 return TrySendInstantMessage(im, url, false); 312 return TrySendInstantMessage(im, url, false, foreigner);
313 } 313 }
314 314
315 } 315 }
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index 387547e..2f2ebfb 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -197,8 +197,11 @@ namespace OpenSim.Services.HypergridService
197 agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason); 197 agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason);
198 198
199 // restore the old travel info 199 // restore the old travel info
200 lock (m_TravelingAgents) 200 if(reason != "Logins Disabled")
201 m_TravelingAgents[agentCircuit.SessionID] = old; 201 {
202 lock (m_TravelingAgents)
203 m_TravelingAgents[agentCircuit.SessionID] = old;
204 }
202 205
203 return false; 206 return false;
204 } 207 }
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs
index 753c205..82ec8ce 100644
--- a/OpenSim/Services/Interfaces/IHypergridServices.cs
+++ b/OpenSim/Services/Interfaces/IHypergridServices.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Interfaces
72 public interface IInstantMessage 72 public interface IInstantMessage
73 { 73 {
74 bool IncomingInstantMessage(GridInstantMessage im); 74 bool IncomingInstantMessage(GridInstantMessage im);
75 bool OutgoingInstantMessage(GridInstantMessage im, string url); 75 bool OutgoingInstantMessage(GridInstantMessage im, string url, bool foreigner);
76 } 76 }
77 public interface IFriendsSimConnector 77 public interface IFriendsSimConnector
78 { 78 {