초기커밋
This commit is contained in:
14
GameServer/Contents/Quest/QuestChecker/IQuest.cs
Normal file
14
GameServer/Contents/Quest/QuestChecker/IQuest.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public interface IQuest
|
||||
{
|
||||
bool checkValidTaskScript(QuestAttribute questAttribute, QuestTaskUpdateHandler questTaskUpdateHandler);
|
||||
|
||||
Result questTaskFunctionProgress(Player player, ref QuestTaskUpdateHandler questTaskUpdateHandler);
|
||||
Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler);
|
||||
|
||||
}
|
||||
}
|
||||
18
GameServer/Contents/Quest/QuestChecker/QuestActiveQuest.cs
Normal file
18
GameServer/Contents/Quest/QuestChecker/QuestActiveQuest.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestActiveQuest : QuestBase
|
||||
{
|
||||
public QuestActiveQuest(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, UInt32 questId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = questId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
GameServer/Contents/Quest/QuestChecker/QuestAvatarProfile.cs
Normal file
12
GameServer/Contents/Quest/QuestChecker/QuestAvatarProfile.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestAvatarProfile : QuestBase
|
||||
{
|
||||
public QuestAvatarProfile(EQuestEventTargetType targetType, EQuestEventNameType eventNameType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
215
GameServer/Contents/Quest/QuestChecker/QuestBase.cs
Normal file
215
GameServer/Contents/Quest/QuestChecker/QuestBase.cs
Normal file
@@ -0,0 +1,215 @@
|
||||
using Amazon.DynamoDBv2.Model.Internal.MarshallTransformations;
|
||||
using GameServer;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MetaAssets;
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Intrinsics.Arm;
|
||||
|
||||
// TODO: spooky000 테이블 코드 교체 작업으로 인해 현재 안 쓰는 코드는 주석 처리해 둠.
|
||||
// questTaskFunctionProgress 함수 호출되지 않아 reward 관련 코드 주석 처리.
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public abstract class QuestBase : IQuest
|
||||
{
|
||||
public EQuestEventTargetType m_target_type;
|
||||
public EQuestEventNameType m_name_type;
|
||||
|
||||
public int m_request_idx { get; set; }
|
||||
public string m_active_event_string { get; set; } = string.Empty;
|
||||
public string m_condition_1 { get; set; } = string.Empty;
|
||||
public string m_condition_2 { get; set; } = string.Empty;
|
||||
public string m_condition_3 { get; set; } = string.Empty;
|
||||
|
||||
public QuestBase(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int requestIdx, string cond1, string cond2, string cond3)
|
||||
{
|
||||
m_target_type = targetType;
|
||||
m_name_type = eventNameType;
|
||||
|
||||
m_request_idx = requestIdx;
|
||||
m_condition_1 = cond1;
|
||||
m_condition_2 = cond2;
|
||||
m_condition_3 = cond3;
|
||||
}
|
||||
|
||||
public QuestBase(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string eventString, string cond1, string cond2, string cond3)
|
||||
{
|
||||
m_target_type = targetType;
|
||||
m_name_type = eventNameType;
|
||||
|
||||
m_active_event_string = eventString;
|
||||
m_condition_1 = cond1;
|
||||
m_condition_2 = cond2;
|
||||
m_condition_3 = cond3;
|
||||
}
|
||||
|
||||
|
||||
public virtual bool checkValidTaskScript(QuestAttribute questAttribute, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
var quest_task = questTaskUpdateHandler.m_quest_task_group;
|
||||
var event_string = questTaskUpdateHandler.m_active_event;
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(quest_task, () => $"quest_task is null !!!");
|
||||
|
||||
var result = QuestMetaHelper.getQuestTaskEventGroupByEventString(quest_task, event_string, out var events);
|
||||
if (result.isFail()) return false;
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(events, () => $"events is null !!!");
|
||||
|
||||
if (!events.EventTarget.Equals(m_target_type.ToString()) || !events.EventName.Equals(m_name_type.ToString())) return false;
|
||||
|
||||
bool subCheck = checkSubValidTaskScript(questAttribute, events);
|
||||
return subCheck;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public virtual bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events) { return true; }
|
||||
|
||||
public virtual async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
return new Result();
|
||||
}
|
||||
|
||||
|
||||
public virtual Result questTaskFunctionProgress(Player player, ref QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
var quest_action = player.getEntityAction<QuestAction>();
|
||||
var quest_id = questTaskUpdateHandler.m_quest_id;
|
||||
|
||||
var quest = questTaskUpdateHandler.m_quest;
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(quest, () => $"quest is null !!!");
|
||||
|
||||
var quest_attribute = quest.getEntityAttribute<QuestAttribute>();
|
||||
NullReferenceCheckHelper.throwIfNull(quest_attribute, () => $"quest_attribute is null !!!");
|
||||
|
||||
var active_evnet = questTaskUpdateHandler.m_active_event;
|
||||
var quest_task_group = questTaskUpdateHandler.m_quest_task_group;
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(quest_task_group, () => $"quest_task_group is null !!!");
|
||||
|
||||
var result = QuestMetaHelper.getQuestTaskEventGroupByEventString(quest_task_group, active_evnet, out var questEventInfo);
|
||||
if(result.isFail()) return result;
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(questEventInfo, () => $"questEventInfo is null !!!");
|
||||
|
||||
result = functionCheck(player, questEventInfo, quest_attribute, ref questTaskUpdateHandler);
|
||||
if (result.isFail()) return result;
|
||||
|
||||
quest_attribute.ActiveEvents.Remove(active_evnet);
|
||||
|
||||
//패러럴일경우 문자열을 가지고 있는다.
|
||||
if (quest_task_group.EventStringList.Count >= 2)
|
||||
{
|
||||
string str = MetaData.Instance.makeEventScriptStringByEventInfo(questEventInfo);
|
||||
quest_attribute.CompletedIdxStrings.Add(str);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private Result functionCheck(Player player, QuestEventInfo questEventInfo, QuestAttribute quest_attribute, ref QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
var result = new Result();
|
||||
|
||||
foreach (var funcInfo in questEventInfo.QuestEventFunctionList)
|
||||
{
|
||||
if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.QUEST)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.COMPLETE)))
|
||||
{
|
||||
quest_attribute.IsComplete = true ? 1 : 0;
|
||||
quest_attribute.ActiveEvents.Clear();
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.COUNTER)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.INCREASE)))
|
||||
{
|
||||
int counter = int.Parse(funcInfo.FunctionCondition1);
|
||||
quest_attribute.CurrentCounter += counter;
|
||||
|
||||
questTaskUpdateHandler.m_need_counter_check = true;
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.TASK)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.COMPLETE)))
|
||||
{
|
||||
quest_attribute.CurrentTaskComplete = 1;
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.TASK)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.ACTIVE)))
|
||||
{
|
||||
questTaskUpdateHandler.m_next_task_number = int.Parse(funcInfo.FunctionCondition1);
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.REWARD)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.SET)))
|
||||
{
|
||||
quest_attribute.ReplacedRewardGroupId = int.Parse(funcInfo.FunctionCondition1);
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.TIMER)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.START)))
|
||||
{
|
||||
quest_attribute.HasTimer = 1;
|
||||
if (long.TryParse(funcInfo.FunctionCondition1, out long elapsedTime) == false)
|
||||
{
|
||||
Log.getLogger().error($"{funcInfo.FunctionCondition1} is not number");
|
||||
elapsedTime = 10000000;
|
||||
}
|
||||
DateTime now = DateTime.UtcNow;
|
||||
quest_attribute.TimerCompleteTime = now.AddSeconds(elapsedTime);
|
||||
QuestManager.It.m_timer_check_users.TryAdd(player.getUserGuid(), string.Empty);
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.ITEM)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.GIVE)))
|
||||
{
|
||||
(result, var reward) = RewardManager.It.makeRewardFromItemStr(funcInfo.FunctionCondition1, funcInfo.FunctionCondition2);
|
||||
if (result.isFail()) return result;
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(reward, () => $"reward is null !!!");
|
||||
questTaskUpdateHandler.m_rewards.Add(reward);
|
||||
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.ITEM)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.DELETE)))
|
||||
{
|
||||
if (false == int.TryParse(funcInfo.FunctionCondition1, out int delete_item_id))
|
||||
{
|
||||
string err_msg = $"delete item id is not number : {funcInfo.FunctionCondition1}";
|
||||
result.setFail(ServerErrorCode.ItemParsingFromStringToIntErorr, err_msg);
|
||||
Log.getLogger().error(result.toBasicString());
|
||||
return result;
|
||||
}
|
||||
if (false == int.TryParse(funcInfo.FunctionCondition2, out int delete_item_cnt))
|
||||
{
|
||||
string err_msg = $"delete item id is not number : {funcInfo.FunctionCondition2}";
|
||||
result.setFail(ServerErrorCode.ItemParsingFromStringToIntErorr, err_msg);
|
||||
Log.getLogger().error(result.toBasicString());
|
||||
return result;
|
||||
}
|
||||
questTaskUpdateHandler.m_deletable_items.TryAdd(delete_item_id, delete_item_cnt);
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.REWARD)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.GIVE)))
|
||||
{
|
||||
(var resutlt, var reward_metas) = RewardManager.It.makeRewardsInfo(funcInfo.FunctionCondition1);
|
||||
if (resutlt.isFail())
|
||||
{
|
||||
return resutlt;
|
||||
}
|
||||
|
||||
NullReferenceCheckHelper.throwIfNull(reward_metas, () => $"reward_metas is null !!!");
|
||||
|
||||
foreach (var meta in reward_metas)
|
||||
{
|
||||
questTaskUpdateHandler.m_rewards.Add(meta.Reward);
|
||||
}
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.QUEST)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.ASSIGN)))
|
||||
{
|
||||
questTaskUpdateHandler.m_last_check_functions.Add(funcInfo);
|
||||
}
|
||||
else if (funcInfo.FunctionTarget.Equals(nameof(EQuestFunctionTargetType.PROP)) && funcInfo.FunctionName.Equals(nameof(EQuestFunctionNameType.SWITCH)))
|
||||
{
|
||||
questTaskUpdateHandler.m_last_check_functions.Add(funcInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
25
GameServer/Contents/Quest/QuestChecker/QuestBuff.cs
Normal file
25
GameServer/Contents/Quest/QuestChecker/QuestBuff.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestBuff : QuestBase
|
||||
{
|
||||
public QuestBuff(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int buffId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = buffId.ToString();
|
||||
}
|
||||
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
23
GameServer/Contents/Quest/QuestChecker/QuestChair.cs
Normal file
23
GameServer/Contents/Quest/QuestChecker/QuestChair.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestChair : QuestBase
|
||||
{
|
||||
public QuestChair(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int tableId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = tableId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
GameServer/Contents/Quest/QuestChecker/QuestChannel.cs
Normal file
11
GameServer/Contents/Quest/QuestChecker/QuestChannel.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer.Quest
|
||||
{
|
||||
public class QuestChannel : QuestBase
|
||||
{
|
||||
public QuestChannel(EQuestEventTargetType targetType, EQuestEventNameType eventNameType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
21
GameServer/Contents/Quest/QuestChecker/QuestChat.cs
Normal file
21
GameServer/Contents/Quest/QuestChecker/QuestChat.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestChat : QuestBase
|
||||
{
|
||||
public QuestChat(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string chatType, string msg) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = chatType;
|
||||
m_condition_2 = msg;
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (!events.EventCondition1.Equals(m_condition_1)) return false;
|
||||
|
||||
if (m_condition_2.ToUpper().Contains(events.EventCondition2.ToUpper())) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
GameServer/Contents/Quest/QuestChecker/QuestClaim.cs
Normal file
24
GameServer/Contents/Quest/QuestChecker/QuestClaim.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestClaim : QuestBase
|
||||
{
|
||||
public QuestClaim(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string type) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = type;
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1) || events.EventCondition1.Equals("ALL")) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
GameServer/Contents/Quest/QuestChecker/QuestClientSide.cs
Normal file
15
GameServer/Contents/Quest/QuestChecker/QuestClientSide.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestClientSide : QuestBase
|
||||
{
|
||||
public QuestClientSide(Player owner) : base(EQuestEventTargetType.NONE, EQuestEventNameType.NONE, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
24
GameServer/Contents/Quest/QuestChecker/QuestConcert.cs
Normal file
24
GameServer/Contents/Quest/QuestChecker/QuestConcert.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestConcert : QuestBase
|
||||
{
|
||||
public QuestConcert(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int concertId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = concertId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
88
GameServer/Contents/Quest/QuestChecker/QuestCostume.cs
Normal file
88
GameServer/Contents/Quest/QuestChecker/QuestCostume.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
using System.Text.Json;
|
||||
using static ClientToGameReq.Types;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestCostume : QuestBase
|
||||
{
|
||||
ClothInfo changedClothInfo = new();
|
||||
public QuestCostume(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, ClothInfo cloth) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
Log.getLogger().debug($"QuestCostume Constructor Call", JsonConvert.SerializeObject(cloth));
|
||||
changedClothInfo = cloth.Clone();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
/*
|
||||
cloth_avatar = 5;
|
||||
cloth_headwear = 6;
|
||||
cloth_mask = 7;
|
||||
cloth_bag = 8;
|
||||
cloth_shoes = 9;
|
||||
cloth_outer = 10;
|
||||
cloth_tops = 11;
|
||||
cloth_bottoms = 12;
|
||||
cloth_gloves = 13;
|
||||
cloth_earrings = 14;
|
||||
cloth_neckless = 15;
|
||||
cloth_socks = 16;
|
||||
*/
|
||||
if (events.EventCondition1.Equals(ClothSlotType.Avatar.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothAvatar) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Headwear.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothHeadwear) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Mask.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothMask) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Bag.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothBag) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Shoes.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothShoes) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Outer.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothOuter) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Tops.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothTops) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Bottoms.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothBottoms) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Gloves.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothGloves) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Earrings.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothEarrings) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Neckless.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothNeckless) return true;
|
||||
}
|
||||
else if (events.EventCondition1.Equals(ClothSlotType.Socks.ToString().ToUpper()))
|
||||
{
|
||||
if (int.Parse(events.EventCondition2) == changedClothInfo.ClothSocks) return true;
|
||||
}
|
||||
|
||||
Log.getLogger().error($"{events.EventCondition1} does Not Match");
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
19
GameServer/Contents/Quest/QuestChecker/QuestCount.cs
Normal file
19
GameServer/Contents/Quest/QuestChecker/QuestCount.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestCount : QuestBase
|
||||
{
|
||||
public QuestCount(EQuestEventTargetType targetType, EQuestEventNameType eventNameType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (questAttribute.MaxCounter <= questAttribute.CurrentCounter) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
GameServer/Contents/Quest/QuestChecker/QuestCrafting.cs
Normal file
19
GameServer/Contents/Quest/QuestChecker/QuestCrafting.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer;
|
||||
public class QuestCrafting : QuestBase
|
||||
{
|
||||
public QuestCrafting(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, Int32 craftingId) : base(targetType, eventNameType, 0, craftingId.ToString(), string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
23
GameServer/Contents/Quest/QuestChecker/QuestDressRoom.cs
Normal file
23
GameServer/Contents/Quest/QuestChecker/QuestDressRoom.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestDressRoom : QuestBase
|
||||
{
|
||||
public QuestDressRoom(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string enterType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = enterType;
|
||||
}
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
32
GameServer/Contents/Quest/QuestChecker/QuestEmpty.cs
Normal file
32
GameServer/Contents/Quest/QuestChecker/QuestEmpty.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using GameServer;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
//치트용을 위한 클래스 추후 구조개선때 수정 필요
|
||||
public class QuestEmpty : QuestBase
|
||||
{
|
||||
public QuestEmpty() : base(EQuestEventTargetType.NONE, EQuestEventNameType.NONE, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool checkValidTaskScript(QuestAttribute questAttribute, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
GameServer/Contents/Quest/QuestChecker/QuestFarming.cs
Normal file
22
GameServer/Contents/Quest/QuestChecker/QuestFarming.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class QuestFarming : QuestBase
|
||||
{
|
||||
public QuestFarming(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string farmingPropId, string entityType) : base(targetType, eventNameType, 0, farmingPropId, entityType, string.Empty)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1) && events.EventCondition2.Equals(m_condition_2)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
17
GameServer/Contents/Quest/QuestChecker/QuestFriend.cs
Normal file
17
GameServer/Contents/Quest/QuestChecker/QuestFriend.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestFriend : QuestBase
|
||||
{
|
||||
public QuestFriend(EQuestEventTargetType targetType, EQuestEventNameType eventNameType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
35
GameServer/Contents/Quest/QuestChecker/QuestInstance.cs
Normal file
35
GameServer/Contents/Quest/QuestChecker/QuestInstance.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestInstance : QuestBase
|
||||
{
|
||||
public QuestInstance(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int landId, int floorId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = landId.ToString();
|
||||
m_condition_2 = floorId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
switch (m_name_type)
|
||||
{
|
||||
case EQuestEventNameType.ENTERED:
|
||||
if (events.EventCondition1.Equals(m_condition_1) && events.EventCondition2.Equals(m_condition_2)) return true;
|
||||
break;
|
||||
case EQuestEventNameType.EXITED:
|
||||
if (events.EventCondition2.Equals(m_condition_2)) return true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
37
GameServer/Contents/Quest/QuestChecker/QuestInteriroMode.cs
Normal file
37
GameServer/Contents/Quest/QuestChecker/QuestInteriroMode.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class QuestInteriroMode : QuestBase
|
||||
{
|
||||
private Int32 m_count = 0;
|
||||
public QuestInteriroMode(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string typeName, int count) : base(targetType, eventNameType, 0, typeName, count.ToString(), string.Empty)
|
||||
{
|
||||
m_count = count;
|
||||
if (count == 0)
|
||||
{
|
||||
m_condition_2 = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
|
||||
if (false == events.EventCondition1.Equals(m_condition_1)) return false;
|
||||
if(events.EventCondition2.Equals(string.Empty)) return true;
|
||||
|
||||
if (false == int.TryParse(events.EventCondition2, out var cond2)) return false;
|
||||
if (cond2 > m_count) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
36
GameServer/Contents/Quest/QuestChecker/QuestItem.cs
Normal file
36
GameServer/Contents/Quest/QuestChecker/QuestItem.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestItem : QuestBase
|
||||
{
|
||||
List<int> m_item_ids = new List<int>();
|
||||
public QuestItem(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int itemId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_item_ids = new List<int>();
|
||||
m_item_ids.Add(itemId);
|
||||
}
|
||||
|
||||
public QuestItem(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, List<int> itemIds) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_item_ids = new List<int>();
|
||||
m_item_ids.AddRange(itemIds);
|
||||
}
|
||||
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
foreach (int itemId in m_item_ids)
|
||||
{
|
||||
if (events.EventCondition3.Equals(itemId.ToString())) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
GameServer/Contents/Quest/QuestChecker/QuestMail.cs
Normal file
26
GameServer/Contents/Quest/QuestChecker/QuestMail.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using ServerCommon;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestMail : QuestBase
|
||||
{
|
||||
public QuestMail(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string msg) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = msg;
|
||||
}
|
||||
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
switch (m_name_type)
|
||||
{
|
||||
case EQuestEventNameType.RECEIVED:
|
||||
return true;
|
||||
case EQuestEventNameType.SENDED:
|
||||
if (m_condition_1.Contains(events.EventCondition1)) return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
GameServer/Contents/Quest/QuestChecker/QuestMannequin.cs
Normal file
30
GameServer/Contents/Quest/QuestChecker/QuestMannequin.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestMannequin : QuestBase
|
||||
{
|
||||
List<int> m_items = new List<int>();
|
||||
public QuestMannequin(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, List<int> items) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_items = items;
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (!int.TryParse(events.EventCondition2, out var itemId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (m_items.Contains(itemId)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
GameServer/Contents/Quest/QuestChecker/QuestMyHome.cs
Normal file
30
GameServer/Contents/Quest/QuestChecker/QuestMyHome.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
using ServerCommon.Cache;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestMyHome : QuestBase
|
||||
{
|
||||
public QuestMyHome(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string type) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = type;
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
GameServer/Contents/Quest/QuestChecker/QuestParty.cs
Normal file
22
GameServer/Contents/Quest/QuestChecker/QuestParty.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestParty : QuestBase
|
||||
{
|
||||
public QuestParty(EQuestEventTargetType targetType, EQuestEventNameType eventNameType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
24
GameServer/Contents/Quest/QuestChecker/QuestProp.cs
Normal file
24
GameServer/Contents/Quest/QuestChecker/QuestProp.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestProp : QuestBase
|
||||
{
|
||||
public QuestProp(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int itemId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = itemId.ToString();
|
||||
}
|
||||
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
34
GameServer/Contents/Quest/QuestChecker/QuestRentalVisit.cs
Normal file
34
GameServer/Contents/Quest/QuestChecker/QuestRentalVisit.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Concurrent;
|
||||
using GameServer;
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
|
||||
public class QuestRentalVisit : QuestBase
|
||||
{
|
||||
private string m_pair_guid { get; set; } = string.Empty;
|
||||
private RentalInstanceVisitAttribute m_attribute_nullable { get; }
|
||||
|
||||
public QuestRentalVisit(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string myhomeGuid, string ownerGuid, RentalInstanceVisitAttribute attribute) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_pair_guid = myhomeGuid + ":" + ownerGuid;
|
||||
m_attribute_nullable = attribute;
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (true == m_attribute_nullable.m_rental_instance_visit.ContainsKey(m_pair_guid)) return false;
|
||||
|
||||
var now = DateTimeHelper.Current;
|
||||
m_attribute_nullable.m_rental_instance_visit.AddOrUpdate(m_pair_guid, now, (key, old) => now);
|
||||
m_attribute_nullable.modifiedEntityAttribute(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
return await QuestNotifyHelper.sendRedisQuestNotifyRequest(player, questTaskUpdateHandler);
|
||||
}
|
||||
}
|
||||
23
GameServer/Contents/Quest/QuestChecker/QuestReward.cs
Normal file
23
GameServer/Contents/Quest/QuestChecker/QuestReward.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestReward : QuestBase
|
||||
{
|
||||
public QuestReward(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int rewardGroupId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = rewardGroupId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
23
GameServer/Contents/Quest/QuestChecker/QuestSocialAction.cs
Normal file
23
GameServer/Contents/Quest/QuestChecker/QuestSocialAction.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
internal class QuestSocialAction : QuestBase
|
||||
{
|
||||
public QuestSocialAction(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int socialActionId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = socialActionId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
19
GameServer/Contents/Quest/QuestChecker/QuestTaskActive.cs
Normal file
19
GameServer/Contents/Quest/QuestChecker/QuestTaskActive.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestTaskActive : QuestBase
|
||||
{
|
||||
public QuestTaskActive(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int taskId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = taskId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
39
GameServer/Contents/Quest/QuestChecker/QuestTaskReward.cs
Normal file
39
GameServer/Contents/Quest/QuestChecker/QuestTaskReward.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using GameServer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer;
|
||||
public class QuestTaskReward : RewardBase
|
||||
{
|
||||
QuestTaskUpdateHandler m_quest_task_update_handler;
|
||||
public QuestTaskReward(Player player, string userGuid, QuestTaskUpdateHandler questTaskUpdateHandler) : base(player, userGuid, questTaskUpdateHandler.m_rewards)
|
||||
{
|
||||
m_quest_task_update_handler = questTaskUpdateHandler;
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
// 보상전 처리해야되는 것들 처리
|
||||
//=====================================================================================
|
||||
public override Task<Result> prepareReward()
|
||||
{
|
||||
var result = new Result();
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
// 보상처리 후 필요한 로직들 처리
|
||||
//=====================================================================================
|
||||
public override Task<Result> finalizeReward()
|
||||
{
|
||||
var result = new Result();
|
||||
|
||||
m_quest_task_update_handler.m_rewarded_money.AddRange(getRewardedMoneys());
|
||||
m_quest_task_update_handler.m_rewarded_items.AddRange(getRewardedItems());
|
||||
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
|
||||
}
|
||||
37
GameServer/Contents/Quest/QuestChecker/QuestTaskSave.cs
Normal file
37
GameServer/Contents/Quest/QuestChecker/QuestTaskSave.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Google.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using ServerCore;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
using ServerCommon.BusinessLogDomain;
|
||||
using MetaAssets;
|
||||
|
||||
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class QuestTaskSave : RewardBase
|
||||
{
|
||||
public QuestTaskSave(Player player, string userGuid, List<MetaAssets.RewardMetaData> rewarDatas) : base(player, userGuid)
|
||||
{
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
// 보상전 처리해야되는 것들 처리
|
||||
//=====================================================================================
|
||||
public override Task<Result> prepareReward()
|
||||
{
|
||||
return Task.FromResult(new Result());
|
||||
}
|
||||
|
||||
//=====================================================================================
|
||||
// 보상처리 후 필요한 로직들 처리
|
||||
//=====================================================================================
|
||||
public override Task<Result> finalizeReward()
|
||||
{
|
||||
var result = new Result();
|
||||
return Task.FromResult(result);
|
||||
}
|
||||
}
|
||||
24
GameServer/Contents/Quest/QuestChecker/QuestTattoo.cs
Normal file
24
GameServer/Contents/Quest/QuestChecker/QuestTattoo.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestTattoo : QuestBase
|
||||
{
|
||||
public QuestTattoo(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int itemId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = itemId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
24
GameServer/Contents/Quest/QuestChecker/QuestTaxi.cs
Normal file
24
GameServer/Contents/Quest/QuestChecker/QuestTaxi.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestTaxi : QuestBase
|
||||
{
|
||||
public QuestTaxi(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int arrivedTaxiId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = arrivedTaxiId.ToString();
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
38
GameServer/Contents/Quest/QuestChecker/QuestTimer.cs
Normal file
38
GameServer/Contents/Quest/QuestChecker/QuestTimer.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using GameServer;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using ServerCommon;
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestTimer : QuestBase
|
||||
{
|
||||
public QuestTimer(EQuestEventTargetType targetType, EQuestEventNameType eventNameType) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
DateTime nowDt = DateTimeHelper.Current;
|
||||
|
||||
if (questAttribute.TimerCompleteTime <= nowDt)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override async Task<Result> postProcess(Player player, QuestTaskUpdateHandler questTaskUpdateHandler)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
|
||||
if (player is not null)
|
||||
{
|
||||
QuestManager.It.m_timer_check_users.TryRemove(player.getUserGuid(), out _);
|
||||
}
|
||||
|
||||
return new();
|
||||
}
|
||||
}
|
||||
}
|
||||
24
GameServer/Contents/Quest/QuestChecker/QuestTool.cs
Normal file
24
GameServer/Contents/Quest/QuestChecker/QuestTool.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using ServerCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GameServer
|
||||
{
|
||||
public class QuestTool : QuestBase
|
||||
{
|
||||
public QuestTool(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int toolId) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_condition_1 = toolId.ToString();
|
||||
}
|
||||
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if (events.EventCondition1.Equals(m_condition_1)) return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
22
GameServer/Contents/Quest/QuestChecker/QuestTpsPlayerKill.cs
Normal file
22
GameServer/Contents/Quest/QuestChecker/QuestTpsPlayerKill.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using ServerCommon;
|
||||
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class QuestTpsPlayerKill : QuestBase
|
||||
{
|
||||
private Int32 m_kill_count = 0;
|
||||
public QuestTpsPlayerKill(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, int killCount) : base(targetType, eventNameType, 0, string.Empty, string.Empty, string.Empty)
|
||||
{
|
||||
m_kill_count = killCount;
|
||||
}
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
var kill_count = int.Parse(events.EventCondition1);
|
||||
|
||||
if (m_kill_count >= kill_count) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
27
GameServer/Contents/Quest/QuestChecker/QuestUgq.cs
Normal file
27
GameServer/Contents/Quest/QuestChecker/QuestUgq.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using ServerCommon;
|
||||
using ServerCore;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
|
||||
public class QuestUgq : QuestBase
|
||||
{
|
||||
private string m_ugq_grade = string.Empty;
|
||||
public QuestUgq(EQuestEventTargetType targetType, EQuestEventNameType eventNameType, string ugqGrade)
|
||||
: base(targetType, eventNameType, 0, ugqGrade, string.Empty, string.Empty)
|
||||
{
|
||||
m_ugq_grade = ugqGrade;
|
||||
}
|
||||
|
||||
|
||||
public override bool checkSubValidTaskScript(QuestAttribute questAttribute, QuestEventInfo events)
|
||||
{
|
||||
if(events.EventCondition1.Equals(QuestUgqGradeConditionType.ALL.ToString())) return true;
|
||||
if (events.EventCondition1.Equals(m_ugq_grade)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user