Пример #1
0
        private void btnQueryProva_Click(object sender, RoutedEventArgs e)
        {
            //Model.Game wvGame = null;
            //Model.Room wvRoom = wvGame.ActualRoom;

            db = new Helpers.DBHelper();
            try
            {
                /*
                //db.GetItemFromClues(Model.E_Shape.CORTO, Model.E_Gradiation.CHIARO, Model.E_Texture.SCOZZESE, Model.E_ItemKind.Cappello);
                //txtDisplay.Text = db.GetItemByShape(Model.E_Shape.SHORT, Model.E_ItemKind.t_shirt).ToString();
                //txtDisplay.Text = db.GetItemByGradation(Model.E_Gradiation.LIGHT, Model.E_ItemKind.t_shirt).Code.ToString();
                //txtDisplay.Text = db.GetItemFromClues(new Model.Clue(true, Model.E_Gradiation.DARK, Model.E_Shape.LONG, Model.E_Color.BROWN, Model.E_Texture._NULL), Model.E_ItemKind.hat).Code.ToString();
                //txtDisplay.Text = db.GetGameForProf().ToString();
                string wvPlayerID = "15-01-2016-10-50-42_alberto";
                //string wvPlayerName = "alberto";
                //wvPlayerID += ("_" + wvPlayerName);
                string wvPath = Helpers.ResourcesHelper.SavesDirectory + "\\" + wvPlayerID;
                Model.Game wvGame = Helpers.SerializerHelper.Deserialize(wvPath);
                txtDisplay.Text = wvGame.PlayerID;
                txtDisplay.AppendText("\r\n" + wvGame.ActualRoomIndex);
                txtDisplay.AppendText("\r\n" + wvGame.GameStarted);
                txtDisplay.AppendText("\r\n" + wvGame.PlayerName);
                txtDisplay.AppendText("\r\n" + wvGame.Score);
                */
                db = new Helpers.DBHelper();
                txtDisplay.Text = db.GetShape("190114771213").ToString();
            }
            catch (Exception ex)
            {
                txtDisplay.Text = ex.Message;
            }
        }
Пример #2
0
        public DebugWindow(Controller.GameController GameController)
        {
            InitializeComponent();
            db = new Helpers.DBHelper();
            attGameController = GameController;

            attks = KinectSensor.GetDefault();
            attks.Open();
            attBodyFrameReader = attks.BodyFrameSource.OpenReader();
            attBodyFrameReader.FrameArrived += this.Reader_BodyFrameArrived;
        }
Пример #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            var log = loggerFactory.CreateLogger("rud-log:");

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            app.Use(async(context, next) =>
            {
                var timer = Stopwatch.StartNew();
                log.LogInformation("-------- Task Begin --------");
                await next();
                log.LogInformation($"time..{timer.ElapsedMilliseconds.ToString()}ms");
            });

            app.Map("/rud", action => action.Run(async context =>
            {
                Helpers.DBHelper dBHelper = new Helpers.DBHelper(Configuration.GetConnectionString("DefaultConnection"));
                dBHelper.CreateDBObjects(Helpers.DBHelper.DbProviders.MySql);


                var data          = dBHelper.ExecuteReader("SELECT * FROM sakila.film;");
                string[] strArray = new string[data.FieldCount];
                for (int i = 0; i < data.FieldCount; i++)
                {
                    string str = data.GetName(i);//data["title"].ToString();
                    //await context.Response.WriteAsync($"title : {str}\n");
                    strArray[i] = str;
                }
                data.Close();
                var data2 = dBHelper.ExecuteReader("SELECT * FROM sakila.film;");
                while (data2.Read())
                {
                    foreach (var item in strArray)
                    {
                        string str2 = data2[item].ToString();
                        await context.Response.WriteAsync($"{item} : {str2}\n");
                    }
                }


                //var data2 = dBHelper.ExecuteScaler("select count(*) from sakila.film");
                //await context.Response.WriteAsync(data2.ToString());
            }));
            app.UseMvc();
            app.UseStaticFiles();
            app.Run(async(context) =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        }
Пример #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="KinectSensor">The <see cref="Microsoft.Kinect.KinectSensor"/> associated to the game</param>
        public GameController(Microsoft.Kinect.KinectSensor KinectSensor)
        {
            attRandom = new Random(1);
            attKinectInterrogator = new KinectInterrogator( KinectSensor, REFRESH_TIME );

            attDataBase = new Helpers.DBHelper();

            attResumeGame = new ResumeGame();
            attUnloadGame = new UnloadGame();
            attUpdateInventory = new UpdateInventory();
            attNotifyItemException = new NotifyItemException();

            attKinectInterrogator.PlayerEnterKinectSensorEvent = HandlePlayerEnterKinectSensor;
            attKinectInterrogator.PlayerLeaveKinectSensorEvent = HandlePlayerLeaveKinectSensor;
            attKinectInterrogator.BarCodeRecognizedEvent = HandleBarCodeRecognized;
        }
Пример #5
0
 private void btnTestDB_Click(object sender, RoutedEventArgs e)
 {
     db = new Helpers.DBHelper();
     txtDisplay.Text = db.TestConnection();
 }