renaming the increasingly ill-named ChatFromViewerArgs to OSChatMessage

0.6.0-stable
Dr Scofield 2008-07-25 10:05:50 +00:00
parent 50bc51b642
commit 24e15088ea
10 changed files with 35 additions and 31 deletions

View File

@ -12,7 +12,7 @@ namespace OpenSim.Framework
/// <summary>
/// ChatFromViewer Arguments
/// </summary>
public class ChatFromViewerArgs : EventArgs, IEventArgs
public class OSChatMessage : EventArgs, IEventArgs
{
protected int m_channel;
protected string m_from;
@ -25,7 +25,7 @@ namespace OpenSim.Framework
protected ChatTypeEnum m_type;
protected LLUUID m_fromID;
public ChatFromViewerArgs()
public OSChatMessage()
{
m_position = new LLVector3();
}

View File

@ -37,7 +37,7 @@ namespace OpenSim.Framework
public delegate void ViewerEffectEventHandler(IClientAPI sender, List<ViewerEffectEventHandlerArg> args);
public delegate void ChatFromViewer(Object sender, ChatFromViewerArgs e);
public delegate void ChatMessage(Object sender, OSChatMessage e);
public delegate void TextureRequest(Object sender, TextureRequestArgs e);
@ -347,7 +347,7 @@ namespace OpenSim.Framework
// [Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")]
event ImprovedInstantMessage OnInstantMessage;
// [Obsolete("LLClientView Specific - Replace with more bare-bones arguments. Rename OnChat.")]
event ChatFromViewer OnChatFromViewer;
event ChatMessage OnChatFromViewer;
// [Obsolete("LLClientView Specific - Replace with more bare-bones arguments.")]
event TextureRequest OnRequestTexture;
// [Obsolete("LLClientView Specific - Remove bitbuckets. Adam, can you be more specific here.. as I don't see any bit buckets.")]

View File

@ -122,8 +122,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private RequestAvatarProperties handlerRequestAvatarProperties = null; //OnRequestAvatarProperties;
private UpdateAvatarProperties handlerUpdateAvatarProperties = null; // OnUpdateAvatarProperties;
private ChatFromViewer handlerChatFromViewer = null; //OnChatFromViewer;
private ChatFromViewer handlerChatFromViewer2 = null; //OnChatFromViewer;
private ChatMessage handlerChatFromViewer = null; //OnChatFromViewer;
private ChatMessage handlerChatFromViewer2 = null; //OnChatFromViewer;
private ImprovedInstantMessage handlerInstantMessage = null; //OnInstantMessage;
private FriendActionDelegate handlerApproveFriendRequest = null; //OnApproveFriendRequest;
private FriendshipTermination handlerTerminateFriendship = null; //OnTerminateFriendship;
@ -770,7 +770,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event Action<IClientAPI> OnConnectionClosed;
public event ViewerEffectEventHandler OnViewerEffect;
public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer;
public event ChatMessage OnChatFromViewer;
public event TextureRequest OnRequestTexture;
public event RezObject OnRezObject;
public event GenericCall4 OnDeRezObject;
@ -3859,7 +3859,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (OnChatFromViewer != null)
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
OSChatMessage args = new OSChatMessage();
args.Channel = channel;
args.From = fromName;
args.Message = Helpers.FieldToUTF8String(message);
@ -3898,7 +3898,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
byte[] msg = rdialog.Data.ButtonLabel;
if (OnChatFromViewer != null)
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
OSChatMessage args = new OSChatMessage();
args.Channel = ch;
args.From = String.Empty;
args.Message = Helpers.FieldToUTF8String(msg);

View File

@ -105,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
#endregion
#region ISimChat Members
public void SimBroadcast(Object sender, ChatFromViewerArgs c)
public void SimBroadcast(Object sender, OSChatMessage c)
{
// We only want to relay stuff on channel 0 and on the debug channel
if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return;
@ -140,7 +140,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
});
}
public void SimChat(Object sender, ChatFromViewerArgs e)
public void SimChat(Object sender, OSChatMessage e)
{
// early return if not on public or debug channel
if (e.Channel != 0 && e.Channel != DEBUG_CHANNEL) return;

View File

@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
#region ISimChat Members
public void SimChat(Object sender, ChatFromViewerArgs e)
public void SimChat(Object sender, OSChatMessage e)
{
// We only want to relay stuff on channel 0
if (e.Channel != 0) return;
@ -631,7 +631,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
// Any chat ???
if (data != null)
{
ChatFromViewerArgs c = new ChatFromViewerArgs();
OSChatMessage c = new OSChatMessage();
c.Message = data["msg"];
c.Type = ChatTypeEnum.Say;
c.Channel = 0;
@ -679,7 +679,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat
{
try
{
ChatFromViewerArgs c = new ChatFromViewerArgs();
OSChatMessage c = new OSChatMessage();
c.From = sender;
c.Message = String.Format(format, args);
c.Type = ChatTypeEnum.Say;

View File

@ -322,7 +322,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.WorldComm
*
* *****************************************************************/
private void DeliverClientMessage(Object sender, ChatFromViewerArgs e)
private void DeliverClientMessage(Object sender, OSChatMessage e)
{
DeliverMessage(e.Type,
e.Channel,

View File

@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
private void SendOnChatFromViewer(string message, ChatTypeEnum chatType)
{
ChatFromViewerArgs chatFromViewer = new ChatFromViewerArgs();
OSChatMessage chatFromViewer = new OSChatMessage();
chatFromViewer.Channel = 0;
chatFromViewer.From = Name;
chatFromViewer.Message = message;
@ -155,7 +155,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
public event Action<IClientAPI> OnConnectionClosed;
public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer;
public event ChatMessage OnChatFromViewer;
public event TextureRequest OnRequestTexture;
public event RezObject OnRezObject;
public event ModifyTerrain OnModifyTerrain;

View File

@ -235,13 +235,13 @@ namespace OpenSim.Region.Environment.Scenes
/// from world comes in (chat from viewer is available via
/// client.OnChatFromViewer).
/// </summary>
public delegate void ChatFromWorldEvent(Object sender, ChatFromViewerArgs chat);
public delegate void ChatFromWorldEvent(Object sender, OSChatMessage chat);
public event ChatFromWorldEvent OnChatFromWorld;
/// <summary>
/// ChatBroadcastEvent is called via Scene when a broadcast chat message
/// from world comes in (chat from viewer is available via client.OnChatFromViewer).
/// </summary>
public delegate void ChatBroadcastEvent(Object sender, ChatFromViewerArgs chat);
public delegate void ChatBroadcastEvent(Object sender, OSChatMessage chat);
public event ChatBroadcastEvent OnChatBroadcast;
public delegate float SunLindenHour();
@ -760,7 +760,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void TriggerOnChatFromWorld(Object sender, ChatFromViewerArgs chat)
public void TriggerOnChatFromWorld(Object sender, OSChatMessage chat)
{
handlerChatFromWorld = OnChatFromWorld;
if (handlerChatFromWorld != null)
@ -769,7 +769,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void TriggerOnChatBroadcast(Object sender, ChatFromViewerArgs chat)
public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat)
{
handlerChatBroadcast = OnChatBroadcast;
if (handlerChatBroadcast != null)

View File

@ -37,7 +37,7 @@ namespace OpenSim.Region.Environment.Scenes
protected void SimChat(byte[] message, ChatTypeEnum type, int channel, LLVector3 fromPos, string fromName,
LLUUID fromID, bool fromAgent, bool broadcast)
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
OSChatMessage args = new OSChatMessage();
args.Message = Helpers.FieldToUTF8String(message);
args.Channel = channel;
@ -113,7 +113,8 @@ namespace OpenSim.Region.Environment.Scenes
((SceneObjectGroup) ent).GetProperties(remoteClient);
((SceneObjectGroup) ent).IsSelected = true;
// A prim is only tainted if it's allowed to be edited by the person clicking it.
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) || ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|| ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
{
EventManager.TriggerParcelPrimCountTainted();
}
@ -156,7 +157,8 @@ namespace OpenSim.Region.Environment.Scenes
{
((SceneObjectGroup) ent).IsSelected = false;
((SceneObjectGroup)ent).ScheduleGroupForFullUpdate();
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId) || ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
if (ExternalChecks.ExternalChecksCanEditObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId)
|| ExternalChecks.ExternalChecksCanMoveObject(((SceneObjectGroup)ent).UUID, remoteClient.AgentId))
{
EventManager.TriggerParcelPrimCountTainted();
break;
@ -166,10 +168,11 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount, int transactiontype, string description)
public virtual void ProcessMoneyTransferRequest(LLUUID source, LLUUID destination, int amount,
int transactiontype, string description)
{
EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(
source, destination, amount, transactiontype, description);
EventManager.MoneyTransferArgs args = new EventManager.MoneyTransferArgs(source, destination, amount,
transactiontype, description);
EventManager.TriggerMoneyTransfer(this, args);
}
@ -177,8 +180,9 @@ namespace OpenSim.Region.Environment.Scenes
public virtual void ProcessParcelBuy(LLUUID agentId, LLUUID groupId, bool final, bool groupOwned,
bool removeContribution, int parcelLocalID, int parcelArea, int parcelPrice, bool authenticated)
{
EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(
agentId, groupId, final, groupOwned, removeContribution, parcelLocalID, parcelArea, parcelPrice, authenticated);
EventManager.LandBuyArgs args = new EventManager.LandBuyArgs(agentId, groupId, final, groupOwned,
removeContribution, parcelLocalID, parcelArea,
parcelPrice, authenticated);
// First, allow all validators a stab at it
m_eventManager.TriggerValidateLandBuy(this, args);

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event Action<IClientAPI> OnConnectionClosed;
public event ImprovedInstantMessage OnInstantMessage;
public event ChatFromViewer OnChatFromViewer;
public event ChatMessage OnChatFromViewer;
public event TextureRequest OnRequestTexture;
public event RezObject OnRezObject;
public event ModifyTerrain OnModifyTerrain;
@ -668,7 +668,7 @@ namespace OpenSim.Region.Examples.SimpleModule
{
if (OnChatFromViewer != null)
{
ChatFromViewerArgs args = new ChatFromViewerArgs();
OSChatMessage args = new OSChatMessage();
args.Message = "Hey You! Get out of my Home. This is my Region";
args.Channel = 0;
args.From = FirstName + " " + LastName;