コード例 #1
0
        void RecvHasQuestFinishRequirements(IIPSocket conn, BitStream r)
        {
            var questID = r.ReadQuestID();

            User user;

            if ((user = TryGetUser(conn)) == null)
            {
                return;
            }

            var quest           = _questManager.GetQuest(questID);
            var hasRequirements = false;

            if (quest == null)
            {
                const string errmsg = "User `{0}` sent request for invalid quest ID `{1}`.";
                if (log.IsWarnEnabled)
                {
                    log.WarnFormat(errmsg, user, questID);
                }
            }
            else
            {
                hasRequirements = quest.FinishRequirements.HasRequirements(user);
            }

            using (var pw = ServerPacket.HasQuestFinishRequirements(questID, hasRequirements))
            {
                user.Send(pw, ServerMessageType.GUI);
            }
        }