Compare commits

..

No commits in common. "945bf3c829526d51dbecf53faf739ed93a3a1aa8" and "6923ed95f175f9f204cfa766d651bff2f85b8336" have entirely different histories.

20 changed files with 7210 additions and 181 deletions

View File

@ -0,0 +1,16 @@
{
"Id":5,
"Name":"51活动",
"Desc":"对局领福袋",
"StartTime":"2018-04-20 00:00:00",
"EndTime":"2018-05-02 23:59:59",
"TaskIds":[],
"IsDelTaskWhenEnd":true,
"IsDelActIdWhenEnd":true,
"Data":[
{"Name":"PerDayLimit", "IntVal":3 },
{"Name":"CostTimes", "IntArr":[5,3] },
{"Name":"Prize1", "IntArr":[1,1500,60,1,2000,20,1,3000,10,4,100,6,4,200,3,4,500,1] },
{"Name":"Prize2", "IntArr":[1,200,40,1,300,25,1,500,15,1,800,10,1,1000,5,4,100,5] }
]
}

View File

@ -0,0 +1,20 @@
{
"Id":3,
"Name":"元宵猜灯谜",
"Desc":"元宵猜灯谜",
"StartTime":"2018-03-02 00:00:00",
"EndTime":"2018-03-02 23:59:59",
"TaskIds":[],
"IsDelTaskWhenEnd":true,
"IsDelActIdWhenEnd":true,
"Data":[
{"Name":"Count", "IntVal":6 },
{"Name":"Prize", "IntArr":[1,2000,50,1,3000,30,3,20,15,3,50,5] },
{"Name":"1", "StrArr":["2018-03-02 00:00:00","1","弟兄五六个,围着圆柱坐,大家一分手,衣服都扯破。","A:花生","B:大蒜","C:向日葵","D:糖葫芦"] },
{"Name":"2", "StrArr":["2018-03-02 04:00:00","2","红公鸡,绿尾巴,身体钻到地底下,又甜又脆营养大。","A:番茄","B:红薯","C:红萝卜","D:花生"] },
{"Name":"3", "StrArr":["2018-03-02 08:00:00","3","纸老虎(打一成语)","A:狐假虎威","B:狗仗人势","C:仗势欺人","D:外强中干"] },
{"Name":"4", "StrArr":["2018-03-02 12:00:00","0","笑死人(打一成语)","A:乐极生悲","B:笑里藏刀","C:哭笑不得","D:强颜欢笑"] },
{"Name":"5", "StrArr":["2018-03-02 16:00:00","3","兔子请老虎(打一成语)","A:狐假虎威","B:为虎作伥","C:与虎谋皮","D:寅吃卯粮"] },
{"Name":"6", "StrArr":["2018-03-02 20:00:00","1", "白又方,嫩又香,能做菜,能煮汤,豆子是它爹和妈,它和爹妈不一样。","A:土豆","B:豆腐","C:大米","D:萝卜"] }
]
}

View File

@ -0,0 +1,11 @@
{
"Id":4,
"Name":"邀请新人",
"Desc":"邀请新人",
"StartTime":"2018-03-23 00:00:00",
"EndTime":"2018-05-31 23:59:59",
"TaskIds":[],
"IsDelTaskWhenEnd":true,
"IsDelActIdWhenEnd":true,
"Data":[]
}

View File

@ -0,0 +1,14 @@
{
"Id":1,
"Name":"新人注册领红包",
"Desc":"新人注册领红包",
"StartTime":"2018-02-05 12:00:00",
"EndTime":"2020-05-30 12:00:00",
"TaskIds":[1,2,3,4,5,6,7,8,9,10],
"IsDelTaskWhenEnd":false,
"IsDelActIdWhenEnd":false,
"Data":[
{"Name":"MaxNum", "IntVal":2000 },
{"Name":"AcceptRate", "IntArr":[1001,100,2001,20] }
]
}

View File

@ -0,0 +1,11 @@
{
"Id":6,
"Name":"投资返利",
"Desc":"投资返利",
"StartTime":"2018-04-20 00:00:00",
"EndTime":"2025-05-02 23:59:59",
"TaskIds":[],
"IsDelTaskWhenEnd":true,
"IsDelActIdWhenEnd":true,
"Data":[]
}

View File

