초기커밋

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 Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyFriendDeleteHandler
{
public void send_GS2C_NTF_FRIEND_DELETE(ServerMessage.Types.FriendDeleteNoti noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
if (false == player_manager.tryGetUserByPrimaryKey(noti.ReceiverGuid, out var player))
{
Log.getLogger().warn($"{noti.SenderGuid} user not exist this Server");
return;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.FriendDeleteNoti = new();
clientToGame.Message.FriendDeleteNoti.SenderId = noti.SenderId;
clientToGame.Message.FriendDeleteNoti.SenderGuid = noti.SenderGuid;
clientToGame.Message.FriendDeleteNoti.SenderNickName = noti.SenderNickName;
clientToGame.Message.FriendDeleteNoti.ReceiverId = noti.ReceiverId;
clientToGame.Message.FriendDeleteNoti.ReceiverGuid = noti.ReceiverGuid;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
QuestManager.It.QuestCheck(player, new QuestFriend(EQuestEventTargetType.FRIEND, EQuestEventNameType.DELETED)).Wait();
}
}

View File

@@ -0,0 +1,38 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyFriendLeavingHomeHandler
{
public void send_GS2C_NTF_FRIEND_LEAVING_HOME(ServerMessage.Types.GS2C_NTF_FRIEND_LEAVING_HOME noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
// ReceiverID에 friendGuid가 있다.
if (false == player_manager.tryGetUserByPrimaryKey(noti.ReceiverId, out var player))
{
Log.getLogger().warn($"{noti.Guid} user not exist this Server");
return;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.NtfFriendLeavingHome = new();
clientToGame.Message.NtfFriendLeavingHome.Guid = noti.Guid;
clientToGame.Message.NtfFriendLeavingHome.NickName = noti.NickName;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
}
}

View File

@@ -0,0 +1,36 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyFriendLoginHandler
{
public void send_GS2C_NTF_LOGIN_TO_FRIEND(Player player, ServerMessage.Types.LoginNotiToFriend noti)
{
ClientToGame ntf_friend_login = new ClientToGame();
ntf_friend_login.Message = new ClientToGameMessage();
ntf_friend_login.Message.FriendLoginNoti = new();
ntf_friend_login.Message.FriendLoginNoti.BaseInfo = new();
ntf_friend_login.Message.FriendLoginNoti.BaseInfo.SenderId = noti.BaseInfo.SenderId;
ntf_friend_login.Message.FriendLoginNoti.BaseInfo.SenderGuid = noti.BaseInfo.SenderGuid;
ntf_friend_login.Message.FriendLoginNoti.BaseInfo.SenderNickName = noti.BaseInfo.SenderNickName;
ntf_friend_login.Message.FriendLoginNoti.BaseInfo.SenderState = noti.BaseInfo.SenderState;
ntf_friend_login.Message.FriendLoginNoti.BaseInfo.SenderMapId = noti.BaseInfo.SenderMapId;
ntf_friend_login.Message.FriendLoginNoti.LocationInfo = noti.LocationInfo;
if (false == GameServerApp.getServerLogic().onSendPacket(player, ntf_friend_login))
{
Log.getLogger().error("Failed to send_GS2C_NTF_LOGIN_TO_FRIEND !!!");
}
}
}

View File

@@ -0,0 +1,39 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyFriendLogoutHandler
{
public void send_GS2C_NTF_FRIEND_LOGOUT(ServerMessage.Types.LogoutNotiToFriend noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
if (false == player_manager.tryGetUserByPrimaryKey(noti.BaseInfo.ReceiverGuid, out var player))
{
Log.getLogger().warn($"{noti.BaseInfo.SenderGuid} user not exist this Server");
return;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.FriendLogoutNoti = new();
clientToGame.Message.FriendLogoutNoti.BaseInfo = new();
clientToGame.Message.FriendLogoutNoti.BaseInfo.SenderId = noti.BaseInfo.SenderId;
clientToGame.Message.FriendLogoutNoti.BaseInfo.SenderGuid = noti.BaseInfo.SenderGuid;
clientToGame.Message.FriendLogoutNoti.BaseInfo.SenderNickName = noti.BaseInfo.SenderNickName;
clientToGame.Message.FriendLogoutNoti.BaseInfo.ReceiverId = noti.BaseInfo.ReceiverId;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
}
}

View File

@@ -0,0 +1,40 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyFriendRequestCancelHandler
{
public void send_GS2C_NTF_FRIEND_REQUEST_CANCEL(ServerMessage.Types.CancelFriendRequestNoti noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
if (false == player_manager.tryGetUserByPrimaryKey(noti.ReceiverGuid, out var player))
{
Log.getLogger().warn($"{noti.ReceiverGuid} user not exist this Server");
return;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.CancelFriendRequestNoti = new();
clientToGame.Message.CancelFriendRequestNoti.SenderId = noti.SenderId;
clientToGame.Message.CancelFriendRequestNoti.SenderGuid = noti.SenderGuid;
clientToGame.Message.CancelFriendRequestNoti.SenderNickName = noti.SenderNickName;
clientToGame.Message.CancelFriendRequestNoti.ReceiverId = noti.ReceiverId;
clientToGame.Message.CancelFriendRequestNoti.ReceiverGuid = noti.ReceiverGuid;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
}
}

View File

@@ -0,0 +1,39 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
namespace GameServer;
public class NotifyFriendRequestHandler
{
public void send_GS2C_NTF_FRIEND_REQUEST(ServerMessage.Types.FriendRequestNoti noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
if (false == player_manager.tryGetUserByPrimaryKey(noti.RequestInfo.Guid, out var player))
{
Log.getLogger().warn($"{noti.RequestInfo.Guid} user not exist this Server");
return;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.FriendRequestNoti = new();
clientToGame.Message.FriendRequestNoti.RequestInfo = new();
clientToGame.Message.FriendRequestNoti.RequestInfo.Guid = noti.RequestInfo.Guid;
clientToGame.Message.FriendRequestNoti.RequestInfo.NickName = noti.RequestInfo.NickName;
clientToGame.Message.FriendRequestNoti.RequestInfo.IsNew = noti.RequestInfo.IsNew;
clientToGame.Message.FriendRequestNoti.RequestInfo.RequestTime = noti.RequestInfo.RequestTime;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
}
}

View File

@@ -0,0 +1,47 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyFriendStateHandler
{
public bool send_GS2C_NTF_FRIEND_STATE(ServerMessage.Types.StateNotiToFriend noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
if (false == player_manager.tryGetUserByPrimaryKey(noti.BaseInfo.ReceiverGuid, out var player))
{
Log.getLogger().error($"send_GS2CS_NTF_FRIEND_STATE {noti.BaseInfo.ReceiverGuid} user not exist this Server");
return false;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.FriendStateNoti = new();
clientToGame.Message.FriendStateNoti.BaseInfo = new();
clientToGame.Message.FriendStateNoti.BaseInfo.SenderId = noti.BaseInfo.SenderId;
clientToGame.Message.FriendStateNoti.BaseInfo.SenderGuid = noti.BaseInfo.SenderGuid;
clientToGame.Message.FriendStateNoti.BaseInfo.SenderNickName = noti.BaseInfo.SenderNickName;
clientToGame.Message.FriendStateNoti.BaseInfo.SenderState = noti.BaseInfo.SenderState;
clientToGame.Message.FriendStateNoti.BaseInfo.SenderMapId = noti.BaseInfo.SenderMapId;
clientToGame.Message.FriendStateNoti.LocationInfo = noti.LocationInfo;
if (false == GameServerApp.getServerLogic().onSendPacket(player, clientToGame))
{
Log.getLogger().error("Failed to send_GS2C_NTF_FRIEND_STATE !!!");
}
return true;
}
}

View File

@@ -0,0 +1,45 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyReceiveInviteMyHomeHandler
{
public void send_GS2C_NTF_RECEIVE_INVITE_MYHOME(ServerMessage.Types.ReceiveInviteMyHomeNoti noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
if (false == player_manager.tryGetUserByPrimaryKey(noti.BaseInfo.ReceiverGuid, out var player))
{
Log.getLogger().warn($"{noti.BaseInfo.SenderGuid} user not exist this Server");
return;
}
ClientToGame clientToGame = new();
clientToGame.Message = new();
clientToGame.Message.ReceiveInviteMyHomeNoti = new();
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo = new();
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.SenderMapId = 0;
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.SenderNickName = noti.BaseInfo.SenderNickName;
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.SenderGuid = noti.BaseInfo.SenderGuid;
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.SenderId = noti.BaseInfo.SenderId;
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.ReceiverGuid = noti.BaseInfo.ReceiverGuid;
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.ReceiverNickName = noti.BaseInfo.ReceiverNickName;
clientToGame.Message.ReceiveInviteMyHomeNoti.BaseInfo.ReceiverId = noti.BaseInfo.ReceiverId;
clientToGame.Message.ReceiveInviteMyHomeNoti.ExpireTime = noti.ExpireTime;
clientToGame.Message.ReceiveInviteMyHomeNoti.InviterMyHomeId = noti.InviterMyHomeId;
clientToGame.Message.ReceiveInviteMyHomeNoti.ReplyExpireTime = noti.ReplyExpireTime;
clientToGame.Message.ReceiveInviteMyHomeNoti.UniqueKey = noti.UniqueKey;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
}
}

View File

@@ -0,0 +1,32 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyReplyFriendRequestHandler
{
public void send_GS2C_NTF_FRIEND_ACCEPT(Player player, ServerMessage.Types.FriendAcceptNoti noti)
{
ClientToGame clientToGame = new ClientToGame();
clientToGame.Message = new ClientToGameMessage();
clientToGame.Message.FriendAcceptNoti = new ClientToGameMessage.Types.FriendAcceptNoti();
clientToGame.Message.FriendAcceptNoti.AcceptOrRefuse = noti.AcceptOrRefuse;
clientToGame.Message.FriendAcceptNoti.SenderId = noti.SenderId;
clientToGame.Message.FriendAcceptNoti.SenderGuid = noti.SenderGuid;
clientToGame.Message.FriendAcceptNoti.SenderNickName = noti.SenderNickName;
clientToGame.Message.FriendAcceptNoti.ReceiverId = noti.ReceiverId;
clientToGame.Message.FriendAcceptNoti.ReceiverGuid = noti.ReceiverGuid;
GameServerApp.getServerLogic().onSendPacket(player, clientToGame);
}
}

View File

@@ -0,0 +1,41 @@
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using ServerCore;
using ServerBase;
using ServerCommon;
using ServerCommon.BusinessLogDomain;
using MetaAssets;
namespace GameServer;
public class NotifyReplyInviteFriendHandler
{
public void send_GS2C_NTF_REPLY_INVITE_MYHOME(ServerMessage.Types.ReplyInviteMyhomeNoti noti)
{
var player_manager = GameServerApp.getServerLogic().getPlayerManager();
ArgumentNullException.ThrowIfNull(player_manager);
/*
ReceiverID로 찾는 이유
리팩토링 전에 id로 찾던게 있어서 noti 보낼때 id에 guid로 담아서 보낸다.
*/
if (false == player_manager.tryGetUserByPrimaryKey(noti.ReceiverId, out var player))
{
Log.getLogger().warn($"{noti.ReplyUserGuid} user not exist this Server");
return;
}
ClientToGame noti_packet = new ClientToGame();
noti_packet.Message = new ClientToGameMessage();
noti_packet.Message.ReplyInviteMyhomeNoti = new ();
noti_packet.Message.ReplyInviteMyhomeNoti.ReplyUserGuid = noti.ReplyUserGuid;
noti_packet.Message.ReplyInviteMyhomeNoti.ReceiverId = noti.ReceiverId;
noti_packet.Message.ReplyInviteMyhomeNoti.AcceptOrRefuse = noti.AcceptOrRefuse;
GameServerApp.getServerLogic().onSendPacket(player, noti_packet);
}
}