del[protocol]: deprecate PROTOCOL_ID

This commit is contained in:
godotg committed 2023-09-03 15:03:55 +08:00
1 parent 8cb904ba50
commit 4d703215e3
75 files changed
+147 -714

No files matched your search

+1 -19
View File
@@ -154,26 +154,8 @@ your protocol number a little more compactly, so that your protocol number will
}
```
- The second uses static constants + interfaces: the value of this protocol number must be the same as the value
returned by the IPacket interface, which can slightly improve performance
```
public class SimpleObject implements IPacket {
public static final short PROTOCOL_ID = 104;
public int c;
public boolean g;
@Override
public short protocolId() {
return PROTOCOL_ID;
}
}
```
- The third use: Register the agreement through Protocol Manager.initProtocolAuto() without writing the protocol
- The second use: Register the agreement through Protocol Manager.initProtocolAuto() without writing the protocol
number
```
public class SimpleObject implements IPacket {