@ -0,0 +1,21 @@
{
"Id":2,
"Name":"对暗号拿红包",
"Desc":"对暗号拿红包",
"StartTime":"2018-02-16 00:00:00",
"EndTime":"2018-02-23 00:00:00",
"TaskIds":[],
"IsDelTaskWhenEnd":false,
"IsDelActIdWhenEnd":false,
"Data":[
{"Name":"Count", "IntVal":7 },
{"Name":"UnOpenTip", "StrVal":"0" },
{"Name":"1", "StrVal":"2018-02-16 19:00:00|1" },
{"Name":"2", "StrVal":"2018-02-17 19:00:00|2" },
{"Name":"3", "StrVal":"2018-02-18 19:00:00|3" },
{"Name":"4", "StrVal":"2018-02-19 19:00:00|4" },
{"Name":"5", "StrVal":"2018-02-20 19:00:00|5" },
{"Name":"6", "StrVal":"2018-02-21 19:00:00|6" },
{"Name":"7", "StrVal":"2018-02-22 19:00:00|7" }
]
}

1173
data/botai/dvtfollowwin.json Normal file

File diff suppressed because it is too large Load Diff

1284
data/botai/dvtinvertwin.json Normal file

File diff suppressed because it is too large Load Diff

1059
data/botai/dvtrandom.json Normal file

File diff suppressed because it is too large Load Diff

1174
data/botai/rvbfollowwin.json Normal file

File diff suppressed because it is too large Load Diff

1285
data/botai/rvbinvertwin.json Normal file

File diff suppressed because it is too large Load Diff

1026
data/botai/rvbrandom.json Normal file

File diff suppressed because it is too large Load Diff

1
data/fishpath/path.json Normal file
View File

@ -0,0 +1 @@
{"count":3,"pools":[{"id":-1,"type":2,"scatter":0,"s_obj":{"helix":0,"h_obj":{"offset":0},"custom":0,"c_obj":{"start":0,"offset":0}},"move":0,"m_obj":{"sx":0,"sy":0,"ex":0,"ey":0,"sp":0},"points":[{"x":-464,"y":-77,"stay":0},{"x":354,"y":1175,"stay":100},{"x":1352,"y":1038,"stay":50},{"x":897,"y":-374,"stay":50}],"stay":200,"length":3986}],"maxId":3,"lastEdit":1}

View File

