Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.IO;
- using System.Xml.Serialization;
- namespace Bunny.Core
- {
- class Configuration
- {
- public class DatabaseConfig
- {
- public string Host = "";
- public string DatabaseName = "";
- public bool WindowsAuth = false;
- public string User = "";
- public string Pass = "";
- }
- public class TCPConfig
- {
- public short Port = 0;
- public int BackLog = 0;
- public int ReceiveBuffer = 0;
- public int SendBuffer = 0;
- }
- public class UDPConfig
- {
- public short Port = 0;
- public int Buffer = 0;
- }
- public class LocatorConfig
- {
- public string IP = "";
- public short Port = 0;
- }
- public class AgentConfig
- {
- public string IP = "";
- public short TCPPort = 0;
- public short UDPPort = 0;
- }
- public class ServerConfig
- {
- public byte ID = 0;
- public short Capacity = 0;
- public string Mode = "";
- public bool Survival = false;
- public bool DuelTourney = false;
- public string Name = "";
- public bool UseMD5 = false;
- }
- public class ClientConfig
- {
- public int Version = 0;
- public bool UseCRC = false;
- public uint FileList = 0;
- }
- public class PingConfig
- {
- public int Delay = 0;
- public int Timeout = 0;
- }
- public class CharacterConfig
- {
- public int StartingBounty = 0;
- public int MaxItems = 0;
- public bool EquipSameItems = false;
- }
- public class ItemsConfig
- {
- public int MaxWeight = 0;
- public bool UseBounty = false;
- }
- public static Configuration Load()
- {
- return (Configuration)new XmlSerializer(typeof (Configuration)).Deserialize(new StreamReader("Config.xml"));
- }
- public DatabaseConfig Databse = null;
- public TCPConfig TCP = null;
- public UDPConfig UDP = null;
- public LocatorConfig Locator = null;
- public AgentConfig Agent = null;
- public ServerConfig Server = null;
- public ClientConfig Client = null;
- public PingConfig Ping = null;
- public CharacterConfig Character = null;
- public ItemsConfig Item = null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement