Init() 공개 메소드

public Init ( ) : void
리턴 void
예제 #1
0
파일: GridProxyMain.cs 프로젝트: zadark/par
 public static void Main(string[] args)
 {
     ProxyFrame p = new ProxyFrame(args);
     ProxyPlugin analyst = new Analyst(p);
     analyst.Init();
     p.proxy.Start();
 }
예제 #2
0
    public static void Main(string[] args)
    {
        ProxyFrame  p       = new ProxyFrame(args);
        ProxyPlugin analyst = new Analyst(p);

        analyst.Init();
        p.proxy.Start();
    }
예제 #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();
            }
        }