* 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...
This commit is contained in:
Teravus Ovares
2008-01-01 06:12:04 +00:00
parent b8975ecbd9
commit b4c9b6bd19
17 changed files with 590 additions and 51 deletions

View File

@@ -52,6 +52,7 @@ namespace OpenSim.Region.Environment.Modules
{
m_scenes.Add(scene);
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnGridInstantMessageToIMModule += OnGridInstantMessage;
}
}
@@ -67,19 +68,29 @@ namespace OpenSim.Region.Environment.Modules
uint ParentEstateID, LLVector3 Position, LLUUID RegionID,
byte[] binaryBucket)
{
foreach (Scene scene in m_scenes)
bool FriendDialog = ((dialog == (byte)38) || (dialog == (byte)39) || (dialog == (byte)40));
// IM dialogs need to be pre-processed and have their sessionID filled by the server
// so the sim can match the transaction on the return packet.
// Don't send a Friend Dialog IM with a LLUUID.Zero session.
if (!(FriendDialog && imSessionID == LLUUID.Zero))
{
if (scene.Entities.ContainsKey(toAgentID) && scene.Entities[toAgentID] is ScenePresence)
foreach (Scene scene in m_scenes)
{
// Local message
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
if (!user.IsChildAgent)
if (scene.Entities.ContainsKey(toAgentID) && scene.Entities[toAgentID] is ScenePresence)
{
user.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message,
toAgentID, imSessionID, fromAgentName, dialog,
timestamp);
// Message sent
return;
// Local message
ScenePresence user = (ScenePresence)scene.Entities[toAgentID];
if (!user.IsChildAgent)
{
user.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message,
toAgentID, imSessionID, fromAgentName, dialog,
timestamp);
// Message sent
return;
}
}
}
}
@@ -87,6 +98,20 @@ namespace OpenSim.Region.Environment.Modules
// Still here, try send via Grid
// TODO
}
// Trusty OSG1 called method. This method also gets called from the FriendsModule
// Turns out the sim has to send an instant message to the user to get it to show an accepted friend.
private void OnGridInstantMessage(GridInstantMessage msg)
{
// Trigger the above event handler
OnInstantMessage(new LLUUID(msg.fromAgentID), new LLUUID(msg.fromAgentSession),
new LLUUID(msg.toAgentID), new LLUUID(msg.imSessionID), msg.timestamp, msg.fromAgentName,
msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID,
new LLVector3(msg.Position.x,msg.Position.y,msg.Position.z), new LLUUID(msg.RegionID),
msg.binaryBucket);
}
public void PostInitialise()
{