Exemple #1
0
        private KwsAnpEventStatus HandleTriggerKwsEvent(AnpMsg evt)
        {
            UInt64 date    = evt.Elements[1].UInt64;
            UInt32 userID  = evt.Elements[3].UInt32;
            String subject = evt.Elements[4].String;

            AnpMsg etEvt = Kws.MakePermEAnpEvent(EAnpEvt.PbKwsRequested, date, userID);

            etEvt.AddString(subject);
            Kws.PostPermEAnpEvent(etEvt);

            return(KwsAnpEventStatus.Processed);
        }
Exemple #2
0
        public override KwsAnpEventStatus HandleAnpEvent(AnpMsg evt)
        {
            if (evt.Type == KAnp.KANP_EVT_VNC_START)
            {
                UInt64 date      = evt.Elements[1].UInt64;
                UInt32 userID    = evt.Elements[2].UInt32;
                UInt64 sessionID = evt.Elements[3].UInt64;
                String subject   = evt.Elements[4].String;

                AnpMsg etEvt = Kws.MakePermEAnpEvent(EAnpEvt.VncSessionStarted, date, userID);
                etEvt.AddUInt64(sessionID);
                etEvt.AddString(subject);
                Kws.PostPermEAnpEvent(etEvt);

                return(KwsAnpEventStatus.Processed);
            }

            else if (evt.Type == KAnp.KANP_EVT_VNC_END)
            {
                UInt64 date      = evt.Elements[1].UInt64;
                UInt32 userID    = evt.Elements[2].UInt32;
                UInt64 sessionID = evt.Elements[3].UInt64;

                AnpMsg etEvt = Kws.MakePermEAnpEvent(EAnpEvt.VncSessionEnded, date, userID);
                etEvt.AddUInt64(sessionID);
                Kws.PostPermEAnpEvent(etEvt);

                // If we have a local session, notify it about the event.
                if (LocalSession != null)
                {
                    EAnpException ex = null;
                    if (evt.Minor >= 5)
                    {
                        ex = EAnpException.FromKAnpFailure(evt, 4);
                    }
                    else
                    {
                        ex = new EAnpExGeneric("session closed");
                    }
                    LocalSession.OnSessionEndEventReceived(sessionID, ex);
                }

                return(KwsAnpEventStatus.Processed);
            }

            return(KwsAnpEventStatus.Unprocessed);
        }
Exemple #3
0
        public override KwsAnpEventStatus HandleAnpEvent(AnpMsg evt)
        {
            // Incoming chat message.
            if (evt.Type == KAnp.KANP_EVT_CHAT_MSG)
            {
                UInt64 date    = evt.Elements[1].UInt64;
                UInt32 userID  = evt.Elements[3].UInt32;
                String userMsg = evt.Elements[4].String;

                AnpMsg etEvt = Kws.MakePermEAnpEvent(EAnpEvt.ChatMsgReceived, date, userID);
                etEvt.AddString(userMsg);
                Kws.PostPermEAnpEvent(etEvt);

                return(KwsAnpEventStatus.Processed);
            }

            return(KwsAnpEventStatus.Unprocessed);
        }