122 lines
4.9 KiB
C#
122 lines
4.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
using static ClientToGameMessage.Types;
|
|
|
|
|
|
using USER_GUID = System.String;
|
|
|
|
|
|
namespace GameServer
|
|
{
|
|
public static class UgcNpcNotifyHelper
|
|
{
|
|
|
|
public static void send_GS2C_NTF_UGC_NPC_ALL_LOAD( this Player player )
|
|
{
|
|
ArgumentNullReferenceCheckHelper.throwIfNull(player, () => $"player is null !!!");
|
|
|
|
var player_action = player.getEntityAction<PlayerAction>();
|
|
NullReferenceCheckHelper.throwIfNull(player_action, () => $"player_action is null !!! - {player.toBasicString()}");
|
|
|
|
var ntf = new GS2C_NTF_UGC_NPC_ALL_LOAD();
|
|
ntf.HasUgcNpcSummaries.Add(player_action.toUgcNpcSummaryAll4Client().toMapField());
|
|
ntf.HasUgcNpcItems.Add(player_action.toUgcNpcItemsAll4Client().toMapField());
|
|
|
|
ClientToGame packet = new ClientToGame();
|
|
packet.Message = new ClientToGameMessage();
|
|
packet.Message.NtfUgcNpcAllLoad = ntf;
|
|
|
|
player.sendPacket(packet);
|
|
}
|
|
|
|
public static void send_GS2C_NTF_UGC_NPC_DELETION( Player player, string deletedUgcNpcMetaGuid, CommonResult commonResult)
|
|
{
|
|
var ntf = new GS2C_NTF_UGC_NPC_DELETION();
|
|
ntf.DeletedUgcNpcMetaGuid = deletedUgcNpcMetaGuid;
|
|
ntf.CommonResult = commonResult;
|
|
|
|
ClientToGame packet = new ClientToGame();
|
|
packet.Message = new ClientToGameMessage();
|
|
packet.Message.NtfUgcNpcDeletion = ntf;
|
|
|
|
player.sendPacket(packet);
|
|
}
|
|
|
|
public static void send_GS2C_NTF_BEACON_DETAIL_INFO( Player player
|
|
, UgcNpcSummary ugcNpcSummary
|
|
, Int64 likeCount, Int64 dialogCount )
|
|
{
|
|
var ntf = new GS2C_NTF_BEACON_DETAIL_INFO();
|
|
ntf.UgcNpcMetaGuid = ugcNpcSummary.UgcNpcMetaGuid;
|
|
ntf.OwnerUserGuid = ugcNpcSummary.OwnerUserGuid;
|
|
ntf.UgcNpcSummary = ugcNpcSummary;
|
|
ntf.LikeCount = likeCount;
|
|
ntf.DialogCount = dialogCount;
|
|
|
|
ClientToGame packet = new ClientToGame();
|
|
packet.Message = new ClientToGameMessage();
|
|
packet.Message.NtfBeaconDetailInfo = ntf;
|
|
|
|
player.sendPacket(packet);
|
|
}
|
|
|
|
public static void send_GS2C_NTF_BEACON_INTERACTION_INFO( Player player
|
|
, UgcNpc ugcNpc
|
|
, UgcNpcInteraction ugcNpcInteraction )
|
|
{
|
|
var ntf = new GS2C_NTF_BEACON_INTERACTION_INFO();
|
|
ntf.EntityInstantGuid = ugcNpcInteraction.UgcNpcMetaGuid;
|
|
ntf.UgcNpcInteraction = ugcNpcInteraction;
|
|
|
|
ClientToGame packet = new ClientToGame();
|
|
packet.Message = new ClientToGameMessage();
|
|
packet.Message.NtfBeaconInteractionInfo = ntf;
|
|
|
|
player.sendPacket(packet);
|
|
}
|
|
|
|
public static void send_GS2C_NTF_BEACON_COMPACT_UPDATE( Player player
|
|
, UgcNpc ugcNpc
|
|
, UgcNpcCompact ugcNpcCompact)
|
|
{
|
|
var ntf = new GS2C_NTF_BEACON_COMPACT_UPDATE();
|
|
ntf.UgcNpcMetaGuid = ugcNpcCompact.UgcNpcMetaGuid;
|
|
ntf.OwnerUserGuid = ugcNpcCompact.OwnerUserGuid;
|
|
ntf.UgcNpcCompact = ugcNpcCompact;
|
|
|
|
ClientToGame packet = new ClientToGame();
|
|
packet.Message = new ClientToGameMessage();
|
|
packet.Message.NtfBeaconCompactUpdate = ntf;
|
|
|
|
player.sendPacket(packet);
|
|
}
|
|
|
|
public static void send_GS2MQS_NTF_BEACON_COMPACT_SYNC( GameServerLogic serverLogic
|
|
, string targetServerName
|
|
, USER_GUID userGuid
|
|
, UgcNpcCompact ugcNpcCompact, string locatedInstanceGuid )
|
|
{
|
|
var mg_server = serverLogic.getRabbitMqConnector() as RabbitMQ4Game;
|
|
NullReferenceCheckHelper.throwIfNull(mg_server, () => $"mg_server is null !!! - userGuid:{userGuid}");
|
|
|
|
var s2s_ntf_msg = new ServerMessage();
|
|
var ntf_beacon_compact_sync = new ServerMessage.Types.GS2MQS_NTF_BEACON_COMPACT_SYNC();
|
|
s2s_ntf_msg.NtfBeaconCompactSync = ntf_beacon_compact_sync;
|
|
|
|
ntf_beacon_compact_sync.UserGuid = userGuid;
|
|
ntf_beacon_compact_sync.UgcNpcCompact = ugcNpcCompact;
|
|
ntf_beacon_compact_sync.LocatedInstanceGuid = locatedInstanceGuid;
|
|
|
|
mg_server.SendMessage(targetServerName, s2s_ntf_msg);
|
|
}
|
|
}
|
|
}
|