From b4c9b6bd19c0725ae5bf60172db75ebc63ba72c6 Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Tue, 1 Jan 2008 06:12:04 +0000
Subject: * You can add and remove a friend in standalone now within the same
simulator. It saves. * You can add and remove a friend in grid mode now
within the same simulator. It doesn't save yet. * I got rid of Mr. OpenSim
as a friend.. he bothers me /:b...
---
OpenSim/Region/Environment/Scenes/Scene.cs | 41 ++++++++++++++++++++++++
OpenSim/Region/Environment/Scenes/SceneEvents.cs | 36 +++++++++++++++++++++
2 files changed, 77 insertions(+)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index a0f19bd..ba99640 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1625,6 +1625,8 @@ namespace OpenSim.Region.Environment.Scenes
}
}
+
+
#endregion
#region Other Methods
@@ -1699,6 +1701,45 @@ namespace OpenSim.Region.Environment.Scenes
}
}
+ ///
+ /// This method is a way for the Friends Module to create an instant
+ /// message to the avatar and for Instant Messages that travel across
+ /// gridcomms to make it to the Instant Message Module.
+ ///
+ /// Friendship establishment and groups are unfortunately tied with instant messaging and
+ /// there's no way to separate them completely.
+ ///
+ /// object containing the instant message data
+ /// void
+ public void TriggerGridInstantMessage(GridInstantMessage message,InstantMessageReceiver options)
+ {
+ m_eventManager.TriggerGridInstantMessage(message,options);
+ }
+
+
+ public virtual void StoreAddFriendship(LLUUID ownerID, LLUUID friendID, uint perms)
+ {
+ // TODO: m_sceneGridService.DoStuff;
+ CommsManager.AddNewUserFriend(ownerID, friendID, perms);
+ }
+
+ public virtual void StoreUpdateFriendship(LLUUID ownerID, LLUUID friendID, uint perms)
+ {
+ // TODO: m_sceneGridService.DoStuff;
+ CommsManager.UpdateUserFriendPerms(ownerID, friendID, perms);
+ }
+
+ public virtual void StoreRemoveFriendship(LLUUID ownerID, LLUUID ExfriendID)
+ {
+ // TODO: m_sceneGridService.DoStuff;
+ CommsManager.RemoveUserFriend(ownerID, ExfriendID);
+ }
+ public virtual List StoreGetFriendsForUser(LLUUID ownerID)
+ {
+ // TODO: m_sceneGridService.DoStuff;
+ return CommsManager.GetUserFriendList(ownerID);
+ }
+
#endregion
#region Console Commands
diff --git a/OpenSim/Region/Environment/Scenes/SceneEvents.cs b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
index a6a8fb6..5bf23ac 100644
--- a/OpenSim/Region/Environment/Scenes/SceneEvents.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneEvents.cs
@@ -27,12 +27,14 @@
*/
using libsecondlife;
+using System;
using OpenSim.Framework;
using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.LandManagement;
namespace OpenSim.Region.Environment.Scenes
{
+
///
/// A class for triggering remote scene events.
///
@@ -115,6 +117,16 @@ namespace OpenSim.Region.Environment.Scenes
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
+ public delegate void NewGridInstantMessage(GridInstantMessage message);
+
+ public event NewGridInstantMessage OnGridInstantMessageToIMModule;
+
+ public event NewGridInstantMessage OnGridInstantMessageToFriendsModule;
+
+ public event NewGridInstantMessage OnGridInstantMessageToGroupsModule;
+
+
+
public void TriggerOnClientMovement(ScenePresence avatar)
{
if (OnClientMovement != null)
@@ -265,5 +277,29 @@ namespace OpenSim.Region.Environment.Scenes
OnAvatarEnteringNewParcel(avatar, localLandID, regionID);
}
}
+
+ ///Used to pass instnat messages around between the Scene, the Friends Module and the Instant Messsage Module
+ ///Object containing the Instant Message Data
+ ///A bit vector containing the modules to send the message to
+ public void TriggerGridInstantMessage(GridInstantMessage message, InstantMessageReceiver whichModule)
+ {
+ if ((whichModule & InstantMessageReceiver.IMModule) != 0)
+ {
+
+ if (OnGridInstantMessageToIMModule != null)
+ {
+ OnGridInstantMessageToIMModule(message);
+ }
+ }
+ if ((whichModule & InstantMessageReceiver.FriendsModule) != 0)
+ {
+ if (OnGridInstantMessageToFriendsModule != null)
+ {
+ OnGridInstantMessageToFriendsModule(message);
+ }
+
+ }
+ }
+
}
}
\ No newline at end of file
--
cgit v1.1