diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/network/shortLocCmd.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/network/shortLocCmd.java')
| -rw-r--r-- | NET/worlds/network/shortLocCmd.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/NET/worlds/network/shortLocCmd.java b/NET/worlds/network/shortLocCmd.java new file mode 100644 index 0000000..80463a8 --- /dev/null +++ b/NET/worlds/network/shortLocCmd.java @@ -0,0 +1,45 @@ +package NET.worlds.network; + +import NET.worlds.scape.Drone; +import java.io.IOException; + +public class shortLocCmd extends receivedNetPacket { + public static final byte SHORTLOCCMD = 4; + protected byte _dx; + protected byte _dy; + protected byte _ddirection; + + public shortLocCmd() { + this._commandType = 4; + } + + @Override + void parseNetData(ServerInputStream data) throws IOException { + this._dx = data.readByte(); + this._dy = data.readByte(); + this._ddirection = data.readByte(); + } + + @Override + void process(WorldServer _serv) throws Exception { + NetworkObject o = _serv.getObject(this._objID); + if (o == null) { + System.out.println("Unknown short id: " + this.toString(_serv)); + new Exception().printStackTrace(System.out); + } else { + if (o instanceof Drone) { + ((Drone)o).shortLoc(this._dx, this._dy, this._ddirection); + } + } + } + + @Override + public String toString(WorldServer serv) { + return "SHORTLOC " + this._objID.toString(serv) + " delta=" + this._dx + "," + this._dy + "," + this._ddirection; + } + + @Override + public String toString() { + return "SHORTLOC " + this._objID + " delta=" + this._dx + "," + this._dy + "," + this._ddirection; + } +} |