초기커밋

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,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Amazon.DynamoDBv2.DocumentModel;
using ServerCommon.BusinessLogDomain;
namespace GameServer
{
public static class SocialActionBusinessLogHelper
{
public static SocialActionLogInfo toSocialActionLogInfo(int socialActionId)
{
var social_action_log_info = new SocialActionLogInfo();
social_action_log_info.setSocialActionInfo(socialActionId);
return social_action_log_info;
}
public static void setSocialActionInfo(this SocialActionLogInfo logData, int socialActionId)
{
logData.SocialActionMetaId = socialActionId;
}
public static SocialActionSlotExchangeLogInfo toSocialActionSlotExchangeLogInfo(string usetGuid, int socialActionSlot, int oldSocialActionMetaId, int newSocialActionMetaId)
{
var social_action_slot_exchange_log_info = new SocialActionSlotExchangeLogInfo();
social_action_slot_exchange_log_info.setSocialActionSlotExchangeInfo(usetGuid, socialActionSlot, oldSocialActionMetaId, newSocialActionMetaId);
return social_action_slot_exchange_log_info;
}
public static void setSocialActionSlotExchangeInfo(this SocialActionSlotExchangeLogInfo logData, string usetGuid, int socialActionSlot, int oldSocialActionMetaId, int newSocialActionMetaId)
{
logData.UserGuid = usetGuid;
logData.SocialActionSlot = socialActionSlot;
logData.OldSocialActionMetaId = oldSocialActionMetaId;
logData.NewSocialActionMetaId = newSocialActionMetaId;
}
}
}

View File

@@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using ServerCore; using ServerBase;
using ServerCommon;
using static ClientToGameMessage.Types;
namespace GameServer
{
internal static class SocialActionNotifyHelper
{
public static bool send_S2C_NTF_OWNED_SOCIAL_ACTION(this Player player)
{
ArgumentNullReferenceCheckHelper.throwIfNull(player, () => $"player is null !!!");
var social_action_agent_action = player.getEntityAction<SocialActionLoadAction>();
NullReferenceCheckHelper.throwIfNull(social_action_agent_action, () => $"social_action_agent_action is null !!! - {player.toBasicString()}");
var ntf_packet = new ClientToGame();
ntf_packet.Message = new ClientToGameMessage();
ntf_packet.Message.OwnedSocialActionNoti = new OwnedSocialActionNoti();
var social_actions = social_action_agent_action.getSocialActions();
foreach (var social_action in social_actions)
{
var social_action_attribute = social_action.getEntityAttribute<UserSocialActionAttribute>();
NullReferenceCheckHelper.throwIfNull(social_action_attribute, () => $"social_action_attribute is null !!! - {player.toBasicString()}");
ntf_packet.Message.OwnedSocialActionNoti.OwnedList.Add((int)social_action_attribute.SocialActionMetaId);
if (social_action_attribute.EquipedPos != 0)
{
var slot_info = new SlotInfo();
slot_info.Slot = social_action_attribute.EquipedPos - 1; // 인덱스가 클라는 0번부터 서버는 1번부터
slot_info.Id = (int)social_action_attribute.SocialActionMetaId;
ntf_packet.Message.OwnedSocialActionNoti.EquipList.Add(slot_info);
}
}
if (false == GameServerApp.getServerLogic().onSendPacket(player, ntf_packet))
{
return false;
}
return true;
}
public static bool send_S2C_NTF_PLAY_SOCIAL_ACTION(this Player player)
{
ArgumentNullReferenceCheckHelper.throwIfNull(player, () => $"player is null !!!");
var user_social_action_executor_action = player.getEntityAction<UserSocialActionExecutorAction>();
NullReferenceCheckHelper.throwIfNull(user_social_action_executor_action, () => $"$user_social_action_executor_action is null - {player.toBasicString()}");
var game_zone_action = player.getEntityAction<GameZoneAction>();
NullReferenceCheckHelper.throwIfNull(game_zone_action, () => $"game_zone_action is null - {player.toBasicString()}");
var ntf_packet = new ClientToGame();
ntf_packet.Message = new ClientToGameMessage();
ntf_packet.Message.PlaySocialActionNoti = new PlaySocialActionNoti();
ntf_packet.Message.PlaySocialActionNoti.ActorGuid = player.getUserGuid();
ntf_packet.Message.PlaySocialActionNoti.SocialActionId = user_social_action_executor_action.getPlayingSocialActionMetaId();
ntf_packet.Message.PlaySocialActionNoti.StartTime = user_social_action_executor_action.getPlayingSocialActionStartTime().ToTimestamp();
game_zone_action.broadcast(player, ntf_packet);
return true;
}
public static bool send_S2C_NTF_STOP_SOCIAL_ACTION(this Player player)
{
ArgumentNullReferenceCheckHelper.throwIfNull(player, () => $"player is null !!!");
var game_zone_action = player.getEntityAction<GameZoneAction>();
NullReferenceCheckHelper.throwIfNull(game_zone_action, () => $"game_zone_action is null - {player.toBasicString()}");
var ntf_packet = new ClientToGame();
ntf_packet.Message = new ClientToGameMessage();
ntf_packet.Message.StopSocialActionNoti = new StopSocialActionNoti();
ntf_packet.Message.StopSocialActionNoti.ActorGuid = player.getUserGuid();
game_zone_action.broadcast(player, ntf_packet);
return true;
}
public static ClientToGame makeNtfSocialActionAddPacket(int social_action_meta_id)
{
var ntf_packet = new ClientToGame();
ntf_packet.Message = new ClientToGameMessage();
ntf_packet.Message.SocialActionAddNoti = new SocialActionAddNoti();
ntf_packet.Message.SocialActionAddNoti.SocialActionId = social_action_meta_id;
return ntf_packet;
}
}
}