Пример #1
0
    public static void Main(string[] args)
    {
        libslAssembly = Assembly.Load("libsecondlife");
        if (libslAssembly == null) throw new Exception("Assembly load exception");

        ProxyConfig proxyConfig = new ProxyConfig("Analyst V2", "Austin Jennings / Andrew Ortman", args);
        proxy = new Proxy(proxyConfig);

        // build the table of /command delegates
        InitializeCommandDelegates();

        // add delegates for login
        proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
        proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));

        // add a delegate for outgoing chat
        proxy.AddDelegate(PacketType.ChatFromViewer, Direction.Outgoing, new PacketDelegate(ChatFromViewerOut));

        //  handle command line arguments
        foreach (string arg in args)
            if (arg == "--log-all")
                LogAll();
            else if (arg == "--log-login")
                logLogin = true;

        // start the proxy
        proxy.Start();
    }
Пример #2
0
    public static void Main(string[] args)
    {
        // configure the proxy
        client = new SecondLife("../data/keywords.txt", "../data/message_template.msg");
        protocolManager = client.Protocol;
        ProxyConfig proxyConfig = new ProxyConfig("Analyst", "*****@*****.**", protocolManager, args);
        proxy = new Proxy(proxyConfig);

        // build the table of /command delegates
        InitializeCommandDelegates();

        // add delegates for login
        proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
        proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));

        // add a delegate for outgoing chat
        proxy.AddDelegate("ChatFromViewer", Direction.Incoming, new PacketDelegate(ChatFromViewerIn));
        proxy.AddDelegate("ChatFromViewer", Direction.Outgoing, new PacketDelegate(ChatFromViewerOut));

        //  handle command line arguments
        foreach (string arg in args)
            if (arg == "--log-all")
                LogAll();
            else if (arg == "--log-login")
                logLogin = true;

        // start the proxy
        proxy.Start();
    }
        public frmSecondGlance()
        {
            InitializeComponent();

            PacketType[] types = (PacketType[])Enum.GetValues(typeof(PacketType));

            // Fill up the "To Log" combo box with options
            foreach (PacketType type in types)
            {
                if (type != PacketType.Default) cboToLog.Items.Add(type);
            }

            // Set the default selection to the first entry
            cboToLog.SelectedIndex = 0;

            // Setup the proxy
            ProxyConfig proxyConfig = new ProxyConfig("Second Glance", "John Hurliman <*****@*****.**>",
                new string[0]);
            Proxy = new Proxy(proxyConfig);

            Proxy.Start();

            // Start the timer that moves packets from the queue and displays them
            DisplayTimer.Elapsed += new System.Timers.ElapsedEventHandler(DisplayTimer_Elapsed);
            DisplayTimer.Start();
        }
Пример #4
0
	public static void Main(string[] args) {
		// configure the proxy
		ProxyConfig proxyConfig = new ProxyConfig("ChatConsole V2", "Austin Jennings / Andrew Ortman", args);
		proxy = new Proxy(proxyConfig);

		// set a delegate for when the client logs in
		proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(Login));

		// add a delegate for incoming chat
		proxy.AddDelegate(PacketType.ChatFromSimulator, Direction.Incoming, new PacketDelegate(ChatFromSimulator));

		// start the proxy
		proxy.Start();
	}
    public static void Main(string[] args)
    {
        // configure the proxy
        client = new SecondLife("../data/keywords.txt", "../data/message_template.msg");
        protocolManager = client.Protocol;
        ProxyConfig proxyConfig = new ProxyConfig("ChatConsole", "*****@*****.**", protocolManager, args);
        proxy = new Proxy(proxyConfig);

        // set a delegate for when the client logs in
        proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(Login));

        // add a delegate for incoming chat
        proxy.AddDelegate("ChatFromSimulator", Direction.Incoming, new PacketDelegate(ChatFromSimulator));

        // start the proxy
        proxy.Start();
    }
Пример #6
0
        public ProxyFrame(string[] args)
        {
            bool externalPlugin = false;
            this.args = args;

            ProxyConfig proxyConfig = new ProxyConfig("SLProxy", "Austin Jennings / Andrew Ortman", args);
            proxy = new Proxy(proxyConfig);

            // add delegates for login
            proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest));
            proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse));

            // add a delegate for outgoing chat
            proxy.AddDelegate(PacketType.ChatFromViewer, Direction.Outgoing, new PacketDelegate(ChatFromViewerOut));

            //  handle command line arguments
            foreach (string arg in args)
                if (arg == "--log-login")
                    logLogin = true;
                else if (arg.Substring(0, 2) == "--")
                {
                    int ipos = arg.IndexOf("=");
                    if (ipos != -1)
                    {
                        string sw = arg.Substring(0, ipos);
                        string val = arg.Substring(ipos + 1);
                        Console.WriteLine("arg '" + sw + "' val '" + val + "'");
                        if (sw == "--load")
                        {
                            externalPlugin = true;
                            LoadPlugin(val);
                        }
                    }
                }

            commandDelegates["/load"] = new CommandDelegate(CmdLoad);

            if (!externalPlugin)
            {
                ProxyPlugin analyst = new Analyst(this);
                analyst.Init();
            }
        }
Пример #7
0
        /*
         * Proxy Management
         */

        // Proxy: construct a proxy server with the given configuration
        public Proxy(ProxyConfig proxyConfig)
        {
            this.proxyConfig = proxyConfig;

            InitializeLoginProxy();
            InitializeSimProxy();
            InitializeCaps();
        }
Пример #8
0
        static void Main(string[] args)
        {
            usbcontrol.InitUSBHandle();
            usbcontrol.SetPower(0);
            // configure the proxy
            protocolManager = new ProtocolManager("keywords.txt", "protocol.txt");
            ProxyConfig proxyConfig = new ProxyConfig("ChatConsole", "*****@*****.**", protocolManager, args);
            proxy = new SLProxy.Proxy(proxyConfig);

            // set a delegate for when the client logs in
            proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(Login));

            // add a delegate for incoming chat
            proxy.AddDelegate("ChatFromSimulator", Direction.Incoming, new PacketDelegate(ChatFromSimulator));

            // start the proxy
            proxy.Start();
        }
Пример #9
0
 // SimProxy: construct a proxy for a single simulator
 public SimProxy(ProxyConfig proxyConfig, IPEndPoint simEndPoint, Proxy proxy)
 {
     this.proxyConfig = proxyConfig;
     remoteEndPoint = new IPEndPoint(simEndPoint.Address, simEndPoint.Port);
     this.proxy = proxy;
     socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
     socket.Bind(new IPEndPoint(proxyConfig.clientFacingAddress, 0));
     proxy.AddHandler(remoteEndPoint, this);
     Reset();
 }