Compare commits

...

12 Commits

Author SHA1 Message Date
sk 945bf3c829 Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2024-12-07 18:06:00 +08:00
sk ea41d7f379 十三张调试发牌 2024-12-07 18:05:37 +08:00
DESKTOP-45ANQ2C\unis 2f8123333c Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2024-12-07 17:19:52 +08:00
DESKTOP-45ANQ2C\unis 51b946bc0b 十三水测试牌型比率 2024-12-07 17:18:25 +08:00
sk 690a5f1a08 十三张比牌包含花色 2024-12-07 17:09:19 +08:00
sk 52b4994de3 修改十三张全垒打分数 2024-12-07 10:20:06 +08:00
sk 766d30d7ca Merge branch 'develop' into sk 2024-12-06 17:07:45 +08:00
sk 4fc2019770 update statistics 2024-12-06 10:15:17 +08:00
sk 2ea5226a14 no message 2024-12-04 17:40:39 +08:00
DESKTOP-45ANQ2C\unis 86bbeb8c9b Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2024-11-29 13:55:09 +08:00
DESKTOP-45ANQ2C\unis 1c800d794f Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop 2024-11-26 17:20:45 +08:00
DESKTOP-45ANQ2C\unis 70ddc7e6b2 道具表格更新 2024-11-25 11:39:42 +08:00
20 changed files with 181 additions and 7210 deletions

View File

@ -1,16 +0,0 @@
{
"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

@ -1,20 +0,0 @@
{
"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

@ -1,11 +0,0 @@
{
"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

@ -1,14 +0,0 @@
{
"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

@ -1,11 +0,0 @@
{
"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

@ -1,21 +0,0 @@
{
"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" }
]
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
{"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,36 +245,35 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group {
// 不可能
} else if n == 0 { // 逻辑点数相同
// 比花色,比三条就行了
//n, index1, index2 := IndexCompareColorByLogic(c1, c2)
n = 0
n, index1, index2 := IndexCompareColorByLogic(c1, c2)
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) {
@ -381,13 +380,12 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group {
}
} else if n == 0 { // 点数相同
// 比花色
//n, index1, index2 := IndexCompareColorByLogic(nHead[:], nMid[:])
n = 0
n, index1, index2 := IndexCompareColorByLogic(nHead[:], nMid[:])
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) {
@ -426,13 +424,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]
}
}
}
}
}
@ -834,10 +832,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 {
@ -869,10 +867,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)
@ -888,20 +886,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
@ -928,10 +926,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)
@ -946,10 +944,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)
@ -960,10 +958,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)
@ -979,20 +977,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
@ -1019,10 +1017,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)
@ -1053,10 +1051,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)
@ -1077,10 +1075,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:
// 乌龙不会有癞子
@ -1090,10 +1088,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
}
@ -1136,10 +1134,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 {
@ -1164,10 +1162,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 {
@ -1184,10 +1182,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,3 +279,69 @@ 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
this.seats[k].winAllPlayers[playerEx.Pos] -= v
playerEx.score[5] += v
playerEx.winAllPlayers[k] += v
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
}
}
}

View File

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