초기커밋

This commit is contained in:
2025-05-01 07:20:41 +09:00
commit 98bb2e3c5c
2747 changed files with 646947 additions and 0 deletions

View File

@@ -0,0 +1,213 @@
using System.Collections.Concurrent;
using Axion.Collections.Concurrent;
using Google.Protobuf.WellKnownTypes;
using MetaAssets;
using ServerCore; using ServerBase;
namespace ServerCommon;
//파일럿이라 무시하고 이쪽에 넣는다...
public class BattleInstancesObject
{
public EBattleObjectType m_type = EBattleObjectType.None;
public string m_anchor_guid { get; set; } = string.Empty;
public DateTime m_active_time { get; set; } = DateTimeHelper.Current;
public bool m_is_active { get; set; } = true;
public BattleInstancesObject(EBattleObjectType type, string guid)
{
m_type = type;
m_anchor_guid = guid;
}
public BattleInstancesObject(EBattleObjectType type, string guid, bool isActive)
{
m_type = type;
m_anchor_guid = guid;
m_is_active = isActive;
}
}
public class BattleObjectPodStorage : BattleInstancesObject
{
//private ECombatPodType m_combat_pod_type { get; } = ECombatPodType.Storage;
public Int32 m_reward_cnt { get; set; } = 0;
public BattleObjectPodStorage(string anchorGuid) : base(EBattleObjectType.Pod_Combat, anchorGuid)
{
}
}
public class BattleObjectEmpty : BattleInstancesObject
{
public BattleObjectEmpty() : base(EBattleObjectType.None, string.Empty)
{
}
}
public class BattleObjectPodCombat : BattleInstancesObject
{
private ECombatPodType m_combat_pod_type { get; } = ECombatPodType.Pod;
public string m_source_storage_anchor_guid { get; set; } = string.Empty; //pod 발생된 스토리지의 anchor guid
public PodCombatStateType m_state { get; set; } = PodCombatStateType.Active; //warn : 이름 바꾸려면 클라랑 협의
public DateTime m_state_change_time { get; set; } = DateTimeHelper.Current; //이게 상태에 따라 획득한 시간으로도 쓴다.
public Pos m_currenct_Pos { get; set; } = new();
public string m_current_occupier_guid { get; set; } = string.Empty;
public DateTime m_occupied_time { get; set; } = DateTimeHelper.Current; //이게 상태에 따라 획득한 시간으로도 쓴다.
public BattleObjectPodCombat(): base(EBattleObjectType.Pod_Combat, string.Empty, false)
{
}
public BattleObjectPodCombat(string anchorGuid, string sourceAnchorGuid, DateTime startTime) : base(EBattleObjectType.Pod_Combat, anchorGuid, false)
{
m_source_storage_anchor_guid = sourceAnchorGuid;
m_state = PodCombatStateType.Active;
m_active_time = startTime;
init();
}
public void init()
{
m_is_active = true;
}
public void changeDropState( Pos pos)
{
m_state = PodCombatStateType.Dropped;
m_state_change_time = DateTimeHelper.Current;
m_currenct_Pos = pos;
m_current_occupier_guid = string.Empty;
}
public void setDeactive()
{
m_state = PodCombatStateType.DeActive;
m_state_change_time = DateTimeHelper.Current;
m_currenct_Pos = new();
m_current_occupier_guid = String.Empty;
}
public void setActive(DateTime t)
{
m_state = PodCombatStateType.Active;
m_state_change_time = t;
m_active_time = t;
m_currenct_Pos = new();
m_current_occupier_guid = String.Empty;
m_occupied_time = DateTimeHelper.Current;
}
}
public class BattleObjectPickupPod : BattleInstancesObject
{
//public bool m_has_reward = false;
public BattleObjectPickupPod(string anchorGuid) : base(EBattleObjectType.Pod_Box, anchorGuid)
{
}
// public BattleObjectPickupPod(string anchorGuid, bool isActive) : base(EBattleObjectType.Pod_Box, anchorGuid)
// {
// m_is_active = isActive;
// }
public BattleObjectPickupPod clone()
{
BattleObjectPickupPod new_pod = new(m_anchor_guid);
new_pod.m_type = m_type;
new_pod.m_active_time = m_active_time;
new_pod.m_is_active = m_is_active;
return new_pod;
}
}
public class BattleObjectWeapon : BattleInstancesObject
{
//뭐가 필요할까?
public BattleObjectWeapon(string anchorGuid) : base(EBattleObjectType.Weapon, anchorGuid)
{
}
public BattleObjectWeapon clone()
{
BattleObjectWeapon new_weapon = new(m_anchor_guid);
new_weapon.m_type = m_type;
new_weapon.m_active_time = m_active_time;
new_weapon.m_is_active = m_is_active;
return new_weapon;
}
}
public class BattleObjectBuff : BattleInstancesObject
{
//뭐가 필요할까?
public BattleObjectBuff(string anchorGuid) : base(EBattleObjectType.Buff, anchorGuid)
{
}
public BattleObjectBuff clone()
{
BattleObjectBuff new_buff = new(m_anchor_guid);
new_buff.m_type = m_type;
new_buff.m_active_time = m_active_time;
new_buff.m_is_active = m_is_active;
return new_buff;
}
}
public class BattleTacticalBoardInfo
{
//누굴 죽이고 누구한테 죽였는지는 로그를 남긴다.
public string m_user_guid { get; private set; } = string.Empty;
public Int32 m_kill_count { get; set; } = 0;
public Int32 m_Death_count { get; set; } = 0;
public Int32 m_Pod_count { get; set; } = 0;
public BattleTacticalBoardInfo(string userGuid)
{
m_user_guid = userGuid;
}
public BattleTacticalBoardInfo clone()
{
BattleTacticalBoardInfo new_info = new(m_user_guid);
new_info.m_kill_count = m_kill_count;
new_info.m_Death_count = m_Death_count;
new_info.m_Pod_count = m_Pod_count;
return new_info;
}
}
public class PickupPodGeneratedInfo
{
public int m_group_id { get; set; } = 0;
public int m_idx { get; set; } = 0;
public string m_anchor_guid { get; set; } = string.Empty; //픽업포드 anchor_guid
public string m_before_anchor_guid { get; set; } = string.Empty; //이전에 활성화 됏던 anchor_guid
public DateTime m_next_generate_time { get; set; } = DateTimeHelper.Current; //다음 보상 받을 시간
public PickupPodGeneratedInfo(int groupId, int idx, string newAnchorGuid, string beforeAnchorGuid, DateTime nextGenerateTime)
{
m_group_id = groupId;
m_idx = idx;
m_anchor_guid = newAnchorGuid;
m_before_anchor_guid = beforeAnchorGuid;
m_next_generate_time = nextGenerateTime;
}
public PickupPodGeneratedInfo clone()
{
PickupPodGeneratedInfo clone = new(m_group_id, m_idx, m_anchor_guid, m_before_anchor_guid, m_next_generate_time);
return clone;
}
}

