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/conf/server/MapConfig.txt b/conf/server/MapConfig.txt index b4804f9e8..766d3384b 100644 --- a/conf/server/MapConfig.txt +++ b/conf/server/MapConfig.txt @@ -1,12 +1,11 @@ Id Info Size MoveConfused EnergyConfused OpenRule int string mut,int#int,1 int int string -101 鎴樹贡鑽掓灄 20#10 1 10 null -102 鏋楁笂娣卞 20#10 2 10 null -103 涓夐旀触 20#15 2 20 null -104 闈掗緳闂 15#20 2 20 null -105 椋庤鍘熼噹 20#20 2 20 null -106 鑽掕姕涓橀櫟 20#10 2 20 null -107 瑙傛緶娓 20#15 2 20 null -108 鐧藉彾娓 20#20 2 20 null -109 鑽嗘娴佸煙 30#30 2 20 null -110 涓績鏋㈢航 20#10 2 20 null +101 鎴樹贡鑽掓灄 20#10 1 10 +102 鏋楁笂娣卞 20#10 2 10 +103 涓夐旀触 20#15 2 20 +104 闈掗緳闂 15#20 2 20 +105 椋庤鍘熼噹 20#20 2 20 +106 鑽掕姕涓橀櫟 20#10 2 20 +107 瑙傛緶娓 20#15 2 20 +108 鐧藉彾娓 20#20 2 20 +109 鑽嗘娴佸煙 30#30 2 20 diff --git a/conf/server/MapEventsConfig.txt b/conf/server/MapEventsConfig.txt index e868acd0e..171c9d656 100644 --- a/conf/server/MapEventsConfig.txt +++ b/conf/server/MapEventsConfig.txt @@ -1,28 +1,147 @@ Id Style Refresh TriggerRules IsSchedule ExploreValues int int int int bool int -101001 1 2 1 0 0 -101002 2 2 1 0 0 -101003 4 2 1 0 0 -101004 1 2 1 0 0 -101005 1 2 1 0 0 -101006 5 3 1 0 0 -101007 5 4 1 0 0 -101008 5 2 1 0 0 -101009 5 3 1 0 0 -101010 5 2 1 0 0 -101011 5 2 1 0 0 -101012 3 2 1 0 0 -102001 1 2 1 0 0 -102002 1 2 1 0 0 -102003 1 2 1 0 0 -102004 1 2 1 0 0 -102005 5 3 1 0 0 -102006 5 3 1 0 0 -102007 5 3 1 0 0 -102008 5 3 1 0 0 -102009 5 3 1 0 0 -102010 2 1 1 0 0 -102011 2 2 1 0 0 -102012 2 2 1 0 0 -102013 2 1 1 0 0 -102014 2 2 1 0 0 \ No newline at end of file +101001 1 2 1 true 0 +101002 1 2 1 true 0 +101003 1 2 1 true 0 +101004 2 3 1 true 0 +101005 3 2 1 true 0 +101006 4 2 1 true 0 +101007 5 3 1 true 0 +101008 5 4 1 true 0 +101009 5 3 1 true 0 +101010 5 3 1 true 0 +101011 5 3 1 true 0 +101012 5 3 1 true 0 +101013 8 2 1 true 0 +102001 1 2 1 true 0 +102002 1 2 1 true 0 +102003 1 2 1 true 0 +102004 1 2 1 true 0 +102005 2 2 1 true 0 +102006 2 2 1 true 0 +102007 2 1 1 true 0 +102008 2 2 1 true 0 +102009 2 1 1 true 0 +102010 3 2 1 true 0 +102011 5 3 1 true 0 +102012 5 3 1 true 0 +102013 5 3 1 true 0 +102014 5 3 1 true 0 +102015 5 3 1 true 0 +103001 1 2 1 true 0 +103002 1 2 1 true 0 +103003 1 2 1 true 0 +103004 2 2 1 true 0 +103005 2 1 1 true 0 +103006 2 2 1 true 0 +103007 2 1 1 true 0 +103008 2 1 1 true 0 +103009 2 2 1 true 0 +103010 3 2 1 true 0 +103011 4 2 1 true 0 +103012 5 3 1 true 0 +103013 5 3 1 true 0 +103014 5 3 1 true 0 +103015 5 3 1 true 0 +103016 5 3 1 true 0 +103017 5 3 1 true 0 +103018 5 3 1 true 0 +103019 5 3 1 true 0 +103020 5 3 1 true 0 +103021 5 3 1 true 0 +103022 5 3 1 true 0 +103023 8 2 1 true 0 +104001 1 2 1 true 0 +104002 1 2 1 true 0 +104003 1 2 1 true 0 +104004 2 2 1 true 0 +104005 2 1 1 true 0 +104006 2 2 1 true 0 +104007 2 1 1 true 0 +104008 2 1 1 true 0 +104009 2 2 1 true 0 +104010 2 2 1 true 0 +104011 2 2 1 true 0 +104012 3 2 1 true 0 +104013 5 3 1 true 0 +104014 5 3 1 true 0 +104015 5 3 1 true 0 +104016 5 3 1 true 0 +104017 5 3 1 true 0 +104018 5 3 1 true 0 +104019 8 2 1 true 0 +105001 1 2 1 true 0 +105002 1 2 1 true 0 +105003 1 2 1 true 0 +105004 2 2 1 true 0 +105005 2 1 1 true 0 +105006 2 2 1 true 0 +105007 2 1 1 true 0 +105008 2 1 1 true 0 +105009 2 2 1 true 0 +105010 2 2 1 true 0 +105011 2 2 1 true 0 +105012 2 1 1 true 0 +105013 3 2 1 true 0 +105014 5 3 1 true 0 +105015 5 3 1 true 0 +105016 5 3 1 true 0 +105017 5 3 1 true 0 +105018 5 3 1 true 0 +105019 5 3 1 true 0 +105020 5 3 1 true 0 +105021 4 2 1 true 0 +105022 8 2 1 true 0 +106001 1 2 1 true 0 +106002 1 2 1 true 0 +106003 2 2 1 true 0 +106004 2 1 1 true 0 +106005 2 2 1 true 0 +106006 3 2 1 true 0 +106007 5 3 1 true 0 +106008 5 3 1 true 0 +106009 5 3 1 true 0 +106010 5 3 1 true 0 +106011 5 3 1 true 0 +106012 5 3 1 true 0 +106013 8 2 1 true 0 +107001 1 2 1 true 0 +107002 1 2 1 true 0 +107003 2 2 1 true 0 +107004 2 1 1 true 0 +107005 2 2 1 true 0 +107006 2 2 1 true 0 +107007 2 1 1 true 0 +107008 2 2 1 true 0 +107009 3 2 1 true 0 +107010 5 3 1 true 0 +107011 5 3 1 true 0 +107012 5 3 1 true 0 +107013 5 3 1 true 0 +107014 5 3 1 true 0 +107015 5 3 1 true 0 +107016 5 3 1 true 0 +107017 5 3 1 true 0 +107018 5 3 1 true 0 +107019 5 3 1 true 0 +107020 5 3 1 true 0 +107021 5 3 1 true 0 +107022 5 3 1 true 0 +107023 8 2 1 true 0 +108001 1 2 1 true 0 +108002 1 2 1 true 0 +108003 1 2 1 true 0 +108004 2 2 1 true 0 +108005 2 1 1 true 0 +108006 2 2 1 true 0 +108007 2 2 1 true 0 +108008 2 1 1 true 0 +108009 2 2 1 true 0 +108010 2 2 1 true 0 +108011 3 2 1 true 0 +108012 4 2 1 true 0 +108013 5 3 1 true 0 +108014 5 3 1 true 0 +108015 5 3 1 true 0 +108016 5 3 1 true 0 +108017 5 3 1 true 0 diff --git a/conf/server/MapEventsItemConfig.txt b/conf/server/MapEventsItemConfig.txt new file mode 100644 index 000000000..e717ddffb --- /dev/null +++ b/conf/server/MapEventsItemConfig.txt @@ -0,0 +1,63 @@ +Id EventsId Order Contents Reward Jump OpenRules +int int int mut,int#int,2 mut,int#int,2 mut,int#int,2 mut,int#int,2 +1 101001 1 1#10101 1 null null +2 101002 1 1#10102 1 null null +3 101003 1 1#10103 1 null null +4 101004 1 3#1200#1|6#100 2#0 null null +5 101005 1 11#0|6#1 null null null +6 101006 1 11#102|6#1 null null null +7 101007 0 3#2#0|6#100 null 1#1 null +8 101007 1 3#2#0|6#100 null 1#2 null +9 101007 2 3#2#0|6#100 null 1#3 null +10 101007 3 null null 1#4 null +11 101007 4 null null 1#5 null +12 101007 5 3#2#0|6#100 null 1#6 null +13 101007 6 null null 1#7 null +14 101007 7 null null 1#8 null +15 101007 8 null null 1#9 null +16 101007 9 null null 1#10 null +17 101007 10 null null 1#11 null +18 101007 11 null null 1#12 null +19 101007 12 null null 1#13 null +20 101007 13 null null 1#14 null +21 101007 14 null null 1#15 null +22 101007 15 null null 1#16 null +23 101007 16 null null 1#17 null +24 101007 17 null null 1#18 null +25 101007 18 null null 1#19 null +26 101007 19 null null null null +27 101008 0 null null 1#1 null +28 101008 1 null null 1#2 null +29 101008 2 null null 1#3 null +30 101008 3 null null 1#4 null +31 101008 4 null null 1#5 null +32 101008 5 null null 1#6 null +33 101008 6 null null 1#7 null +34 101008 7 null null 1#8 null +35 101008 8 null null 1#9 null +36 101008 9 null null 1#10 null +37 101008 10 null null 1#11 null +38 101008 11 null null 1#12 null +39 101008 12 null null 1#13 null +40 101008 13 null null 1#14 null +41 101008 14 null null 1#15 null +42 101008 15 null null 1#16 null +43 101008 16 null null 1#17 null +44 101008 17 null null 1#18 null +45 101008 18 null null 1#19 null +46 101008 19 null null 1#20 null +47 101008 20 null null 1#21 null +48 101008 21 null null 1#22 null +49 101008 22 null null 1#23 null +50 101008 23 null null 1#24 null +51 101008 24 null null 1#25 null +52 101008 25 null null 1#26 null +53 101008 26 null null 1#27 null +54 101008 27 null null 1#28 null +55 101008 28 null null 1#29 null +56 101008 29 null null 1#30 null +57 101008 30 null null 1#31 null +58 101008 31 null null 1#32 null +59 101008 32 null null null null +60 101009 1 null null null null +61 101010 1 null null null null diff --git a/conf/server/Map_101.txt b/conf/server/Map_101.txt new file mode 100644 index 000000000..e4fc870e7 --- /dev/null +++ b/conf/server/Map_101.txt @@ -0,0 +1,53 @@ +id Event Groups +int int mut,int#int,2 +1 101013 1#19 +2 101013 2#19 +3 101013 1#20 +4 101013 2#20 +5 101013 1#3 +6 101013 8#7 +7 101013 10#7 +8 101013 3#20 +9 101013 10#16 +10 101013 8#17 +11 101013 1#18 +12 101002 8#3|9#3|8#4|7#5|7#6 +13 101001 2#14|3#14|2#15|3#15 +14 101001 7#18|8#18|8#19 +15 101002 4#10|4#11 +16 101010 2#17 +17 101013 9#15 +18 101013 10#15 +19 101013 8#16 +20 101013 9#8 +21 101013 10#8 +22 101013 2#1 +23 101011 8#8 +24 101012 7#15 +25 101013 1#1 +26 101013 3#1 +27 101013 4#1 +28 101013 5#1 +29 101013 1#2 +30 101013 2#2 +31 101013 3#2 +32 101013 4#2 +33 101001 4#18|3#19 +34 101013 2#3|1#4 +35 101013 7#17 +36 101013 9#7 +37 101013 4#20 +38 101013 9#16 +39 101013 9#17 +40 101008 8#2 +41 101009 10#10 +42 101004 1#11|2#11|1#12|2#12|5#17|6#17|6#18 +43 101005 10#20 +44 101006 4#3 +45 101007 5#4 +46 101001 8#11|9#11|8#12|9#12 +47 101001 1#6|2#6|1#7|2#7 +48 101002 6#1|5#2|6#2 +49 101002 5#7|6#7|5#8|6#8 +50 101003 10#4|10#5 +51 101002 6#13|6#14 diff --git a/conf/server/Map_102.txt b/conf/server/Map_102.txt new file mode 100644 index 000000000..4f56b8830 --- /dev/null +++ b/conf/server/Map_102.txt @@ -0,0 +1,26 @@ +id Event Groups +int int mut,int#int,2 +1 101010 9#11 +2 101008 2#2 +3 102009 4#5|5#5|4#6|5#6 +4 101009 7#16 +5 102006 8#12|9#12|8#13|9#13 +6 102005 5#17|6#17|5#18|6#18 +7 101005 2#20 +8 102008 1#8|2#8|1#9|2#9 +9 101007 10#1 +10 102007 1#14|2#14|1#15|2#15 +11 101002 1#5|2#5|1#6|2#6 +12 101011 5#9 +13 101001 6#7|7#7|6#8|7#8 +14 101001 2#17|3#17|2#18|3#18 +15 102004 3#1|1#2|4#2 +16 101002 4#3|5#3|4#4|5#4 +17 101002 7#4|8#4|7#5|8#5 +18 102003 9#6|10#6|9#7|10#7 +19 102003 3#7|4#7|3#8|4#8 +20 102003 2#10|3#10|2#11|3#11 +21 102003 5#12|6#12|5#13|6#13 +22 102003 9#14|10#14|9#15|10#15 +23 101002 9#17|10#17|9#18|10#18 +24 101002 6#19|7#19|6#20|7#20 diff --git a/conf/server/Map_103.txt b/conf/server/Map_103.txt new file mode 100644 index 000000000..04539fba1 --- /dev/null +++ b/conf/server/Map_103.txt @@ -0,0 +1,78 @@ +id Event Groups +int int mut,int#int,2 +1 103011 14#20 +2 103002 7#8|7#9 +3 101013 7#11 +4 101013 7#12 +5 101013 6#13 +6 101013 7#13 +7 103018 8#12 +8 103019 12#20 +9 101013 10#8 +10 103002 2#6|3#6|2#7|3#7 +11 101004 11#9 +12 103001 1#1|2#1|1#2|2#2 +13 103001 6#14|6#15 +14 101013 9#9 +15 101013 8#10 +16 101013 5#13 +17 101013 5#16 +18 101013 11#10 +19 101013 8#11 +20 101013 10#11 +21 101013 4#17 +22 101013 3#18 +23 103001 9#12|10#12|9#13|10#13 +24 103002 6#1|7#1|6#2|7#2 +25 101004 14#13|15#13 +26 103001 11#19|12#19|11#20 +27 101004 5#6|5#7|4#8|5#8 +28 103002 11#7|12#7|11#8|12#8 +29 103002 12#14|13#14|12#15|13#15 +30 103002 2#15|2#16 +31 101010 7#19 +32 101013 2#20 +33 101013 2#19 +34 101013 2#18 +35 101013 14#9 +36 101013 13#9 +37 101013 12#9 +38 101013 14#8 +39 101013 15#8 +40 101013 8#2 +41 101011 14#14 +42 101012 2#11 +43 101013 8#1 +44 101013 9#2 +45 101013 9#3 +46 101013 9#4 +47 101013 10#4 +48 101013 10#5 +49 101013 10#6 +50 101013 10#7 +51 103001 12#4|13#4|12#5|13#5 +52 103021 15#10 +53 103002 3#3|3#4 +54 103020 11#14 +55 101004 5#18|5#19 +56 103022 5#14 +57 101013 9#8 +58 101013 11#11 +59 101013 8#9 +60 101013 5#15 +61 101013 12#10 +62 101013 9#11 +63 101013 4#16 +64 101013 3#17 +65 101008 8#3 +66 101009 9#10 +67 101013 1#20 +68 101004 10#1|11#1|12#1|13#1 +69 103002 9#17|9#18 +70 101005 1#5 +71 103001 14#17|14#18 +72 101007 15#3 +73 103001 6#5|7#5|6#6|7#6 +74 103002 12#11|12#12 +75 101004 1#13|1#14 +76 103002 3#11|4#11|3#12|4#12 diff --git a/conf/server/Map_104.txt b/conf/server/Map_104.txt new file mode 100644 index 000000000..560a39a17 --- /dev/null +++ b/conf/server/Map_104.txt @@ -0,0 +1,61 @@ +id Event Groups +int int mut,int#int,2 +1 101013 7#12 +2 101013 8#12 +3 101013 8#13 +4 101013 9#13 +5 101013 5#8 +6 101004 8#5|9#5|8#6|9#6 +7 101013 6#9 +8 101013 4#11 +9 101013 10#13 +10 101013 11#14 +11 101013 2#12 +12 101013 4#12 +13 101013 6#12 +14 101013 13#14 +15 101013 14#15 +16 101004 11#10|12#10|11#11|12#11 +17 101004 14#7|15#7|14#8|15#8 +18 101004 14#3|15#3|14#4|15#4 +19 104002 6#2|7#2|6#3|7#3 +20 104002 3#1|4#1|3#2|4#2 +21 104001 12#5|13#5|12#6|13#6 +22 101010 3#15 +23 101013 15#15 +24 101013 6#13 +25 101013 5#14 +26 101013 5#15 +27 101013 5#11|4#13 +28 101013 6#11|5#13 +29 104001 9#14|10#14|9#15|10#15 +30 104002 10#7|11#7|10#8|11#8 +31 104002 15#9|15#10 +32 104001 13#12|14#12|13#13|14#13 +33 104001 1#14|2#14|1#15|2#15 +34 101013 2#3 +35 104001 1#10|2#10|1#11|2#11 +36 101011 12#13 +37 104002 6#6|7#6|3#7|4#7|6#7|7#7|3#8|4#8 +38 101012 5#10 +39 104002 9#11|10#11|9#12|10#12 +40 101013 1#3 +41 101013 3#3 +42 101013 3#4 +43 101013 3#5 +44 101013 4#5 +45 101013 4#6 +46 101013 5#6 +47 101013 5#7 +48 101004 9#2|10#2|9#3|10#3 +49 101013 5#9 +50 101013 3#12 +51 101013 4#9 +52 101013 11#13 +53 101013 1#12 +54 101013 5#12 +55 101013 12#14 +56 101013 14#14 +57 101008 12#1 +58 101009 8#15 +59 101004 11#15|12#15 diff --git a/conf/server/Map_105.txt b/conf/server/Map_105.txt new file mode 100644 index 000000000..349e78e96 --- /dev/null +++ b/conf/server/Map_105.txt @@ -0,0 +1,35 @@ +id Event Groups +int int mut,int#int,2 +1 104001 3#10|4#10|3#11|4#11 +2 104001 7#4|8#4|7#5|8#5 +3 101010 2#20 +4 104001 12#6|13#6|12#7|13#7 +5 104001 15#7|16#7|15#8|16#8 +6 103018 17#14 +7 104001 10#17|11#17|10#18|11#18 +8 104001 10#14|11#14|10#15|11#15 +9 104001 18#14|17#15|18#15 +10 101011 18#4 +11 104001 14#10|15#10|14#11|15#11 +12 104001 2#13|3#13|2#14|3#14 +13 101012 13#8 +14 101004 11#9|12#9 +15 101004 9#12|10#12 +16 101001 3#18|4#18|3#19|4#19 +17 101008 5#19 +18 101009 7#18 +19 101001 15#2|16#2|15#3|16#3 +20 101004 10#20|11#20 +21 101005 1#3 +22 101004 17#11|18#11 +23 101004 17#20|18#20 +24 101007 3#17 +25 101004 3#6|4#6 +26 101001 13#13|14#13|13#14|14#14 +27 101001 3#2|4#2|3#3|4#3 +28 101001 6#8|7#8|6#9|7#9 +29 101004 5#15|6#15 +30 101004 14#17|15#17 +31 101004 8#1|9#1 +32 101001 11#3|12#3|11#4|12#4 +33 101001 18#16|19#16|18#17|19#17 diff --git a/conf/server/Map_106.txt b/conf/server/Map_106.txt new file mode 100644 index 000000000..3b11876da --- /dev/null +++ b/conf/server/Map_106.txt @@ -0,0 +1,30 @@ +id Event Groups +int int mut,int#int,2 +1 106001 6#2|7#2|6#3|7#3 +2 101010 9#1 +3 106002 2#4|2#5 +4 106002 7#15|7#16 +5 106002 8#11|8#12 +6 106002 1#15|1#16 +7 106001 5#7|6#7|5#8|6#8 +8 106001 3#12|4#12|3#13|4#13 +9 106001 10#17|10#18 +10 106001 3#18|4#18|3#19|4#19 +11 101013 10#2 +12 106002 1#8|1#9 +13 101011 10#13 +14 101013 10#1 +15 101013 9#2 +16 101013 8#3 +17 101013 9#3 +18 101013 8#4 +19 101013 7#5 +20 101013 8#5 +21 101013 7#6 +22 101008 5#17 +23 101009 3#7 +24 101004 4#1|5#1 +25 101005 1#2 +26 101007 10#4|2#20 +27 101004 7#20|8#20 +28 101004 8#6|9#6 diff --git a/conf/server/Map_107.txt b/conf/server/Map_107.txt new file mode 100644 index 000000000..6fc3acee3 --- /dev/null +++ b/conf/server/Map_107.txt @@ -0,0 +1,115 @@ +id Event Groups +int int mut,int#int,2 +1 101013 4#9 +2 101013 3#9 +3 101013 13#10 +4 101013 14#10 +5 101013 14#11 +6 101013 15#11 +7 107018 14#8 +8 101013 10#1 +9 107002 15#8|15#9 +10 101013 12#1 +11 107001 12#4|13#4|12#5|13#5 +12 101013 14#1 +13 101013 3#7 +14 107001 2#16|3#16|2#17|3#17 +15 101013 1#7 +16 101013 1#9 +17 107001 9#11|10#11|9#12|10#12 +18 101013 2#9 +19 107002 8#19|8#20 +20 101013 5#9 +21 101013 5#11 +22 101013 6#12 +23 101013 6#14 +24 101013 7#15 +25 101013 9#9 +26 101013 10#9 +27 101010 15#17 +28 101013 6#5 +29 101013 5#5 +30 101013 12#10 +31 101013 6#8 +32 101013 7#8 +33 101013 2#2 +34 101013 1#2 +35 101013 2#1 +36 101011 2#12 +37 101012 5#2 +38 101013 1#1 +39 101013 5#1 +40 101013 6#1 +41 101013 9#1 +42 103021 4#13 +43 101004 14#12|14#13 +44 103020 9#15 +45 103022 11#19 +46 101013 13#1 +47 101013 8#4 +48 101013 6#2 +49 101013 14#2 +50 101013 2#7 +51 101013 2#5 +52 107001 4#3|5#3|4#4|5#4 +53 101013 8#16 +54 101008 1#19 +55 101009 7#5 +56 101004 13#7|13#8 +57 101005 15#4 +58 101013 1#10 +59 107001 10#6|11#6|10#7|11#7 +60 101013 11#17 +61 101007 8#14 +62 107002 12#14|12#15 +63 101013 5#12 +64 101013 7#14 +65 101013 12#19 +66 101013 12#18 +67 101013 11#18 +68 101013 13#19 +69 101013 13#20 +70 101013 2#3 +71 101013 10#3 +72 101013 1#4 +73 101013 6#4 +74 103018 12#12 +75 103019 2#8 +76 101004 3#10|3#11 +77 101013 7#4 +78 101013 9#4 +79 101013 8#2 +80 101013 12#2 +81 101013 1#3 +82 101013 1#5 +83 101013 8#17 +84 101013 3#5 +85 101013 5#8 +86 101013 10#17 +87 101004 6#17|6#18 +88 101004 5#6|5#7 +89 101013 11#9 +90 101013 8#8 +91 101013 8#9 +92 101013 4#5 +93 101013 12#9 +94 101013 3#2 +95 101013 4#2 +96 101013 15#1 +97 101013 3#1 +98 101013 4#1 +99 101013 7#1 +100 101013 8#1 +101 107022 5#20 +102 101013 11#1 +103 101013 10#2 +104 101013 5#10 +105 101013 10#4 +106 101013 1#8 +107 101013 1#6 +108 107001 14#14|15#14|14#15|15#15 +109 101013 9#17 +110 107002 1#13|1#14 +111 101004 2#4 +112 101013 6#13 +113 101013 8#15 diff --git a/conf/server/Map_108.txt b/conf/server/Map_108.txt new file mode 100644 index 000000000..383529837 --- /dev/null +++ b/conf/server/Map_108.txt @@ -0,0 +1,27 @@ +id Event Groups +int int mut,int#int,2 +1 101010 19#3 +2 108002 2#8|3#8|2#9|3#9 +3 108001 7#2|8#2|7#3|8#3 +4 108001 18#11|19#11|18#12|19#12 +5 108002 18#19|19#19|18#20|19#20 +6 108001 17#5|18#5|17#6|18#6 +7 108001 12#4|13#4|12#5|13#5 +8 108001 14#8|15#8|14#9|15#9 +9 108002 3#12|4#12|3#13|4#13 +10 108002 8#14|9#14|8#15|9#15 +11 108002 13#17|14#17|13#18|14#18 +12 101011 6#12 +13 101012 10#9 +14 101012 15#13 +15 101004 6#14|6#15 +16 101004 12#14|12#15 +17 108012 14#1 +18 101008 4#1 +19 101009 10#6 +20 101004 16#2|16#3 +21 101007 12#20 +22 101004 13#8|13#9 +23 101004 19#7|19#8 +24 101004 16#19|16#20 +25 101004 7#4|7#5 diff --git a/conf/server/RewardGroup.txt b/conf/server/RewardGroup.txt new file mode 100644 index 000000000..9a90df9ba --- /dev/null +++ b/conf/server/RewardGroup.txt @@ -0,0 +1,3 @@ +RewardGroupID Info IsUpset RewardItem RewardMaxNum Loop +int string int mut,int#int,1 int int +1 閽荤煶鎷涘嫙鍗℃睜1 2 1#2#3#4#5#6#7#8#9#10#11#12#13#14#15#16#17#18#19#20#21#22#23#24#25#26#27#28#29#30#31#32#33#34#35#36#37#38#39#40#41#42#43#44#45#46#47#48#49#50#51#52#53#54#55#56 1 0 diff --git a/conf/server/RewardItemConfig.txt b/conf/server/RewardItemConfig.txt new file mode 100644 index 000000000..d44de6dc4 --- /dev/null +++ b/conf/server/RewardItemConfig.txt @@ -0,0 +1,58 @@ +Id ItemId Chance GrowChance RandomMin RandomMax +int int int int int int +1 10001 100 0 1 1 +2 10002 100 0 1 1 +3 10003 100 0 1 1 +4 10004 100 0 1 1 +5 10005 100 0 1 1 +6 10006 100 0 1 1 +7 10007 100 0 1 1 +8 10008 100 0 1 1 +9 10009 100 0 1 1 +10 10010 100 0 1 1 +11 10011 100 0 1 1 +12 10012 100 0 1 1 +13 10013 100 0 1 1 +14 10014 100 0 1 1 +15 10015 100 0 1 1 +16 10016 100 0 1 1 +17 10017 100 0 1 1 +18 10018 100 0 1 1 +19 10019 100 0 1 1 +20 10020 100 0 1 1 +21 10021 100 0 1 1 +22 10022 100 0 1 1 +23 10023 100 0 1 1 +24 10024 100 0 1 1 +25 10025 100 0 1 1 +26 10026 100 0 1 1 +27 10027 100 0 1 1 +28 10028 100 0 1 1 +29 10029 100 0 1 1 +30 10030 100 0 1 1 +31 10031 100 0 1 1 +32 10032 100 0 1 1 +33 10033 100 0 1 1 +34 10034 100 0 1 1 +35 10035 100 0 1 1 +36 10036 100 0 1 1 +37 10037 100 0 1 1 +38 10038 100 0 1 1 +39 10039 100 0 1 1 +40 10040 100 0 1 1 +41 10041 100 0 1 1 +42 10042 100 0 1 1 +43 10043 100 0 1 1 +44 10044 100 0 1 1 +45 10045 100 0 1 1 +46 10046 100 0 1 1 +47 10047 100 0 1 1 +48 10048 100 0 1 1 +49 10049 100 0 1 1 +50 10050 100 0 1 1 +51 10051 100 0 1 1 +52 10052 100 0 1 1 +53 10053 100 0 1 1 +54 10054 100 0 1 1 +55 10055 100 0 1 1 +56 10056 100 0 1 1 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SCMapEventsItemConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SCMapEventsItemConfig.java index fa55e24ce..c975d9f70 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SCMapEventsItemConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SCMapEventsItemConfig.java @@ -25,31 +25,31 @@ public class SCMapEventsItemConfig implements BaseConfig{ /** * 浜嬩欢鍐呭 */ - private String contents; + private int[][] contents; /** * 濂栧姳 */ - private String reward; + private int[][] reward; /** * 缁撴灉璺宠浆 */ - private String jump; + private int[][] jump; /** * 寮鍚潯浠 */ - private String openRules; + private int[][] openRules; @Override public void init() throws Exception { scMapEventsItemConfigMap = STableManager.getConfig(SCMapEventsItemConfig.class); scMapEventsItemConfigs = new HashMap<>(scMapEventsItemConfigMap.size()); for (SCMapEventsItemConfig eventsItemConfigEntry : scMapEventsItemConfigMap.values()){ - if (!scMapEventsItemConfigs.containsKey(eventsItemConfigEntry.getEventId())) { - scMapEventsItemConfigs.put(eventsItemConfigEntry.getEventId(), new HashMap<>()); + if (!scMapEventsItemConfigs.containsKey(eventsItemConfigEntry.getEventsId())) { + scMapEventsItemConfigs.put(eventsItemConfigEntry.getEventsId(), new HashMap<>()); } - scMapEventsItemConfigs.get(eventsItemConfigEntry.getEventId()).put(eventsItemConfigEntry.getOrder(), eventsItemConfigEntry); + scMapEventsItemConfigs.get(eventsItemConfigEntry.getEventsId()).put(eventsItemConfigEntry.getOrder(), eventsItemConfigEntry); } } @@ -57,18 +57,6 @@ public class SCMapEventsItemConfig implements BaseConfig{ return id; } - public int getEventId() { - return eventsId; - } - - public String getContents() { - return contents; - } - - public String getReward() { - return reward; - } - public int getEventsId() { return eventsId; } @@ -77,11 +65,19 @@ public class SCMapEventsItemConfig implements BaseConfig{ return order; } - public String getJump() { + public int[][] getContents() { + return contents; + } + + public int[][] getReward() { + return reward; + } + + public int[][] getJump() { return jump; } - public String getOpenRules() { + public int[][] getOpenRules() { return openRules; } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SDrop.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SDrop.java deleted file mode 100644 index f037e73ae..000000000 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/SDrop.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.ljsd.jieling.config; - -import com.ljsd.jieling.logic.STableManager; -import com.ljsd.jieling.logic.Table; - -import java.util.Map; - -@Table(name = "drop") -public class SDrop implements BaseConfig { - public static Map sDropMap; - private int id; - private int dropType; // 鎺夎惤type - private int[][] item; - private int[] weight; - - @Override - public void init() throws Exception { - sDropMap = STableManager.getConfig(SDrop.class); - } - - - public int getId() { - return id; - } - - public int[][] getItem() { - return item; - } - - public static Map getsDropMap() { - return sDropMap; - } - - public int getDropType() { - return dropType; - } - - public int[] getWeight() { - return weight; - } -} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SMapEventsItemConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SMapEventsItemConfig.java new file mode 100644 index 000000000..99363bf19 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SMapEventsItemConfig.java @@ -0,0 +1,85 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name ="MapEventsItemConfig") +public class SMapEventsItemConfig implements BaseConfig { + + private int id; + + private int eventsId; + + private int order; + + private int sort; + + private int[][] contents; + + private int[][] reward; + + private int[][] jump; + + private int[][] openRules; + + private String unfinishInfo; + + private String unfinishOption; + + private int[][] unfinishContents; + + + @Override + public void init() throws Exception { + + } + + + public int getId() { + return id; + } + + public int getEventsId() { + return eventsId; + } + + public int getOrder() { + return order; + } + + public int getSort() { + return sort; + } + + public int[][] getContents() { + return contents; + } + + public int[][] getReward() { + return reward; + } + + public int[][] getJump() { + return jump; + } + + public int[][] getOpenRules() { + return openRules; + } + + public String getUnfinishInfo() { + return unfinishInfo; + } + + public String getUnfinishOption() { + return unfinishOption; + } + + public int[][] getUnfinishContents() { + return unfinishContents; + } + + +} \ No newline at end of file diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SRewardGroup.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SRewardGroup.java new file mode 100644 index 000000000..636d7a0e2 --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SRewardGroup.java @@ -0,0 +1,55 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name = "RewardGroup") +public class SRewardGroup implements BaseConfig { + public static Map sRewardItemMap; + private int id; + /** + * 缁勫唴鎶藉彇閬撳叿瑙勫垯 + * 1缁勫唴鍏ㄥ嚭 + * 2鎸夌収鐗╁搧鍦ㄧ粍闃熺殑鍗犳瘮鍑 + * 3鎸夌収缁勫唴閬撳叿姒傜巼锛屼緷娆℃娊鍙 + */ + private int isUpset; // 鎺夎惤type + private int[] rewardGroupID; + private int rewardMaxNum; // 閬撳叿鏁 + /** + * 濡傛灉鎶藉彇瑙勫垯閫3 锛屽垯闇瑕佽缃惊鐜疆鏁 + */ + private int loop ; + + @Override + public void init() throws Exception { + sRewardItemMap = STableManager.getConfig(SRewardGroup.class); + } + + + public int getId() { + return id; + } + + public static Map getsRewardItemMap() { + return sRewardItemMap; + } + + public int getIsUpset() { + return isUpset; + } + + public int[] getRewardGroupID() { + return rewardGroupID; + } + + public int getRewardMaxNum() { + return rewardMaxNum; + } + + public int getLoop() { + return loop; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/SRewardItem.java b/serverlogic/src/main/java/com/ljsd/jieling/config/SRewardItem.java new file mode 100644 index 000000000..35f2fc23c --- /dev/null +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/SRewardItem.java @@ -0,0 +1,51 @@ +package com.ljsd.jieling.config; + +import com.ljsd.jieling.logic.STableManager; +import com.ljsd.jieling.logic.Table; + +import java.util.Map; + +@Table(name = "RewardItemConfig") +public class SRewardItem implements BaseConfig { + public static Map sDropMap; + private int id; + private int itemId; + private int chance; //鑾峰彇姒傜巼 + private int growChance; //鎴愰暱姒傜巼 閽堝鐗规畩澶勭悊锛屽鏋滀笉鑾峰彇锛屽垯鑾峰彇姒傜巼澧炲姞 + private int randomMin; //鑾峰彇鏁伴噺鏈灏忓 + private int randomMax; //鑾峰彇鏁伴噺鏈澶у + + @Override + public void init() throws Exception { + sDropMap = STableManager.getConfig(SRewardItem.class); + } + + + public int getId() { + return id; + } + + public static Map getsDropMap() { + return sDropMap; + } + + public int getItemId() { + return itemId; + } + + public int getChance() { + return chance; + } + + public int getGrowChance() { + return growChance; + } + + public int getRandomMin() { + return randomMin; + } + + public int getRandomMax() { + return randomMax; + } +} diff --git a/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java b/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java index 9a626ac54..719917d00 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/exception/ErrorCode.java @@ -2,4 +2,14 @@ package com.ljsd.jieling.exception; public class ErrorCode { + //绯荤粺閿欒 + public static final int sysErrorCode = -100; + + //閲嶅鐧婚檰 + public static final int reloginCode = -101; + + //韪㈢敤鎴蜂笅绾 + public static final int kickUserCode = -102; + + } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java b/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java index fabf9ce1a..926c78229 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/globals/GlobalItemType.java @@ -4,8 +4,10 @@ public interface GlobalItemType { //鎺夎惤鐗╁搧绫诲瀷 int ALL_DROP = 0; //鍏ㄩ儴鎺夎惤 int WEIGHT_DROP = 1; //闅忔満鎺夎惤 + int SUCCESSIVELY_RANDOM = 2; // 渚濇闅忔満 // 鐗╁搧绫诲瀷 - int ITEM = 10; //閬撳叿绫诲瀷 + int ITEM = 10; //閬撳叿 + int CARD = 11; // 鍗$墝 } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/Cell.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/Cell.java index 2924b3a65..c9f05e4d1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/Cell.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/Cell.java @@ -1,13 +1,40 @@ package com.ljsd.jieling.handler.map; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - public class Cell { - private Map eventIds = new ConcurrentHashMap(); + private int cellId; - public Map getEventIds() { - return eventIds; + private int eventId; + + private int state; + + public Cell(int cellId, int eventId, int state) { + this.cellId = cellId; + this.eventId = eventId; + this.state = state; + } + + public int getCellId() { + return cellId; + } + + public void setCellId(int cellId) { + this.cellId = cellId; + } + + public int getEventId() { + return eventId; + } + + public void setEventId(int eventId) { + this.eventId = eventId; + } + + public int getState() { + return state; + } + + public void setState(int state) { + this.state = state; } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java index 45c7c7a17..e8738ba50 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/EventType.java @@ -3,17 +3,17 @@ package com.ljsd.jieling.handler.map; public class EventType { /** * 澶т簨浠剁偣绫诲瀷 - * 1鎬墿 2鐭 3浼犻侀棬 4杩炵画浜嬩欢 5琛岃剼鍟嗕汉 6瀹濈 7闃绘尅鐐 8浜嬩欢鍖哄煙鍏ㄩ儴鍑轰簨浠 + * (1鎬 2鐭 3鍑虹敓鐐 4浼犻侀棬 5杩炵画浜嬩欢 6琛岃剼鍟嗕汉 7瀹濈 8闃绘尅鐐 9浜嬩欢鍖哄煙鍏ㄩ儴鍑轰簨浠) */ - public static final int enter = 0; public static final int monster = 1; public static final int mine = 2; - public static final int portal = 3; - public static final int continuity = 4; - public static final int businessman = 5; - public static final int box = 6; - public static final int hinder = 7; - public static final int allEvents = 8; + public static final int enter = 3; + public static final int portal = 4; + public static final int continuity = 5; + public static final int businessman = 6; + public static final int box = 7; + public static final int hinder = 8; + public static final int allEvents = 9; /** * 灏忎簨浠剁被鍨 diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapEnterRequestHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapEnterRequestHandler.java index d896cb0c6..9f89c6580 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapEnterRequestHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapEnterRequestHandler.java @@ -7,6 +7,8 @@ import com.ljsd.jieling.protocols.MapInfoProto; import com.ljsd.jieling.protocols.MessageTypeProto; import org.springframework.stereotype.Component; +import java.util.List; + @Component public class MapEnterRequestHandler extends BaseHandler{ @Override @@ -18,6 +20,7 @@ public class MapEnterRequestHandler extends BaseHandler{ public void process(ISession iSession, PacketNetData netData) throws Exception { byte[] message = netData.parseClientProtoNetData(); MapInfoProto.MapEnterRequest mapEnterRequest = MapInfoProto.MapEnterRequest.parseFrom(message); - MapLogic.getInstance().enterMap(iSession, mapEnterRequest.getMapId(), MessageTypeProto.MessageType.MAP_ENTER_RESPONSE); + List heroInfosList = mapEnterRequest.getHeroInfosList(); + MapLogic.getInstance().enterMap(iSession, mapEnterRequest.getMapId(), heroInfosList, MessageTypeProto.MessageType.MAP_ENTER_RESPONSE); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java index 87a5ef88c..d0d85e881 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.java @@ -45,7 +45,7 @@ public class MapLogic { * * @param mapId */ - public void enterMap(ISession iSession, int mapId, MessageTypeProto.MessageType messageType) throws Exception { + public void enterMap(ISession iSession, int mapId, List heroInfosList, MessageTypeProto.MessageType messageType) throws Exception { int uid = iSession.getUid(); User user = UserManager.getUser(uid); MapManager mapManager = user.getMapManager(); @@ -69,20 +69,12 @@ public class MapLogic { } List cells = new ArrayList<>(mapManager.getMapInfo().size()); for (Map.Entry entry : mapManager.getMapInfo().entrySet()) { - List cellEvents = new ArrayList<>(); Cell cell = entry.getValue(); - for (Map.Entry cellEntry : cell.getEventIds().entrySet()) { - CommonProto.CellEvent cellEvent = CommonProto.CellEvent - .newBuilder() - .setEventId(cellEntry.getKey()) - .setState(cellEntry.getValue()) - .build(); - cellEvents.add(cellEvent); - } CommonProto.Cell cellProto = CommonProto.Cell .newBuilder() .setCellId(entry.getKey()) - .addAllCellEvents(cellEvents) + .setEventId(cell.getEventId()) + .setState(cell.getState()) .build(); cells.add(cellProto); } @@ -102,12 +94,11 @@ public class MapLogic { Random random = new Random(); for (Map.Entry entry : scMap.entrySet()) { SCMap scMap1 = entry.getValue(); - Cell cellValue = new Cell(); - cellValue.getEventIds().put(scMap1.getEvent(), 0); int randomIndex = random.nextInt(scMap1.getGroups().length); int x = scMap1.getGroups()[randomIndex][0]; int y = scMap1.getGroups()[randomIndex][1]; int xy = CellUtil.xy2Pos(x, y); + Cell cellValue = new Cell(xy, scMap1.getEvent(), 0); SCMapEventsConfig scMapEvent = SCMapEventsConfig.scMapEventMap.get(scMap1.getEvent()); if (scMapEvent.getStyle() == EventType.enter) { mapManager.setCurXY(xy); @@ -178,17 +169,12 @@ public class MapLogic { LOGGER.info("xy is wrong =>{}", xy); return; } - if (cell.getEventIds().isEmpty()) { - LOGGER.info("no event eventId"); - return; - } mapManager.setCurXY(xy); - Map eventIds = cell.getEventIds(); - if (!eventIds.containsKey(bigEventId)) { + if (cell.getEventId() != bigEventId) { LOGGER.info("no this event eventId=>{}", bigEventId); return; } - int schedule = eventIds.get(bigEventId); + int schedule = cell.getState(); if (schedule == -1) { LOGGER.info("event is finished,bigEventId=>{} smallEventId=>{}", bigEventId, -1); return; @@ -199,13 +185,13 @@ public class MapLogic { LOGGER.info("no scMapEventsItemConfig bigEventId=>{} smallEventId=>{}", bigEventId, schedule); return; } - String[] contents = scMapEventsItemConfig.getContents().split("\\|"); + int[][] contents = scMapEventsItemConfig.getContents(); if (choice < contents.length - 1 || contents.length - 1 < choice) { LOGGER.info("no this choice =>{} scMapEventsItemConfig.getContents()=>{}", choice, scMapEventsItemConfig.getContents()); return; } - String[] eventArr = contents[choice].split("#"); - switch (Integer.parseInt(eventArr[0])) { + int[] eventArr = contents[choice]; + switch (eventArr[0]) { case EventType.fight: { fightStart(uid, bigEventId); break; @@ -218,7 +204,7 @@ public class MapLogic { case EventType.useItem: case EventType.scout: { Map useItems = new HashMap<>(); - useItems.put(Integer.parseInt(eventArr[1]), Integer.parseInt(eventArr[2])); + useItems.put(eventArr[1], eventArr[2]); ItemUtil.useItem(user, useItems); break; } @@ -238,20 +224,20 @@ public class MapLogic { return; } } - if (scMapEventsItemConfig.getJump() == null || scMapEventsItemConfig.getJump().isEmpty()) { - cell.getEventIds().put(bigEventId, schedule + 1); + if (scMapEventsItemConfig.getJump() == null || scMapEventsItemConfig.getJump().length == 0) { + cell.setState(schedule + 1); } else { - String[] jumps = scMapEventsItemConfig.getJump().split("\\|"); + int[][] jumps = scMapEventsItemConfig.getJump(); for (int i = 0; i < jumps.length; i++) { - String[] jump = jumps[i].split("#"); - if (Integer.parseInt(jump[0]) == choice - 1) { - cell.getEventIds().put(bigEventId, Integer.parseInt(jump[1])); + int[] jump = jumps[i]; + if (jump[0] == choice - 1) { + cell.setState(jump[1]); break; } } } - String reward = scMapEventsItemConfig.getReward(); - if (reward != null && !reward.isEmpty()) { + int[][] reward = scMapEventsItemConfig.getReward(); + if (reward != null && reward.length > 0) { Map itemMap = new HashMap<>(); // ItemUtil.addItem(user, itemMap); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/CalHeroFinalAttri.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/CalHeroFinalAttri.java index 3f9c2a9e2..aab94fc8b 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/CalHeroFinalAttri.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/CalHeroFinalAttri.java @@ -12,4 +12,7 @@ public class CalHeroFinalAttri { + + + } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/OnlineUserManager.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/OnlineUserManager.java index adfd5db36..23083ccee 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/OnlineUserManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/OnlineUserManager.java @@ -8,19 +8,16 @@ import java.util.concurrent.ConcurrentHashMap; public class OnlineUserManager { - public static Map onlineUidMap = new ConcurrentHashMap<>(); public static Map sessionMap = new ConcurrentHashMap<>(); public static Map onlineUserMap = new ConcurrentHashMap<>(10000); - public static void registUser(int uid, int serverId, ISession session) { - onlineUidMap.put(uid, serverId); + public static void userOnline(int uid, ISession session) { sessionMap.put(uid, session); } - public static void unRegistUser(int uid) { - onlineUidMap.remove(uid); + public static void userOffline(int uid) { sessionMap.remove(uid); } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/network/server/ProtocolsManager.java b/serverlogic/src/main/java/com/ljsd/jieling/network/server/ProtocolsManager.java index 8bbe0953b..621465ec6 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/network/server/ProtocolsManager.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/network/server/ProtocolsManager.java @@ -3,7 +3,11 @@ package com.ljsd.jieling.network.server; import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.MessageLite; import com.ljsd.GameApplication; +import com.ljsd.jieling.exception.ErrorCode; import com.ljsd.jieling.handler.BaseHandler; +import com.ljsd.jieling.logic.OnlineUserManager; +import com.ljsd.jieling.logic.dao.User; +import com.ljsd.jieling.logic.dao.UserManager; import com.ljsd.jieling.netty.cocdex.PacketNetData; import com.ljsd.jieling.netty.handler.GameMessageHandler; import com.ljsd.jieling.network.session.ISession; @@ -207,7 +211,7 @@ public class ProtocolsManager implements ProtocolsAbstract { int resultCode = checkAndRefresh(session,packetNetData); if (resultCode != 0 ){ - MessageUtil.sendErrorCode(session); + MessageUtil.sendErrorCode(session,0); return; } @@ -251,8 +255,9 @@ public class ProtocolsManager implements ProtocolsAbstract { private int checkAndRefresh(ISession session, PacketNetData packetNetData) { int myToken = 0; - if (packetNetData.getMsgId()== MessageTypeProto.MessageType.LOGIN_REQUEST_VALUE){ + OnlineUserManager.userOnline(session.getUid(),session); + //TODO 鏇存柊token }else if (packetNetData.getMsgId()== MessageTypeProto.MessageType.RECONNECT_REQUEST_VALUE){ //TODO 鏇存柊token @@ -260,6 +265,13 @@ public class ProtocolsManager implements ProtocolsAbstract { }else { } + + if (OnlineUserManager.checkUidOnline(session.getUid())){ + ISession iSession = OnlineUserManager.getSessionByUid(session.getUid()); + MessageUtil.sendErrorCode(session, ErrorCode.reloginCode); + iSession.close(); + } + // if (myToken != packetNetData.getToken()){ // return 1; // } @@ -295,14 +307,10 @@ public class ProtocolsManager implements ProtocolsAbstract { return; } - if (nowSession != null) { - LOGGER.error("offLine->uid={},session={},nowUid={},nowSession={}", - session.getUid(), session, nowSession.getUid(), nowSession); - } GameMessageHandler.currentSessions.remove(session.getUid()); try { - + OnlineUserManager.userOffline(session.getUid()); // 涓嬬嚎澶勭悊鐨勯昏緫闇瑕佹坊鍔犲湪杩欓噷 } finally { //淇濊瘉鏁版嵁鐨勪繚瀛 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/java/com/ljsd/jieling/util/ItemUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java index 86b0e3a47..c73714d80 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/ItemUtil.java @@ -1,12 +1,10 @@ package com.ljsd.jieling.util; -import com.ljsd.jieling.config.SDrop; +import com.ljsd.jieling.config.SRewardItem; import com.ljsd.jieling.config.SItem; +import com.ljsd.jieling.config.SRewardGroup; import com.ljsd.jieling.globals.GlobalItemType; -import com.ljsd.jieling.logic.dao.Item; -import com.ljsd.jieling.logic.dao.ItemManager; -import com.ljsd.jieling.logic.dao.User; -import com.ljsd.jieling.logic.dao.UserManager; +import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.protocols.CommonProto; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -20,47 +18,108 @@ import java.util.concurrent.CopyOnWriteArrayList; public class ItemUtil { private static final Logger LOGGER = LoggerFactory.getLogger(ItemUtil.class); //鎺夎惤 - public static CommonProto.Drop.Builder drop(User user, int dropId, CommonProto.Drop.Builder drop) throws Exception { - SDrop sDrop = SDrop.getsDropMap().get(dropId); - if (sDrop == null){ + public static CommonProto.Drop.Builder drop(User user, int dropGroupId, CommonProto.Drop.Builder drop) throws Exception { + SRewardGroup sRewardGroup = SRewardGroup.getsRewardItemMap().get(dropGroupId); + if (sRewardGroup == null){ return drop; } - int dropType = sDrop.getDropType(); Map itemMap = new HashMap<>(); - selectDrop(sDrop, dropType, itemMap); + Map cardMap = new HashMap<>(); + + selectDrop(sRewardGroup,itemMap,cardMap); addItem(user,itemMap,drop); - + addCard(user,cardMap,drop); return drop; } - private static void selectDrop(SDrop sDrop, int dropType, Map itemMap) { - int[][] itemIds = sDrop.getItem(); - if (dropType == GlobalItemType.ALL_DROP){ - for (int[] itemId : itemIds) { - getMap(itemId, itemMap); + private static void selectDrop(SRewardGroup sRewardGroup,Map itemMap, Map cardMap) { + int[] rewardItem = sRewardGroup.getRewardGroupID(); + StringBuilder rewardStr = new StringBuilder(); + StringBuilder weight = new StringBuilder(); + for (int dropId :rewardItem){ + SRewardItem sRewardItem = SRewardItem.getsDropMap().get(dropId); + if (sRewardItem == null){ + continue; + } + if (rewardStr.length() == 0){ + rewardStr = new StringBuilder(String.valueOf(sRewardItem.getItemId())); + }else{ + rewardStr.append("#").append(sRewardItem.getItemId()); + } + if (weight.length() == 0){ + weight = new StringBuilder(String.valueOf(sRewardItem.getChance())); + }else{ + weight.append("#").append(sRewardItem.getItemId()); } - }else{ - int[] weights = sDrop.getWeight(); - int index = MathUtils.randomForStrArray(weights); - getMap(itemIds[index], itemMap); } - } - - private static void getMap(int[] itemInfo, Map itemMap) { - SItem sItem = SItem.getsItemMap().get(itemInfo[1]); - int itemType = sItem.getItemType(); - switch (itemType) { - case GlobalItemType.ITEM: - putcountMap(itemInfo, itemMap); + switch (sRewardGroup.getIsUpset()) { + case GlobalItemType.ALL_DROP: + getMap(rewardStr.toString().split("#"),itemMap,cardMap); + break; + case GlobalItemType.WEIGHT_DROP: + getRandomMap(sRewardGroup.getRewardMaxNum(),rewardStr.toString().split("#"),weight.toString().split("#"),itemMap,cardMap); + break; + case GlobalItemType.SUCCESSIVELY_RANDOM: + getSuccessivelyRandmoMap(sRewardGroup,rewardStr.toString().split("#"),weight.toString().split("#"),itemMap,cardMap); break; default: break; } } - private static void putcountMap(int[] itemInfo, Map map) { - map.merge(itemInfo[0], itemInfo[1], (a, b) -> b + a); + private static void getSuccessivelyRandmoMap(SRewardGroup sRewardGroup,String[] rewardArr,String[] weightArr, Map itemMap, Map cardMap) { + for (int i = 0 ; i < sRewardGroup.getRewardMaxNum();i++){ + int itemId = 0; + for (int j = 0 ; j < sRewardGroup.getLoop();i++){ + int index = MathUtils.randomForStrArray(weightArr); + itemId = Integer.parseInt(rewardArr[index]); + if (itemId ==Integer.parseInt(rewardArr[j])){ + break; + } + } + if (0 == itemId){ + int index = MathUtils.randomForStrArray(weightArr); + itemId = Integer.parseInt(rewardArr[index]); + } + SRewardItem sRewardItem = SRewardItem.getsDropMap().get(itemId); + getMap(itemId,itemMap, cardMap, sRewardItem); + } + } + + private static void getRandomMap(int randomItemNum ,String[] rewardArr,String[] weightArr, Map itemMap, Map cardMap) { + for (int i = 0 ; i < randomItemNum;i++){ + int index = MathUtils.randomForStrArray(weightArr); + int itemId = Integer.parseInt(rewardArr[index]); + SRewardItem sRewardItem = SRewardItem.getsDropMap().get(itemId); + getMap(itemId,itemMap, cardMap, sRewardItem); + } + } + + private static void getMap(String[] itemInfo, Map itemMap,Map cardMap) { + for (String itemId :itemInfo){ + SRewardItem sRewardItem = SRewardItem.getsDropMap().get(Integer.parseInt(itemId)); + getMap(Integer.parseInt(itemId),itemMap, cardMap, sRewardItem); + } + } + + private static void getMap(int itemId ,Map itemMap, Map cardMap, SRewardItem sRewardItem) { + int itemNum = MathUtils.random(sRewardItem.getRandomMin(), sRewardItem.getRandomMax()); + SItem sItem = SItem.getsItemMap().get(itemId); + switch (sItem.getItemType()) { + case GlobalItemType.ITEM: + putcountMap(itemId,itemNum,itemMap); + break; + case GlobalItemType.CARD: + putcountMap(itemId,itemNum,cardMap); + break; + default: + break; + } + } + + private static void putcountMap(int itemId,int itemNum, Map map) { + map.merge(itemId, itemNum, (a, b) -> b + a); } /** @@ -83,8 +142,7 @@ public class ItemUtil { } } if (dropBuilder != null) { - CommonProto.Item itemProto = CommonProto.Item.newBuilder().setItemId(item.getItemId()).setItemNum(item.getItemNum()).build(); - itemProtoList.add(itemProto); + itemProtoList.add(CBean2Proto.getItem(item)); } } dropBuilder.addAllItemlist(itemProtoList); @@ -124,4 +182,22 @@ public class ItemUtil { return itemList; } + + public static void addCard(User user,Map cardMap,CommonProto.Drop.Builder dropBuilder) throws Exception { + List heroList = new CopyOnWriteArrayList<>(); + for (Map.Entry entry : cardMap.entrySet()) { + int count = entry.getValue(); + for (int i = 0; i < count; i++) { + addCard(user, entry.getKey(),heroList); + } + } + } + + public static void addCard(User user,int cardId,List heroList) throws Exception { + HeroManager heroManager = user.getHeroManager(); + Hero hero = new Hero(user.getId(),cardId); + heroManager.addHero(hero); + heroList.add(CBean2Proto.getHero(hero)); + } + } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java b/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java index 118319da1..cb2975f9e 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/MathUtils.java @@ -22,10 +22,10 @@ public class MathUtils { * @param rateArray * @return */ - public static int randomForStrArray(int[] rateArray) { + public static int randomForStrArray(String [] rateArray) { return randomStrArray(rateArray, -1); } - public static int randomStrArray(int[] rateArray, int minSum) { + public static int randomStrArray(String [] rateArray, int minSum) { if (null == rateArray) { throw new IllegalArgumentException( "The random array must not be null!"); @@ -42,11 +42,11 @@ public class MathUtils { for (int i = 0; i < arrayLength; i++) { - if (rateArray[i] < 0) { + if (Integer.parseInt(rateArray[i]) < 0) { throw new IllegalArgumentException( "The array's element must not be equal or greater than zero!"); } - rateSum += rateArray[i]; + rateSum += Integer.parseInt(rateArray[i]); rateSumArray[i] = rateSum; } if (rateSum <= 0) { diff --git a/serverlogic/src/main/java/com/ljsd/jieling/util/MessageUtil.java b/serverlogic/src/main/java/com/ljsd/jieling/util/MessageUtil.java index 1f6451834..e125f5662 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/util/MessageUtil.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/util/MessageUtil.java @@ -5,6 +5,7 @@ import com.ljsd.jieling.logic.dao.UserManager; import com.ljsd.jieling.netty.PackageConstant; import com.ljsd.jieling.netty.cocdex.Tea; import com.ljsd.jieling.network.session.ISession; +import com.ljsd.jieling.protocols.MessageTypeProto; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,10 +44,14 @@ public class MessageUtil { } - public static void sendMessage(ISession session, int result, int msgId, GeneratedMessage generatedMessage, boolean flush) throws Exception { + public static void sendMessage(ISession session, int result, int msgId, GeneratedMessage generatedMessage, boolean flush) { byte[] byteBuf = wrappedBuffer(session.getUid(), session.getToken(), session.getIndex(), result, msgId, generatedMessage); - UserManager.ljsdMongoTemplate.lastUpdate(); - System.out.println("-----> msgId : "+ msgId+"; length : "+byteBuf.length+"; content : "+byteBuf); + try { + UserManager.ljsdMongoTemplate.lastUpdate(); + } catch (Exception e) { + e.printStackTrace(); + } +// System.out.println("-----> msgId : "+ msgId+"; length : "+byteBuf.length+"; content : "+byteBuf); if (flush) { session.writeAndFlush(byteBuf); } else { @@ -59,23 +64,19 @@ public class MessageUtil { + PackageConstant.MSG_ID_FIELD_LEN ; byte[] bytes = new byte[length]; int pos = 0; - Tea.intToByte(bytes, pos, 100001); + Tea.intToByte(bytes, pos, session.getUid()); pos += PackageConstant.UID_FIELD_LEN; - Tea.intToByte(bytes, pos, 123456); + Tea.intToByte(bytes, pos, session.getToken()); pos += PackageConstant.TOKEN_LEN; - Tea.intToByte(bytes, pos, 1001); + Tea.intToByte(bytes, pos, MessageTypeProto.MessageType.HEART_BEAT_RESPONSE_VALUE); byte[] byteBuf = Tea.encrypt2(bytes, Tea.KEY); session.writeAndFlush(byteBuf); } - public static void sendErrorCode(ISession session,int result,int msgId,String errMsg) throws Exception { - /* if(StringUtils.isEmpty(errMsg)){ - sendMessage(session, result, msgId, null, true); - }else{ - PlayerInfoProto.ErrorMsgResponse build = PlayerInfoProto.ErrorMsgResponse.newBuilder().setMsg(errMsg).build(); - sendMessage(session, result, msgId, build, true); - }*/ - + public static void sendErrorCode(ISession session,int errorCode) { + byte[] byteBuf = wrappedBuffer(session.getUid(), session.getToken(), session.getIndex(), + errorCode, MessageTypeProto.MessageType.ERROR_CODE_INDICATION_VALUE, null); + session.writeAndFlush(byteBuf); } // public static void sendErrorResponse(Msg msg, GeneratedMessage error_message, int msgId) throws Exception { diff --git a/serverlogic/src/main/resources/application.properties b/serverlogic/src/main/resources/application.properties index d76aac83e..6dfd8afd2 100644 --- a/serverlogic/src/main/resources/application.properties +++ b/serverlogic/src/main/resources/application.properties @@ -41,7 +41,7 @@ mongodb.options.maxConnectionIdleTime = 1000 # netty config -netty.tcpPort = 18090 +netty.tcpPort = 16080 netty.chatTcpPort = 20001 netty.logintcpPort = 18091 netty.udpPort = 18092 @@ -55,14 +55,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