48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
|
|
namespace GameServer;
|
|
|
|
public partial class MapManager
|
|
{
|
|
public Pos GetBattleInstnaceRespawnPos(string mapFileName, string roomId)
|
|
{
|
|
Pos startPos = new();
|
|
|
|
|
|
var startPosAnchorGuid = MapDataTable.Instance.GetRoomStartPosAnchorGuid(mapFileName);
|
|
|
|
if (!AnchorTrees.TryGetValue(startPosAnchorGuid, out var startPosAnchor))
|
|
{
|
|
return startPos;
|
|
}
|
|
|
|
startPos.X = startPosAnchor.AnchorPos.X;
|
|
startPos.Y = startPosAnchor.AnchorPos.Y;
|
|
startPos.Z = startPosAnchor.AnchorPos.Z + 100;
|
|
|
|
return startPos;
|
|
}
|
|
|
|
public List<Anchor> getAllRespawnPos(string mapFileName)
|
|
{
|
|
List<Anchor> anchors = new();
|
|
|
|
//바꿔야 된다. 배틀인스턴스 스폰 포인트로 바꿔야 한다. 아직 안바꿨음
|
|
if (false == MapDataTable.Instance.getMapData(mapFileName, out var mapData))
|
|
{
|
|
//여기는 error 다. 로그만 찍고 startPos는 그대로 보낸다.
|
|
Log.getLogger().error($"not exist map data namd : {mapFileName}");
|
|
return anchors;
|
|
}
|
|
|
|
foreach (var anchor in mapData.Anchors)
|
|
{
|
|
if (anchor.Type == "AT_RespawnPos")
|
|
{
|
|
anchors.Add(anchor);
|
|
}
|
|
}
|
|
return anchors;
|
|
}
|
|
} |