View File

@@ -0,0 +1,78 @@
using MetaAssets;
using Newtonsoft.Json;
using ServerCore; using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattleObjectInteractionLogInfo : ILogInvoker.IInfo
{
[JsonProperty("interaction_user_guid")]
public string m_interaction_user_guid { get; set; } = string.Empty;
[JsonProperty("interaction_user_nickname")]
public string m_interaction_user_nickname { get; set; } = string.Empty;
[JsonProperty("interaction_anchor_guid")]
public string m_interaction_anchor_guid { get; set; } = string.Empty;
[JsonProperty("room_id")]
public string m_room_id { get; set; } = string.Empty;
[JsonProperty("battle_object_type")]
public EBattleObjectType m_battle_object_type { get; set; } = EBattleObjectType.None;
[JsonProperty("pod_type")]
public ECombatPodType m_pod_type { get; set; } = ECombatPodType.None;
[JsonProperty("has_pod_combat")]
public bool m_has_pod_combat { get; set; } = false;
[JsonProperty("pod_combat_pos")]
public Pos m_pod_combat_pos { get; set; } = new();
[JsonProperty("pod_combat_state")]
public PodCombatStateType m_pod_combat_state { get; set; } = PodCombatStateType.None;
[JsonProperty("next_active_time")]
public DateTime m_object_next_active_time = DateTimeHelper.Current;
[JsonProperty("is_active")]
public bool m_is_active = false;
[JsonProperty("reward")]
public List<MetaAssets.Reward> m_rewards = new();
public BattleObjectInteractionLogInfo()
{
}
public BattleObjectInteractionLogInfo(ILogInvoker parent, BattleObjectInteractionLogInfo logInfo)
: base(parent)
{
if (null != logInfo)
{
setLogInfo(logInfo);
}
}
private void setLogInfo(BattleObjectInteractionLogInfo logInfo)
{
m_interaction_user_guid = logInfo.m_interaction_user_guid;
m_interaction_user_nickname = logInfo.m_interaction_user_nickname;
m_interaction_anchor_guid = logInfo.m_interaction_anchor_guid;
m_room_id = logInfo.m_room_id;
m_battle_object_type = logInfo.m_battle_object_type;
m_pod_type = logInfo.m_pod_type;
m_has_pod_combat = logInfo.m_has_pod_combat;
m_pod_combat_pos = logInfo.m_pod_combat_pos;
m_pod_combat_state = logInfo.m_pod_combat_state;
m_object_next_active_time = logInfo.m_object_next_active_time;
m_is_active = logInfo.m_is_active;
m_rewards = logInfo.m_rewards;
}
}

