예제 #1
0
        public bool PHPSessionCorrect()
        {
            DataOfPlayer dataOfPlayer = new DataOfPlayer();
            var          d            = dataOfPlayer.GetDataOfPlayer("michalk001");

            if (d != null)
            {
                return(true);
            }
            return(false);
        }
예제 #2
0
        public void CreatDataPlayers()
        {
            Thread thread = new Thread(() =>
            {
                foreach (var item in playersName.Skip(playersName.Count() / 2))
                {
                    DataOfPlayer dataOfPlayer = new DataOfPlayer();
                    var d = dataOfPlayer.GetDataOfPlayer(item);
                    if (d != null)
                    {
                        playersData.Add(d);
                    }
                    Thread.Sleep(200);
                }
            });
            Thread thread2 = new Thread(() =>
            {
                foreach (var item in playersName.Take((playersName.Count() / 2)))
                {
                    DataOfPlayer dataOfPlayer = new DataOfPlayer();
                    var d = dataOfPlayer.GetDataOfPlayer(item);
                    if (d != null)
                    {
                        playersData.Add(d);
                    }
                    Thread.Sleep(200);
                }
            });

            thread.Start();
            thread2.Start();

            while (!(thread.ThreadState == ThreadState.Stopped) || !(thread2.ThreadState == ThreadState.Stopped))
            {
                ;
            }
        }