mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 10:19:04 +00:00
del[protocol]: deprecate PROTOCOL_ID
This commit is contained in:
1 parent
8cb904ba50
commit
4d703215e3
75 files changed
+147
-714
No files matched your search
+1
-19
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user