Пример #1
0
        private void Eval_Private(TCPPacketReader packet)
        {
            if (!Settings.GetReg <bool>("can_receive_pms", true))
            {
                return;
            }

            String name = packet.ReadString(this.crypto);
            String text = packet.ReadString(this.crypto);
            User   u    = this.users.Find(x => x.Name == name);

            if (u == null)
            {
                return;
            }

            AresFont font = null;

            if (u.Font != null)
            {
                font = u.Font;
            }

            if (u.Ignored)
            {
                return;
            }

            text = ScriptEvents.OnPmReceiving(this, u, text);

            if (!String.IsNullOrEmpty(text))
            {
                this.Panel.PMTextReceived(this, u, name, text, font, PMTextReceivedType.Text);
                this.Panel.CheckUnreadStatus();
                ScriptEvents.OnPmReceived(this, u, text);
            }
        }
Пример #2
0
        private void Eval_cb0t_pm_msg(User user, byte[] data)
        {
            if (!Settings.GetReg <bool>("can_receive_pms", true))
            {
                return;
            }

            String name = user.Name;
            String text = Encoding.UTF8.GetString(PMCrypto.SoftDecrypt(this.MyName, data));
            User   u    = this.users.Find(x => x.Name == name);

            if (u == null)
            {
                return;
            }

            if (u.Ignored)
            {
                return;
            }

            AresFont font = null;

            if (u.Font != null)
            {
                font = u.Font;
            }

            text = ScriptEvents.OnPmReceiving(this, u, text);

            if (!String.IsNullOrEmpty(text))
            {
                this.Panel.PMTextReceived(this, u, name, text, font, PMTextReceivedType.Text);
                this.Panel.CheckUnreadStatus();
                ScriptEvents.OnPmReceived(this, u, text);
            }
        }