aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Modules/FriendsModule.cs43
1 files changed, 40 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs
index d9f09f7..d2fcba9 100644
--- a/OpenSim/Region/Environment/Modules/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs
@@ -27,24 +27,61 @@
27*/ 27*/
28 28
29using Nini.Config; 29using Nini.Config;
30using System;
31using System.Collections;
32using System.Collections.Generic;
33using OpenSim.Framework;
34using OpenSim.Framework.Console;
30using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
31using OpenSim.Region.Environment.Scenes; 36using OpenSim.Region.Environment.Scenes;
37using libsecondlife;
38using libsecondlife.Packets;
32 39
33namespace OpenSim.Region.Environment.Modules 40namespace OpenSim.Region.Environment.Modules
34{ 41{
35 public class FriendsModule : IRegionModule 42 public class FriendsModule : IRegionModule
36 { 43 {
37 private Scene m_scene; 44 private List<Scene> m_scenes = new List<Scene>();
45 private LogBase m_log;
38 46
39 public void Initialise(Scene scene, IConfigSource config) 47 public void Initialise(Scene scene, IConfigSource config)
40 { 48 {
41 m_scene = scene; 49 m_log = MainLog.Instance;
50 if (!m_scenes.Contains(scene))
51 {
52 m_scenes.Add(scene);
53 scene.EventManager.OnNewClient += OnNewClient;
54 }
55 }
56
57 private void OnNewClient(IClientAPI client)
58 {
59 FormFriendship(client,new Guid("c43a67ab-b196-4d62-936c-b40369547dee"));
60 FormFriendship(client, new Guid("0a2f777b-f44c-4662-8b22-c90ae038a3e6"));
42 } 61 }
43 62
44 public void PostInitialise() 63 public void PostInitialise()
45 { 64 {
46 } 65 }
47 66
67 private void FormFriendship(IClientAPI client, Guid friend)
68 {
69 foreach (Scene scene in m_scenes)
70 {
71 if (scene.Entities.ContainsKey(client.AgentId) && scene.Entities[client.AgentId] is ScenePresence)
72 {
73 OnlineNotificationPacket ONPack = new OnlineNotificationPacket();
74 OnlineNotificationPacket.AgentBlockBlock[] AgentBlock = new OnlineNotificationPacket.AgentBlockBlock[1];
75
76 AgentBlock[0] = new OnlineNotificationPacket.AgentBlockBlock();
77 AgentBlock[0].AgentID = new LLUUID(friend);
78 ONPack.AgentBlock = AgentBlock;
79 client.OutPacket(ONPack,ThrottleOutPacketType.Task);
80 }
81 }
82
83 }
84
48 public void Close() 85 public void Close()
49 { 86 {
50 } 87 }
@@ -56,7 +93,7 @@ namespace OpenSim.Region.Environment.Modules
56 93
57 public bool IsSharedModule 94 public bool IsSharedModule
58 { 95 {
59 get { return false; } 96 get { return true; }
60 } 97 }
61 } 98 }
62} \ No newline at end of file 99} \ No newline at end of file