//リプライが来た時のフィルター /* * private bool evFill(string content) * { * string[] contentSprit = content.Replace(" ", " ").Split(' '); //全角スペースを半角スペースに変換 * (JobClass mainclass, JobClass subclass) = myFunction.convertJobClass(contentSprit[0]); * return (mainclass != JobClass.None && subclass != JobClass.None) || (mainclass == JobClass.Hr); * } */ //緊急クエストが始まる時に使う public async Task postEmgTime(emgQuest emg, int interval) { if (interval == 0) { await emgService.PostAsync(string.Format("【緊急開始】{0} {1}", emg.eventTime.ToString("HH:mm"), emg.eventName)); } else { string liveStr = myFunction.getLiveEmgStr(emg); await emgService.PostAsync(string.Format("【{0}分前】{1} {2}", interval, emg.eventTime.ToString("HH:mm"), liveStr)); } }
static public string getLiveEmgStr(emgQuest e, string section = "->") //クーナライブがある時に使う { if (e.liveEnable == true) { if (Regex.IsMatch(e.live, "^クーナスペシャルライブ「.*」") == true) //他のライブの時は無理 { //もっといい方法がありそう string str = Regex.Replace(e.live, "^クーナスペシャルライブ「", ""); str = Regex.Replace(str, "」$", ""); return(string.Format("{0}{1}{2}", str, section, e.eventName)); } else { return(string.Format("{0}{1}{2}", e.live, section, e.eventName)); } } return(e.eventName); }
/* * public void setTable(string t) * { * this.tablename = t; * } */ public List <EventData> getEmgList(DateTime start, DateTime end) { List <EventData> outputData = new List <EventData>(); DateTime fixStart; DateTime fixEnd; if (start > end) //startのほうが遅い { fixStart = end; fixEnd = start; } else { fixStart = start; fixEnd = end; } string que = string.Format("SELECT id, emgname,livename,emgtime,emgtype FROM {0} WHERE emgtime >= '{1}' AND emgtime <= '{2}' ORDER BY emgtime ASC;", tablename, fixStart.ToString(), fixEnd.ToString()); List <List <object> > outtable = selectQue(que); int count = 0; foreach (List <object> o in outtable) { int?Ntype = o[4] as int?; string emgname = o[1] as string; string livename = o[2] as string; DateTime?Ntime = o[3] as DateTime?; count++; //nullチェック if (Ntype != null && Ntime != null) { EventData ev; int type = (int)Ntype; DateTime time = (DateTime)Ntime; switch (type) { case 1: ev = new casino(time); outputData.Add(ev); break; case 0: if (livename != "") { ev = new emgQuest(time, emgname, livename); } else { ev = new emgQuest(time, emgname); } outputData.Add(ev); break; } } } //Console.WriteLine("getDB:Start{0},end:{1}",start.ToString("HH:mm:ss"),end.ToString("HH:mm:ss")); return(outputData); }