mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-06-05 04:14:43 +00:00
ref[net]: refactored the packet service
This commit is contained in:
@@ -16,7 +16,7 @@ import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.config.ConfigManager;
|
||||
import com.zfoo.net.config.model.NetConfig;
|
||||
import com.zfoo.net.consumer.Consumer;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.net.router.Router;
|
||||
import com.zfoo.net.session.SessionManager;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zfoo.net.config.IConfigManager;
|
||||
import com.zfoo.net.consumer.IConsumer;
|
||||
import com.zfoo.net.core.AbstractClient;
|
||||
import com.zfoo.net.core.AbstractServer;
|
||||
import com.zfoo.net.packet.service.IPacketService;
|
||||
import com.zfoo.net.packet.IPacketService;
|
||||
import com.zfoo.net.router.IRouter;
|
||||
import com.zfoo.net.session.ISessionManager;
|
||||
import com.zfoo.net.session.Session;
|
||||
@@ -43,7 +43,7 @@ import java.util.ArrayList;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class NetContext implements ApplicationListener<ApplicationContextEvent>, Ordered {
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ConfigManager implements IConfigManager {
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.zfoo.net.config.model.NetConfig;
|
||||
import com.zfoo.net.consumer.registry.IRegistry;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IConfigManager {
|
||||
|
||||
@@ -14,13 +14,11 @@
|
||||
package com.zfoo.net.config.model;
|
||||
|
||||
|
||||
import com.zfoo.protocol.registration.ProtocolModule;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ConsumerConfig {
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zfoo.protocol.registration.ProtocolModule;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ConsumerModule {
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class MonitorConfig {
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.zfoo.protocol.generate.GenerateOperation;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class NetConfig {
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ProviderConfig {
|
||||
|
||||
@@ -17,8 +17,7 @@ import com.zfoo.protocol.registration.ProtocolModule;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ProviderModule {
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class RegistryConfig {
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class AbstractClient implements IClient {
|
||||
|
||||
@@ -32,7 +32,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class AbstractServer implements IServer {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.net.core;
|
||||
import com.zfoo.net.session.Session;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IClient {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.net.core;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IServer {
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.zfoo.event.model.event.IEvent;
|
||||
import com.zfoo.net.session.Session;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ClientSessionInactiveEvent implements IEvent {
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.zfoo.event.model.event.IEvent;
|
||||
import com.zfoo.net.session.Session;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class ServerSessionInactiveEvent implements IEvent {
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.lang.Nullable;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class GatewayServer extends AbstractServer {
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.net.core.gateway;
|
||||
/**
|
||||
* 网关负载均衡使用计算一致性hash的参数,如果packet继承了这个接口,则网关的一致性hash负载均衡优先使用这个接口计算一致性hash;
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IGatewayLoadBalancer {
|
||||
|
||||
@@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class WebsocketGatewayServer extends AbstractServer {
|
||||
|
||||
@@ -39,7 +39,7 @@ import java.io.InputStream;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class WebsocketSslGatewayServer extends AbstractServer {
|
||||
|
||||
@@ -16,12 +16,12 @@ package com.zfoo.net.core.gateway.model;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class AuthUidAsk implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 22;
|
||||
public static final short PROTOCOL_ID = 22;
|
||||
|
||||
private String gatewayHostAndPort;
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ import com.zfoo.protocol.IPacket;
|
||||
/**
|
||||
* 网关登录成功过后,将uid授权给网关
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class AuthUidToGatewayCheck implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 20;
|
||||
public static final short PROTOCOL_ID = 20;
|
||||
|
||||
private long uid;
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ import com.zfoo.protocol.IPacket;
|
||||
/**
|
||||
* 网关登录成功过后,将uid授权给网关的返回
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class AuthUidToGatewayConfirm implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 21;
|
||||
public static final short PROTOCOL_ID = 21;
|
||||
|
||||
private long uid;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.net.core.gateway.model;
|
||||
import com.zfoo.event.model.event.IEvent;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class AuthUidToGatewayEvent implements IEvent {
|
||||
|
||||
@@ -16,12 +16,12 @@ package com.zfoo.net.core.gateway.model;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class GatewaySessionInactiveAsk implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 23;
|
||||
public static final short PROTOCOL_ID = 23;
|
||||
|
||||
private String gatewayHostAndPort;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.net.core.gateway.model;
|
||||
import com.zfoo.event.model.event.IEvent;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class GatewaySessionInactiveEvent implements IEvent {
|
||||
|
||||
@@ -20,12 +20,12 @@ import java.util.Map;
|
||||
/**
|
||||
* 同步网关的session信息到push
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class GatewaySynchronizeSidAsk implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 24;
|
||||
public static final short PROTOCOL_ID = 24;
|
||||
|
||||
private String gatewayHostAndPort;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ package com.zfoo.net.core.http;
|
||||
import com.zfoo.net.core.AbstractServer;
|
||||
import com.zfoo.net.handler.ServerRouteHandler;
|
||||
import com.zfoo.net.handler.codec.http.HttpCodecHandler;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.protocol.util.IOUtils;
|
||||
import com.zfoo.util.net.HostAndPort;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
@@ -29,7 +29,7 @@ import io.netty.handler.stream.ChunkedWriteHandler;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HttpServer extends AbstractServer {
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.lang.Nullable;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class JProtobufGatewayServer extends AbstractServer {
|
||||
|
||||
@@ -24,7 +24,7 @@ import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.handler.timeout.IdleStateHandler;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class JProtobufTcpClient extends AbstractClient {
|
||||
|
||||
@@ -23,7 +23,7 @@ import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.handler.timeout.IdleStateHandler;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class JProtobufTcpServer extends AbstractServer {
|
||||
|
||||
@@ -24,7 +24,7 @@ import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.handler.timeout.IdleStateHandler;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TcpClient extends AbstractClient {
|
||||
|
||||
@@ -23,7 +23,7 @@ import io.netty.channel.socket.SocketChannel;
|
||||
import io.netty.handler.timeout.IdleStateHandler;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TcpServer extends AbstractServer {
|
||||
|
||||
@@ -30,7 +30,7 @@ import io.netty.channel.epoll.EpollDatagramChannel;
|
||||
import io.netty.channel.socket.nio.NioDatagramChannel;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class UdpClient extends AbstractClient {
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class UdpServer extends AbstractServer {
|
||||
|
||||
@@ -28,7 +28,7 @@ import io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandler;
|
||||
import io.netty.handler.stream.ChunkedWriteHandler;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class WebsocketClient extends AbstractClient {
|
||||
|
||||
@@ -26,7 +26,7 @@ import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
|
||||
import io.netty.handler.stream.ChunkedWriteHandler;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class WebsocketServer extends AbstractServer {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.net.handler;
|
||||
|
||||
import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.session.Session;
|
||||
import com.zfoo.net.util.SessionUtils;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
@@ -27,7 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ChannelHandler.Sharable
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ChannelHandler.Sharable
|
||||
|
||||
@@ -18,10 +18,10 @@ import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.consumer.balancer.ConsistentHashConsumerLoadBalancer;
|
||||
import com.zfoo.net.core.gateway.IGatewayLoadBalancer;
|
||||
import com.zfoo.net.core.gateway.model.GatewaySessionInactiveEvent;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.common.Heartbeat;
|
||||
import com.zfoo.net.packet.common.Ping;
|
||||
import com.zfoo.net.packet.common.Pong;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.router.attachment.GatewayAttachment;
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
import com.zfoo.net.router.attachment.SignalAttachment;
|
||||
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ChannelHandler.Sharable
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ChannelHandler.Sharable
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
package com.zfoo.net.handler.codec.http;
|
||||
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.common.Message;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.router.attachment.HttpAttachment;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import com.zfoo.protocol.util.JsonUtils;
|
||||
@@ -30,7 +30,7 @@ import java.util.function.Function;
|
||||
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class HttpCodecHandler extends MessageToMessageCodec<FullHttpRequest, EncodedPacketInfo> {
|
||||
|
||||
+4
-4
@@ -15,9 +15,9 @@ package com.zfoo.net.handler.codec.jprotobuf;
|
||||
|
||||
import com.baidu.bjf.remoting.protobuf.Codec;
|
||||
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
import com.zfoo.net.util.SessionUtils;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
@@ -39,7 +39,7 @@ import java.util.List;
|
||||
* header(4byte) + protocolId(2byte) + packet
|
||||
* header = body(bytes.length) + protocolId.length(2byte)
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class JProtobufTcpCodecHandler extends ByteToMessageCodec<EncodedPacketInfo> {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
package com.zfoo.net.handler.codec.json;
|
||||
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import com.zfoo.protocol.ProtocolManager;
|
||||
import com.zfoo.protocol.buffer.ByteBufUtils;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
package com.zfoo.net.handler.codec.tcp;
|
||||
|
||||
import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.net.util.SessionUtils;
|
||||
import com.zfoo.protocol.util.IOUtils;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
@@ -33,7 +33,7 @@ import java.util.List;
|
||||
* header(4byte) + protocolId(2byte) + packet
|
||||
* header = body(bytes.length) + protocolId.length(2byte)
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TcpCodecHandler extends ByteToMessageCodec<EncodedPacketInfo> {
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
package com.zfoo.net.handler.codec.udp;
|
||||
|
||||
import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.net.router.attachment.UdpAttachment;
|
||||
import com.zfoo.protocol.util.IOUtils;
|
||||
import com.zfoo.protocol.util.JsonUtils;
|
||||
@@ -32,7 +32,7 @@ import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class UdpCodecHandler extends MessageToMessageCodec<DatagramPacket, EncodedPacketInfo> {
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
package com.zfoo.net.handler.codec.websocket;
|
||||
|
||||
import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.protocol.util.IOUtils;
|
||||
import com.zfoo.protocol.util.JsonUtils;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
@@ -35,7 +35,7 @@ import java.util.List;
|
||||
* header(4byte) + protocolId(2byte) + packet
|
||||
* header = body(bytes.length) + protocolId.length(2byte)
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class WebSocketCodecHandler extends MessageToMessageCodec<WebSocketFrame, EncodedPacketInfo> {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
package com.zfoo.net.handler.idle;
|
||||
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.common.Heartbeat;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.util.SessionUtils;
|
||||
import io.netty.channel.ChannelDuplexHandler;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
@@ -25,7 +25,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ChannelHandler.Sharable
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ChannelHandler.Sharable
|
||||
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The zfoo Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
@@ -11,13 +10,13 @@
|
||||
* See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package com.zfoo.net.packet.model;
|
||||
package com.zfoo.net.packet;
|
||||
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class DecodedPacketInfo {
|
||||
+2
-3
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The zfoo Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
@@ -11,7 +10,7 @@
|
||||
* See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package com.zfoo.net.packet.model;
|
||||
package com.zfoo.net.packet;
|
||||
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
@@ -20,7 +19,7 @@ import org.springframework.lang.Nullable;
|
||||
/**
|
||||
* 被解码后的Packet的信息
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class EncodedPacketInfo {
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The zfoo Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
@@ -11,16 +10,15 @@
|
||||
* See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package com.zfoo.net.packet.service;
|
||||
package com.zfoo.net.packet;
|
||||
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public interface IPacketService {
|
||||
+2
-4
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The zfoo Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License. You may obtain a copy of the License at
|
||||
*
|
||||
@@ -11,10 +10,9 @@
|
||||
* See the License for the specific language governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package com.zfoo.net.packet.service;
|
||||
package com.zfoo.net.packet;
|
||||
|
||||
import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
import com.zfoo.net.router.route.PacketBus;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
@@ -36,7 +34,7 @@ import java.io.IOException;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PacketService implements IPacketService {
|
||||
@@ -21,13 +21,13 @@ import org.slf4j.helpers.FormattingTuple;
|
||||
import org.slf4j.helpers.MessageFormatter;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ProtobufClass
|
||||
public class Error implements IPacket {
|
||||
@Ignore
|
||||
public static final transient short PROTOCOL_ID = 101;
|
||||
public static final short PROTOCOL_ID = 101;
|
||||
|
||||
private int module;
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ProtobufClass
|
||||
public class Heartbeat implements IPacket {
|
||||
|
||||
@Ignore
|
||||
public static final transient short PROTOCOL_ID = 102;
|
||||
public static final short PROTOCOL_ID = 102;
|
||||
|
||||
@Override
|
||||
public short protocolId() {
|
||||
|
||||
@@ -21,13 +21,13 @@ import com.zfoo.protocol.ProtocolManager;
|
||||
/**
|
||||
* 通用的返回,既可以用在远程调用,又可以嵌套在其它协议里
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ProtobufClass
|
||||
public class Message implements IPacket {
|
||||
@Ignore
|
||||
public static final transient short PROTOCOL_ID = 100;
|
||||
public static final short PROTOCOL_ID = 100;
|
||||
|
||||
public static final Message SUCCESS = valueSuccess(null);
|
||||
public static final Message FAIL = valueFail(null);
|
||||
|
||||
@@ -20,12 +20,12 @@ import com.zfoo.protocol.IPacket;
|
||||
/**
|
||||
* Long + String
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PairLS implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 113;
|
||||
public static final short PROTOCOL_ID = 113;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private long key;
|
||||
|
||||
@@ -20,12 +20,12 @@ import com.zfoo.protocol.IPacket;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PairLong implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 111;
|
||||
public static final short PROTOCOL_ID = 111;
|
||||
|
||||
public static transient final Comparator<PairLong> NATURAL_VALUE_COMPARATOR = (a, b) -> Long.compare(a.getValue(), b.getValue());
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ package com.zfoo.net.packet.common;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class PairString implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 112;
|
||||
public static final short PROTOCOL_ID = 112;
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ProtobufClass
|
||||
public class Ping implements IPacket {
|
||||
|
||||
@Ignore
|
||||
public static final transient short PROTOCOL_ID = 103;
|
||||
public static final short PROTOCOL_ID = 103;
|
||||
|
||||
@Override
|
||||
public short protocolId() {
|
||||
|
||||
@@ -19,14 +19,14 @@ import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
@ProtobufClass
|
||||
public class Pong implements IPacket {
|
||||
|
||||
@Ignore
|
||||
public static final transient short PROTOCOL_ID = 104;
|
||||
public static final short PROTOCOL_ID = 104;
|
||||
|
||||
/**
|
||||
* 服务器当前的时间戳
|
||||
|
||||
@@ -18,12 +18,12 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TripleLLS implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 117;
|
||||
public static final short PROTOCOL_ID = 117;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private long left;
|
||||
|
||||
@@ -20,12 +20,12 @@ import com.zfoo.protocol.IPacket;
|
||||
/**
|
||||
* Long + String + String
|
||||
*
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TripleLSS implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 116;
|
||||
public static final short PROTOCOL_ID = 116;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private long left;
|
||||
|
||||
@@ -18,12 +18,12 @@ import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TripleLong implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 114;
|
||||
public static final short PROTOCOL_ID = 114;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private long left;
|
||||
|
||||
@@ -16,12 +16,12 @@ package com.zfoo.net.packet.common;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public class TripleString implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 115;
|
||||
public static final short PROTOCOL_ID = 115;
|
||||
|
||||
private String left;
|
||||
private String middle;
|
||||
|
||||
@@ -19,9 +19,9 @@ import com.zfoo.net.core.event.ServerExceptionEvent;
|
||||
import com.zfoo.net.core.gateway.model.AuthUidToGatewayCheck;
|
||||
import com.zfoo.net.core.gateway.model.AuthUidToGatewayConfirm;
|
||||
import com.zfoo.net.core.gateway.model.AuthUidToGatewayEvent;
|
||||
import com.zfoo.net.packet.EncodedPacketInfo;
|
||||
import com.zfoo.net.packet.common.Error;
|
||||
import com.zfoo.net.packet.common.Heartbeat;
|
||||
import com.zfoo.net.packet.model.EncodedPacketInfo;
|
||||
import com.zfoo.net.router.answer.AsyncAnswer;
|
||||
import com.zfoo.net.router.answer.SyncAnswer;
|
||||
import com.zfoo.net.router.attachment.GatewayAttachment;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package com.zfoo.net.router.route;
|
||||
|
||||
import com.zfoo.event.model.event.IEvent;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.net.router.attachment.GatewayAttachment;
|
||||
import com.zfoo.net.router.attachment.HttpAttachment;
|
||||
import com.zfoo.net.router.attachment.IAttachment;
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.zfoo.net.NetContext;
|
||||
import com.zfoo.net.config.ConfigManager;
|
||||
import com.zfoo.net.config.model.*;
|
||||
import com.zfoo.net.consumer.Consumer;
|
||||
import com.zfoo.net.packet.service.PacketService;
|
||||
import com.zfoo.net.packet.PacketService;
|
||||
import com.zfoo.net.router.Router;
|
||||
import com.zfoo.net.session.SessionManager;
|
||||
import com.zfoo.protocol.util.DomUtils;
|
||||
|
||||
@@ -21,7 +21,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import static com.zfoo.net.handler.BaseRouteHandler.SESSION_KEY;
|
||||
|
||||
/**
|
||||
* @author jaysunxiao
|
||||
* @author godotg
|
||||
* @version 3.0
|
||||
*/
|
||||
public abstract class SessionUtils {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
package com.zfoo.net.core.http;
|
||||
|
||||
import com.zfoo.net.packet.DecodedPacketInfo;
|
||||
import com.zfoo.net.packet.http.HttpHelloRequest;
|
||||
import com.zfoo.net.packet.model.DecodedPacketInfo;
|
||||
import com.zfoo.net.router.attachment.HttpAttachment;
|
||||
import com.zfoo.protocol.exception.RunException;
|
||||
import com.zfoo.protocol.util.StringUtils;
|
||||
|
||||
@@ -74,7 +74,7 @@ org.springframework.context.event.internalEventListenerFactory
|
||||
com.zfoo.net.config.model.NetConfig
|
||||
com.zfoo.net.NetContext
|
||||
com.zfoo.net.config.ConfigManager
|
||||
com.zfoo.net.packet.service.PacketService
|
||||
com.zfoo.net.packet.PacketService
|
||||
com.zfoo.net.router.Router
|
||||
com.zfoo.net.consumer.Consumer
|
||||
com.zfoo.net.session.SessionManager
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
public class CM_Array implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1119;
|
||||
public static final short PROTOCOL_ID = 1119;
|
||||
|
||||
private int[] a;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class CM_Float implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1112;
|
||||
public static final short PROTOCOL_ID = 1112;
|
||||
|
||||
private float a;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class CM_Int implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1110;
|
||||
public static final short PROTOCOL_ID = 1110;
|
||||
|
||||
private boolean flag;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class CM_List implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1118;
|
||||
public static final short PROTOCOL_ID = 1118;
|
||||
|
||||
private List<Integer> list;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class CM_Map implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1120;
|
||||
public static final short PROTOCOL_ID = 1120;
|
||||
|
||||
private Map<Integer, Integer> map;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class CM_Object implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1114;
|
||||
public static final short PROTOCOL_ID = 1114;
|
||||
|
||||
private int a;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class CM_Set implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1121;
|
||||
public static final short PROTOCOL_ID = 1121;
|
||||
|
||||
private Set<Integer> a;
|
||||
private Set<ObjectA> b;
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class ObjectA implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1116;
|
||||
public static final short PROTOCOL_ID = 1116;
|
||||
|
||||
private int a;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class ObjectB implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1117;
|
||||
public static final short PROTOCOL_ID = 1117;
|
||||
|
||||
private boolean flag;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class SM_Float implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1113;
|
||||
public static final short PROTOCOL_ID = 1113;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ import java.util.Objects;
|
||||
*/
|
||||
public class SM_Int implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1111;
|
||||
public static final short PROTOCOL_ID = 1111;
|
||||
|
||||
private Boolean flag;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class SM_Object implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1115;
|
||||
public static final short PROTOCOL_ID = 1115;
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class CM_CSharpRequest implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1165;
|
||||
public static final short PROTOCOL_ID = 1165;
|
||||
|
||||
// 注释1
|
||||
public byte a;
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class CSharpObjectA implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1166;
|
||||
public static final short PROTOCOL_ID = 1166;
|
||||
|
||||
public int value;
|
||||
public CSharpObjectB objectB;
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class CSharpObjectB implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1167;
|
||||
public static final short PROTOCOL_ID = 1167;
|
||||
|
||||
public boolean flag;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class GatewayToProviderRequest implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 5000;
|
||||
public static final short PROTOCOL_ID = 5000;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class GatewayToProviderResponse implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 5001;
|
||||
public static final short PROTOCOL_ID = 5001;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class HttpHelloRequest implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1700;
|
||||
public static final short PROTOCOL_ID = 1700;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class HttpHelloResponse implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1701;
|
||||
public static final short PROTOCOL_ID = 1701;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class JProtobufHelloRequest implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1500;
|
||||
public static final short PROTOCOL_ID = 1500;
|
||||
|
||||
@Protobuf(order = 1)
|
||||
private String message;
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class JProtobufHelloResponse implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1501;
|
||||
public static final short PROTOCOL_ID = 1501;
|
||||
|
||||
@Protobuf(order = 1)
|
||||
private String message;
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class JsonHelloRequest implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1600;
|
||||
public static final short PROTOCOL_ID = 1600;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class JsonHelloResponse implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1601;
|
||||
public static final short PROTOCOL_ID = 1601;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class ProviderMessAnswer implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 4001;
|
||||
public static final short PROTOCOL_ID = 4001;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class ProviderMessAsk implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 4000;
|
||||
public static final short PROTOCOL_ID = 4000;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class AsyncMessAnswer implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1153;
|
||||
public static final short PROTOCOL_ID = 1153;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class AsyncMessAsk implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1152;
|
||||
public static final short PROTOCOL_ID = 1152;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.zfoo.protocol.IPacket;
|
||||
*/
|
||||
public class SyncMessAnswer implements IPacket {
|
||||
|
||||
public static final transient short PROTOCOL_ID = 1151;
|
||||
public static final short PROTOCOL_ID = 1151;
|
||||
|
||||
private String message;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user