Ejemplo n.º 1
0
        public static RankLevel GetInstance()
        {
            if (_rankLevel == null)
            {
                lock (typeof (RankLevel))
                {
                    if (_rankLevel == null)
                        _rankLevel = new RankLevel();
                }
            }

            return _rankLevel;
        }
Ejemplo n.º 2
0
        public static RankLevel GetInstance()
        {
            if (_rankLevel == null)
            {
                lock (typeof(RankLevel))
                {
                    if (_rankLevel == null)
                    {
                        _rankLevel = new RankLevel();
                    }
                }
            }

            return(_rankLevel);
        }
Ejemplo n.º 3
0
        public static void CalcClubFortuneIncrement()
        {
            foreach (var club in ClubLogic.GetActiveClubs())
            {
                try
                {
                    var clubFortuneIncrement = 0;

                    var members = ClubLogic.GetClubMembers(club.ID.Value);

                    foreach (var member in members)
                    {
                        try
                        {
                            var userInfo = Users.GetShortUserInfo(member.Userid.Value);

                            if (userInfo != null)
                            {
                                clubFortuneIncrement += FortuneContributeAlgorithm.CalcContributeFortune(userInfo, true);

                                //int memberFortune = (int)userInfo.Extcredits2;
                                //int memberCredit = userInfo.Credits;
                                //float memberMana = userInfo.Extcredits1;//威望

                                //clubFortuneIncrement += (int)(Config.ClubFortuneIncrementVariable * Math.Pow(Math.Log10(memberCredit), 4)) + (int)((memberMana + 1) * Math.Log10(memberFortune));
                            }
                        }
                        catch
                        {
                        }
                    }

                    club.Fortune = club.Fortune.Value + clubFortuneIncrement;

                    var ra = new RankAlgorithm(club);
                    club.RankLevel = RankLevel.GetInstance().GetRank(club.Fortune.Value).ID;

                    ClubLogic.SaveClub(club);
                }
                catch
                {
                }
            }
        }