public static void CheckBestWave(Dictionary <Mobile, long> score, int wave) { if (BestWave == null || wave > BestWave.Waves) { BestWave = new BestWave(score, wave); Timer.DelayCall(TimeSpan.FromSeconds(1.5), () => World.Broadcast(2072, false, String.Format("A new Void Pool Invasion record has been made: {0}!", wave.ToString()))); } }
public static void OnLoad() { BestSingle = new Dictionary<Mobile, long>(); OverallTotal = new Dictionary<Mobile, long>(); Top20 = new List<Dictionary<Mobile, long>>(); Persistence.Deserialize( FilePath, reader => { int version = reader.ReadInt(); if (reader.ReadInt() == 1) BestWave = new BestWave(reader); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) BestSingle[m] = l; } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) OverallTotal[m] = l; } count = reader.ReadInt(); for (int i = 0; i < count; i++) { int c = reader.ReadInt(); Dictionary<Mobile, long> dic = new Dictionary<Mobile, long>(); for (int j = 0; j < c; j++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) dic[m] = l; } if (dic.Count > 0) Top20.Add(dic); } }); }
public VoidPoolStats(GenericReader reader, bool conversion) { BestSingle = new Dictionary <Mobile, long>(); OverallTotal = new Dictionary <Mobile, long>(); Top20 = new List <Dictionary <Mobile, long> >(); int version = conversion ? 0 : reader.ReadInt(); switch (version) { case 1: Controller = reader.ReadItem() as VoidPoolController; goto case 0; case 0: if (version == 0) { Timer.DelayCall(() => Controller = VoidPoolController.InstanceTram); } if (reader.ReadInt() == 1) { BestWave = new BestWave(reader); } int count = reader.ReadInt(); for (int i = 0; i < count; i++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) { BestSingle[m] = l; } } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) { OverallTotal[m] = l; } } count = reader.ReadInt(); for (int i = 0; i < count; i++) { int c = reader.ReadInt(); Dictionary <Mobile, long> dic = new Dictionary <Mobile, long>(); for (int j = 0; j < c; j++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) { dic[m] = l; } } if (dic.Count > 0) { Top20.Add(dic); } } break; } }
public static void OnLoad() { BestSingle = new Dictionary <Mobile, long>(); OverallTotal = new Dictionary <Mobile, long>(); Top20 = new List <Dictionary <Mobile, long> >(); Persistence.Deserialize( FilePath, reader => { int version = reader.ReadInt(); if (reader.ReadInt() == 1) { BestWave = new BestWave(reader); } int count = reader.ReadInt(); for (int i = 0; i < count; i++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) { BestSingle[m] = l; } } count = reader.ReadInt(); for (int i = 0; i < count; i++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) { OverallTotal[m] = l; } } count = reader.ReadInt(); for (int i = 0; i < count; i++) { int c = reader.ReadInt(); Dictionary <Mobile, long> dic = new Dictionary <Mobile, long>(); for (int j = 0; j < c; j++) { Mobile m = reader.ReadMobile(); long l = reader.ReadLong(); if (m != null) { dic[m] = l; } } if (dic.Count > 0) { Top20.Add(dic); } } }); }
public static void CheckBestWave(Dictionary<Mobile, long> score, int wave) { if (BestWave == null || wave > BestWave.Waves) { BestWave = new BestWave(score, wave); Timer.DelayCall(TimeSpan.FromSeconds(1.5), () => World.Broadcast(2072, false, String.Format("A new Void Pool Invasion record has been made: {0}!", wave.ToString()))); } }