Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
be75504fb8
|
@ -48,4 +48,12 @@ public class BaseInfoForTest extends MongoBase {
|
|||
updateString("otherInfoMsg", name);
|
||||
this.otherInfoMsg = otherInfoMsg;
|
||||
}
|
||||
|
||||
public void remove(String id){
|
||||
otherInfoMsg.remove(id);
|
||||
removeString("otherInfoMsg." + id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Id Contiue Effect EffectValue
|
||||
int int mut,int#int,1 mut,int#int,1
|
|
@ -1,35 +1,46 @@
|
|||
Id MainPool MainNum Pool SecondNumMin SecondNumMax
|
||||
int int int int int int
|
||||
8001 0 0 0 0 0
|
||||
8002 0 0 0 0 0
|
||||
8003 0 0 0 0 0
|
||||
8004 0 0 0 0 0
|
||||
8005 0 0 0 0 0
|
||||
8006 0 0 0 0 0
|
||||
8007 0 0 0 0 0
|
||||
8008 0 0 0 0 0
|
||||
8009 0 0 0 0 0
|
||||
8010 0 0 0 0 0
|
||||
8011 0 0 0 0 0
|
||||
8012 0 0 0 0 0
|
||||
8013 0 0 0 0 0
|
||||
8014 0 0 0 0 0
|
||||
8015 0 0 0 0 0
|
||||
8016 0 0 0 0 0
|
||||
8017 0 0 0 0 0
|
||||
8018 0 0 0 0 0
|
||||
8019 0 0 0 0 0
|
||||
8020 0 0 0 0 0
|
||||
8021 0 0 0 0 0
|
||||
8022 0 0 0 0 0
|
||||
8023 0 0 0 0 0
|
||||
8024 0 0 0 0 0
|
||||
8025 0 0 0 0 0
|
||||
8026 0 0 0 0 0
|
||||
8027 0 0 0 0 0
|
||||
8028 0 0 0 0 0
|
||||
8029 0 0 0 0 0
|
||||
8030 0 0 0 0 0
|
||||
8031 0 0 0 0 0
|
||||
8032 0 0 0 0 0
|
||||
8033 0 0 0 0 0
|
||||
8001 0 0 6 1 1
|
||||
8002 1 1 0 0 0
|
||||
8003 2 1 0 0 0
|
||||
8004 3 1 0 0 0
|
||||
8005 4 1 0 0 0
|
||||
8006 5 1 0 0 0
|
||||
8007 0 0 12 1 1
|
||||
8008 7 1 0 0 0
|
||||
8009 8 1 0 0 0
|
||||
8010 9 1 0 0 0
|
||||
8011 10 1 0 0 0
|
||||
8012 11 1 0 0 0
|
||||
8013 0 0 18 1 2
|
||||
8014 13 1 18 0 1
|
||||
8015 14 1 18 0 1
|
||||
8016 15 1 18 0 1
|
||||
8017 16 1 18 0 1
|
||||
8018 17 1 18 0 1
|
||||
8019 0 0 24 2 2
|
||||
8020 19 1 24 1 1
|
||||
8021 20 1 24 1 1
|
||||
8022 21 1 24 1 1
|
||||
8023 22 1 24 1 1
|
||||
8024 23 1 24 1 1
|
||||
8027 25 1 0 0 0
|
||||
8028 26 1 0 0 0
|
||||
8029 27 1 0 0 0
|
||||
8030 28 1 24 0 1
|
||||
8033 29 1 24 0 1
|
||||
8034 30 1 24 0 1
|
||||
8035 31 1 24 0 1
|
||||
8036 32 1 24 0 1
|
||||
8037 33 1 24 0 1
|
||||
8038 34 1 24 0 1
|
||||
8039 35 1 24 0 1
|
||||
8040 36 1 24 0 1
|
||||
8041 37 1 24 0 1
|
||||
8042 38 1 24 0 1
|
||||
8043 39 1 24 0 1
|
||||
8044 40 1 24 0 1
|
||||
8045 41 1 24 0 1
|
||||
8046 42 1 24 0 1
|
||||
8047 43 1 24 0 1
|
||||
8048 44 1 24 0 1
|
||||
|
|
|
@ -1,2 +1,62 @@
|
|||
id PropertyId Min Max PoolNum Weight
|
||||
int int int int int int
|
||||
1 1 10 26 1 100
|
||||
2 2 1 2 2 100
|
||||
3 3 1 2 3 100
|
||||
4 4 1 2 4 100
|
||||
5 5 1 1 5 100
|
||||
6 1 10 26 6 100
|
||||
7 2 1 2 6 100
|
||||
8 3 1 2 6 100
|
||||
9 4 1 2 6 100
|
||||
10 5 1 1 6 100
|
||||
11 1 29 49 7 100
|
||||
12 2 2 4 8 100
|
||||
13 3 1 1 9 100
|
||||
14 4 1 2 10 100
|
||||
15 5 3 5 11 100
|
||||
16 1 29 49 12 100
|
||||
17 2 2 4 12 100
|
||||
18 3 1 1 12 100
|
||||
19 4 1 2 12 100
|
||||
20 5 3 5 12 100
|
||||
21 1 80 135 13 100
|
||||
22 2 5 10 14 100
|
||||
23 3 5 9 15 100
|
||||
24 4 6 10 16 100
|
||||
25 5 4 5 17 100
|
||||
26 1 80 135 18 100
|
||||
27 2 5 10 18 100
|
||||
28 3 5 9 18 100
|
||||
29 4 6 10 18 100
|
||||
30 5 4 5 18 100
|
||||
31 53 0 2 25 100
|
||||
32 54 0 2 26 100
|
||||
33 55 0 2 27 100
|
||||
34 56 2 6 28 100
|
||||
35 1 430 717 19 100
|
||||
36 2 31 53 20 100
|
||||
37 3 8 13 21 100
|
||||
38 4 33 55 22 100
|
||||
39 5 6 7 23 100
|
||||
40 1 430 717 24 100
|
||||
41 2 31 53 24 100
|
||||
42 3 8 13 24 100
|
||||
43 4 33 55 24 100
|
||||
44 5 6 7 24 100
|
||||
45 54 1 5 29 100
|
||||
46 53 1 5 30 100
|
||||
47 56 10 20 31 100
|
||||
48 55 1 5 32 100
|
||||
49 101 1 4 33 100
|
||||
50 102 1 4 34 100
|
||||
51 103 1 4 35 100
|
||||
52 104 1 4 36 100
|
||||
53 105 1 4 37 100
|
||||
54 106 1 4 38 100
|
||||
55 107 1 4 39 100
|
||||
56 108 1 4 40 100
|
||||
57 109 1 4 41 100
|
||||
58 110 1 4 42 100
|
||||
59 111 1 4 43 100
|
||||
60 112 1 4 44 100
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
Id Type OpenRules Cost Exp Num
|
||||
int int mut,int#int,1 mut,int#int,2 int int
|
||||
1007 1 1#1 1005#100 1 5
|
||||
1008 1 1#2 1005#101 1 5
|
||||
1009 1 1#3 1005#102 1 5
|
||||
0 0 null null 0 0
|
||||
1007 1 1#0 1001#50 1 1
|
||||
1008 1 1#2 1001#350|1003#100 17 1
|
||||
1009 1 1#10 1001#3500|1003#500|1004#20 320 1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Id Quality MainCostQuality SecondaryCost
|
||||
int int mut,int#int,1 mut,int#int,2
|
||||
1 1 1#1 1007#100
|
||||
2 2 2#1 1007#101
|
||||
3 3 3#1 1007#102
|
||||
4 4 4#1 1007#103
|
||||
0 0 null null
|
||||
Id Quality SecondaryCost Exp
|
||||
int int mut,int#int,2 int
|
||||
1 1 1007#100 1
|
||||
2 2 1007#101 2
|
||||
3 3 1007#102 3
|
||||
4 4 1007#103 4
|
||||
0 0 null 0
|
||||
|
|
|
@ -1,103 +1,103 @@
|
|||
Id Exp Promote FoodExp AddNum PoolRate AddSuccessRate
|
||||
int int mut,int#int,1 int float mut,int#int,2 float
|
||||
0 0 null 0 0.0 null 0.0
|
||||
1 1000 1#1 0 0.0 null 0.0
|
||||
2 1500 2#1 0 0.0 null 0.0
|
||||
3 2000 3#1 0 0.0 null 0.0
|
||||
4 2500 4#1 0 0.0 null 0.0
|
||||
5 2500 5#1 0 0.0 null 0.0
|
||||
6 3500 1#3 0 0.0 null 0.0
|
||||
7 4000 2#3 0 0.0 null 0.0
|
||||
8 4500 3#3 0 0.0 null 0.0
|
||||
9 5000 4#3 0 0.0 null 0.0
|
||||
10 5500 5#3 0 0.0 null 0.0
|
||||
11 6000 1#6 0 0.0 null 0.0
|
||||
12 6500 2#6 0 0.0 null 0.0
|
||||
13 7000 3#6 0 0.0 null 0.0
|
||||
14 7500 4#6 0 0 null 0.0
|
||||
15 8000 5#6 0 0.0 null 0.0
|
||||
16 8500 1#10 0 0.0 null 0.0
|
||||
17 9000 2#10 0 0.0 null 0.0
|
||||
18 9500 3#10 0 0.0 null 0.0
|
||||
19 10000 4#10 0 0.0 null 0.0
|
||||
20 10500 5#10 0 0.0 null 0.0
|
||||
21 11000 1#15 0 0.0 null 0.0
|
||||
22 11500 2#15 0 0.0 null 0.0
|
||||
23 12000 3#15 0 0.0 null 0.0
|
||||
24 12500 4#15 0 0.0 null 0.0
|
||||
25 13000 5#15 0 0.0 null 0.0
|
||||
26 13500 1#21 0 0.0 null 0.0
|
||||
27 14000 2#21 0 0.0 null 0.0
|
||||
28 14500 3#21 0 0.0 null 0.0
|
||||
29 15000 4#21 0 0.0 null 0.0
|
||||
30 15500 5#21 0 0.0 null 0.0
|
||||
31 16000 1#28 0 0.0 null 0.0
|
||||
32 16500 2#28 0 0.0 null 0.0
|
||||
33 17000 3#28 0 0.0 null 0.0
|
||||
34 17500 4#28 0 0.0 null 0.0
|
||||
35 18000 5#28 0 0.0 null 0.0
|
||||
36 18500 1#36 0 0.0 null 0.0
|
||||
37 19000 2#36 0 0.0 null 0.0
|
||||
38 19500 3#36 0 0.0 null 0.0
|
||||
39 20000 4#36 0 0.0 null 0.0
|
||||
40 20500 5#36 0 0.0 null 0.0
|
||||
41 21000 1#45 0 0.0 null 0.0
|
||||
42 21500 2#45 0 0.0 null 0.0
|
||||
43 22000 3#45 0 0.0 null 0.0
|
||||
44 22500 4#45 0 0.0 null 0.0
|
||||
45 23000 5#45 0 0.0 null 0.0
|
||||
46 23500 1#55 0 0.0 null 0.0
|
||||
47 24000 2#55 0 0.0 null 0.0
|
||||
48 24500 3#55 0 0.0 null 0.0
|
||||
49 25000 4#55 0 0.0 null 0.0
|
||||
50 25500 5#55 0 0.0 null 0.0
|
||||
51 26000 1#65 0 0.0 null 0.0
|
||||
52 26500 2#65 0 0.0 null 0.0
|
||||
53 27000 3#65 0 0.0 null 0.0
|
||||
54 27500 4#65 0 0.0 null 0.0
|
||||
55 28000 5#65 0 0.0 null 0.0
|
||||
56 28500 1#76 0 0.0 null 0.0
|
||||
57 29000 2#76 0 0.0 null 0.0
|
||||
58 29500 3#76 0 0.0 null 0.0
|
||||
59 30000 4#76 0 0.0 null 0.0
|
||||
60 30500 5#76 0 0.0 null 0.0
|
||||
61 31000 1#88 0 0.0 null 0.0
|
||||
62 31500 2#88 0 0.0 null 0.0
|
||||
63 32000 3#88 0 0.0 null 0.0
|
||||
64 32500 4#88 0 0.0 null 0.0
|
||||
65 33000 5#88 0 0.0 null 0.0
|
||||
66 33500 1#101 0 0.0 null 0.0
|
||||
67 34000 2#101 0 0.0 null 0.0
|
||||
68 34500 3#101 0 0.0 null 0.0
|
||||
69 35000 4#101 0 0.0 null 0.0
|
||||
70 35500 5#101 0 0.0 null 0.0
|
||||
71 36000 1#115 0 0.0 null 0.0
|
||||
72 36500 2#115 0 0.0 null 0.0
|
||||
73 37000 3#115 0 0.0 null 0.0
|
||||
74 37500 4#115 0 0.0 null 0.0
|
||||
75 38000 5#115 0 0.0 null 0.0
|
||||
76 38500 1#130 0 0.0 null 0.0
|
||||
77 39000 2#130 0 0.0 null 0.0
|
||||
78 39500 3#130 0 0.0 null 0.0
|
||||
79 40000 4#130 0 0.0 null 0.0
|
||||
80 40500 5#130 0 0.0 null 0.0
|
||||
81 41000 1#146 0 0.0 null 0.0
|
||||
82 41500 2#146 0 0.0 null 0.0
|
||||
83 42000 3#146 0 0.0 null 0.0
|
||||
84 42500 4#146 0 0.0 null 0.0
|
||||
85 43000 5#146 0 0.0 null 0.0
|
||||
86 43500 1#163 0 0.0 null 0.0
|
||||
87 44000 2#163 0 0.0 null 0.0
|
||||
88 44500 3#163 0 0.0 null 0.0
|
||||
89 45000 4#163 0 0.0 null 0.0
|
||||
90 45500 5#163 0 0.0 null 0.0
|
||||
91 46000 1#181 0 0.0 null 0.0
|
||||
92 46500 2#181 0 0.0 null 0.0
|
||||
93 47000 3#181 0 0.0 null 0.0
|
||||
94 47500 4#181 0 0.0 null 0.0
|
||||
95 48000 5#181 0 0.0 null 0.0
|
||||
96 48500 1#200 0 0.0 null 0.0
|
||||
97 49000 2#200 0 0.0 null 0.0
|
||||
98 49500 3#200 0 0.0 null 0.0
|
||||
99 50000 4#200 0 0.0 null 0.0
|
||||
100 50500 5#200 0 0.0 null 0.0
|
||||
1 600 1#1 0 0.0 null 0.0
|
||||
2 900 2#1 0 0.0 null 0.0
|
||||
3 1200 3#1 0 0.0 null 0.0
|
||||
4 1500 4#1 0 0.0 null 0.0
|
||||
5 1500 5#1 0 0.0 null 0.0
|
||||
6 2100 1#3 0 0.0 null 0.0
|
||||
7 2400 2#3 0 0.0 null 0.0
|
||||
8 2700 3#3 0 0.0 null 0.0
|
||||
9 3000 4#3 0 0.0 null 0.0
|
||||
10 3300 5#3 0 0.0 null 0.0
|
||||
11 3600 1#6 0 0.0 null 0.0
|
||||
12 3900 2#6 0 0.0 null 0.0
|
||||
13 4200 3#6 0 0.0 null 0.0
|
||||
14 4500 4#6 0 0 null 0.0
|
||||
15 4800 5#6 0 0.0 null 0.0
|
||||
16 5100 1#10 0 0.0 null 0.0
|
||||
17 5400 2#10 0 0.0 null 0.0
|
||||
18 5700 3#10 0 0.0 null 0.0
|
||||
19 6000 4#10 0 0.0 null 0.0
|
||||
20 6300 5#10 0 0.0 null 0.0
|
||||
21 6600 1#15 0 0.0 null 0.0
|
||||
22 6900 2#15 0 0.0 null 0.0
|
||||
23 7200 3#15 0 0.0 null 0.0
|
||||
24 7500 4#15 0 0.0 null 0.0
|
||||
25 7800 5#15 0 0.0 null 0.0
|
||||
26 8100 1#21 0 0.0 null 0.0
|
||||
27 8400 2#21 0 0.0 null 0.0
|
||||
28 8700 3#21 0 0.0 null 0.0
|
||||
29 9000 4#21 0 0.0 null 0.0
|
||||
30 9300 5#21 0 0.0 null 0.0
|
||||
31 9600 1#28 0 0.0 null 0.0
|
||||
32 9900 2#28 0 0.0 null 0.0
|
||||
33 10200 3#28 0 0.0 null 0.0
|
||||
34 10500 4#28 0 0.0 null 0.0
|
||||
35 10800 5#28 0 0.0 null 0.0
|
||||
36 11100 1#36 0 0.0 null 0.0
|
||||
37 11400 2#36 0 0.0 null 0.0
|
||||
38 11700 3#36 0 0.0 null 0.0
|
||||
39 12000 4#36 0 0.0 null 0.0
|
||||
40 12300 5#36 0 0.0 null 0.0
|
||||
41 12600 1#45 0 0.0 null 0.0
|
||||
42 12900 2#45 0 0.0 null 0.0
|
||||
43 13200 3#45 0 0.0 null 0.0
|
||||
44 13500 4#45 0 0.0 null 0.0
|
||||
45 13800 5#45 0 0.0 null 0.0
|
||||
46 14100 1#55 0 0.0 null 0.0
|
||||
47 14400 2#55 0 0.0 null 0.0
|
||||
48 14700 3#55 0 0.0 null 0.0
|
||||
49 15000 4#55 0 0.0 null 0.0
|
||||
50 15300 5#55 0 0.0 null 0.0
|
||||
51 15600 1#65 0 0.0 null 0.0
|
||||
52 15900 2#65 0 0.0 null 0.0
|
||||
53 16200 3#65 0 0.0 null 0.0
|
||||
54 16500 4#65 0 0.0 null 0.0
|
||||
55 16800 5#65 0 0.0 null 0.0
|
||||
56 17100 1#76 0 0.0 null 0.0
|
||||
57 17400 2#76 0 0.0 null 0.0
|
||||
58 17700 3#76 0 0.0 null 0.0
|
||||
59 18000 4#76 0 0.0 null 0.0
|
||||
60 18300 5#76 0 0.0 null 0.0
|
||||
61 18600 1#88 0 0.0 null 0.0
|
||||
62 18900 2#88 0 0.0 null 0.0
|
||||
63 19200 3#88 0 0.0 null 0.0
|
||||
64 19500 4#88 0 0.0 null 0.0
|
||||
65 19800 5#88 0 0.0 null 0.0
|
||||
66 20100 1#101 0 0.0 null 0.0
|
||||
67 20400 2#101 0 0.0 null 0.0
|
||||
68 20700 3#101 0 0.0 null 0.0
|
||||
69 21000 4#101 0 0.0 null 0.0
|
||||
70 21300 5#101 0 0.0 null 0.0
|
||||
71 21600 1#115 0 0.0 null 0.0
|
||||
72 21900 2#115 0 0.0 null 0.0
|
||||
73 22200 3#115 0 0.0 null 0.0
|
||||
74 22500 4#115 0 0.0 null 0.0
|
||||
75 22800 5#115 0 0.0 null 0.0
|
||||
76 23100 1#130 0 0.0 null 0.0
|
||||
77 23400 2#130 0 0.0 null 0.0
|
||||
78 23700 3#130 0 0.0 null 0.0
|
||||
79 24000 4#130 0 0.0 null 0.0
|
||||
80 24300 5#130 0 0.0 null 0.0
|
||||
81 24600 1#146 0 0.0 null 0.0
|
||||
82 24900 2#146 0 0.0 null 0.0
|
||||
83 25200 3#146 0 0.0 null 0.0
|
||||
84 25500 4#146 0 0.0 null 0.0
|
||||
85 25800 5#146 0 0.0 null 0.0
|
||||
86 26100 1#163 0 0.0 null 0.0
|
||||
87 26400 2#163 0 0.0 null 0.0
|
||||
88 26700 3#163 0 0.0 null 0.0
|
||||
89 27000 4#163 0 0.0 null 0.0
|
||||
90 27300 5#163 0 0.0 null 0.0
|
||||
91 27600 1#181 0 0.0 null 0.0
|
||||
92 27900 2#181 0 0.0 null 0.0
|
||||
93 28200 3#181 0 0.0 null 0.0
|
||||
94 28500 4#181 0 0.0 null 0.0
|
||||
95 28800 5#181 0 0.0 null 0.0
|
||||
96 29100 1#200 0 0.0 null 0.0
|
||||
97 29400 2#200 0 0.0 null 0.0
|
||||
98 29700 3#200 0 0.0 null 0.0
|
||||
99 30000 4#200 0 0.0 null 0.0
|
||||
100 30300 5#200 0 0.0 null 0.0
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="FoodsConfig")
|
||||
public class SFoodsConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int contiue;
|
||||
|
||||
private int[] effect;
|
||||
|
||||
private int[] effectValue;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getContiue() {
|
||||
return contiue;
|
||||
}
|
||||
|
||||
public int[] getEffect() {
|
||||
return effect;
|
||||
}
|
||||
|
||||
public int[] getEffectValue() {
|
||||
return effectValue;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -78,15 +78,19 @@ public class Equip extends MongoBase {
|
|||
for(Integer runneId : runneIds ){
|
||||
SRunesConfig sRunesConfig = SRunesConfig.getsRunesConfigById(runneId);
|
||||
int secondPool = sRunesConfig.getPool();
|
||||
int secondNumMin = sRunesConfig.getSecondNumMin();
|
||||
int secondNumMax = sRunesConfig.getSecondNumMax();
|
||||
int secondValue = MathUtils.random(secondNumMin, secondNumMax);
|
||||
randomForRunne(secondPool,secondValue,result);
|
||||
if(secondPool!=0){
|
||||
int secondNumMin = sRunesConfig.getSecondNumMin();
|
||||
int secondNumMax = sRunesConfig.getSecondNumMax();
|
||||
int secondValue = MathUtils.random(secondNumMin, secondNumMax);
|
||||
randomForRunne(secondPool,secondValue,result);
|
||||
}
|
||||
|
||||
int mainPool = sRunesConfig.getMainPool();
|
||||
int mainNum = sRunesConfig.getMainNum();
|
||||
if(mainPool!=0){
|
||||
int mainNum = sRunesConfig.getMainNum();
|
||||
randomForRunne(mainPool,mainNum,result);
|
||||
}
|
||||
|
||||
randomForRunne(mainPool,mainNum,result);
|
||||
}
|
||||
secondValueByIdMap = result;
|
||||
}
|
||||
|
@ -105,13 +109,14 @@ public class Equip extends MongoBase {
|
|||
weight+=sRunesPoolConfig.getWeight();
|
||||
if(randomWeight<weight){
|
||||
int random = MathUtils.random(sRunesPoolConfig.getMin(), sRunesPoolConfig.getMax());
|
||||
result.put(sRunesPoolConfig.getId(),random);
|
||||
result.put(sRunesPoolConfig.getPropertyId(),random);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(Integer propertyId : result.values()){
|
||||
Integer value = result.get(propertyId);
|
||||
for(Map.Entry<Integer,Integer> item : result.entrySet()){
|
||||
int propertyId = item.getKey();
|
||||
int value = item.getValue();
|
||||
if(secondValueByIdMap.containsKey(propertyId)){
|
||||
secondValueByIdMap.put(propertyId,secondValueByIdMap.get(propertyId)+value);
|
||||
}else{
|
||||
|
|
|
@ -182,5 +182,12 @@ public class CombatLogic {
|
|||
}
|
||||
|
||||
|
||||
public void eatFood(ISession iSession,int foodId) throws Exception {
|
||||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ public class HeroLogic {
|
|||
SLotterySetting sLotterySetting = SLotterySetting.getsLotterySettingMap().get(type);
|
||||
|
||||
//筛选卡池
|
||||
StringBuilder reward = new StringBuilder();
|
||||
int pooId =0;
|
||||
int perCount = sLotterySetting.getPerCount();
|
||||
boolean isSpecial = false;
|
||||
|
@ -70,20 +69,33 @@ public class HeroLogic {
|
|||
MessageUtil.sendErrorResponse(session, 0, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE,"道具不足");
|
||||
return;
|
||||
}
|
||||
|
||||
//额外获取
|
||||
int length = perCount;
|
||||
int[][] tenTimesMustGetItem = null;
|
||||
if(sLotterySetting.getTenTimesMustGetItem()!=null &&sLotterySetting.getTenTimesMustGetItem().length>0){
|
||||
tenTimesMustGetItem = sLotterySetting.getTenTimesMustGetItem();
|
||||
length+=tenTimesMustGetItem.length;
|
||||
}
|
||||
int[][] dropHeroAndItem = new int[length][];
|
||||
int j=0;
|
||||
for(int i=0;i<perCount;i++){
|
||||
if(!isSpecial){
|
||||
pooId = getPooId(sLotterySetting, pooId);
|
||||
}
|
||||
LOGGER.info("the uid={},the type={},the poolId={}",uid,type,pooId);
|
||||
reward.append(randomHeroByPoolId(pooId)).append("|");
|
||||
int[] reward = randomHeroByPoolId(pooId);
|
||||
if(reward!=null){
|
||||
dropHeroAndItem[j++] = reward;
|
||||
}
|
||||
}
|
||||
if(tenTimesMustGetItem!=null){
|
||||
for(int i=0;i<tenTimesMustGetItem.length;i++){
|
||||
dropHeroAndItem[j++] = tenTimesMustGetItem[i];
|
||||
}
|
||||
}
|
||||
|
||||
//额外获取
|
||||
reward.append( extraReward(sLotterySetting));
|
||||
|
||||
|
||||
HeroInfoProto.HeroRandResponse heroRandResponse = addItem(user, reward.toString());
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropHeroAndItem);
|
||||
HeroInfoProto.HeroRandResponse heroRandResponse = HeroInfoProto.HeroRandResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE, heroRandResponse, true);
|
||||
}
|
||||
|
||||
|
@ -107,40 +119,6 @@ public class HeroLogic {
|
|||
return pooId;
|
||||
}
|
||||
|
||||
public HeroInfoProto.HeroRandResponse addItem(User user, String rewards) throws Exception {
|
||||
HeroInfoProto.HeroRandResponse.Builder builder = HeroInfoProto.HeroRandResponse.newBuilder();
|
||||
List<CommonProto.Hero> heros = new ArrayList<>();
|
||||
List<CommonProto.Item> items = new ArrayList<>();
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
String[] rewardItems = rewards.split("\\|");
|
||||
for(String heroOrItem : rewardItems){
|
||||
String[] splitReward = heroOrItem.split("#");
|
||||
int itemId = Integer.parseInt(splitReward[0]);
|
||||
int itemNum = Integer.parseInt(splitReward[1]);
|
||||
SItem sItem = SItem.getsItemMap().get(itemId);
|
||||
int itemType = sItem.getItemType();
|
||||
if(itemType == 1){ //hero
|
||||
Hero hero = new Hero(user.getId(), itemId);
|
||||
heroManager.addHero(hero);
|
||||
CommonProto.Hero hero1 = CBean2Proto.getHero(hero);
|
||||
heros.add(hero1);
|
||||
}
|
||||
if( itemType == 2) {
|
||||
Item item = itemManager.getItem(itemId);
|
||||
if (item == null) {
|
||||
item = itemManager.newItem(itemId, itemNum);
|
||||
} else {
|
||||
item.setItemNum(item.getItemNum() + itemNum);
|
||||
}
|
||||
items.add(CBean2Proto.getItem(item));
|
||||
}
|
||||
}
|
||||
builder.addAllHeroList(heros);
|
||||
builder.addAllItemList(items);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public int getOrderBoxPoolId(SLotterySetting sLotterySetting) throws Exception {
|
||||
int[] orderBoxPool = sLotterySetting.getOrderBoxPool();
|
||||
int orderBoxOpenTime = sLotterySetting.getOrderBoxOpenTime();
|
||||
|
@ -157,8 +135,7 @@ public class HeroLogic {
|
|||
|
||||
|
||||
|
||||
public String randomHeroByPoolId(int poolId){
|
||||
|
||||
public int[] randomHeroByPoolId(int poolId){
|
||||
List<SLotteryRewardConfig> sLotteryRewardConfigListByPoolId = SLotteryRewardConfig.getSLotteryRewardConfigListByPoolId(poolId);
|
||||
int totalCountByPoolId = SLotteryRewardConfig.getTotalCountByPoolId(poolId);
|
||||
int randCount = MathUtils.randomInt(totalCountByPoolId) + 1;
|
||||
|
@ -166,26 +143,13 @@ public class HeroLogic {
|
|||
for(SLotteryRewardConfig sLotteryRewardConfig :sLotteryRewardConfigListByPoolId){
|
||||
weight += sLotteryRewardConfig.getWeight();
|
||||
if(weight>randCount){
|
||||
int[] reward = sLotteryRewardConfig.getReward();
|
||||
return reward[0] + "#" + reward[1];
|
||||
return sLotteryRewardConfig.getReward();
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String extraReward(SLotterySetting sLotterySetting){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if(sLotterySetting.getTenTimesMustGetItem()!=null &&sLotterySetting.getTenTimesMustGetItem().length>0){
|
||||
int[][] tenTimesMustGetItem = sLotterySetting.getTenTimesMustGetItem();
|
||||
for(int i=0;i<tenTimesMustGetItem.length;i++){
|
||||
sb.append(tenTimesMustGetItem[0]).append("#").append(tenTimesMustGetItem[1]);
|
||||
}
|
||||
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void getAllTeamPosInfo(ISession session) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
List<CommonProto.TeamPosInfo> teamPosInfoList = new ArrayList<>();
|
||||
|
|
|
@ -245,6 +245,11 @@ public class WorkShopLogic {
|
|||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.WORKSHOP_FOUNDATION_RESPONSE_VALUE,null,true);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Date date = new Date(1545253200*1000L);
|
||||
System.out.println(date);
|
||||
}
|
||||
|
||||
//装备打造 TODO
|
||||
public void createEquipByUser(ISession session,int equipTid, List<Integer> runneIdsList) throws Exception {
|
||||
int uid=session.getUid();
|
||||
|
|
|
@ -119,14 +119,7 @@ public class NettyTCPClientHandler extends SimpleChannelInboundHandler<Object> {
|
|||
// System.out.println("--->>>>" + heroListCount);
|
||||
}
|
||||
|
||||
|
||||
if(msgId == HERO_RAND_RESPONSE_VALUE){
|
||||
HeroInfoProto.HeroRandResponse heroRandResponse = HeroInfoProto.HeroRandResponse.parseFrom(packetData);
|
||||
int heroListCount = heroRandResponse.getHeroListCount();
|
||||
// int heroListCount = getHeroInfoResponse.getHeroListCount();
|
||||
//int heroListCount = getHeroInfoResponse.getHeroListCount();
|
||||
// System.out.println("--->>>>" + heroListCount);
|
||||
}
|
||||
|
||||
|
||||
System.out.println("back hartbeat id : "+msgId);
|
||||
|
||||
|
|
Loading…
Reference in New Issue