diff options
author | MW | 2007-11-13 10:47:39 +0000 |
---|---|---|
committer | MW | 2007-11-13 10:47:39 +0000 |
commit | 7f8a69f181aba493416c8b5c6e8aa4be8fde7a34 (patch) | |
tree | 79b47e2e40fa6aac8627715bb51f4ccd8c7ce8a8 /OpenSim/Framework/Communications/LoginResponse.cs | |
parent | * Fixed the walk vs fall animation. (diff) | |
download | opensim-SC_OLD-7f8a69f181aba493416c8b5c6e8aa4be8fde7a34.zip opensim-SC_OLD-7f8a69f181aba493416c8b5c6e8aa4be8fde7a34.tar.gz opensim-SC_OLD-7f8a69f181aba493416c8b5c6e8aa4be8fde7a34.tar.bz2 opensim-SC_OLD-7f8a69f181aba493416c8b5c6e8aa4be8fde7a34.tar.xz |
Some work on being able to set/send a users Buddylist info. (added handling code to LoginResponse).
And as a test each user signing in will get the test account ("Mr OpenSim") as a friend (online/offline status will not currently show up)
Diffstat (limited to 'OpenSim/Framework/Communications/LoginResponse.cs')
-rw-r--r-- | OpenSim/Framework/Communications/LoginResponse.cs | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index 4d1c35a..a8c3f23 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections; | 30 | using System.Collections; |
31 | using System.Collections.Generic; | ||
31 | using libsecondlife; | 32 | using libsecondlife; |
32 | using Nwc.XmlRpc; | 33 | using Nwc.XmlRpc; |
33 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
@@ -99,6 +100,8 @@ namespace OpenSim.Framework.UserManagement | |||
99 | private string seedCapability; | 100 | private string seedCapability; |
100 | private string lookAt; | 101 | private string lookAt; |
101 | 102 | ||
103 | private BuddyList m_buddyList = null; | ||
104 | |||
102 | public LoginResponse() | 105 | public LoginResponse() |
103 | { | 106 | { |
104 | loginFlags = new ArrayList(); | 107 | loginFlags = new ArrayList(); |
@@ -291,7 +294,11 @@ namespace OpenSim.Framework.UserManagement | |||
291 | responseData["region_y"] = (Int32) RegionY*256; | 294 | responseData["region_y"] = (Int32) RegionY*256; |
292 | 295 | ||
293 | //responseData["inventory-lib-root"] = new ArrayList(); // todo | 296 | //responseData["inventory-lib-root"] = new ArrayList(); // todo |
294 | //responseData["buddy-list"] = new ArrayList(); // todo | 297 | |
298 | if (m_buddyList != null) | ||
299 | { | ||
300 | responseData["buddy-list"] = m_buddyList.ToArray(); | ||
301 | } | ||
295 | 302 | ||
296 | responseData["login"] = "true"; | 303 | responseData["login"] = "true"; |
297 | xmlRpcResponse.Value = responseData; | 304 | xmlRpcResponse.Value = responseData; |
@@ -510,6 +517,12 @@ namespace OpenSim.Framework.UserManagement | |||
510 | set { welcomeMessage = value; } | 517 | set { welcomeMessage = value; } |
511 | } | 518 | } |
512 | 519 | ||
520 | public BuddyList BuddList | ||
521 | { | ||
522 | get{return m_buddyList;} | ||
523 | set { m_buddyList = value; } | ||
524 | } | ||
525 | |||
513 | #endregion | 526 | #endregion |
514 | 527 | ||
515 | public class UserInfo | 528 | public class UserInfo |
@@ -520,5 +533,54 @@ namespace OpenSim.Framework.UserManagement | |||
520 | public LLVector3 homepos; | 533 | public LLVector3 homepos; |
521 | public LLVector3 homelookat; | 534 | public LLVector3 homelookat; |
522 | } | 535 | } |
536 | |||
537 | public class BuddyList | ||
538 | { | ||
539 | public List<BuddyInfo> Buddies = new List<BuddyInfo>(); | ||
540 | |||
541 | public void AddNewBuddy(BuddyInfo buddy) | ||
542 | { | ||
543 | if (!Buddies.Contains(buddy)) | ||
544 | { | ||
545 | Buddies.Add(buddy); | ||
546 | } | ||
547 | } | ||
548 | |||
549 | public ArrayList ToArray() | ||
550 | { | ||
551 | ArrayList buddyArray = new ArrayList(); | ||
552 | foreach (BuddyInfo buddy in Buddies) | ||
553 | { | ||
554 | buddyArray.Add(buddy.ToHashTable()); | ||
555 | } | ||
556 | return buddyArray; | ||
557 | } | ||
558 | |||
559 | public class BuddyInfo | ||
560 | { | ||
561 | public int BuddyRightsHave = 1; | ||
562 | public int BuddyRightsGiven = 1; | ||
563 | public LLUUID BuddyID; | ||
564 | |||
565 | public BuddyInfo(string buddyID) | ||
566 | { | ||
567 | BuddyID = new LLUUID(buddyID); | ||
568 | } | ||
569 | |||
570 | public BuddyInfo(LLUUID buddyID) | ||
571 | { | ||
572 | BuddyID = buddyID; | ||
573 | } | ||
574 | |||
575 | public Hashtable ToHashTable() | ||
576 | { | ||
577 | Hashtable hTable = new Hashtable(); | ||
578 | hTable["buddy_rights_has"] = BuddyRightsHave; | ||
579 | hTable["buddy_rights_given"] = BuddyRightsGiven; | ||
580 | hTable["buddy_id"] = BuddyID.ToStringHyphenated(); | ||
581 | return hTable; | ||
582 | } | ||
583 | } | ||
584 | } | ||
523 | } | 585 | } |
524 | } \ No newline at end of file | 586 | } \ No newline at end of file |