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;
        }
示例#3
0
文件: TPTabWindow.cs 项目: SObS/SLeek
        public TPTabWindow(SleekInstance instance, InstantMessageEventArgs e)
        {
            InitializeComponent();

            this.instance = instance;
            netcom = this.instance.Netcom;
            client = this.instance.Client;
            ProcessEventArgs(e);
        }
示例#4
0
文件: TPTabWindow.cs 项目: SObS/SLeek
        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);
        }
示例#5
0
文件: TabsConsole.cs 项目: SObS/SLeek
        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;
        }
示例#6
0
 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);
                }
            }
        }
示例#9
0
        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);
        }
示例#11
0
        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);
                }
            }
        }
示例#12
0
文件: SLNetCom.cs 项目: SObS/SLeek
        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);
        }
示例#13
0
文件: MainForm.cs 项目: SObS/SLeek
        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);
        }
示例#14
0
文件: TabsConsole.cs 项目: SObS/SLeek
        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();
        }
示例#15
0
文件: TabsConsole.cs 项目: SObS/SLeek
        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);
 }
示例#19
0
文件: TabsConsole.cs 项目: SObS/SLeek
        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;
            }
        }
示例#20
0
文件: TabsConsole.cs 项目: SObS/SLeek
 public IMTabWindow AddIMTab(InstantMessageEventArgs e)
 {
     IMTabWindow imTab = AddIMTab(e.IM.FromAgentID, e.IM.IMSessionID, e.IM.FromAgentName);
     imTab.TextManager.ProcessIM(e);
     return imTab;
 }