Esempio n. 1
0
 public TeamInstanceBusiness(GameConfig gc, string difficulty)
 {
     m_members = Empty;
     int increment = Interlocked.Increment(ref __staticIncrement) & 0x00ffffff;
     int t = GetTimestampUtcNow();
     m_id = (((long)t) << 32) | ((UInt32)increment);
     m_gc = gc;
     m_difficulty = difficulty;
     m_movie = new List<Variant>();
     m_currentApcs = new List<EctypeApc>();
     foreach (var item in gc.Value.GetValueOrDefault<IList>("Movie"))
     {
         if (item is Variant)
         {
             m_movie.Add((Variant)item);
         }
     }
     Variant v = gc.Value.GetVariantOrDefault("Limit");
     if (v != null)
     {
         m_intoLimit = new IntoLimit(m_gc.ID, m_gc.Name, v);
         int maxStay = v.GetIntOrDefault("MaxStay");
         if (maxStay > 0)
         {
             OverTime = DateTime.UtcNow.AddSeconds(maxStay);
         }
     }
 }
Esempio n. 2
0
        public SceneBusiness(GameConfig scene)
        {
            m_players = new ConcurrentDictionary<string, PlayerBusiness>();
            m_walk = new List<Point>(256);
            m_map = new Dictionary<Point, int>(256);

            m_id = scene.ID;
            m_name = scene.Name;
            Variant v = (scene.Value == null ? null : scene.Value.GetVariantOrDefault("Config"));
            if (v != null)
            {
                m_fightInterval = v.GetIntOrDefault("TimeLimit");
                if (v.GetBooleanOrDefault("canFight"))
                {
                    m_fightType = FightType.PK;
                }
                else
                {
                    m_fightType = FightType.NotPK;
                }

                m_minLev = v.GetIntOrDefault("MinLevel");
                m_maxLev = v.GetIntOrDefault("MaxLevel");

                IntoLimit limit = new IntoLimit(m_id, m_name, v);
                if (!limit.IsEmpty)
                {
                    m_intoLimit = limit;
                }

                //初始化降生点道具回城和死亡回城点
                Variant bornPoint = v.GetVariantOrDefault("BornPoint");
                if (bornPoint != null)
                {
                    m_bornX = bornPoint.GetIntOrDefault("X");
                    m_bornY = bornPoint.GetIntOrDefault("Y");
                }
                m_propDest = InitDestination(v.GetVariantOrDefault("BackPoint"));
                m_deadDest = InitDestination(v.GetVariantOrDefault("DeadPoint"));
                m_skin = v.GetStringOrDefault("ReUseSceneID");
            }
        }
Esempio n. 3
0
        protected SceneBusiness(SceneBusiness scene)
        {
            m_players = new ConcurrentDictionary<string, PlayerBusiness>();
            m_walk = scene.m_walk;
            m_map = scene.m_map;
            m_id = scene.m_id;
            m_name = scene.m_name;
            m_skin = scene.m_skin;
            m_fightInterval = scene.m_fightInterval;
            m_fightType = scene.m_fightType;
            m_intoLimit = scene.m_intoLimit;
            m_bornX = scene.m_bornX;
            m_bornY = scene.m_bornY;
            m_propDest = scene.m_propDest;
            m_deadDest = scene.m_deadDest;

            m_showAll = scene.m_showAll;
            m_fightType = scene.m_fightType;
        }