* Added instant message support for the local region. Grid support forthcoming.

This commit is contained in:
Adam Frisby
2007-07-08 03:32:27 +00:00
parent 10ece46cf6
commit bdab40280b
7 changed files with 202 additions and 214 deletions

View File

@@ -34,6 +34,7 @@ using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
public delegate void ChatFromViewer(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
public delegate void ImprovedInstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message); // Cut down from full list
public delegate void RezObject(AssetBase primAsset, LLVector3 pos);
public delegate void ModifyTerrain(float height, float seconds, byte size, byte action, float north, float west);
public delegate void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam);
@@ -74,6 +75,7 @@ namespace OpenSim.Framework.Interfaces
public interface IClientAPI
{
event ImprovedInstantMessage OnInstantMessage;
event ChatFromViewer OnChatFromViewer;
event RezObject OnRezObject;
event ModifyTerrain OnModifyTerrain;
@@ -146,6 +148,7 @@ namespace OpenSim.Framework.Interfaces
void SendRegionHandshake(RegionInfo regionInfo);
void SendChatMessage(string message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
void SendInstantMessage(string message, LLUUID target);
void SendLayerData(float[] map);
void SendLayerData(int px, int py, float[] map);
void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look);

View File

@@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
<ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenSim.Framework</AssemblyName>
@@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenSim.Framework</RootNamespace>
<StartupObject></StartupObject>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@@ -28,7 +31,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
@@ -55,36 +61,34 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="Db4objects.Db4o.dll" >
<Reference Include="Db4objects.Db4o.dll">
<HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<Reference Include="libsecondlife.dll">
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" >
<Reference Include="System">
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="XMLRPC.dll" >
<HintPath>..\..\..\bin\XMLRPC.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="XMLRPC, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Console\OpenSim.Framework.Console.csproj">
<Name>OpenSim.Framework.Console</Name>
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@@ -201,4 +205,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@@ -40,6 +40,7 @@ namespace OpenSim.Region.ClientStack
{
partial class ClientView
{
public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer;
public event RezObject OnRezObject;
public event GenericCall4 OnDeRezObject;
@@ -236,6 +237,30 @@ namespace OpenSim.Region.ClientStack
this.OutPacket(reply);
}
/// <summary>
///
/// </summary>
/// <remarks>TODO</remarks>
/// <param name="message"></param>
/// <param name="target"></param>
public void SendInstantMessage(string message, LLUUID target)
{
ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
msg.AgentData.AgentID = this.AgentID;
msg.AgentData.SessionID = this.SessionID;
msg.MessageBlock.Dialog = 0;
msg.MessageBlock.FromGroup = false;
msg.MessageBlock.ID = target.Combine(this.AgentID);
msg.MessageBlock.Offline = 0;
msg.MessageBlock.ParentEstateID = 0;
msg.MessageBlock.Position = new LLVector3();
msg.MessageBlock.RegionID = new LLUUID();
msg.MessageBlock.Timestamp = 0;
msg.MessageBlock.ToAgentID = target;
this.OutPacket(msg);
}
/// <summary>
/// Send the region heightmap to the client

View File

@@ -92,6 +92,20 @@ namespace OpenSim.Region.ClientStack
this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
}
break;
case PacketType.ImprovedInstantMessage:
ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
string IMmessage = Util.FieldToString(msgpack.MessageBlock.Message);
if (OnInstantMessage != null)
{
this.OnInstantMessage(msgpack.AgentData.AgentID, msgpack.MessageBlock.ToAgentID,
msgpack.MessageBlock.Timestamp, IMfromName, IMmessage);
}
break;
case PacketType.RezObject:
RezObjectPacket rezPacket = (RezObjectPacket)Pack;
AgentInventory inven = this.m_inventoryCache.GetAgentsInventory(this.AgentID);

View File

@@ -97,6 +97,30 @@ namespace OpenSim.Region.Environment.Scenes
return;
}
/// <summary>
///
/// </summary>
/// <remarks>Inefficient. TODO: Fixme</remarks>
/// <param name="fromAgentID"></param>
/// <param name="toAgentID"></param>
/// <param name="timestamp"></param>
/// <param name="fromAgentName"></param>
/// <param name="message"></param>
public void InstantMessage(LLUUID fromAgentID, LLUUID toAgentID, uint timestamp, string fromAgentName, string message)
{
if (this.Avatars.ContainsKey(toAgentID))
{
// Local sim message
ScenePresence avatar = this.Avatars[toAgentID];
}
else
{
// Grid message
}
}
/// <summary>
///
/// </summary>

View File

@@ -450,6 +450,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnRegionHandShakeReply += this.SendLayerData;
//remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims);
client.OnChatFromViewer += this.SimChat;
client.OnInstantMessage += this.InstantMessage;
client.OnRequestWearables += this.InformClientOfNeighbours;
client.OnAddPrim += this.AddNewPrim;
client.OnUpdatePrimPosition += this.UpdatePrimPosition;