Ejemplo n.º 1
0
 public EchelonTemplate(FairyWithUserInfo fairy)
 {
     this.fairyWithUserId = fairy.id;
     this.teamId          = fairy.team;
     this.location        = 6;
     Refresh();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 요정 스킬훈련 완료
        /// ("Fairy/finishUpgrade")
        /// ("Fairy/quickUpgrade")
        /// </summary>
        /// <param name="request_string"></param>
        /// <param name="response_string"></param>
        public static void FinishSkillTrain(string request_string, string response_string)
        {
            #region Packet Example
            // request

            /*
             *  {
             *      "upgrade_slot": 1
             *  }
             */
            #endregion
            try
            {
                log.Debug("요정 스킬훈련 완료");
                JObject request = Parser.Json.ParseJObject(request_string);
                if (request != null)
                {
                    int upgradeSlot             = Parser.Json.ParseInt(request["upgrade_slot"]);
                    SkillTrainTemplate template = dashboardView.GetSlotSkillTrain(upgradeSlot);
                    if (template != null && template.fairyWithUserId > 0)
                    {
                        long id = template.fairyWithUserId;
                        FairyWithUserInfo fairy = UserData.Fairy.Get(id);
                        if (fairy != null)
                        {
                            fairy.skill = template.toSkillLevel;
                            UserData.Fairy.Set(fairy);
                        }
                    }

                    // 알림 탭 제거
                    dashboardView.Remove(template);
                }
            }
            catch (Exception ex)
            {
                log.Error(ex, "failed to get Fairy/finishUpgrade");
            }
        }
Ejemplo n.º 3
0
        // ==============================================
        // ===== Function
        // ==============================================
        #region Function

        /// <summary>
        /// 새로고침
        /// </summary>
        /// <param name="refresh"></param>
        public void Refresh(bool forceUpdate = false)
        {
            if (this.gunWithUserId > 0)
            {
                DollWithUserInfo data = UserData.Doll.Get(this.gunWithUserId);
                if (data != null)
                {
                    data.Refresh(DollWithUserInfo.REFRESH.ALL, forceUpdate);
                    this.assign    = data.location == 1 ? "LEADER" : "";
                    this.location  = data.location;
                    this.star      = data.star;
                    this.collabo   = data.collabo;
                    this.level     = data.level;
                    this.maxLevel  = data.maxLevel;
                    this.number    = data.link.ToString();
                    this.maxNumber = data.maxLink.ToString();
                    this.name      = data.name;
                    if (data.remainExp == 0 && data.level == data.maxLevel)
                    {
                        this.remainExp = "MAX";
                    }
                    else
                    {
                        this.remainExp = data.remainExp.ToString();
                    }
                    this.type        = data.type;
                    this.hp          = data.hp.ToString();
                    this.maxHp       = data.maxHp.ToString();
                    this.TBHpWarning = data.hpWarningLevel.ToString();

                    this.hpHeight  = (double)data.hp / (double)data.maxHp * this.maxHpHeight;
                    this.expHeight = (double)data.currentExp / (double)data.maxExp * this.maxExpHeight;

                    this.typeIcon = GetTypeIcon(this.type, "", this.star, this.collabo);

                    this.supply[0] = data.ammo;
                    this.supply[1] = data.mre;
                    OnPropertyChanged("supply");

                    this.runCount = data.runCount;
                    OnPropertyChanged("runCount");
                    this.reportCount = data.reportCount;
                    OnPropertyChanged("reportCount");

                    int[] restore = data.restore;
                    if (restore.Length == 3)
                    {
                        this.TBRestoreRequireTime     = TimeUtil.GetRemainHHMMSS(data.restore[0] + TimeUtil.GetCurrentSec());
                        this.TBRestoreRequireManpower = restore[1].ToString();
                        this.TBRestoreRequirePart     = restore[2].ToString();
                    }
                    OnPropertyChanged("TBRestoreRequireTime");
                    OnPropertyChanged("TBRestoreRequireManpower");
                    OnPropertyChanged("TBRestoreRequirePart");
                }
                else
                {
                    log.Warn("인형 정보가 존재하지 않음 {0}", this.gunWithUserId);
                }
            }
            else if (this.fairyWithUserId > 0)
            {
                FairyWithUserInfo data = UserData.Fairy.Get(this.fairyWithUserId);
                if (data != null)
                {
                    this.type      = "FAIRY";
                    this.fairyType = data.category;
                    this.location  = 6;
                    this.level     = data.level;
                    this.maxLevel  = data.maxLevel;
                    this.name      = data.name;
                    if (data.remainExp == 0 && data.level == data.maxLevel)
                    {
                        this.remainExp = "MAX";
                    }
                    else
                    {
                        this.remainExp = data.remainExp.ToString();
                    }
                    this.fairyTrait  = data.traitName;
                    this.isRareTrait = data.isRareTrait.ToString();

                    this.expHeight = (double)data.currentExp / (double)data.maxExp * this.maxExpHeight;

                    this.typeIcon = GetTypeIcon(this.type, this.fairyType, 0, false);

                    data.Refresh(FairyWithUserInfo.REFRESH.CHANGE_TEAM_EXP);

                    if (data.remainExp == 0)
                    {
                        this.runCount    = new long[] { 0, 0, 0 };
                        this.reportCount = new long[] { 0, 0, 0 };
                    }
                    else
                    {
                        this.runCount    = data.runCount;
                        this.reportCount = data.reportCount;
                    }

                    this.TBRestoreRequireTime = "00:00:00";
                    OnPropertyChanged("TBRestoreRequireTime");
                }
                else
                {
                    log.Warn("요정 정보가 존재하지 않음 {0}", this.fairyWithUserId);
                }
            }
        }