Example #1
0
    void ProxyManager_OnLoginResponse(object request, GridProxy.Direction direction)
    {
        Application.Invoke((xsender, xe) =>
        {
            string loginType;

            if (request is Nwc.XmlRpc.XmlRpcRequest)
            {
                loginType = "Login Request";
            }
            else
            {
                loginType = "Login Response";
            }

            if (UDPFilterItems.ContainsKey(loginType) && UDPFilterItems[loginType].Enabled)
            {
                PacketCounter++;

                SessionLogin sessionLogin = new SessionLogin(request, direction, cbLoginURL.ActiveText, request.GetType().Name + " " + loginType);

                sessionLogin.Columns = new string[] { PacketCounter.ToString(), sessionLogin.TimeStamp.ToString("HH:mm:ss.fff"),
                        sessionLogin.Protocol, sessionLogin.Name, sessionLogin.Length.ToString(), sessionLogin.Host, sessionLogin.ContentType };

                messages.AddSession(sessionLogin);
            }

        });
    }
        public static Session FromOSD(OSDMap map)
        {
            Session session;

            switch (map["SessionType"].AsString())
            {
                case "SessionCaps":
                    session = new SessionCaps();
                    break;
                case "SessionEvent":
                    session = new SessionEvent();
                    break;
                case "SessionLogin":
                    session = new SessionLogin();
                    break;
                case "SessionPacket":
                    session = new SessionPacket();
                    break;
                default:
                    return null;
            }

            session.Deserialize(map);
            return session;
        }