Пример #1
0
 private static void Save(Type type)
 {
     using (ServiceBussiness sb = new ServiceBussiness())
     {
         foreach (FieldInfo fieldInfo in type.GetFields())
         {
             if (fieldInfo.IsStatic)
             {
                 object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(ConfigPropertyAttribute), false);
                 if (customAttributes.Length != 0)
                 {
                     GameProperties.SaveProperty((ConfigPropertyAttribute)customAttributes[0], sb, fieldInfo.GetValue((object)null));
                 }
             }
         }
     }
 }
Пример #2
0
 private static void Load(Type type)
 {
     using (ServiceBussiness sb = new ServiceBussiness())
     {
         foreach (FieldInfo f in type.GetFields())
         {
             if (!f.IsStatic)
             {
                 continue;
             }
             object[] attribs = f.GetCustomAttributes(typeof(ConfigPropertyAttribute), false);
             if (attribs.Length == 0)
             {
                 continue;
             }
             ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)attribs[0];
             f.SetValue(null, GameProperties.LoadProperty(attrib, sb));
         }
     }
 }
Пример #3
0
 private static void Save(Type type)
 {
     using (ServiceBussiness serviceBussiness = new ServiceBussiness())
     {
         FieldInfo[] fields = type.GetFields();
         for (int i = 0; i < fields.Length; i++)
         {
             FieldInfo fieldInfo = fields[i];
             if (fieldInfo.IsStatic)
             {
                 object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(ConfigPropertyAttribute), false);
                 if (customAttributes.Length != 0)
                 {
                     ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)customAttributes[0];
                     GameProperties.SaveProperty(attrib, serviceBussiness, fieldInfo.GetValue(null));
                 }
             }
         }
     }
 }
Пример #4
0
 public static void Save()
 {
     GameProperties.log.Info("Saving game properties into db!");
     GameProperties.Save(typeof(GameProperties));
 }
Пример #5
0
 public static int HoleLevelUpExp(int lv)
 {
     return(GameProperties.getProp(GameProperties.HoleLevelUpExpList)[lv]);
 }
Пример #6
0
 public static int VIPStrengthenExp(int vipLv)
 {
     return(GameProperties.getProp(GameProperties.VIPStrengthenEx)[vipLv]);
 }
Пример #7
0
 public static int ConsortiaStrengExp(int Lv)
 {
     return(GameProperties.getProp(GameProperties.ConsortiaStrengthenEx)[Lv]);
 }
Пример #8
0
 public static List <int> RuneExp()
 {
     return(GameProperties.getProp(GameProperties.RuneLevelUpExp));
 }
Пример #9
0
 public static List <int> VIPExp()
 {
     return(GameProperties.getProp(GameProperties.VIPExpForEachLv));
 }
Пример #10
0
 public static void Refresh()
 {
     GameProperties.log.Info("Refreshing game properties!");
     GameProperties.Load(typeof(GameProperties));
 }