diff options
author | Teravus Ovares | 2008-02-26 08:31:00 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-26 08:31:00 +0000 |
commit | cb828c98242bf11294a9b085d8f186e37f1239e0 (patch) | |
tree | 6d366fdf39e21be2273efd009018812619c84aa1 /OpenSim/Grid/MessagingServer | |
parent | * Start sending "ImageNotFound" packet back to the client if we can't find an... (diff) | |
download | opensim-SC-cb828c98242bf11294a9b085d8f186e37f1239e0.zip opensim-SC-cb828c98242bf11294a9b085d8f186e37f1239e0.tar.gz opensim-SC-cb828c98242bf11294a9b085d8f186e37f1239e0.tar.bz2 opensim-SC-cb828c98242bf11294a9b085d8f186e37f1239e0.tar.xz |
* More Message server stuff. Still not ready.
Diffstat (limited to 'OpenSim/Grid/MessagingServer')
-rw-r--r-- | OpenSim/Grid/MessagingServer/Main.cs | 2 | ||||
-rw-r--r-- | OpenSim/Grid/MessagingServer/MessageService.cs | 103 |
2 files changed, 78 insertions, 27 deletions
diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index 5a383ef..bbf25f6 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs | |||
@@ -94,7 +94,7 @@ namespace OpenSim.Grid.MessagingServer | |||
94 | if (msgsvc.registerWithUserServer()) | 94 | if (msgsvc.registerWithUserServer()) |
95 | { | 95 | { |
96 | httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); | 96 | httpServer.AddXmlRPCHandler("login_to_simulator", msgsvc.UserLoggedOn); |
97 | 97 | httpServer.AddXmlRPCHandler("logout_of_simulator", msgsvc.UserLoggedOff); | |
98 | //httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); | 98 | //httpServer.AddXmlRPCHandler("get_user_by_name", m_userManager.XmlRPCGetUserMethodName); |
99 | //httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); | 99 | //httpServer.AddXmlRPCHandler("get_user_by_uuid", m_userManager.XmlRPCGetUserMethodUUID); |
100 | //httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", m_userManager.XmlRPCGetAvatarPickerAvatar); | 100 | //httpServer.AddXmlRPCHandler("get_avatar_picker_avatar", m_userManager.XmlRPCGetAvatarPickerAvatar); |
diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index 42277e2..d0b939b 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs | |||
@@ -101,22 +101,28 @@ namespace OpenSim.Grid.MessagingServer | |||
101 | /// <param name="userpresence">The Agent we're processing the friendlist subscriptions</param> | 101 | /// <param name="userpresence">The Agent we're processing the friendlist subscriptions</param> |
102 | public void ProcessFriendListSubscriptions(UserPresenceData userpresence) | 102 | public void ProcessFriendListSubscriptions(UserPresenceData userpresence) |
103 | { | 103 | { |
104 | lock (m_presences) | ||
105 | { | ||
106 | if (!m_presences.Contains(userpresence.agentData.AgentID)) | ||
107 | m_presences.Add(userpresence.agentData.AgentID, userpresence); | ||
108 | } | ||
109 | |||
104 | List<FriendListItem> uFriendList = userpresence.friendData; | 110 | List<FriendListItem> uFriendList = userpresence.friendData; |
105 | for (int i = 0; i < uFriendList.Count; i++) | 111 | for (int i = 0; i < uFriendList.Count; i++) |
106 | { | 112 | { |
107 | m_presence_BackReferences.Add(userpresence.agentData.AgentID, uFriendList[i].Friend); | 113 | //m_presence_BackReferences.Add(userpresence.agentData.AgentID, uFriendList[i].Friend); |
108 | m_presence_BackReferences.Add(uFriendList[i].Friend, userpresence.agentData.AgentID); | 114 | // m_presence_BackReferences.Add(uFriendList[i].Friend, userpresence.agentData.AgentID); |
109 | 115 | ||
110 | if (m_presences.Contains(uFriendList[i].Friend)) | 116 | if (m_presences.Contains(uFriendList[i].Friend)) |
111 | { | 117 | { |
112 | UserPresenceData friendup = (UserPresenceData)m_presences[uFriendList[i]]; | 118 | UserPresenceData friendup = (UserPresenceData)m_presences[uFriendList[i].Friend]; |
113 | // Add backreference | 119 | // Add backreference |
114 | 120 | ||
115 | SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i],i); | 121 | SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i],i); |
116 | } | 122 | } |
117 | } | 123 | } |
118 | 124 | ||
119 | m_presences.Add(userpresence.agentData.AgentID, userpresence); | 125 | |
120 | } | 126 | } |
121 | 127 | ||
122 | /// <summary> | 128 | /// <summary> |
@@ -220,23 +226,47 @@ namespace OpenSim.Grid.MessagingServer | |||
220 | /// <param name="AgentID"></param> | 226 | /// <param name="AgentID"></param> |
221 | private void ProcessLogOff(LLUUID AgentID) | 227 | private void ProcessLogOff(LLUUID AgentID) |
222 | { | 228 | { |
223 | if (m_presences.Contains(AgentID)) | 229 | UserPresenceData AgentData = null; |
230 | List<LLUUID> AgentsNeedingNotification = new List<LLUUID>(); | ||
231 | UserPresenceData friendd = null; | ||
232 | lock (m_presences) | ||
233 | { | ||
234 | if (m_presences.Contains(AgentID)) | ||
235 | { | ||
236 | AgentData = (UserPresenceData)m_presences[AgentID]; | ||
237 | } | ||
238 | } | ||
239 | |||
240 | if (AgentData != null) | ||
224 | { | 241 | { |
225 | UserPresenceData AgentData = (UserPresenceData)m_presences[AgentID]; | 242 | AgentsNeedingNotification = AgentData.subscriptionData; |
243 | //lock (m_presence_BackReferences) | ||
244 | //{ | ||
245 | //if (m_presence_BackReferences.Contains(AgentID)) | ||
246 | //{ | ||
247 | //AgentsNeedingNotification = (List<LLUUID>)m_presence_BackReferences[AgentID]; | ||
248 | //} | ||
249 | //} | ||
226 | 250 | ||
227 | if (m_presence_BackReferences.Contains(AgentID)) | 251 | |
252 | for (int i = 0; i < AgentsNeedingNotification.Count; i++) | ||
228 | { | 253 | { |
229 | List<LLUUID> AgentsNeedingNotification = (List<LLUUID>)m_presence_BackReferences[AgentID]; | 254 | // TODO: Do Region Notifications |
230 | for (int i = 0; i < AgentsNeedingNotification.Count; i++) | 255 | lock(m_presences) |
231 | { | 256 | { |
232 | // TODO: Do Region Notifications | ||
233 | if (m_presences.Contains(AgentsNeedingNotification[i])) | 257 | if (m_presences.Contains(AgentsNeedingNotification[i])) |
234 | { | 258 | { |
235 | UserPresenceData friendd = (UserPresenceData)m_presences[AgentsNeedingNotification[i]]; | 259 | friendd = (UserPresenceData)m_presences[AgentsNeedingNotification[i]]; |
236 | 260 | } | |
237 | // This might need to be enumerated and checked before we try to remove it. | 261 | } |
262 | |||
263 | // This might need to be enumerated and checked before we try to remove it. | ||
264 | if (friendd != null) | ||
265 | { | ||
266 | lock (friendd) | ||
267 | { | ||
238 | friendd.subscriptionData.Remove(AgentID); | 268 | friendd.subscriptionData.Remove(AgentID); |
239 | 269 | ||
240 | List<FriendListItem> fl = friendd.friendData; | 270 | List<FriendListItem> fl = friendd.friendData; |
241 | for (int j = 0; j < fl.Count; j++) | 271 | for (int j = 0; j < fl.Count; j++) |
242 | { | 272 | { |
@@ -247,15 +277,19 @@ namespace OpenSim.Grid.MessagingServer | |||
247 | 277 | ||
248 | } | 278 | } |
249 | friendd.friendData = fl; | 279 | friendd.friendData = fl; |
250 | 280 | m_presences[AgentsNeedingNotification[i]] = friendd; | |
251 | SendRegionPresenceUpdate(AgentData, friendd); | ||
252 | 281 | ||
253 | } | 282 | } |
254 | removeBackReference(AgentID, AgentsNeedingNotification[i]); | 283 | SendRegionPresenceUpdate(AgentData, friendd); |
284 | |||
255 | 285 | ||
286 | //removeBackReference(AgentID, AgentsNeedingNotification[i]); | ||
256 | } | 287 | } |
288 | |||
257 | } | 289 | } |
290 | |||
258 | } | 291 | } |
292 | |||
259 | } | 293 | } |
260 | 294 | ||
261 | 295 | ||
@@ -335,12 +369,24 @@ namespace OpenSim.Grid.MessagingServer | |||
335 | { | 369 | { |
336 | m_log.Info("[LOGON]: User logged on, building indexes for user"); | 370 | m_log.Info("[LOGON]: User logged on, building indexes for user"); |
337 | Hashtable requestData = (Hashtable)request.Params[0]; | 371 | Hashtable requestData = (Hashtable)request.Params[0]; |
372 | |||
373 | //requestData["sendkey"] = serv.sendkey; | ||
374 | //requestData["agentid"] = agentID.ToString(); | ||
375 | //requestData["sessionid"] = sessionID.ToString(); | ||
376 | //requestData["regionid"] = RegionID.ToString(); | ||
377 | //requestData["regionhandle"] = regionhandle.ToString(); | ||
378 | //requestData["positionx"] = positionX.ToString(); | ||
379 | //requestData["positiony"] = positionY.ToString(); | ||
380 | //requestData["positionz"] = positionZ.ToString(); | ||
381 | //requestData["firstname"] = firstname; | ||
382 | //requestData["lastname"] = lastname; | ||
383 | |||
338 | AgentCircuitData agentData = new AgentCircuitData(); | 384 | AgentCircuitData agentData = new AgentCircuitData(); |
339 | agentData.SessionID = new LLUUID((string)requestData["session_id"]); | 385 | agentData.SessionID = new LLUUID((string)requestData["sessionid"]); |
340 | agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); | 386 | agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); |
341 | agentData.firstname = (string)requestData["firstname"]; | 387 | agentData.firstname = (string)requestData["firstname"]; |
342 | agentData.lastname = (string)requestData["lastname"]; | 388 | agentData.lastname = (string)requestData["lastname"]; |
343 | agentData.AgentID = new LLUUID((string)requestData["agent_id"]); | 389 | agentData.AgentID = new LLUUID((string)requestData["agentid"]); |
344 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); | 390 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); |
345 | agentData.CapsPath = (string)requestData["caps_path"]; | 391 | agentData.CapsPath = (string)requestData["caps_path"]; |
346 | 392 | ||
@@ -351,9 +397,9 @@ namespace OpenSim.Grid.MessagingServer | |||
351 | else | 397 | else |
352 | { | 398 | { |
353 | agentData.startpos = | 399 | agentData.startpos = |
354 | new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), | 400 | new LLVector3(Convert.ToUInt32(requestData["positionx"]), |
355 | Convert.ToUInt32(requestData["startpos_y"]), | 401 | Convert.ToUInt32(requestData["positiony"]), |
356 | Convert.ToUInt32(requestData["startpos_z"])); | 402 | Convert.ToUInt32(requestData["positionz"])); |
357 | agentData.child = false; | 403 | agentData.child = false; |
358 | } | 404 | } |
359 | 405 | ||
@@ -383,10 +429,10 @@ namespace OpenSim.Grid.MessagingServer | |||
383 | 429 | ||
384 | Hashtable requestData = (Hashtable)request.Params[0]; | 430 | Hashtable requestData = (Hashtable)request.Params[0]; |
385 | 431 | ||
386 | LLUUID AgentID = new LLUUID((string)requestData["agent_id"]); | 432 | LLUUID AgentID = new LLUUID((string)requestData["agentid"]); |
387 | 433 | ||
388 | 434 | ||
389 | //ProcessLogOff(AgentID); | 435 | ProcessLogOff(AgentID); |
390 | 436 | ||
391 | 437 | ||
392 | return new XmlRpcResponse(); | 438 | return new XmlRpcResponse(); |
@@ -458,8 +504,13 @@ namespace OpenSim.Grid.MessagingServer | |||
458 | regionProfile.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); | 504 | regionProfile.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); |
459 | regionProfile.UUID = new LLUUID((string)responseData["region_UUID"]); | 505 | regionProfile.UUID = new LLUUID((string)responseData["region_UUID"]); |
460 | regionProfile.regionName = (string)responseData["region_name"]; | 506 | regionProfile.regionName = (string)responseData["region_name"]; |
461 | 507 | lock (m_regionInfoCache) | |
462 | m_regionInfoCache.Add(regionHandle, regionProfile); | 508 | { |
509 | if (!m_regionInfoCache.Contains(regionHandle)) | ||
510 | { | ||
511 | m_regionInfoCache.Add(regionHandle, regionProfile); | ||
512 | } | ||
513 | } | ||
463 | } | 514 | } |
464 | catch (WebException) | 515 | catch (WebException) |
465 | { | 516 | { |