private void CheckDump(EmptyStickeredDatabase db) { HashSet <Tuple <long, long> > temp = db.unstickeredCache; Assert.IsTrue(db.LoadFromArray(db.Dump())); Assert.AreEqual(temp, db.unstickeredCache); Assert.IsTrue( db.LoadFromArray( BinarySerialization.NS.Deserialize <string[]>( BinarySerialization.NS.Serialize(db.Dump())))); Assert.AreEqual(temp, db.unstickeredCache); Assert.IsTrue( db.LoadFromArray( BinarySerialization.NS.Deserialize <string[]>( BinarySerialization.NS.Serialize(db.Dump(), true), true))); Assert.AreEqual(temp, db.unstickeredCache); }
private void Init() { try { unstickeredCache.LoadFromArray(File.ReadAllLines(Path.Combine("assets", "emptystickered.txt"))); } catch { } ReloadConfig(); Task.Run((Action)BackgroundCheck); Task.Run((Action)UnstickeredDumper); }
public Core(int port = 4345) { try { server = new HttpListener(); logger = new NewMarketLogger("Core"); server.Prefixes.Add($"http://+:{port}/"); Init(); VK.Init(); unstickeredCache = new EmptyStickeredDatabase(); unstickeredCache.LoadFromArray(File.ReadAllLines(Path.Combine("assets", "emptystickered.txt"))); logger.Nothing("Starting!"); ReloadConfig(); server.Start(); logger.Nothing("Started!"); Task.Run((Action)Listen); Task.Run((Action)BackgroundCheck); Task.Run((Action)UnstickeredDumper); //Task.Run((Action)DBHitProvider); } catch (Exception ex) { logger.Crash($"Message: {ex.Message}. Trace: {ex.StackTrace}"); } }