本文整理汇总了C#中Tibialyzer.Hunt.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# Hunt.Reset方法的具体用法?C# Hunt.Reset怎么用?C# Hunt.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tibialyzer.Hunt
的用法示例。
在下文中一共展示了Hunt.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: resetHunt
public static void resetHunt(Hunt h)
{
h.Reset();
LootDatabaseManager.DeleteHuntTable(h);
LootDatabaseManager.CreateHuntTable(h);
LootDatabaseManager.UpdateLoot();
}
示例2: clearOldLog
public static void clearOldLog(Hunt h, int clearMinutes = 10)
{
var time = DateTime.Now;
int hour = time.Hour;
int minute = time.Minute;
while (clearMinutes > 60) {
hour--;
clearMinutes -= 60;
}
if (minute >= clearMinutes) {
minute -= clearMinutes;
} else {
hour--;
minute = 60 + (minute - clearMinutes);
}
int stamp = TimestampManager.getDayStamp();
while (hour < 0) {
hour += 24;
stamp--;
}
h.Reset(clearMinutes);
HuntManager.SetHuntTime(h, clearMinutes);
LootDatabaseManager.DeleteMessagesBefore(h, stamp, hour, minute);
SQLiteDataReader reader = LootDatabaseManager.GetHuntMessages(h);
Dictionary<string, List<string>> logMessages = new Dictionary<string, List<string>>();
while (reader.Read()) {
string line = reader["message"].ToString();
if (line.Length < 15) continue;
string t = line.Substring(0, 5);
if (!(t[0].isDigit() && t[1].isDigit() && t[3].isDigit() && t[4].isDigit() && t[2] == ':')) continue; //not a valid timestamp
if (!logMessages.ContainsKey(t)) logMessages.Add(t, new List<string>());
logMessages[t].Add(line);
}
Parser.ParseLootMessages(h, logMessages, null, false, false, true);
LootDatabaseManager.UpdateLoot();
}