Beispiel #1
0
        void HandleDBQueryBulk(DBQueryBulk dbQuery)
        {
            IDB2Storage store = Global.DB2Mgr.GetStorage(dbQuery.TableHash);

            if (store == null)
            {
                Log.outError(LogFilter.Network, "CMSG_DB_QUERY_BULK: {0} requested unsupported unknown hotfix type: {1}", GetPlayerInfo(), dbQuery.TableHash);
                return;
            }

            foreach (DBQueryBulk.DBQueryRecord record in dbQuery.Queries)
            {
                DBReply dbReply = new DBReply();
                dbReply.TableHash = dbQuery.TableHash;
                dbReply.RecordID  = record.RecordID;

                if (store.HasRecord(record.RecordID))
                {
                    dbReply.Allow     = true;
                    dbReply.Timestamp = (uint)GameTime.GetGameTime();
                    store.WriteRecord(record.RecordID, GetSessionDbcLocale(), dbReply.Data);
                }
                else
                {
                    Log.outTrace(LogFilter.Network, "CMSG_DB_QUERY_BULK: {0} requested non-existing entry {1} in datastore: {2}", GetPlayerInfo(), record.RecordID, dbQuery.TableHash);
                    dbReply.Timestamp = (uint)Time.UnixTime;
                }

                SendPacket(dbReply);
            }
        }
        void HandleDBQueryBulk(DBQueryBulk dbQuery)
        {
            IDB2Storage store = Global.DB2Mgr.GetStorage(dbQuery.TableHash);

            foreach (DBQueryBulk.DBQueryRecord record in dbQuery.Queries)
            {
                DBReply dbReply = new DBReply();
                dbReply.TableHash = dbQuery.TableHash;
                dbReply.RecordID  = record.RecordID;

                if (store != null && store.HasRecord(record.RecordID))
                {
                    dbReply.Status    = 1;
                    dbReply.Timestamp = (uint)GameTime.GetGameTime();
                    store.WriteRecord(record.RecordID, GetSessionDbcLocale(), dbReply.Data);

                    var optionalDataEntries = Global.DB2Mgr.GetHotfixOptionalData(dbQuery.TableHash, record.RecordID, GetSessionDbcLocale());
                    foreach (HotfixOptionalData optionalData in optionalDataEntries)
                    {
                        dbReply.Data.WriteUInt32(optionalData.Key);
                        dbReply.Data.WriteBytes(optionalData.Data);
                    }
                }
                else
                {
                    Log.outTrace(LogFilter.Network, "CMSG_DB_QUERY_BULK: {0} requested non-existing entry {1} in datastore: {2}", GetPlayerInfo(), record.RecordID, dbQuery.TableHash);
                    dbReply.Timestamp = (uint)Time.UnixTime;
                }

                SendPacket(dbReply);
            }
        }
Beispiel #3
0
        public void SendLfgJoinResult(LfgJoinResultData joinData)
        {
            LFGJoinResult lfgJoinResult = new LFGJoinResult();

            RideTicket ticket = Global.LFGMgr.GetTicket(GetPlayer().GetGUID());

            if (ticket != null)
            {
                lfgJoinResult.Ticket = ticket;
            }

            lfgJoinResult.Result = (byte)joinData.result;
            if (joinData.result == LfgJoinResult.RoleCheckFailed)
            {
                lfgJoinResult.ResultDetail = (byte)joinData.state;
            }

            foreach (var it in joinData.lockmap)
            {
                var blackList = new LFGJoinBlackList();
                blackList.PlayerGuid = it.Key;

                foreach (var lockInfo in it.Value)
                {
                    Log.outTrace(LogFilter.Lfg, "SendLfgJoinResult:: {0} DungeonID: {1} Lock status: {2} Required itemLevel: {3} Current itemLevel: {4}",
                                 it.Key.ToString(), (lockInfo.Key & 0x00FFFFFF), lockInfo.Value.lockStatus, lockInfo.Value.requiredItemLevel, lockInfo.Value.currentItemLevel);

                    blackList.Slots.Add(new LFGJoinBlackListSlot((int)lockInfo.Key, (int)lockInfo.Value.lockStatus, lockInfo.Value.requiredItemLevel, (int)lockInfo.Value.currentItemLevel));
                }
            }

            SendPacket(lfgJoinResult);
        }
        public override bool CanUpdateCriteriaTree(Criteria criteria, CriteriaTree tree, Player referencePlayer)
        {
            QuestObjective objective = tree.QuestObjective;

            if (objective == null)
            {
                return(false);
            }

            if (HasCompletedObjective(objective))
            {
                Log.outTrace(LogFilter.Player, $"QuestObjectiveCriteriaMgr.CanUpdateCriteriaTree: (Id: {criteria.Id} Type {criteria.Entry.Type} Quest Objective {objective.Id}) Objective already completed");
                return(false);
            }

            if (_owner.GetQuestStatus(objective.QuestID) != QuestStatus.Incomplete)
            {
                Log.outTrace(LogFilter.Achievement, $"QuestObjectiveCriteriaMgr.CanUpdateCriteriaTree: (Id: {criteria.Id} Type {criteria.Entry.Type} Quest Objective {objective.Id}) Not on quest");
                return(false);
            }

            Quest quest = Global.ObjectMgr.GetQuestTemplate(objective.QuestID);

            if (_owner.GetGroup() && _owner.GetGroup().IsRaidGroup() && !quest.IsAllowedInRaid(referencePlayer.GetMap().GetDifficultyID()))
            {
                Log.outTrace(LogFilter.Achievement, $"QuestObjectiveCriteriaMgr.CanUpdateCriteriaTree: (Id: {criteria.Id} Type {criteria.Entry.Type} Quest Objective {objective.Id}) Quest cannot be completed in raid group");
                return(false);
            }

            return(base.CanUpdateCriteriaTree(criteria, tree, referencePlayer));
        }
Beispiel #5
0
        public override bool CanUpdateCriteriaTree(Criteria criteria, CriteriaTree tree, Player referencePlayer)
        {
            QuestObjective objective = tree.QuestObjective;

            if (objective == null)
            {
                return(false);
            }

            if (HasCompletedObjective(objective))
            {
                Log.outTrace(LogFilter.Player, "QuestObjectiveCriteriaMgr.CanUpdateCriteriaTree: (Id: {criteria.ID} Type {criteria.Entry.Type} Quest Objective {objective.ID}) Objective already completed");
                return(false);
            }

            return(base.CanUpdateCriteriaTree(criteria, tree, referencePlayer));
        }