Init() public method

public Init ( ) : void
return void
Ejemplo n.º 1
0
 public static void Main(string[] args)
 {
     ProxyFrame p = new ProxyFrame(args);
     ProxyPlugin analyst = new Analyst(p);
     analyst.Init();
     p.proxy.Start();
 }
Ejemplo n.º 2
0
    public static void Main(string[] args)
    {
        ProxyFrame  p       = new ProxyFrame(args);
        ProxyPlugin analyst = new Analyst(p);

        analyst.Init();
        p.proxy.Start();
    }
Ejemplo n.º 3
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();
            }
        }