summaryrefslogtreecommitdiff
path: root/NET/worlds/network/shortLocCmd.java
diff options
context:
space:
mode:
Diffstat (limited to 'NET/worlds/network/shortLocCmd.java')
-rw-r--r--NET/worlds/network/shortLocCmd.java45
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;
+ }
+}