protected virtual void OnInstantMessageReceived(InstantMessageEventArgs e) { if (InstantMessageReceived != null) { InstantMessageReceived(this, e); } }
public IMTabWindow AddIMTab(LLUUID target, LLUUID session, string targetName, InstantMessageEventArgs e) { IMTabWindow imTab = this.AddIMTab(target, session, targetName); imTab.TextManager.PassIMEvent(e); return imTab; }
public TPTabWindow(SleekInstance instance, InstantMessageEventArgs e) { InitializeComponent(); this.instance = instance; netcom = this.instance.Netcom; client = this.instance.Client; ProcessEventArgs(e); }
private void ProcessEventArgs(InstantMessageEventArgs e) { targetName = e.IM.FromAgentName; targetUUID = e.IM.FromAgentID; lblSubheading.Text = "Received teleport offer from " + targetName + " with message:"; rtbOfferMessage.AppendText(e.IM.Message); }
public TPTabWindow AddTPTab(InstantMessageEventArgs e) { TPTabWindow tpTab = new TPTabWindow(instance, e); tpTab.Dock = DockStyle.Fill; toolStripContainer1.ContentPanel.Controls.Add(tpTab); SleekTab tab = AddTab(tpTab.TargetUUID.ToString(), "TP: " + tpTab.TargetName, tpTab); return tpTab; }
private void ProcessIncomingIM(InstantMessageEventArgs e) { PrintIM(DateTime.Now, e.IM.FromAgentName, e.IM.Message); }
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e) { if (!tbtnIM.Checked) { tbtnIM.ForeColor = Color.Red; } if (IMTabs.ContainsKey(e.FromAgentName)) { return; } this.AddIMTab(e.FromAgentId, e.Id, e.FromAgentName, e); }
private void InstantMessageIncoming(Packet packet, Simulator simulator) { if (packet.Layout.Name != "ImprovedInstantMessage") return; LLUUID FromAgentID = new LLUUID(); LLUUID ToAgentID = new LLUUID(); uint ParentEstateID = 0; LLUUID RegionID = new LLUUID(); LLVector3 Position = new LLVector3(); bool Offline = false; byte Dialog = 0; LLUUID ID = new LLUUID(); uint Timestamp = 0; DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0); //The Unix epoch! string FromAgentName = string.Empty; string Message = string.Empty; string BinaryBucket = string.Empty; ArrayList blocks = packet.Blocks(); foreach (Block block in blocks) { foreach (Field field in block.Fields) { switch (field.Layout.Name) { case "FromAgentID": FromAgentID = (LLUUID)field.Data; break; case "ToAgentID": ToAgentID = (LLUUID)field.Data; break; case "ParentEstateID": ParentEstateID = (uint)field.Data; break; case "RegionID": RegionID = (LLUUID)field.Data; break; case "Position": Position = (LLVector3)field.Data; break; case "Offline": Offline = ((byte)field.Data == 1 ? true : false); break; case "Dialog": Dialog = (byte)field.Data; break; case "ID": ID = (LLUUID)field.Data; break; case "Timestamp": Timestamp = (uint)field.Data; if (Timestamp == 0) //User is online dt = DateTime.Now; else //User is offline dt = dt.AddSeconds(Timestamp); break; case "FromAgentName": FromAgentName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty); break; case "Message": Message = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty); break; case "BinaryBucket": BinaryBucket = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty); break; } } InstantMessageEventArgs eventArgs = new InstantMessageEventArgs( FromAgentID, ToAgentID, ParentEstateID, RegionID, Position, Offline, Dialog, ID, dt, FromAgentName, Message, BinaryBucket); if (netcomSync != null) { object[] ea = new object[1]; ea[0] = eventArgs; netcomSync.Invoke(new OnInstantMessageRaise(OnInstantMessageReceived), ea); } else { OnInstantMessageReceived(eventArgs); } } }
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e) { if (e.IM.IMSessionID != sessionID) return; if (e.IM.Dialog == InstantMessageDialog.StartTyping || e.IM.Dialog == InstantMessageDialog.StopTyping) return; textBuffer.Add(e); ProcessIM(e); }
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e) { if (IMTabs.ContainsKey(e.FromAgentName)) return; this.AddIMTab(e.FromAgentId, e.Id, e.FromAgentName, e); }
private void InstantMessageIncoming(Packet packet, Simulator simulator) { if (packet.Layout.Name != "ImprovedInstantMessage") { return; } LLUUID FromAgentID = new LLUUID(); LLUUID ToAgentID = new LLUUID(); uint ParentEstateID = 0; LLUUID RegionID = new LLUUID(); LLVector3 Position = new LLVector3(); bool Offline = false; byte Dialog = 0; LLUUID ID = new LLUUID(); uint Timestamp = 0; DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0); //The Unix epoch! string FromAgentName = string.Empty; string Message = string.Empty; string BinaryBucket = string.Empty; ArrayList blocks = packet.Blocks(); foreach (Block block in blocks) { foreach (Field field in block.Fields) { switch (field.Layout.Name) { case "FromAgentID": FromAgentID = (LLUUID)field.Data; break; case "ToAgentID": ToAgentID = (LLUUID)field.Data; break; case "ParentEstateID": ParentEstateID = (uint)field.Data; break; case "RegionID": RegionID = (LLUUID)field.Data; break; case "Position": Position = (LLVector3)field.Data; break; case "Offline": Offline = ((byte)field.Data == 1 ? true : false); break; case "Dialog": Dialog = (byte)field.Data; break; case "ID": ID = (LLUUID)field.Data; break; case "Timestamp": Timestamp = (uint)field.Data; if (Timestamp == 0) //User is online { dt = DateTime.Now; } else //User is offline { dt = dt.AddSeconds(Timestamp); } break; case "FromAgentName": FromAgentName = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty); break; case "Message": Message = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty); break; case "BinaryBucket": BinaryBucket = System.Text.Encoding.UTF8.GetString((byte[])field.Data).Replace("\0", string.Empty); break; } } InstantMessageEventArgs eventArgs = new InstantMessageEventArgs( FromAgentID, ToAgentID, ParentEstateID, RegionID, Position, Offline, Dialog, ID, dt, FromAgentName, Message, BinaryBucket); if (netcomSync != null) { object[] ea = new object[1]; ea[0] = eventArgs; netcomSync.Invoke(new OnInstantMessageRaise(OnInstantMessageReceived), ea); } else { OnInstantMessageReceived(eventArgs); } } }
private void Self_OnInstantMessage(InstantMessage im, Simulator simulator) { InstantMessageEventArgs ea = new InstantMessageEventArgs(im, simulator); if (netcomSync != null) netcomSync.BeginInvoke(new OnInstantMessageRaise(OnInstantMessageReceived), new object[] { ea }); else OnInstantMessageReceived(ea); }
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e) { if (e.IM.Dialog == InstantMessageDialog.StartTyping || e.IM.Dialog == InstantMessageDialog.StopTyping) return; if (!this.Focused) FormFlash.Flash(this); }
private void HandleTP(InstantMessageEventArgs e) { string fromAgentID = e.IM.FromAgentID.ToString(); if (TabExists(fromAgentID)) tabs[fromAgentID].Close(); TPTabWindow tpTab = AddTPTab(e); tabs[tpTab.TargetUUID.ToString()].Highlight(); }
private void HandleIM(InstantMessageEventArgs e) { if (TabExists(e.IM.FromAgentName)) { SleekTab tab = tabs[e.IM.FromAgentName.ToLower()]; if (!tab.Selected) tab.Highlight(); return; } IMTabWindow imTab = AddIMTab(e); tabs[imTab.TargetName.ToLower()].Highlight(); }
protected virtual void OnInstantMessageReceived(InstantMessageEventArgs e) { if (InstantMessageReceived != null) InstantMessageReceived(this, e); }
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e) { this.PrintIM(e.Timestamp, e.FromAgentName, e.Message); }
public void PassIMEvent(InstantMessageEventArgs e) { this.netcom_InstantMessageReceived(netcom, e); }
private void netcom_InstantMessageReceived(object sender, InstantMessageEventArgs e) { switch (e.IM.Dialog) { case InstantMessageDialog.MessageFromAgent: case InstantMessageDialog.MessageFromObject: HandleIM(e); break; case InstantMessageDialog.StartTyping: if (TabExists(e.IM.FromAgentName)) { SleekTab tab = tabs[e.IM.FromAgentName.ToLower()]; if (!tab.Highlighted) tab.PartialHighlight(); } break; case InstantMessageDialog.StopTyping: if (TabExists(e.IM.FromAgentName)) { SleekTab tab = tabs[e.IM.FromAgentName.ToLower()]; if (!tab.Highlighted) tab.Unhighlight(); } break; case InstantMessageDialog.RequestTeleport: HandleTP(e); break; } }
public IMTabWindow AddIMTab(InstantMessageEventArgs e) { IMTabWindow imTab = AddIMTab(e.IM.FromAgentID, e.IM.IMSessionID, e.IM.FromAgentName); imTab.TextManager.ProcessIM(e); return imTab; }