using System.Runtime.Serialization; namespace PlayerOp { public class PlayerOpServerConfig { public string dbname; public string dbip; public string dbuser; public string dbpassword; public int maxExchangeCodeCount; public int dbtype; public string codefliepath; } public class PlayerOpConfigDef { private const int DefaultMaxExchangeCodeCount = 200; public static int MaxExchangeCodeCount { get { var cfg = PlayerOpServerUtils.GetServerConfig(); if(cfg != null && cfg.maxExchangeCodeCount > 0) { return cfg.maxExchangeCodeCount; } return PlayerOpConfigDef.DefaultMaxExchangeCodeCount; } } } }