summaryrefslogtreecommitdiff
path: root/NET/worlds/network/netProperty.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/network/netProperty.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/network/netProperty.java')
-rw-r--r--NET/worlds/network/netProperty.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/NET/worlds/network/netProperty.java b/NET/worlds/network/netProperty.java
new file mode 100644
index 0000000..c2f8e4b
--- /dev/null
+++ b/NET/worlds/network/netProperty.java
@@ -0,0 +1,50 @@
+package NET.worlds.network;
+
+import java.io.IOException;
+
+public class netProperty {
+ protected int _propID;
+ protected String _value;
+
+ public netProperty() {
+ this._propID = 0;
+ }
+
+ public netProperty(int p) {
+ this._propID = p;
+ }
+
+ public netProperty(int p, String val) {
+ assert val != null;
+
+ this._propID = p;
+ this._value = val;
+ }
+
+ public int property() {
+ return this._propID;
+ }
+
+ public String value() {
+ return this._value;
+ }
+
+ int packetSize() {
+ return this._value != null ? 2 + ServerOutputStream.utfLength(this._value) : 0;
+ }
+
+ void parseNetData(ServerInputStream data) throws IOException {
+ this._propID = data.readUnsignedByte();
+ this._value = data.readUTF();
+ }
+
+ void send(ServerOutputStream o) throws IOException {
+ o.writeByte(this._propID);
+ o.writeUTF(this._value);
+ }
+
+ @Override
+ public String toString() {
+ return netCmds.getPropName(this._propID) + "=" + this._value;
+ }
+}