View File

@@ -0,0 +1,52 @@
using MetaAssets;
using Newtonsoft.Json;
using ServerCore;
using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattleObjectLogInfo
{
[JsonProperty("anchor_guid")]
public string m_anchor_guid { get; set; } = string.Empty;
[JsonProperty("battle_object_type")]
public EBattleObjectType m_battle_object_type { get; set; } = EBattleObjectType.None;
[JsonProperty("active_time")]
public DateTime m_active_time { get; set; } = DateTimeHelper.Current;
}
public class BattleObjectStateUpdateLogInfo : ILogInvoker.IInfo
{
[JsonProperty("room_id")]
public string m_room_id { get; set; } = string.Empty;
[JsonProperty("object_infos")]
public List<BattleObjectLogInfo> m_infos { get; set; } = new();
public BattleObjectStateUpdateLogInfo()
{
}
public BattleObjectStateUpdateLogInfo(ILogInvoker parent, BattleObjectStateUpdateLogInfo logInfo) : base(parent)
{
if (null != logInfo)
{
setLogInfo(logInfo);
}
}
private void setLogInfo(BattleObjectStateUpdateLogInfo logInfo)
{
m_room_id = logInfo.m_room_id;
m_infos = logInfo.m_infos;
}
}

View File

@@ -0,0 +1,46 @@
using Newtonsoft.Json;
using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattlePodCombatRewardLogInfo : ILogInvoker.IInfo
{
[JsonProperty("room_id")]
public string m_room_id { get; set; } = string.Empty;
[JsonProperty("round")]
public int m_round { get; set; } = 0;
[JsonProperty("round_state")]
public BattleRoundStateType m_round_state { get; set; } = BattleRoundStateType.None;
[JsonProperty("rewarded_user_guid")]
public string m_rewarded_user_guid { get; set; } = string.Empty;
[JsonProperty("rewarded_user_nickname")]
public string m_rewarded_user_nickname { get; set; } = string.Empty;
[JsonProperty("charged_step")]
public int m_charged_step { get; set; } = 0;
[JsonProperty("rewarded_step")]
public int m_rewarded_step { get; set; } = 0;
[JsonProperty("rewards")]
public List<MetaAssets.Reward> m_rewards { get; set; } = new();
public BattlePodCombatRewardLogInfo(ILogInvoker parent, string roomId, int round, BattleRoundStateType roundSate, string rewardUserGuid, string rewardUserNickname
, int chargedStep, int rewardedStep, List<MetaAssets.Reward> rewards) : base(parent)
{
m_room_id = roomId;
m_round = round;
m_round_state = roundSate;
m_rewarded_user_guid = rewardUserGuid;
m_rewarded_user_nickname = rewardUserNickname;
m_charged_step = chargedStep;
m_rewarded_step = rewardedStep;
m_rewards.AddRange(rewards);
}
}