@ -245,35 +245,36 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group {
// 不可能
} else if n == 0 { // 逻辑点数相同
// 比花色,比三条就行了
n, index1, index2 := IndexCompareColorByLogic(c1, c2)
//n, index1, index2 := IndexCompareColorByLogic(c1, c2)
n = 0
if n == 1 {
// 花色交换,结束
if index1 >= 0 && index2 >= 0 {
for k, v := range cards.Head {
if v == r1[index1] {
cards.Head[k] = -1
break
}
}
for k, v := range cards.Mid {
if v == r2[index2] {
cards.Mid[k] = -1
break
}
}
for k, v := range cards.Head {
if v == -1 && r2[index2] >= 0 {
cards.Head[k] = r2[index2]
break
}
}
for k, v := range cards.Mid {
if v == -1 && r1[index1] >= 0 {
cards.Mid[k] = r1[index1]
break
}
}
}
//if index1 >= 0 && index2 >= 0 {
// for k, v := range cards.Head {
// if v == r1[index1] {
// cards.Head[k] = -1
// break
// }
// }
// for k, v := range cards.Mid {
// if v == r2[index2] {
// cards.Mid[k] = -1
// break
// }
// }
// for k, v := range cards.Head {
// if v == -1 && r2[index2] >= 0 {
// cards.Head[k] = r2[index2]
// break
// }
// }
// for k, v := range cards.Mid {
// if v == -1 && r1[index1] >= 0 {
// cards.Mid[k] = r1[index1]
// break
// }
// }
//}
} else if n == 0 {
// 比癞子数
if l.LaiZiCount(r1) < l.LaiZiCount(r2) {
@ -380,12 +381,13 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group {
}
} else if n == 0 { // 点数相同
// 比花色
n, index1, index2 := IndexCompareColorByLogic(nHead[:], nMid[:])
//n, index1, index2 := IndexCompareColorByLogic(nHead[:], nMid[:])
n = 0
if n == 1 {
// 交换花色,结束
if index1 >= 0 && index2 >= 0 {
cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1]
}
//if index1 >= 0 && index2 >= 0 {
// cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1]
//}
} else if n == 0 {
// 比癞子多少
if l.LaiZiCount(r1) < l.LaiZiCount(r2) {
@ -424,13 +426,13 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group {
}
} else if n == 0 {
// 点数相同比花色
n, index1, index2 := IndexCompareColorByLogic(cards.Head[:], cards.Mid[:])
if n == 1 {
// 交换最大花色的牌
if index1 >= 0 && index2 >= 0 {
cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1]
}
}
//n, index1, index2 := IndexCompareColorByLogic(cards.Head[:], cards.Mid[:])
//if n == 1 {
// // 交换最大花色的牌
// if index1 >= 0 && index2 >= 0 {
// cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1]
// }
//}
}
}
}
@ -832,10 +834,10 @@ func (l *Logic) CompareHead(c, cs [3]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
// 比癞子数
z1, z2 := l.LaiZiCount(c[:]), l.LaiZiCount(cs[:])
if z1 < z2 {
@ -867,10 +869,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypeStraightFlush:
_, c1 := FindMaxSameColorFlush(c[:], l.LaiZi)
@ -886,20 +888,20 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
}
if ch1 && ch2 {
// 比花色
n := CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n := CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
} else if !ch1 && !ch2 {
n := CompareLogic(c1, c2)
if n != 0 {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
} else {
if ch1 {
return -1
@ -926,10 +928,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypeFullHouse:
_, c1 := FindMaxGourdCards(c[:], l.LaiZi)
@ -944,10 +946,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypeFlush:
_, c1 := FindMaxSameColors(c[:], l.LaiZi)
@ -958,10 +960,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypeStraight:
_, c1 := FindMaxFlush(c[:], l.LaiZi)
@ -977,20 +979,20 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
}
if ch1 && ch2 {
// 比花色
n := CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n := CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
} else if !ch1 && !ch2 {
n := CompareLogic(c1, c2)
if n != 0 {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
} else {
if ch1 {
return -1
@ -1017,10 +1019,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypeTwoPairs:
r1, c1 := FindMaxPairs(c[:], l.LaiZi)
@ -1051,10 +1053,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypePair:
r1, c1 := FindMaxPairs(c[:], l.LaiZi)
@ -1075,10 +1077,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c1, c2)
if n != 0 {
return n
}
//n = CompareColorByLogic(c1, c2)
//if n != 0 {
// return n
//}
case PokersTypeOne:
// 乌龙不会有癞子
@ -1088,10 +1090,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int {
return n
}
// 比花色
n = CompareColorByLogic(c[:], cs[:])
if n != 0 {
return n
}
//n = CompareColorByLogic(c[:], cs[:])
//if n != 0 {
// return n
//}
return 0
}
@ -1134,10 +1136,10 @@ func (l *Logic) IsDP(head [3]int, mid, end [5]int) bool {
return n == 1
}
// 比花色
n = CompareColorByLogic(c1, changeMid)
if n != 0 {
return n == 1
}
//n = CompareColorByLogic(c1, changeMid)
//if n != 0 {
// return n == 1
//}
// 比癞子数
z1, z2 := l.LaiZiCount(r1), l.LaiZiCount(r2)
if z1 < z2 {
@ -1162,10 +1164,10 @@ func (l *Logic) IsDP(head [3]int, mid, end [5]int) bool {
return n == 1
}
// 比花色
n = CompareColorByLogic(c1, changeMid)
if n != 0 {
return n == 1
}
//n = CompareColorByLogic(c1, changeMid)
//if n != 0 {
// return n == 1
//}
// 比癞子数
z1, z2 := l.LaiZiCount(r1), l.LaiZiCount(r2)
if z1 < z2 {
@ -1182,10 +1184,10 @@ func (l *Logic) IsDP(head [3]int, mid, end [5]int) bool {
return n == 1
}
// 比花色
n = CompareColorByLogic(head[:], mid[:])
if n != 0 {
return n == 1
}
//n = CompareColorByLogic(head[:], mid[:])
//if n != 0 {
// return n == 1
//}
}
}

View File

@ -279,69 +279,3 @@ func TestLogic_CompareFive(t *testing.T) {
func TestLogic_IsDP(t *testing.T) {
}
func TestStatisticsPokerType(t *testing.T) {
poker := NewPokers(1, false)
if poker == nil {
return
}
logic := new(Logic)
loop := 2000000
allTypeData := make([]int, PokersTypeMax)
specialAllTypeData := make([]int, SpecialTypeMax)
totalCnt := 0
stotalCnt := 0
for i := 0; i < loop; i++ {
poker.Init()
cardsArr := make([][13]int, poker.N*4)
//cardsGroup := make([]map[int]*Group, poker.N*4)
for k := range cardsArr {
cardsArr[k] = poker.Get13Crads()
specialType := logic.GetSpecialType(cardsArr[k])
specialAllTypeData[specialType]++
stotalCnt++
//cardsGroup[k] = logic.Suggest(cardsArr[k])
//
//cardsO := GetMaxCard(cardsGroup[k])
//
//headType := logic.GetType(cardsO.Head[:])
//midType := logic.GetType(cardsO.Mid[:])
//endType := logic.GetType(cardsO.End[:])
//
//allTypeData[headType]++
//totalCnt++
//allTypeData[midType]++
//totalCnt++
//allTypeData[endType]++
//totalCnt++
//t.Logf("头牌类型:%v 中牌类型: %v 尾牌类型: %v \n", PokersTypeName[headType], PokersTypeName[midType], PokersTypeName[endType])
}
}
t.Logf("共%v次循环", loop)
//ccc := 0.0
for pType, count := range allTypeData {
percent := (float64(count) / float64(totalCnt)) * 100
// t.Logf("牌类型:%v 占百分比: %.2f \n", PokersTypeName[pType], percent)
t.Logf("%v %.2f\n", PokersTypeName[pType], percent)
//ccc += percent
}
t.Logf("特殊牌型共%v次循环", loop)
//ccc := 0.0
for pType, count := range specialAllTypeData {
percent := (float64(count) / float64(stotalCnt)) * 100
// t.Logf("牌类型:%v 占百分比: %.2f \n", PokersTypeName[pType], percent)
t.Logf("%v %.10f\n", SpecialTypeName[pType], percent)
//ccc += percent
}
}

View File

@ -1100,10 +1100,10 @@ func (this *SceneEx) CountScore() {
playerEx.winAllPlayers[k] += v
// 全垒打分数
if playerEx.Pos == this.isCanAllHitPos {
this.seats[k].score[5] -= v * 2
this.seats[k].winAllPlayers[playerEx.Pos] -= v * 2
playerEx.score[5] += v * 2
playerEx.winAllPlayers[k] += v * 2
this.seats[k].score[5] -= v
this.seats[k].winAllPlayers[playerEx.Pos] -= v
playerEx.score[5] += v
playerEx.winAllPlayers[k] += v
}
}
}

View File

@ -726,7 +726,6 @@ func (this *StateSendCard) OnEnter(s *base.Scene) {
} else {
sceneEx.testPokers = nil
v.cards = sceneEx.poker.Get13Crads()
v.allGroup = sceneEx.logic.Suggest(v.cards)
}
}
} else {

View File

@ -68,9 +68,9 @@ func DoTickPlatform(ctx context.Context, wg *sync.WaitGroup, duration time.Durat
}
func main() {
VP = viperx.GetViper("config.yaml")
VP = viperx.GetViper("config", "yaml")
// mongo
vp := viperx.GetViper("mongo.yaml")
vp := viperx.GetViper("mongo", "yaml")
// mongo初始化
conf := &mongox.Config{}
err := vp.Unmarshal(conf)
@ -81,7 +81,7 @@ func main() {
defer mongox.Close()
// mysql
vp = viperx.GetViper("mysql.yaml")
vp = viperx.GetViper("mysql", "yaml")
myConf := &mysqlx.Config{}
err = vp.Unmarshal(myConf)
if err != nil {

View File

@ -35,9 +35,9 @@ func main() {
logger.Logger.Flush()
logger.Logger.Close()
}()
VP = viperx.GetViper("config.yaml")
VP = viperx.GetViper("config", "yaml")
// mongo
vp := viperx.GetViper("mongo.yaml")
vp := viperx.GetViper("mongo", "yaml")
// mongo初始化
conf := &mongox.Config{}
err := vp.Unmarshal(conf)
@ -48,7 +48,7 @@ func main() {
defer mongox.Close()
// mysql
vp = viperx.GetViper("mysql.yaml")
vp = viperx.GetViper("mysql", "yaml")
myConf := &mysqlx.Config{}
err = vp.Unmarshal(myConf)
if err != nil {

View File

@ -3,6 +3,5 @@
"Passwd": "123456",
"Addr": "127.0.0.1",
"RemoteDir": "/root/win88",
"LocalDir": "D:\\trunk\\src\\mongo.games.com\\game",
"PPK": "C:\\Users\\dell\\Downloads\\beta.ppk"
"LocalDir": "D:\\trunk\\src\\mongo.games.com\\game"
}