示例#1
0
        private void start()
        {
            clearup();
            DB.Print("Starting root", Levels.SCRIPTS);
            try {
                proxy.start(host, world);
                if (proxy.Shutdown)
                {
                    shutdownProxy("Shutdown flagged after starting root");
                }
                else
                {
                    if (chatQ != null)
                    {
                        chatQ.stop();
                        chatQ = new AsynchQueue <Pair <IEntity, String> >();
                    }
                    if (touchQ != null)
                    {
                        touchQ.stop();
                        touchQ = new AsynchQueue <Pair <UUID, TouchEventArgs> >();
                    }
                    if (touchAddQ != null)
                    {
                        touchAddQ.stop();
                        touchAddQ = new AsynchQueue <UUID>();
                    }

                    chatQ     = new AsynchQueue <Pair <IEntity, String> >();
                    touchQ    = new AsynchQueue <Pair <UUID, TouchEventArgs> >();
                    touchAddQ = new AsynchQueue <UUID>();

                    chatQ.start(proxy.chat, "Chat Event Process", Levels.SCRIPTS);
                    touchQ.start(proxy.touched, "Touch Event Process", Levels.SCRIPTS);
                    touchAddQ.start(addTouchListener, "Touch Add Process", Levels.SCRIPTS);

                    Thread t = new Thread(checkThread);
                    t.Name = "Entry point check shutdown thread";
                    t.Start();
                    DB.Print("Root started", Levels.SCRIPTS);
                }
            } catch (Exception e) {
                DB.Exception(e, "Problem starting up root", Levels.SCRIPTS);
                shutdownProxy("Exception starting up root");
            }
        }
示例#2
0
        private void start()
        {
            clearup();
            DB.Print("Starting root", Levels.SCRIPTS);
            try {
                proxy.start(host, world);
                if (proxy.Shutdown)
                    shutdownProxy("Shutdown flagged after starting root");
                else {
                    if (chatQ != null) {
                        chatQ.stop();
                        chatQ = new AsynchQueue<Pair<IEntity, String>>();
                    }
                    if (touchQ != null) {
                        touchQ.stop();
                        touchQ = new AsynchQueue<Pair<UUID, TouchEventArgs>>();
                    }
                    if (touchAddQ != null) {
                        touchAddQ.stop();
                        touchAddQ = new AsynchQueue<UUID>();
                    }

                    chatQ = new AsynchQueue<Pair<IEntity, String>>();
                    touchQ = new AsynchQueue<Pair<UUID, TouchEventArgs>>();
                    touchAddQ = new AsynchQueue<UUID>();

                    chatQ.start(proxy.chat, "Chat Event Process", Levels.SCRIPTS);
                    touchQ.start(proxy.touched, "Touch Event Process", Levels.SCRIPTS);
                    touchAddQ.start(addTouchListener, "Touch Add Process", Levels.SCRIPTS);

                    Thread t = new Thread(checkThread);
                    t.Name = "Entry point check shutdown thread";
                    t.Start();
                    DB.Print("Root started", Levels.SCRIPTS);
                }
            } catch (Exception e) {
                DB.Exception(e, "Problem starting up root", Levels.SCRIPTS);
                shutdownProxy("Exception starting up root");
            }
        }