using System.Collections.Concurrent; using Newtonsoft.Json; using ServerCommon; using ServerCore; using ServerBase; namespace GameServer; public class BattleInstanceSnapshotPlayModePodCombatAttrib { [JsonProperty("respawns")] public ConcurrentDictionary m_respawns {get; set;} = new (); [JsonProperty("pod_storages")] public ConcurrentDictionary m_pod_storages {get; set;} = new (); [JsonProperty("pod_combat")] public BattleObjectPodCombat m_pod_combat {get; set;} = new (); [JsonProperty("pickup_pods")] public ConcurrentDictionary m_pickup_pods {get; set;} = new (); [JsonProperty("pickup_pods_generation_info")] public List m_pickup_pod_generated_info { get; set; } = new(); [JsonProperty("weapons")] public ConcurrentDictionary m_weapons {get; set;} = new (); [JsonProperty("buffs")] public ConcurrentDictionary m_buffs {get; set;} = new (); [JsonProperty("state")] public BattleRoundStateType m_round_state_type { get; set; } = BattleRoundStateType.Rounding; [JsonProperty("round")] public int m_current_round { get; set; } = 1; [JsonProperty("state_start_time")] public DateTime m_current_state_start_time { get; set; } = DateTimeHelper.Current; [JsonProperty("charged_step")] public int m_charged_step { get; set; } = 0; [JsonProperty("rewarded_step")] public int m_rewarded_step { get; set; } = 0; [JsonProperty("tactical_board")] public ConcurrentDictionary m_tactical_board = new(); } public class BattleInstanceSnapshotAttrib : AttribBase { [JsonProperty("room_id")] public string m_room_id { get; set; } = string.Empty; [JsonProperty("combat_pod_attrib")] public BattleInstanceSnapshotPlayModePodCombatAttrib m_combat_pod_attrib { get; set; } = new(); public BattleInstanceSnapshotAttrib() : base(typeof(BattleInstanceSnapshotAttrib).Name) { } } //============================================================================================= // PK(Partition Key) : "battle_instance_snapshot#global" // SK(Sort Key) : "date#room_id" // DocType : BattleInstanceSnapshotDoc // BlockUserAttrib : {} // ... //============================================================================================= public class BattleInstanceSnapshotDoc : DynamoDbDocBase { public static readonly string pk = "battle_instance_snapshot#global"; public BattleInstanceSnapshotDoc() : base(typeof(BattleInstanceSnapshotDoc).Name) { appendAttribWrapper(new AttribWrapper()); } public BattleInstanceSnapshotDoc(string combinationKeyForSk) : base(typeof(BattleInstanceSnapshotDoc).Name) { setCombinationKeyForSK(combinationKeyForSk); appendAttribWrapper(new AttribWrapper()); fillUpPrimaryKey(onMakePK(), onMakeSK()); } protected override string onGetPrefixOfPK() { return string.Empty; } protected override string onMakePK() { return pk; } // protected override string onMakeSK() // { // return $"{getCombinationKeyForSK()}"; // // } protected override ServerErrorCode onCheckAndSetPK(string partitionKey) { getPrimaryKey().fillUpPK(partitionKey); return ServerErrorCode.Success; } protected override ServerErrorCode onCheckAndSetSK(string sortKey) { getPrimaryKey().fillUpSK(sortKey); return ServerErrorCode.Success; } }