View File

@@ -0,0 +1,34 @@
using Newtonsoft.Json;
using ServerCore; using ServerBase;
namespace ServerCommon;
public class BattleRespawnLogInfo : ILogInvoker.IInfo
{
[JsonProperty("room_id")] public string m_room_id { get; set; } = string.Empty;
[JsonProperty("round")] public int m_round { get; set; } = 0;
[JsonProperty("round_state")] public BattleRoundStateType m_round_state { get; set; } = BattleRoundStateType.None;
[JsonProperty("user_guid")] public string m_user_guid { get; set; } = string.Empty;
[JsonProperty("user_nickname")] public string m_user_nickname { get; set; } = string.Empty;
[JsonProperty("respawn_anchor_guid")] public string m_respawn_anchor_guid { get; set; } = string.Empty;
[JsonProperty("m_next_available_respawn_time_at_this_anchor")]
public DateTime m_next_available_respawn_time_at_this_anchor { get; set; } = DateTimeHelper.Current;
public BattleRespawnLogInfo(ILogInvoker parent, string roomId, int round, BattleRoundStateType roundState, string userGuid, string userNickname, string respawnAnchorGuid, DateTime nextAvailableRespawnTimeAtThisAnchor)
: base(parent)
{
m_room_id = roomId;
m_round = round;
m_round_state = roundState;
m_user_guid = userGuid;
m_user_nickname = userNickname;
m_respawn_anchor_guid = respawnAnchorGuid;
m_next_available_respawn_time_at_this_anchor = nextAvailableRespawnTimeAtThisAnchor;
}
}

View File

@@ -0,0 +1,28 @@
using Newtonsoft.Json;
using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattleRoomJoinSuccessLogInfo : ILogInvoker.IInfo
{
[JsonProperty("join_user_guid")]
public string m_join_user_guid { get; set; } = string.Empty;
[JsonProperty("join_user_nickname")]
public string m_join_user_nickname { get; set; } = string.Empty;
[JsonProperty("room_id")]
public string m_room_id { get; set; } = string.Empty;
[JsonProperty("join_round")]
public int m_join_round { get; set; } = 0;
public BattleRoomJoinSuccessLogInfo(ILogInvoker parent, string joinUserGuid, string joinUserNickname, string roomId, int joinRound) : base(parent)
{
m_join_user_guid = joinUserGuid;
m_join_user_nickname = joinUserNickname;
m_room_id = roomId;
m_join_round = joinRound;
}
}

View File

@@ -0,0 +1,41 @@
using Newtonsoft.Json;
using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattleRoomPlayerDeadLogInfo : ILogInvoker.IInfo
{
[JsonProperty("dead_user_guid")]
public string m_dead_user_guid { get; set; } = string.Empty;
[JsonProperty("dead_user_nickname")]
public string m_dead_user_nickname { get; set; } = string.Empty;
[JsonProperty("killer_guid")]
public string m_killer_guid { get; set; } = string.Empty;
[JsonProperty("killer_nickname")]
public string m_killer_nickname { get; set; } = string.Empty;
[JsonProperty("room_id")]
public string m_room_id { get; set; } = string.Empty;
[JsonProperty("round")]
public int m_round { get; set; } = 0; //죽은 시점의 라운드
[JsonProperty("has_pod_combat")]
public bool m_has_pod_combat { get; set; } = false;
public BattleRoomPlayerDeadLogInfo(ILogInvoker parent, string deadUserGuid, string deadUserNickname, string killerGuid, string killerNickname
, string roomId, int round, bool hasPodCombat)
: base(parent)
{
m_dead_user_guid = deadUserGuid;
m_dead_user_nickname = deadUserNickname;
m_killer_guid = killerGuid;
m_killer_nickname = killerNickname;
m_room_id = roomId;
m_round = round;
m_has_pod_combat = hasPodCombat;
}
}

View File

