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/propCmd.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/network/propCmd.java')
| -rw-r--r-- | NET/worlds/network/propCmd.java | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/NET/worlds/network/propCmd.java b/NET/worlds/network/propCmd.java new file mode 100644 index 0000000..6d7386e --- /dev/null +++ b/NET/worlds/network/propCmd.java @@ -0,0 +1,58 @@ +package NET.worlds.network; + +import java.io.IOException; + +public class propCmd extends receivedNetPacket { + public static final byte PROPCMD = 3; + protected OldPropertyList _propList; + + public propCmd() { + this._commandType = 3; + this._propList = new OldPropertyList(); + } + + public propCmd(OldPropertyList propList) { + super(null, 3); + this._propList = propList; + } + + public propCmd(ObjID objID, OldPropertyList propList) { + super(objID, 3); + this._propList = propList; + } + + @Override + void parseNetData(ServerInputStream data) throws IOException { + this._propList = new OldPropertyList(); + this._propList.parseNetData(data); + } + + @Override + int packetSize() { + return super.packetSize() + this._propList.packetSize(); + } + + @Override + void send(ServerOutputStream o) throws IOException { + super.send(o); + + assert this._propList != null; + + this._propList.send(o); + } + + @Override + void process(WorldServer _serv) throws Exception { + NetworkObject o = _serv.getObject(this._objID); + if (o == null) { + System.err.println("propCmd::process() error: cannot find object with name " + this._objID); + } else { + o.property(this._propList); + } + } + + @Override + public String toString(WorldServer serv) { + return "PROP " + this._objID.toString(serv) + " " + this._propList; + } +} |