From 9fe73b049bd739a65b57ec96dec357b0abe42aee Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 15 Jan 2015 13:41:56 +1300 Subject: Move Xexun to 5006 port --- default.cfg | 11 ++++------- src/org/traccar/ServerManager.java | 30 +++++++++++------------------- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/default.cfg b/default.cfg index 7270355cc..7c7de9561 100644 --- a/default.cfg +++ b/default.cfg @@ -68,10 +68,6 @@ all /home/user/Documents/traccar/target/tracker-server.log - - true - 5000 - true 5001 @@ -92,9 +88,10 @@ true 5005 - - true - 5006 + + true + 5006 + false true diff --git a/src/org/traccar/ServerManager.java b/src/org/traccar/ServerManager.java index 1f1a380e4..1bf2a09b7 100644 --- a/src/org/traccar/ServerManager.java +++ b/src/org/traccar/ServerManager.java @@ -104,13 +104,12 @@ public class ServerManager { initGeocoder(properties); - initXexunServer("xexun"); initGps103Server("gps103"); initTk103Server("tk103"); initGl100Server("gl100"); initGl200Server("gl200"); initT55Server("t55"); - initXexun2Server("xexun2"); + initXexunServer("xexun"); initTotemServer("totem"); initEnforaServer("enfora"); initMeiligaoServer("meiligao"); @@ -234,19 +233,6 @@ public class ServerManager { return false; } - private void initXexunServer(final String protocol) throws SQLException { - if (isProtocolEnabled(properties, protocol)) { - serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { - @Override - protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new XexunFrameDecoder()); - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new XexunProtocolDecoder(dataManager, protocol, properties)); - } - }); - } - } - private void initGps103Server(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @@ -333,14 +319,20 @@ public class ServerManager { } } - private void initXexun2Server(final String protocol) throws SQLException { + private void initXexunServer(final String protocol) throws SQLException { if (isProtocolEnabled(properties, protocol)) { serverList.add(new TrackerServer(this, new ServerBootstrap(), protocol) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); // tracker bug \n\r - pipeline.addLast("stringDecoder", new StringDecoder()); - pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(dataManager, protocol, properties)); + if (Boolean.valueOf(properties.containsKey(protocol + ".extended"))) { + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); // tracker bug \n\r + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new Xexun2ProtocolDecoder(dataManager, protocol, properties)); + } else { + pipeline.addLast("frameDecoder", new XexunFrameDecoder()); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("objectDecoder", new XexunProtocolDecoder(dataManager, protocol, properties)); + } } }); } -- cgit v1.2.3