Esempio n. 1
0
    private void onExitClick(GameObject go)
    {
        MainFlow flow = GameApp.Instance.GetCurFlow() as MainFlow;

        flow.BackToLogin();
        WindowManager.Instance.OpenUI("login");
    }
Esempio n. 2
0
        static void Main(string[] args)
        {
            try
            {
                MainFlow main = new MainFlow();
                main.Run();
            }
            catch (ConfigurationErrorsException ex)
            {
                ConsoleWriter.WriteLine(ex.Message, Color.Red);

                LogManager.GetLogger().Error(ex);
            }
            catch (DirectoryNotFoundException ex)
            {
                ConsoleWriter.WriteLine($"Configured AgentPluginPath path not found. {ex.Message}", Color.Red);

                LogManager.GetLogger().Error(ex);
            }
            catch (Exception ex)
            {
                LogManager.GetLogger().Error(ex);

                ConsoleWriter.WriteLine($"Application Error. Please check log.");
            }
            finally
            {
                ConsoleWriter.WriteLine();

                ConsoleWriter.WriteLine("Press any key to exit ...");

                Console.ReadLine();
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 增加agv
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void BtnAddAGV_Click(object sender, RoutedEventArgs e)
        {
            // 裁剪ip
            string[] temp = txtNewAGVIp.Text.Split('.');
            // 校验ip
            if (txtNewAGVIp.Text == "" && temp.Length < 4)
            {
                return;
            }
            // 校验客户端
            foreach (var item in MainFlow.Clients.Keys)
            {
                if (item.Contains(txtNewAGVIp.Text + ":" + txtNewAGVPort.Text))
                {
                    MessageBox.Show("控制端已连接上该小车,请不要重复操作!");
                    return;
                }
            }
            // 启动客户端
            string ip   = txtNewAGVIp.Text;
            string port = txtNewAGVPort.Text;
            byte   id   = Convert.ToByte(txtNewAGVNum.Text);
            await MainFlow.AddForkliftAsync(ip, port, id);

            AddAgvLabel(id.ToString());
            txtNewAGVNum.Text = (id + 1).ToString();
        }
Esempio n. 4
0
    public void PlatformNotify()
    {
        LoginFlow flow = mCurFlow as LoginFlow;

        if (flow != null)
        {
            flow.PlatformLogin();
            return;
        }

        MainFlow mflow = mCurFlow as MainFlow;

        if (mflow == null)
        {
            return;
        }

        if (!PlatformSDK.PlatformLoginSucceed)
        {
            mflow.BackToLogin();
        }
        else
        {// 更新票据到服务器 xeixin
        }
    }
Esempio n. 5
0
    private BaseFlow createNextFlow(GAME_FLOW_ENUM flow)
    {
        BaseFlow nextFlow = null;

        switch (flow)
        {
        case GAME_FLOW_ENUM.GAME_FLOW_VERIFY:
        {
            nextFlow = new VerifyFlow();
        } break;

        case GAME_FLOW_ENUM.GAME_FLOW_LOGIN:
        {
            nextFlow = new LoginFlow();
        } break;

        case GAME_FLOW_ENUM.GAME_FLOW_MAIN:
        {
            nextFlow = new MainFlow();
        } break;
        }

        if (nextFlow != null)
        {
            nextFlow.Init();
        }

        return(nextFlow);
    }
Esempio n. 6
0
    private static void BackToLogin(object param)
    {
        MainFlow flow = GameApp.Instance.GetCurFlow() as MainFlow;

        if (flow != null)
        {
            flow.BackToLogin();
        }
    }
Esempio n. 7
0
    public void OnBuyGameCoinsRst(string param)
    {
        MainFlow mflow = mCurFlow as MainFlow;

        if (mflow == null)
        {
            return;
        }

        mflow.OnBuyGameCoinsRst(param);
    }
Esempio n. 8
0
    public void ReLogin()
    {
        MainFlow flow = mCurFlow as MainFlow;

        if (flow == null)
        {
            return;
        }

        flow.BackToLogin();
    }
Esempio n. 9
0
        private static void RunChatRoom(Chat chat, MainFlow newMain)
        {
            var task = newMain.Run();

            task.ContinueWith(
                (t) =>
            {
                Botlog.WriteError(chat.Id, $"Faulted {t.Exception}", true);
                Chats.TryRemove(chat.Id, out _);
            }, TaskContinuationOptions.OnlyOnFaulted);
        }
Esempio n. 10
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
 }
Esempio n. 11
0
        /// <summary>
        /// 入库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void BtnStockIn_Click(object sender, RoutedEventArgs e)
        {
            await MainFlow.SetTask(unloadNodeTextbox.Text, targetStorageLocation.Text, txtNewAGVNum.Text);

            //await MainFlow.SetTask2(unloadNodeTextbox.Text, targetStorageLocation.Text);
            //var x = MainFlow.GetVs();
            //string y = "";
            //foreach (var item in x)
            //{
            //    y += item.ToString("X2");
            //}
            //MessageBox.Show(y);
            //await Task.Delay(100);
        }
Esempio n. 12
0
        public void Run(string[] args)
        {
            try
            {
                CreateServices(args);

                MainFlow mainFlow = ninjectKernel.Get <MainFlow>();
                mainFlow.Execute();
            }
            catch (Exception ex)
            {
                logger.Error(ex);
            }
        }
Esempio n. 13
0
        private static MainFlow CreateChatRoom(Chat chat)
        {
            var newChatRoom = new MainFlow(
                new ChatIO(_botClient, chat),
                new TelegramUserInfo(chat.Id, chat.FirstName, chat.LastName, chat.Username),
                _settings,
                _addWordService,
                _userWordService,
                _userService,
                _localDictionaryService,
                _learningSetService);

            Chats.TryAdd(chat.Id, newChatRoom);
            return(newChatRoom);
        }
Esempio n. 14
0
        public MainWindow()
        {
            try
            {
                InitializeComponent();

                Show();

                mainFlow          = new MainFlow();
                mainFlow.MainForm = this;

                mainFlow.StartFlow();
            }
            catch (Exception e)
            {
                var folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                System.IO.File.WriteAllText(folder + "/InstallerError.txt", e.ToString());
            }
        }
Esempio n. 15
0
        public async Task Run(IEnumerable <TypedValue> expecteds, string value)
        {
            ConsoleWrapperMock.Setup(x => x.ReadLine(It.IsAny <string>()))
            .Returns <string>(x => value);

            TaskWrapperMock.Setup(x => x.Delay(It.IsAny <int>()))
            .Returns <int>(x => Task.CompletedTask);

            await MainFlow.Run();

            var count = expecteds.Count();

            TaskWrapperMock.Verify(x => x.Delay(It.IsAny <int>()), Times.Exactly(count));
            ConsoleWrapperMock.Verify(x => x.WriteLine(It.IsAny <string>()), Times.Exactly(count));

            foreach (var e in expecteds)
            {
                ConsoleWrapperMock.Verify(x => x.WriteLine(e.ToString()), Times.Once);
            }
        }
Esempio n. 16
0
 public void OnButtonSuccessFailClick()
 {
     MainFlow.LeaveTestingGame();
 }
Esempio n. 17
0
    public void SendText(ChatChannelType type, string msg)
    {
        if (msg.Length >= 1 && msg.StartsWith("."))
        {
            string commend = "";
            commend = msg.Remove(0, 1);
            if (string.IsNullOrEmpty(commend) || string.IsNullOrEmpty(commend))
            {
                return;
            }

            string[] paras = commend.Split(new string[] { " " }, System.StringSplitOptions.None);

            if (paras.Length <= 0)
            {
                return;
            }

            if (mParamList == null)
            {
                mParamList = new ArrayList();
            }
            else
            {
                mParamList.Clear();
            }

            for (int i = 1; i < paras.Length; i++)
            {
                mParamList.Add(paras[i]);
            }

            if (!GMHandler.Instance.DoHandler(PlayerController.Instance.GetControlObj(), paras[0], mParamList))
            {
                GMActionParam param = new GMActionParam();
                param.Cmd = commend;

                Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_GM, param);
            }
        }
        else
        {
            //系统频道不允许玩家发送
            if (type == ChatChannelType.ChannelType_System)
            {
                return;
            }

            PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>();
            if (module == null)
            {
                return;
            }

            MainFlow mainFlow = GameApp.Instance.GetCurFlow() as MainFlow;
            if (mainFlow != null)
            {
                CSChatMessage packet = new CSChatMessage();
                packet.channel_type = (int)type;
                packet.name         = module.GetName();
                packet.msg          = msg;

                mainFlow.SendToChatServer(packet);
            }
            Role role = PlayerController.Instance.GetControlObj() as Role;
            if (role != null)
            {
                role.Talk(msg);
            }
        }
    }
Esempio n. 18
0
 /// <summary>
 /// 关闭窗口
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     syncForkliftStatusData = false;
     MainFlow.CloseMainFlow().Wait(2000);
 }
Esempio n. 19
0
 /// <summary>
 /// 出库
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void BtnStockOut_Click(object sender, RoutedEventArgs e)
 {
     await MainFlow.SetTask(takeStockNode.Text, loadNodeTextbox.Text, txtNewAGVNum.Text);
 }
Esempio n. 20
0
 public void Initialize(MainFlow mainFlow)
 {
     this.mainFlow = mainFlow;
 }
Esempio n. 21
0
 public JsBridge(MainFlow mainFlow)
 {
     _mainFlow = mainFlow;
     _currPage = Page.Index;
 }