Example #1
0
 private static void AfterStartIncident(int chatId, string msg, ModelStatus stat)
 {
     Loger.Log("IncidentLod ChatController.AfterStartIncident 1 msg:" + msg);
     if (stat.Status == 0)
     {
         string error;
         var    result = OCIncident.GetCostOnGameByCommand(msg, false, out error);
         //Find.WindowStack.Add(new Dialog_Input("Вызов инциндента", error ?? result, true));
         Find.WindowStack.Add(new Dialog_MessageBox(error ?? result));
     }
     else
     {
         //выводим сообщение с ошибкой
         var errorMessage = string.IsNullOrEmpty(stat.Message) ? "Error call" : stat.Message.Translate().ToString();
         Loger.Log("IncidentLod ChatController.AfterStartIncident errorMessage:" + errorMessage);
         Find.WindowStack.Add(new Dialog_MessageBox(errorMessage));
     }
 }
Example #2
0
        private static ModelStatus BeforeStartIncident(int chatId, string msg)
        {
            Loger.Log("IncidentLod ChatController.BeforeStartIncident 1 msg:" + msg);
            string error;

            OCIncident.GetCostOnGameByCommand(msg, true, out error);

            if (error != null)
            {
                Loger.Log("IncidentLod ChatController.BeforeStartIncident errorMessage:" + error);
                Find.WindowStack.Add(new Dialog_MessageBox(error));

                return(new ModelStatus()
                {
                    Status = 1
                });
            }
            else
            {
                Loger.Log("IncidentLod ChatController.BeforeStartIncident ok");
                return(null);
            }
        }