@@ -0,0 +1,60 @@
using Newtonsoft.Json;
using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattleRoundingExistUsers
{
[JsonProperty("user_guid")] public string m_user_guid { get; set; } = string.Empty;
[JsonProperty("user_nickname")] public string m_user_nickname { get; set; } = string.Empty;
public BattleRoundingExistUsers(string userGuid, string nickname)
{
m_user_guid = userGuid;
m_user_nickname = nickname;
}
}
public class BattleRoundingUpdateLogInfo : ILogInvoker.IInfo
{
[JsonProperty("room_id")]
public string m_room_id { get; set; } = string.Empty;
[JsonProperty("ended_round")]
public int m_ended_round { get; set; } = 0;
[JsonProperty("round_state")]
public BattleRoundStateType m_round_state { get; set; } = BattleRoundStateType.None;
[JsonProperty("exist_users")]
public List<BattleRoundingExistUsers> m_exist_users { get; set; } = new();
public BattleRoundingUpdateLogInfo(ILogInvoker parent, string roomId, int endedRound, BattleRoundStateType roundSate, List<BattleRoundingExistUsers> users) : base(parent)
{
m_room_id = roomId;
m_ended_round = endedRound;
m_round_state = roundSate;
m_exist_users.AddRange(users);
}
// public BattleRoundingUpdateLogInfo(string roomId, int endedRound, BattleRoundStateType roundSate, List<BattleRoundingExistUsers> users,
// string rewardUserGuid, string rewardUserNickname, List<MetaAssets.Reward> rewards)
// {
// m_room_id = roomId;
// m_ended_round = endedRound;
// m_round_state = roundSate;
// m_exist_users.AddRange(users);
// m_rewarded_user_guid = rewardUserGuid;
// m_rewarded_user_nickname = rewardUserNickname;
// m_rewards.AddRange(rewards);
// }
}

View File

@@ -0,0 +1,72 @@
using System.Collections.Concurrent;
using Newtonsoft.Json;
using ServerCore; using ServerBase;
namespace ServerCommon.BusinessLogDomain;
public class BattleSnapshotLogInfo : ILogInvoker.IInfo
{
[JsonProperty("room_id")] public string m_room_id { get; set; } = string.Empty;
[JsonProperty("snapshot_load_type")] public string m_snapshot_load_type { get; set; } = string.Empty;
[JsonProperty("play_mode")]
public BattlePlayMode m_play_mode { get; set; } = BattlePlayMode.None;
[JsonProperty("event_start_time")]
public DateTime m_battle_instance_event_start_time { get; set; } = DateTimeHelper.Current;
[JsonProperty("reward_group_id")]
public Int32 m_pod_combat_reward_group_id { get; set; } = 1;
[JsonProperty("ffa_id")]
public Int32 m_pod_combat_ffa_id { get; set; } = 1;
[JsonProperty("hot_time")]
public Int32 m_hot_time_reward { get; set; } = 1;
[JsonProperty("round_count")]
public Int32 m_round_count { get; set; } = 8;
[JsonProperty("respawns")]
public ConcurrentDictionary<string, DateTime> m_respawns {get; set;} = new ();
[JsonProperty("pod_storages")]
public ConcurrentDictionary<string, BattleObjectPodStorage> m_pod_storages {get; set;} = new ();
[JsonProperty("pod_combat")]
public BattleObjectPodCombat m_pod_combat {get; set;} = new ();
[JsonProperty("pickup_pods")]
public ConcurrentDictionary<string, BattleObjectPickupPod> m_pickup_pods {get; set;} = new ();
[JsonProperty("pickup_pods_generation_info")] public List<PickupPodGeneratedInfo> m_pickup_pod_generated_info { get; set; } = new();
[JsonProperty("weapons")]
public ConcurrentDictionary<string, BattleObjectWeapon> m_weapons {get; set;} = new ();
[JsonProperty("buffs")]
public ConcurrentDictionary<string, BattleObjectBuff> 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<string, BattleTacticalBoardInfo> m_tactical_board = new();
public BattleSnapshotLogInfo(ILogInvoker parent, string roomId, string loadType)
: base(parent)
{
m_room_id = roomId;
m_snapshot_load_type = loadType;
}
}