Beispiel #1
0
        /// <summary>
        /// Creates a new ArenaTeamRecord row in the database with the given information.
        /// </summary>
        /// <param name="leader">leader's character record</param>
        /// <param name="name">the name of the new character</param>
        /// <returns>the <seealso cref="T:WCell.RealmServer.Battlegrounds.Arenas.ArenaTeam" /> object</returns>
        public ArenaTeam(CharacterRecord leader, string name, uint type)
            : this()
        {
            this._id          = ArenaTeam._idGenerator.Next();
            this._leaderLowId = (int)leader.EntityLowId;
            this._name        = name;
            this._type        = (int)type;
            this.m_slot       = ArenaMgr.GetSlotByType(type);
            this.m_leader     = new ArenaTeamMember(leader, this, true);
            this.m_stats      = new ArenaTeamStats(this);
            this.Members.Add(this.m_leader.Id, this.m_leader);
            this.m_leader.Create();
            ServerApp <WCell.RealmServer.RealmServer> .IOQueue.AddMessage(new Action(((ActiveRecordBase)this).Create));

            this.Register();
        }
Beispiel #2
0
        /// <summary>
        /// Creates a new ArenaTeamRecord row in the database with the given information.
        /// </summary>
        /// <param name="leader">leader's character record</param>
        /// <param name="name">the name of the new character</param>
        /// <returns>the <seealso cref="ArenaTeam"/> object</returns>
        public ArenaTeam(CharacterRecord leader, string name, uint type)
            : this()
        {
            _id          = _idGenerator.Next();
            _leaderLowId = (int)leader.EntityLowId;
            _name        = name;
            _type        = (int)type;

            m_slot = ArenaMgr.GetSlotByType(type);

            m_leader = new ArenaTeamMember(leader, this, true);
            m_stats  = new ArenaTeamStats(this);

            Members.Add(m_leader.Id, m_leader);
            m_leader.Create();

            RealmServer.IOQueue.AddMessage(Create);
            Register();
        }
Beispiel #3
0
        internal void InitAfterLoad()
        {
            foreach (ArenaTeamMember arenaTeamMember in ArenaTeamMember.FindAll(this))
            {
                arenaTeamMember.Init(this);
                this.Members.Add(arenaTeamMember.Id, arenaTeamMember);
            }

            this.m_stats = ActiveRecordBase <ArenaTeamStats> .FindByPrimaryKey((object)this.Id);

            this.m_slot   = ArenaMgr.GetSlotByType(this.Type);
            this.m_leader = this[this.LeaderLowId];
            if (this.m_leader == null)
            {
                this.OnLeaderDeleted();
            }
            if (this.m_leader == null)
            {
                return;
            }
            this.Register();
        }
Beispiel #4
0
        /// <summary>
        /// Load & initialize the Team
        /// </summary>
        internal void InitAfterLoad()
        {
            var members = ArenaTeamMember.FindAll(this);

            foreach (var atm in members)
            {
                atm.Init(this);
                Members.Add(atm.Id, atm);
            }
            m_stats = ArenaTeamStats.FindByPrimaryKey(this.Id);
            m_slot  = ArenaMgr.GetSlotByType(Type);

            m_leader = this[LeaderLowId];
            if (m_leader == null)
            {
                OnLeaderDeleted();
            }
            if (m_leader != null)
            {
                Register();
            }
        }