fix[net]: 加一个注解ProtobufClass注解支持心跳包,要不然jprotobuf会报错

This commit is contained in:
jaysunxiao
2022-01-12 12:04:54 +08:00
parent 1c05bfd4a9
commit 3e7b51294b
3 changed files with 8 additions and 0 deletions
@@ -13,12 +13,14 @@
package com.zfoo.net.packet.common;
import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
import com.zfoo.protocol.IPacket;
/**
* @author jaysunxiao
* @version 3.0
*/
@ProtobufClass
public class Heartbeat implements IPacket {
public static final transient short PROTOCOL_ID = 102;
@@ -13,12 +13,14 @@
package com.zfoo.net.packet.common;
import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
import com.zfoo.protocol.IPacket;
/**
* @author jaysunxiao
* @version 3.0
*/
@ProtobufClass
public class Ping implements IPacket {
public static final transient short PROTOCOL_ID = 103;
@@ -13,12 +13,15 @@
package com.zfoo.net.packet.common;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
import com.zfoo.protocol.IPacket;
/**
* @author jaysunxiao
* @version 3.0
*/
@ProtobufClass
public class Pong implements IPacket {
public static final transient short PROTOCOL_ID = 104;
@@ -26,6 +29,7 @@ public class Pong implements IPacket {
/**
* 服务器当前的时间戳
*/
@Protobuf(order = 1)
private long time;
public static Pong valueOf(long time) {