Abstraction Layer GeoEngine.

This commit is contained in:
MobiusDevelopment
2022-07-16 06:04:42 +00:00
parent 534f5dbf33
commit beb1aa0b77
1220 changed files with 92917 additions and 72972 deletions

View File

@@ -55,8 +55,8 @@ public class AdminGeodata implements IAdminCommandHandler
final int worldX = activeChar.getX();
final int worldY = activeChar.getY();
final int worldZ = activeChar.getZ();
final int geoX = GeoEngine.getGeoX(worldX);
final int geoY = GeoEngine.getGeoY(worldY);
final int geoX = GeoEngine.getInstance().getGeoX(worldX);
final int geoY = GeoEngine.getInstance().getGeoY(worldY);
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{
@@ -73,8 +73,8 @@ public class AdminGeodata implements IAdminCommandHandler
final int worldX = activeChar.getX();
final int worldY = activeChar.getY();
final int worldZ = activeChar.getZ();
final int geoX = GeoEngine.getGeoX(worldX);
final int geoY = GeoEngine.getGeoY(worldY);
final int geoX = GeoEngine.getInstance().getGeoX(worldX);
final int geoY = GeoEngine.getInstance().getGeoY(worldY);
if (GeoEngine.getInstance().hasGeoPos(geoX, geoY))
{

View File

@@ -19,9 +19,9 @@ package handlers.admincommandhandlers;
import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.geoengine.pathfinding.AbstractNodeLoc;
import org.l2jmobius.gameserver.geoengine.pathfinding.PathFinding;
import org.l2jmobius.gameserver.handler.IAdminCommandHandler;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.util.BuilderUtil;
@@ -37,20 +37,21 @@ public class AdminPathNode implements IAdminCommandHandler
{
if (command.equals("admin_path_find"))
{
if (!Config.PATHFINDING)
if (Config.PATHFINDING < 1)
{
BuilderUtil.sendSysMessage(activeChar, "PathFinding is disabled.");
return true;
}
if (activeChar.getTarget() != null)
{
final List<Location> path = GeoEngine.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld());
final List<AbstractNodeLoc> path = PathFinding.getInstance().findPath(activeChar.getX(), activeChar.getY(), (short) activeChar.getZ(), activeChar.getTarget().getX(), activeChar.getTarget().getY(), (short) activeChar.getTarget().getZ(), activeChar.getInstanceWorld(), true);
if (path == null)
{
BuilderUtil.sendSysMessage(activeChar, "No Route!");
return true;
}
for (Location a : path)
for (AbstractNodeLoc a : path)
{
BuilderUtil.sendSysMessage(activeChar, "x:" + a.getX() + " y:" + a.getY() + " z:" + a.getZ());
}

View File

@@ -72,7 +72,7 @@ public class AdminServerInfo implements IAdminCommandHandler
html.replace("%slots%", getPlayersCount("ALL") + "/" + Config.MAXIMUM_ONLINE_USERS);
html.replace("%gameTime%", GameTimeTaskManager.getInstance().getGameHour() + ":" + GameTimeTaskManager.getInstance().getGameMinute());
html.replace("%dayNight%", GameTimeTaskManager.getInstance().isNight() ? "Night" : "Day");
html.replace("%geodata%", Config.PATHFINDING ? "Enabled" : "Disabled");
html.replace("%geodata%", Config.PATHFINDING > 0 ? "Enabled" : "Disabled");
html.replace("%serverTime%", SDF.format(new Date(System.currentTimeMillis())));
html.replace("%serverUpTime%", getServerUpTime());
html.replace("%onlineAll%", getPlayersCount("ALL"));

View File

@@ -52,7 +52,7 @@ public class Ground implements ITargetTypeHandler
return null;
}
if (!GeoEngine.getInstance().canSeeLocation(creature, worldPosition))
if (!GeoEngine.getInstance().canSeeTarget(creature, worldPosition))
{
if (sendMessage)
{