mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-09-12 22:45:18 -04:00
Updated WaypointObject's encode method for little endian
This commit is contained in:
@@ -17,7 +17,6 @@ public class RequestWaypointCmdCallback implements ICmdCallback {
|
||||
|
||||
WaypointObject waypoint = (WaypointObject) objManager.createObject("object/waypoint/shared_waypoint.iff", player.getCreatureObject().getLocation());
|
||||
ghost.addWaypoint(waypoint);
|
||||
System.out.println("Waypoitn requested.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package resources.commands.callbacks;
|
||||
|
||||
import resources.commands.ICmdCallback;
|
||||
import resources.objects.SWGObject;
|
||||
import resources.objects.player.PlayerObject;
|
||||
import resources.objects.waypoint.WaypointObject;
|
||||
import resources.player.Player;
|
||||
import services.objects.ObjectManager;
|
||||
|
||||
@@ -9,7 +11,13 @@ public class WaypointCmdCallback implements ICmdCallback {
|
||||
|
||||
@Override
|
||||
public void execute(ObjectManager objManager, Player player, SWGObject target, String args) {
|
||||
System.out.println("Create Waypoint: " + args);
|
||||
PlayerObject ghost = (PlayerObject) player.getPlayerObject();
|
||||
if (ghost == null)
|
||||
return;
|
||||
|
||||
//System.out.println("Create Waypoint: " + args);
|
||||
WaypointObject waypoint = (WaypointObject) objManager.createObject("object/waypoint/shared_waypoint.iff", player.getCreatureObject().getLocation());
|
||||
ghost.addWaypoint(waypoint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public class PlayerObject extends IntangibleObject {
|
||||
experience.put(type, value);
|
||||
experience.sendDeltaMessage(this);
|
||||
}
|
||||
|
||||
public String getProfession() {
|
||||
return profession;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package resources.objects.waypoint;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import resources.network.BaselineBuilder;
|
||||
@@ -103,7 +104,7 @@ public class WaypointObject extends IntangibleObject implements Encodable{
|
||||
|
||||
@Override
|
||||
public byte[] encode() {
|
||||
ByteBuffer bb = ByteBuffer.allocate(42 + name.length() * 2);
|
||||
ByteBuffer bb = ByteBuffer.allocate(42 + name.length() * 2).order(ByteOrder.LITTLE_ENDIAN);
|
||||
bb.putInt(cellNumber);
|
||||
bb.putFloat((float) getLocation().getX());
|
||||
bb.putFloat((float) getLocation().getY());
|
||||
|
||||
Reference in New Issue
Block a user