100 lines
3.8 KiB
C#
100 lines
3.8 KiB
C#
using MetaAssets;
|
|
using Newtonsoft.Json;
|
|
using ServerBase;
|
|
using ServerCommon;
|
|
using ServerCore;
|
|
|
|
namespace GameServer.Contents.Battle.Doc;
|
|
|
|
|
|
public class BattleEventAttrib : AttribBase
|
|
{
|
|
public BattleEventAttrib() : base(typeof(BattleEventAttrib).Name) { }
|
|
|
|
[JsonProperty("event_id")] public Int32 m_event_id { get; set; } = 0;
|
|
[JsonProperty("is_active")] public bool m_is_active { get; set; } = false;
|
|
|
|
[JsonProperty("start_day")] public DateTime m_start_day = DateTimeHelper.Current.Date;//2025-01-01T00:00:00
|
|
[JsonProperty("start_hour")] public Int32 m_start_hour = 0; //00 ~ 23;
|
|
[JsonProperty("start_min")] public Int32 m_start_min = 0; //00 ~ 59;
|
|
|
|
[JsonProperty("end_date")] public DateTime m_end_date = DateTimeHelper.Current.Date.AddHours(12); //이시간이 지나면 더이상 이벤트 열지 않는다.
|
|
|
|
//[JsonProperty("sequence_id")] public Int32 m_sequence_id { get; set; } = 0;
|
|
[JsonProperty("instance_id")] public Int32 m_instance_id { get; set; } = 0;
|
|
[JsonProperty("once_period_type")] public OncePeriodRangeType m_period { get; set; } = OncePeriodRangeType.NONE;
|
|
[JsonProperty("day_of_week_type")] public HashSet<DayOfWeekType> m_day_of_week_type { get; set; } = new();
|
|
//[JsonProperty("battle_play_mode")] public BattlePlayMode m_battle_playe_mode { get; set; } = BattlePlayMode.None;
|
|
[JsonProperty("ffa_config_data_id")] public Int32 m_ffa_config_data_id { get; set; } = 4;
|
|
[JsonProperty("ffa_reward_group_id")] public Int32 m_ffa_reward_group_id { get; set; } = 7;
|
|
[JsonProperty("ffa_hot_time")] public Int32 m_ffa_hot_time { get; set; } = 1;
|
|
[JsonProperty("round_count")] public Int32 m_round_count { get; set; } = 1;
|
|
|
|
|
|
public BattleEventAttrib clone()
|
|
{
|
|
BattleEventAttrib new_attrib = new();
|
|
new_attrib.m_event_id = this.m_event_id;
|
|
new_attrib.m_is_active = this.m_is_active;
|
|
new_attrib.m_start_day = this.m_start_day;
|
|
new_attrib.m_start_hour = this.m_start_hour;
|
|
new_attrib.m_start_min = this.m_start_min;
|
|
new_attrib.m_instance_id = this.m_instance_id;
|
|
new_attrib.m_period = this.m_period;
|
|
new_attrib.m_day_of_week_type = this.m_day_of_week_type;
|
|
new_attrib.m_ffa_config_data_id = this.m_ffa_config_data_id;
|
|
new_attrib.m_ffa_reward_group_id = this.m_ffa_reward_group_id;
|
|
new_attrib.m_ffa_hot_time = this.m_ffa_hot_time;
|
|
|
|
new_attrib.m_end_date = this.m_end_date;
|
|
new_attrib.m_round_count = this.m_round_count;
|
|
|
|
return new_attrib;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================================
|
|
// PK(Partition Key) : "management_battle_event#global"
|
|
// SK(Sort Key) : "event_id"
|
|
// DocType : BattleEventDoc
|
|
// SystemMailAttrib : {}
|
|
// ...
|
|
//=============================================================================================
|
|
public class BattleEventDoc : DynamoDbDocBase
|
|
{
|
|
public BattleEventDoc()
|
|
: base(typeof(BattleEventDoc).Name)
|
|
{
|
|
setCombinationKeyForPK(DynamoDbClient.PK_GLOBAL);
|
|
appendAttribWrapperAll();
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
}
|
|
|
|
public BattleEventDoc(string event_id)
|
|
: base(typeof(BattleEventDoc).Name)
|
|
{
|
|
setCombinationKeyForPKSK(DynamoDbClient.PK_GLOBAL, event_id);
|
|
appendAttribWrapperAll();
|
|
fillUpPrimaryKey(onMakePK(), onMakeSK());
|
|
}
|
|
|
|
private void appendAttribWrapperAll()
|
|
{
|
|
appendAttribWrapper(new AttribWrapper<BattleEventAttrib>());
|
|
}
|
|
|
|
protected override string onGetPrefixOfPK()
|
|
{
|
|
return "management_battle_event#";
|
|
}
|
|
|
|
protected override ServerErrorCode onCheckAndSetSK(string sortKey)
|
|
{
|
|
getPrimaryKey().fillUpSK(sortKey);
|
|
setCombinationKeyForSK(sortKey);
|
|
return ServerErrorCode.Success;
|
|
}
|
|
} |