示例#1
0
        private void NetworkProcess()
        {
            //network
            {
                //network thread
                Task.Run(() =>
                {
                    while (true)
                    {
                        NetProcess.start();
                        NetProcess.client.PacketRecvSync();
                        Thread.Sleep(1);
                    }
                });

                //network thread
                Task.Run(() =>
                {
                    DateTime checktime = DateTime.Now;

                    while (true)
                    {
                        NetProcess.Loop();
                        Thread.Sleep(1);
                    }
                });
            }
        }
示例#2
0
        public Lobby()
        {
            InitializeComponent();

            iIterstitia = DependencyService.Get <iAd_IterstitialView>();
            //      iIterstitia.ShowAd();

            mypicture.Source = null;

            Device.StartTimer(TimeSpan.FromMilliseconds(50), () =>
            {
                if (NoticeLabel.TranslationX > -(NoticeLabel.Width + (NoticeLabel.Width * 0.2)))
                {
                    NoticeLabel.TranslationX -= 5f;
                }
                else
                {
                    NoticeLabel.TranslationX = NoticeLabel.Width;
                }

                return(true);
            });


            //network thread
            Task.Run(() =>
            {
                while (true)
                {
                    NetProcess.start();
                    NetProcess.client.PacketRecvSync();
                }
            });

            //network thread
            Task.Run(() =>
            {
                DateTime checktime = DateTime.Now;

                while (true)
                {
                    NetProcess.Loop(this);
                }
            });

            UpdateLocalMenu();

            Navigation.PushModalAsync(new Loading() /*_MachPage*/);
        }
示例#3
0
        public App()
        {
            InitializeComponent();

            MainPage = new MainPage();

            //소켓 연결
            {
                NetProcess.start();

                Device.StartTimer(new TimeSpan(0, 0, 0, 0, 300), () =>
                {
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        NetProcess.Loop((MainPage)MainPage);
                    });
                    return(true); //if true repeat
                });
            }
        }