public void Setup()
 {
     var iniDoc = new IniDocument();
     var configSource = new IniConfigSource(iniDoc);
     configSource.AddConfig("InWorldz.Phlox");
     world = SceneHelper.CreateScene(9000, 1000, 1000);
     engine = new MockScriptEngine(world, configSource);
 }
Example #2
0
        public void Setup()
        {
            var iniDoc       = new IniDocument();
            var configSource = new IniConfigSource(iniDoc);

            configSource.AddConfig("InWorldz.Phlox");
            world = SceneHelper.CreateScene(9000, 1000, 1000);
            var engine = new MockScriptEngine(world, configSource);

            lslSystemApi = new LSLSystemAPI(engine, null, 0, UUID.Zero);
        }
Example #3
0
        public void Setup()
        {
            mockScene = SceneHelper.CreateScene(REGION_PORT_BASE, 1000, 1000);
            mockScene.RegisterModuleInterface <IEventQueue>(new InWorldz.Testing.MockEventQueue());

            neighbor1left = SceneHelper.CreateScene(REGION_PORT_BASE + 1, 999, 1000);
            neighbor2left = SceneHelper.CreateScene(REGION_PORT_BASE + 2, 998, 1000);
            neighbor3left = SceneHelper.CreateScene(REGION_PORT_BASE + 3, 997, 1000);

            presence = new ScenePresence(mockScene, 256f, new MockClientAPI());

            neighbor1left.CommsManager.HttpServer.AddHTTPHandler("/agent/", HandleAgentStuff);
            neighbor1left.CommsManager.HttpServer.AddHTTPHandler("/agent2/", HandleAgentStuff);
            neighbor2left.CommsManager.HttpServer.AddHTTPHandler("/agent/", HandleAgentStuff);
            neighbor2left.CommsManager.HttpServer.AddHTTPHandler("/agent2/", HandleAgentStuff);
        }
        public override void OnNavigatedTo(FirstFloor.ModernUI.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.Parameter is Tuple <string, string, int> parameter)
            {
                // 动态生成场景
                _scene = SceneHelper.CreateScene(parameter.Item1, parameter.Item2, parameter.Item3);
            }
            if (_scene == null)
            {
                ModernDialog.ShowMessage("创建场景失败,请确认配置正确.", "错误", MessageBoxButton.OK);
                ((ScenePageViewModel)DataContext).GoBackCommand.Execute(null);
                return;
            }

            Root.Children.Insert(0, _scene);
            _scene.HorizontalAlignment = HorizontalAlignment.Stretch;
            _scene.VerticalAlignment   = VerticalAlignment.Stretch;
            _scene.Exit += _scene_Exit;

            // 将Root的DataContext设置为游戏场景
            Root.DataContext = _scene;

            // 准备开始游戏
            _scene.Show();

            if (_simulationData)
            {
                MouseRightButtonDown += ScenePage_MouseRightButtonDown;
            }

            if (DataProducerHelper.Current.DataProducer != null)
            {
                DataProducerHelper.Current.DataProducer.DataReceived += DataProducer_DataReceived;
                //  DataProducerHelper.Current.DataProducer.Open();
            }
        }