From 43330ab36e0dbe4934a466c086098e6ea3970649 Mon Sep 17 00:00:00 2001 From: mashiyu Date: Tue, 22 Jan 2019 14:43:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/application.properties | 58 +++++++++++++++++++ .../java/com/ljsd/jieling/util/CellUtil.java | 24 ++++++++ .../src/main/resources/application.properties | 11 +--- 3 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 conf/application.properties diff --git a/conf/application.properties b/conf/application.properties new file mode 100644 index 000000000..7dca5c4e9 --- /dev/null +++ b/conf/application.properties @@ -0,0 +1,58 @@ +#server info +server.id = 10180 +server.openTime = 20190101000101 + + +# redis config +# Redis数据库索引(默认为0) +spring.redis.database=0 +# Redis服务器地址 +spring.redis.host=60.1.1.14 +# Redis服务器连接端口 +spring.redis.port=6379 +# Redis服务器连接密码(默认为空) +spring.redis.password= +# 连接池最大连接数(使用负值表示没有限制) +spring.redis.pool.max-active=8 +# 连接池最大阻塞等待时间(使用负值表示没有限制) +spring.redis.pool.max-wait=-1 +# 连接池中的最大空闲连接 +spring.redis.pool.max-idle=8 +# 连接池中的最小空闲连接 +spring.redis.pool.min-idle=0 +# 连接超时时间(毫秒) +spring.redis.timeout=0 + +spring.redis.expireTime = -1 + + +#spring.data.mongodb.uri = mongodb://mongouser:ysj#2017#ljsd@111.231.54.96:27017/ysj_wx_1 +#spring.data.mongodb2.uri = mongodb://mongouser:ysj#2017#ljsd@111.231.54.96:27017/develop_ysj_wx_1 +#mongodb2 develop +spring.data.mongodb.uri = mongodb://60.1.1.14:27017/jieling_msy +mongodb.options.maxWaitTime = 120000 +mongodb.options.connectTimeout = 1000 +mongodb.options.socketTimeout = 0 +mongodb.options.threadsAllowedToBlockForConnectionMultiplier = 20 +mongodb.options.connectionsPerHost = 256 +mongodb.options.minConnectionsPerHost = 5 +mongodb.options.maxConnectionIdleTime = 1000 + + +# netty config +netty.tcpPort = 16080 +netty.chatTcpPort = 20001 +netty.logintcpPort = 18091 +netty.udpPort = 18092 +netty.udpTargetIp=127.0.0.1 +netty.udpTargetPort=10001 +netty.reconnectDelay=3000 +netty.bossThreadCount=1 +netty.workerThreadCount=10 +netty.readTimeout=32 +netty.writeTimeout=32 +netty.allTimeout=35 + + + +logging.config = conf/logback-boot.xml \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/CellUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/CellUtil.java index 08fd06ebd..8f109d7e2 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/CellUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/CellUtil.java @@ -40,6 +40,13 @@ public class CellUtil { } + /** + * 鍦╳idth x height 鐨勬牸瀛愪笂 pos浣嶇疆鍛ㄥ洿寮鍚糠闆剧殑鏍煎瓙 + * @param width + * @param height + * @param pos + * @return + */ public static Set getOneOpenCell(int width, int height, int pos){ int[] xy = pos2XY(pos); int x = xy[0]; @@ -89,4 +96,21 @@ public class CellUtil { } return s1 ; } + + /** + * 妫娴嬫槸鍚︽槸鐩搁偦鐨勬牸瀛 + * @param pos1 + * @param pos2 + * @return + */ + public static boolean checkIsNextCell(int pos1 , int pos2){ + int[] xy1 = pos2XY(pos1); + int[] xy2 = pos2XY(pos2); + if ((xy1[0]==xy2[0] && Math.abs(xy1[1]-xy2[1])==1) || (xy1[1]==xy2[1] && Math.abs(xy1[0]-xy2[0])==1)){ + return true; + } + return false ; + } + + } diff --git a/serverlogic/src/main/resources/application.properties b/serverlogic/src/main/resources/application.properties index 2f5510da6..7dca5c4e9 100644 --- a/serverlogic/src/main/resources/application.properties +++ b/serverlogic/src/main/resources/application.properties @@ -40,7 +40,7 @@ mongodb.options.maxConnectionIdleTime = 1000 # netty config -netty.tcpPort = 18090 +netty.tcpPort = 16080 netty.chatTcpPort = 20001 netty.logintcpPort = 18091 netty.udpPort = 18092 @@ -54,14 +54,5 @@ netty.writeTimeout=32 netty.allTimeout=35 -#core -services.core.ip=60.1.1.180 -services.core.port=7900 -services.core.area=1000 -services.core.id=1 -services.core.weight=5 - -#arena service -services.fight.key=key_dir_checkserver_Hash logging.config = conf/logback-boot.xml \ No newline at end of file