Exemple #1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, BallInfo> dictionary  = BallMgr.LoadFromDatabase();
         Dictionary <int, Tile>     dictionary2 = BallMgr.LoadFromFiles(dictionary);
         if (dictionary.Values.Count > 0 && dictionary2.Values.Count > 0)
         {
             Interlocked.Exchange <Dictionary <int, BallInfo> >(ref BallMgr.m_infos, dictionary);
             Interlocked.Exchange <Dictionary <int, Tile> >(ref BallMgr.m_tiles, dictionary2);
             return(true);
         }
     }
     catch (Exception exception)
     {
         BallMgr.log.Error("Ball Mgr init error:", exception);
     }
     return(false);
 }
Exemple #2
0
        public static bool ReLoad()
        {
            bool result;

            try
            {
                Dictionary <int, BallInfo> tempBalls    = BallMgr.LoadFromDatabase();
                Dictionary <int, Tile>     tempBallTile = BallMgr.LoadFromFiles(tempBalls);
                if (tempBalls.Values.Count > 0 && tempBallTile.Values.Count > 0)
                {
                    Interlocked.Exchange <Dictionary <int, BallInfo> >(ref BallMgr.m_infos, tempBalls);
                    Interlocked.Exchange <Dictionary <int, Tile> >(ref BallMgr.m_tiles, tempBallTile);
                    result = true;
                    return(result);
                }
            }
            catch (Exception ex)
            {
                BallMgr.log.Error("Ball Mgr init error:", ex);
            }
            result = false;
            return(result);
        }