Exemplo n.º 1
0
        public int Update(NoneSimulationQuestCountValue noneSimulCountValue, ref DBUserQuests userQuestInfo, Int64 traceId)
        {
            var userID   = userQuestInfo._id;
            var hitCount = 0;

            if (noneSimulCountValue != null)
            {
                if (userQuestInfo.Quest.ID != 0 && userQuestInfo.Quest.IsC == false && userQuestInfo.Quest.ST > 0)
                {
                    var quest = Loader.GetQuestData(userQuestInfo.Quest.ID);
                    if (quest == null)
                    {
                        OPLogger.Error(LOG_TYPE.QUEST_PR_UPDATE, traceId, string.Format("UserID:{0}, 퀘스트ID:{1} 정보가 없음", userID, userQuestInfo.Quest.ID));
                        return(hitCount);
                    }

                    hitCount += noneSimulCountValue.Update(quest.SubjectID,
                                                           quest.SubjectCountOpenStart,
                                                           ref userQuestInfo.Quest.PR);

                    CheckUpdateComplete(quest.SubjectCount, userQuestInfo.Quest.PR, ref userQuestInfo.Quest.IsC);
                }

                for (int i = 0; i < userQuestInfo.DQList.Count; ++i)
                {
                    if (userQuestInfo.DQList[i].ID != 0 && userQuestInfo.DQList[i].IsC == false && userQuestInfo.DQList[i].ST > 0)
                    {
                        var quest = Loader.GetQuestData(userQuestInfo.DQList[i].ID);
                        if (quest == null)
                        {
                            OPLogger.Error(LOG_TYPE.QUEST_PR_UPDATE, traceId, string.Format("UserID:{0}, 퀘스트ID:{1} 정보가 없음", userID, userQuestInfo.DQList[i].ID));
                            continue;
                        }

                        hitCount += noneSimulCountValue.Update(quest.SubjectID,
                                                               quest.SubjectCountOpenStart,
                                                               ref userQuestInfo.DQList[i].PR);

                        CheckUpdateComplete(quest.SubjectCount, userQuestInfo.DQList[i].PR, ref userQuestInfo.DQList[i].IsC);
                    }
                }
            }

            return(hitCount);
        }
Exemplo n.º 2
0
        public static async Task <int> Update(string userID, NoneSimulationQuestCountValue noneSimulCountValue, Int64 traceId = 0)
        {
            int updateCount = 0;

            var userQuestInfo = await DBUserGameData.GetQuestData(userID);

            if (userQuestInfo != null)
            {
                updateCount = CountUpdaterInst.Update(noneSimulCountValue, ref userQuestInfo, traceId);
                if (updateCount > 0)
                {
                    await DBUserGameData.SaveQuestData(userQuestInfo);
                }
            }
            else
            {
                OPLogger.Error(LOG_TYPE.QUEST_PR_UPDATE, traceId, string.Format("{0} 유저의 퀘스트 정보가 없습니다", userID));
            }

            return(updateCount);
        }