Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1.  
  2.  
  3.  
  4. // This source is targeted to Conquer Online, client version 6600
  5. //
  6. // Source Owner : jiMMy
  7. // ConquerGx 6570- MsgServer - SoulProtection.cs
  8. // Last Edit: 2017/6/15 13:43
  9.  
  10.  
  11. using System;
  12. using System.IO;
  13. using System.Collections.Generic;
  14.  
  15. namespace COServer.Database
  16. {
  17. public unsafe class SoulProtection
  18. {
  19. public struct SoulInfo
  20. {
  21. public uint UID;
  22. public uint ItemType;
  23. public Network.GamePackets.ItemHandler.Positions Pos;
  24. }
  25. public static void Load()
  26. {
  27. if (File.Exists(Constants.DataHolderPath + "souls_protection.txt"))
  28. {
  29. string[] lines = File.ReadAllLines(Constants.DataHolderPath + "souls_protection.txt");
  30. foreach (var item in lines)
  31. {
  32. try
  33. {
  34. var coloums = item.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
  35. SoulInfo info = new SoulInfo();
  36. info.UID = uint.Parse(coloums[0]);
  37. info.ItemType = uint.Parse(coloums[1]);
  38. info.Pos = (Network.GamePackets.ItemHandler.Positions)uint.Parse(coloums[2]);
  39. if (!Soul_Protections.ContainsKey(info.UID))
  40. Soul_Protections.Add(info.UID, info);
  41. }
  42. catch (Exception e)
  43. {
  44. Console.WriteLine(e.ToString());
  45. throw;
  46. }
  47. }
  48. }
  49. }
  50. public static SafeDictionary<uint, SoulInfo> Soul_Protections = new SafeDictionary<uint, SoulInfo>();
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement