Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.56 KB | None | 0 0
  1. using System.IO;
  2. using System.Xml.Serialization;
  3.  
  4. namespace Bunny.Core
  5. {
  6.     class Configuration
  7.     {
  8.         public class DatabaseConfig
  9.         {
  10.             public string Host = "";
  11.             public string DatabaseName = "";
  12.             public bool WindowsAuth = false;
  13.             public string User = "";
  14.             public string Pass = "";
  15.         }
  16.  
  17.         public class TCPConfig
  18.         {
  19.             public short Port = 0;
  20.             public int BackLog = 0;
  21.             public int ReceiveBuffer = 0;
  22.             public int SendBuffer = 0;
  23.         }
  24.  
  25.         public class UDPConfig
  26.         {
  27.             public short Port = 0;
  28.             public int Buffer = 0;
  29.         }
  30.  
  31.         public class LocatorConfig
  32.         {
  33.             public string IP = "";
  34.             public short Port = 0;
  35.         }
  36.  
  37.         public class AgentConfig
  38.         {
  39.             public string IP = "";
  40.             public short TCPPort = 0;
  41.             public short UDPPort = 0;
  42.         }
  43.  
  44.         public class ServerConfig
  45.         {
  46.             public byte ID = 0;
  47.             public short Capacity = 0;
  48.             public string Mode = "";
  49.             public bool Survival = false;
  50.             public bool DuelTourney = false;
  51.             public string Name = "";
  52.             public bool UseMD5 = false;
  53.         }
  54.  
  55.         public class ClientConfig
  56.         {
  57.             public int Version = 0;
  58.             public bool UseCRC = false;
  59.             public uint FileList = 0;
  60.         }
  61.  
  62.         public class PingConfig
  63.         {
  64.             public int Delay = 0;
  65.             public int Timeout = 0;
  66.         }
  67.  
  68.         public class CharacterConfig
  69.         {
  70.             public int StartingBounty = 0;
  71.             public int MaxItems = 0;
  72.             public bool EquipSameItems = false;
  73.         }
  74.  
  75.         public class ItemsConfig
  76.         {
  77.             public int MaxWeight = 0;
  78.             public bool UseBounty = false;
  79.         }
  80.  
  81.         public static Configuration Load()
  82.         {
  83.             return (Configuration)new XmlSerializer(typeof (Configuration)).Deserialize(new StreamReader("Config.xml"));
  84.         }
  85.  
  86.         public DatabaseConfig Databse = null;
  87.         public TCPConfig TCP = null;
  88.         public UDPConfig UDP = null;
  89.         public LocatorConfig Locator = null;
  90.         public AgentConfig Agent = null;
  91.         public ServerConfig Server = null;
  92.         public ClientConfig Client = null;
  93.         public PingConfig Ping = null;
  94.         public CharacterConfig Character = null;
  95.         public ItemsConfig Item = null;
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement