private void onExitClick(GameObject go) { MainFlow flow = GameApp.Instance.GetCurFlow() as MainFlow; flow.BackToLogin(); WindowManager.Instance.OpenUI("login"); }
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(); } }
/// <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(); }
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 } }
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); }
private static void BackToLogin(object param) { MainFlow flow = GameApp.Instance.GetCurFlow() as MainFlow; if (flow != null) { flow.BackToLogin(); } }
public void OnBuyGameCoinsRst(string param) { MainFlow mflow = mCurFlow as MainFlow; if (mflow == null) { return; } mflow.OnBuyGameCoinsRst(param); }
public void ReLogin() { MainFlow flow = mCurFlow as MainFlow; if (flow == null) { return; } flow.BackToLogin(); }
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); }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } }
/// <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); }
public void Run(string[] args) { try { CreateServices(args); MainFlow mainFlow = ninjectKernel.Get <MainFlow>(); mainFlow.Execute(); } catch (Exception ex) { logger.Error(ex); } }
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); }
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()); } }
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); } }
public void OnButtonSuccessFailClick() { MainFlow.LeaveTestingGame(); }
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); } } }
/// <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); }
/// <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); }
public void Initialize(MainFlow mainFlow) { this.mainFlow = mainFlow; }
public JsBridge(MainFlow mainFlow) { _mainFlow = mainFlow; _currPage = Page.Index; }