Exemplo n.º 1
0
 public void TranslateSentientOutpost(SentientOutpost se)
 {
     if (se.mission != null)
     {
         se.mission.node = TranslateNode(se.mission.node);
     }
     se.activation = GetRealTime(se.activation);
     se.expiry     = GetRealTime(se.expiry);
     //se.previous.expiry = GetRealTime(se.previous.expiry);
     //se.previous.activation = GetRealTime(se.activation);
 }
Exemplo n.º 2
0
        public void ProcessSentientOutpost(NotificationState state, SentientOutpost so)
        {
            var sendFCM = ProcessSingleExpirable(state, so, so.StatType);

            if (sendFCM && so.Expiry != null && so.Mission != null)
            {
                var ttl     = so.TimeLeft;
                var message = FCM.CreateMessage("Sentient Anomaly", $"{so.Mission.Node}", platform, YawsNotification.Topic.SentientOutpost, nameof(SentientOutpost), ttl);
                NotificationMessages.Add(message);
            }
        }
Exemplo n.º 3
0
        public static string ToString(SentientOutpost outpost)
        {
            var sb = new StringBuilder();

            if (outpost.active)
            {
                sb.Append("此功能维护中");
                // var expiry = outpost.expiry > DateTime.Now + TimeSpan.FromHours(1) ? outpost.previous.expiry : outpost.expiry;
                // 这行大概是因为api是wip 以后可以直接删掉换成outpost.expiry
                // 但愿吧
                var expiry = outpost.expiry;
                var time   = (expiry - DateTime.Now).Humanize(int.MaxValue, CultureInfo.GetCultureInfo("zh-CN"), TimeUnit.Day, TimeUnit.Minute, " ");
                sb.AppendLine($"    [{outpost.mission.node}]-{outpost.mission.faction} {time}后过期");
            }
            else
            {
                var time = (outpost.activation - DateTime.Now).Humanize(int.MaxValue, CultureInfo.GetCultureInfo("zh-CN"), TimeUnit.Day, TimeUnit.Minute, " ");
                sb.AppendLine("目前没有Sentient异常");
                sb.AppendLine($"下一个异常在{outpost.activation}({time}后)");
            }
            return(sb.ToString().Trim());
        }