using ServerCommon; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ServerCore; using ServerBase; using static ClientToGameMessage.Types; namespace GameServer { internal static class MinimapMarkerNotifyHelper { public static bool send_S2C_NTF_MINIMAP_MARKER(this Player player) { var minimap_marker_agent_action = player.getEntityAction(); NullReferenceCheckHelper.throwIfNull(minimap_marker_agent_action, () => $"minimap_marker_agent_action is null !!! - {player.toBasicString()}"); var ntf_packet = new ClientToGame(); ntf_packet.Message = new ClientToGameMessage(); ntf_packet.Message.MinimapMarkerNoti = new MinimapMarkerNoti(); var minimap_markers = minimap_marker_agent_action.getMinimapMarkers(); foreach (var minimap_marker in minimap_markers) { var minimap_marker_attribute = minimap_marker.getEntityAttribute(); NullReferenceCheckHelper.throwIfNull(minimap_marker_attribute, () => $"minimap_marker_attribute is null !!! - {player.toBasicString()}"); var marker_pos = new CharPos(); marker_pos.MapId = (int)minimap_marker_attribute.WorldMetaId; marker_pos.Pos = minimap_marker_attribute.MarkerPos.toPos(); ntf_packet.Message.MinimapMarkerNoti.MarkerPos.Add(marker_pos); } if (false == GameServerApp.getServerLogic().onSendPacket(player, ntf_packet)) { return false; } return true; } } }