Untitled


SUBMITTED BY: moudixblack

DATE: Aug. 5, 2017, 12:48 a.m.

FORMAT: Text only

SIZE: 2.8 kB

HITS: 642

  1. using System;
  2. using System.Collections.Generic;
  3. namespace LordsRoad.Database
  4. {
  5. public class GoldenTreeTable
  6. {
  7. public class GoldenTreeCondition
  8. {
  9. public uint ID;
  10. public uint Type;
  11. public byte CostType;
  12. public uint CostItemID;
  13. public byte Monopoly;
  14. public byte CD;
  15. public byte CDCost;
  16. public DateTime StartTime;
  17. }
  18. public class GoldenTreePool
  19. {
  20. public uint ID;
  21. public uint Type;
  22. public byte PerfectLevel;
  23. public string Name;
  24. public uint ItemID;
  25. }
  26. public static Dictionary<uint, GoldenTreeCondition> Conditions = new Dictionary<uint, GoldenTreeCondition>();
  27. public static Dictionary<uint, GoldenTreePool> Pools = new Dictionary<uint, GoldenTreePool>();
  28. public static void Load()
  29. {
  30. #region GoldenLotteryCondition
  31. Conditions = new Dictionary<uint, GoldenTreeCondition>();
  32. var r = new IniFile(Constants.DataHolderPath + "globallotterycondition.ini");
  33. int count = r.ReadInt32("ConditionAmount", "Amount", 0);
  34. for (uint i = 0; i < count; i++)
  35. {
  36. GoldenTreeCondition prize = new GoldenTreeCondition();
  37. prize.ID = r.ReadUInt32(i.ToString(), "id");
  38. prize.Type = r.ReadUInt32(i.ToString(), "Type");
  39. prize.CostType = r.ReadByte(i.ToString(), "CostType", 0);
  40. prize.CostItemID = r.ReadUInt32(i.ToString(), "CostValue");
  41. prize.Monopoly = r.ReadByte(i.ToString(), "Monopoly", 0);
  42. prize.CD = r.ReadByte(i.ToString(), "CD", 0);
  43. prize.CDCost = r.ReadByte(i.ToString(), "CDCost", 0);
  44. prize.StartTime = Kernel.FromDateTimeInt(ulong.Parse(r.ReadString(i.ToString(), "StartTime")));
  45. Conditions.Add(prize.ID, prize);
  46. }
  47. #endregion GoldenLotteryCondition
  48. #region GoldenLotteryPool
  49. var file = new DatCryption().Decrypt(Constants.DataHolderPath + "global_lottery_pool.dat");
  50. foreach (var line1 in file)
  51. {
  52. var spilit = line1.Split(new string[] { "@@" }, StringSplitOptions.RemoveEmptyEntries);
  53. GoldenTreePool pool = new GoldenTreePool();
  54. pool.ID = uint.Parse(spilit[0]);
  55. pool.Type = uint.Parse(spilit[1]);
  56. pool.PerfectLevel = byte.Parse(spilit[2]);
  57. pool.Name = spilit[3];
  58. pool.ItemID = uint.Parse(spilit[4]);
  59. Pools.Add(pool.ID, pool);
  60. }
  61. #endregion GoldenLotteryPool
  62. }
  63. }
  64. }

comments powered by Disqus