Esempio n. 1
0
 public void LoadServConf(Action <Dictionary <string, string> > action, bool forceLoad = false)
 {
     if (null == mServConf || mServConf.Count == 0 || forceLoad)
     {
         LoadResServList((List <ResInfo> list) =>
         {
             TimeOutWWW www      = getTimeOutWWW();
             List <string> files = new List <string>();
             for (int i = 0; i < list.Count; i++)
             {
                 files.Add(Tools.PathCombine(list[i].path, GameConfig.STR_ASB_MANIFIST + "/servConf.bytes"));
             }
             www.ReadFirstExistsStr("servConf", files, 0.2f, (bool rst, string msg) =>
             {
                 if (null == mServConf)
                 {
                     mServConf = new Dictionary <string, string>();
                 }
                 else
                 {
                     mServConf.Clear();
                 }
                 if (rst)
                 {
                     mServConf = Tools.SplitStr2Dic(msg, "\n", "|");
                 }
                 else
                 {
                     LogFile.Warn("从资源服servConf.bytes失败");
                 }
                 if (null != action)
                 {
                     action(mServConf);
                 }
             }, null);
         });
     }
     else
     {
         if (null != action)
         {
             action(mServConf);
         }
     }
 }