Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop
This commit is contained in:
commit
2f8123333c
|
@ -2,6 +2,7 @@ package common
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"mongo.games.com/goserver/core"
|
||||
)
|
||||
|
@ -53,6 +54,13 @@ func (this *CustomConfiguration) GetString(key string) string {
|
|||
return str
|
||||
}
|
||||
}
|
||||
|
||||
if v, exist := (*this)[strings.ToLower(key)]; exist {
|
||||
if str, ok := v.(string); ok {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
|
@ -67,6 +75,18 @@ func (this *CustomConfiguration) GetStrings(key string) (strs []string) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
if v, exist := (*this)[strings.ToLower(key)]; exist {
|
||||
if vals, ok := v.([]interface{}); ok {
|
||||
for _, s := range vals {
|
||||
if str, ok := s.(string); ok {
|
||||
strs = append(strs, str)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -86,6 +106,23 @@ func (this *CustomConfiguration) GetCustomCfgs(key string) (strs []*CustomConfig
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
if v, exist := (*this)[strings.ToLower(key)]; exist {
|
||||
if vals, ok := v.([]interface{}); ok {
|
||||
for _, s := range vals {
|
||||
if data, ok := s.(map[string]interface{}); ok {
|
||||
var pkg *CustomConfiguration
|
||||
modelBuff, _ := json.Marshal(data)
|
||||
err := json.Unmarshal(modelBuff, &pkg)
|
||||
if err == nil {
|
||||
strs = append(strs, pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -100,6 +137,18 @@ func (this *CustomConfiguration) GetInts(key string) (strs []int) {
|
|||
return
|
||||
}
|
||||
}
|
||||
|
||||
if v, exist := (*this)[strings.ToLower(key)]; exist {
|
||||
if vals, ok := v.([]interface{}); ok {
|
||||
for _, s := range vals {
|
||||
if str, ok := s.(float64); ok {
|
||||
strs = append(strs, int(str))
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
func (this *CustomConfiguration) GetInt(key string) int {
|
||||
|
@ -108,6 +157,12 @@ func (this *CustomConfiguration) GetInt(key string) int {
|
|||
return int(val)
|
||||
}
|
||||
}
|
||||
|
||||
if v, exist := (*this)[strings.ToLower(key)]; exist {
|
||||
if val, ok := v.(float64); ok {
|
||||
return int(val)
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -117,5 +172,10 @@ func (this *CustomConfiguration) GetBool(key string) bool {
|
|||
return val
|
||||
}
|
||||
}
|
||||
if v, exist := (*this)[strings.ToLower(key)]; exist {
|
||||
if val, ok := v.(bool); ok {
|
||||
return val
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -84,6 +84,8 @@ const (
|
|||
GameId_FortuneRabbit = 310 // FortuneRabbit
|
||||
GameId_FortuneOx = 311 // FortuneOx
|
||||
GameId_FortuneMouse = 312 // FortuneMouse
|
||||
GameId_CashMania = 313 // CashMania
|
||||
GameId_GatesOfOlympus = 314 // GatesOfOlympus
|
||||
__GameId_Fishing_Min__ = 400 //################捕鱼类################
|
||||
GameId_HFishing = 401 //欢乐捕鱼
|
||||
GameId_TFishing = 402 //天天捕鱼
|
||||
|
|
|
@ -204,3 +204,8 @@ func StrTimeToTime(s string) time.Time {
|
|||
t, _ := time.ParseInLocation("2006-01-02 15:04:05", s, time.Local)
|
||||
return t
|
||||
}
|
||||
|
||||
func StrRFC3339TimeToTime(s string) time.Time {
|
||||
t, _ := time.Parse(time.RFC3339, s)
|
||||
return t
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -6661,6 +6661,74 @@
|
|||
"PlayerWaterRate": 100,
|
||||
"BetWaterRate": 100
|
||||
},
|
||||
{
|
||||
"Id": 3130001,
|
||||
"Name": "CashMania",
|
||||
"Title": "1",
|
||||
"GameId": 313,
|
||||
"GameRule": 31300,
|
||||
"GameType": 3,
|
||||
"SceneType": 1,
|
||||
"Desc": "0",
|
||||
"ShowType": 2,
|
||||
"ShowId": 31300,
|
||||
"LimitCoin": 10000,
|
||||
"BaseScore": 1000,
|
||||
"Turn": 31300,
|
||||
"BetDec": "1000",
|
||||
"Ai": [
|
||||
0
|
||||
],
|
||||
"OtherIntParams": [
|
||||
0
|
||||
],
|
||||
"RobotNumRng": [
|
||||
0
|
||||
],
|
||||
"SameIpLimit": 1,
|
||||
"GameDif": "313",
|
||||
"GameClass": 2,
|
||||
"PlatformName": "越南棋牌",
|
||||
"MaxBetCoin": [
|
||||
0
|
||||
],
|
||||
"PlayerWaterRate": 100,
|
||||
"BetWaterRate": 100
|
||||
},
|
||||
{
|
||||
"Id": 3140001,
|
||||
"Name": "GatesOfOlympus",
|
||||
"Title": "1",
|
||||
"GameId": 314,
|
||||
"GameRule": 31400,
|
||||
"GameType": 3,
|
||||
"SceneType": 1,
|
||||
"Desc": "0",
|
||||
"ShowType": 2,
|
||||
"ShowId": 31400,
|
||||
"LimitCoin": 10000,
|
||||
"BaseScore": 1000,
|
||||
"Turn": 31400,
|
||||
"BetDec": "1000",
|
||||
"Ai": [
|
||||
0
|
||||
],
|
||||
"OtherIntParams": [
|
||||
0
|
||||
],
|
||||
"RobotNumRng": [
|
||||
0
|
||||
],
|
||||
"SameIpLimit": 1,
|
||||
"GameDif": "314",
|
||||
"GameClass": 2,
|
||||
"PlatformName": "越南棋牌",
|
||||
"MaxBetCoin": [
|
||||
0
|
||||
],
|
||||
"PlayerWaterRate": 100,
|
||||
"BetWaterRate": 100
|
||||
},
|
||||
{
|
||||
"Id": 6080001,
|
||||
"Name": "娃娃机",
|
||||
|
|
Binary file not shown.
|
@ -71,7 +71,7 @@
|
|||
"Name": "十三张(四人场)",
|
||||
"GameId": 211,
|
||||
"Params": [
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
30,
|
||||
50,
|
||||
|
@ -84,7 +84,7 @@
|
|||
"Name": "十三张(八人场)",
|
||||
"GameId": 212,
|
||||
"Params": [
|
||||
1,
|
||||
8,
|
||||
0,
|
||||
30,
|
||||
50,
|
||||
|
@ -97,7 +97,7 @@
|
|||
"Name": "十三张(自由场经典场)",
|
||||
"GameId": 213,
|
||||
"Params": [
|
||||
1,
|
||||
8,
|
||||
0,
|
||||
30,
|
||||
50,
|
||||
|
@ -110,7 +110,7 @@
|
|||
"Name": "十三张(自由场癞子场)",
|
||||
"GameId": 214,
|
||||
"Params": [
|
||||
1,
|
||||
8,
|
||||
0,
|
||||
30,
|
||||
50,
|
||||
|
@ -250,6 +250,18 @@
|
|||
"GameId": 312,
|
||||
"GameDif": "312"
|
||||
},
|
||||
{
|
||||
"Id": 31300,
|
||||
"Name": "CashMania",
|
||||
"GameId": 313,
|
||||
"GameDif": "313"
|
||||
},
|
||||
{
|
||||
"Id": 31400,
|
||||
"Name": "GatesOfOlympus",
|
||||
"GameId": 314,
|
||||
"GameDif": "314"
|
||||
},
|
||||
{
|
||||
"Id": 60800,
|
||||
"Name": "娃娃机",
|
||||
|
|
Binary file not shown.
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -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] }
|
||||
]
|
||||
}
|
|
@ -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:萝卜"] }
|
||||
]
|
||||
}
|
|
@ -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":[]
|
||||
}
|
|
@ -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] }
|
||||
]
|
||||
}
|
|
@ -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":[]
|
||||
}
|
|
@ -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
|
@ -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}
|
|
@ -0,0 +1,22 @@
|
|||
package fortunemouse
|
||||
|
||||
// 房间类型
|
||||
const (
|
||||
RoomMode_Classic int = iota //经典
|
||||
RoomMode_Max
|
||||
)
|
||||
|
||||
// 场景状态
|
||||
const (
|
||||
FortuneMouseStateStart int = iota //默认状态
|
||||
FortuneMouseStateMax
|
||||
)
|
||||
|
||||
// 玩家操作
|
||||
const (
|
||||
FortuneMousePlayerOpStart int = iota
|
||||
FortuneMousePlayerOpSwitch
|
||||
)
|
||||
const NowByte int64 = 10000
|
||||
|
||||
const GameDataKey = "FortuneData"
|
|
@ -34,6 +34,7 @@ const (
|
|||
ThirteenWaterPlayerOpTest = 3 // test
|
||||
ThirteenWaterPlayerOpReset = 4 // 重新选牌
|
||||
ThirteenWaterPlayerJoin = 5 // 加入游戏
|
||||
ThirteenWaterPlayerOpSelect = 6 // 预选牌
|
||||
)
|
||||
const (
|
||||
ThirteenWaterSceneWaitTimeout = time.Second * 2 //等待倒计时
|
||||
|
|
|
@ -105,7 +105,7 @@ type Group struct {
|
|||
Head [3]int
|
||||
Mid [5]int
|
||||
End [5]int
|
||||
PokerType int
|
||||
PokerType int // -1 无牌数据,0 有牌数据, 1-13 特殊牌型
|
||||
}
|
||||
|
||||
func (p *Group) String() string {
|
||||
|
@ -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]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -612,13 +610,19 @@ func (l *Logic) findAllCombine(cards [13]int) (pokers []*Group) {
|
|||
i++
|
||||
}
|
||||
} else if i == PokersTypeTwoPairs {
|
||||
// 6,7,8 对子
|
||||
// 4,5,6 两对
|
||||
al := len(copyCards)
|
||||
if al == 7 || al == 6 {
|
||||
if al == 8 || al == 7 {
|
||||
copy(poker.Mid[2:], card)
|
||||
} else if al == 5 || al == 4 {
|
||||
copy(poker.Mid[:], card)
|
||||
} else if al == 8 {
|
||||
copy(poker.Mid[:], card)
|
||||
} else if al == 6 {
|
||||
if poker.Mid[2] == -1 {
|
||||
copy(poker.Mid[2:], card)
|
||||
} else {
|
||||
copy(poker.Mid[:], card)
|
||||
}
|
||||
} else {
|
||||
copyCards = append(copyCards, card...)
|
||||
i++
|
||||
|
@ -828,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 {
|
||||
|
@ -863,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)
|
||||
|
@ -882,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
|
||||
|
@ -922,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)
|
||||
|
@ -940,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)
|
||||
|
@ -954,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)
|
||||
|
@ -973,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
|
||||
|
@ -1013,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)
|
||||
|
@ -1047,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)
|
||||
|
@ -1071,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:
|
||||
// 乌龙不会有癞子
|
||||
|
@ -1084,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
|
||||
}
|
||||
|
||||
|
@ -1130,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 {
|
||||
|
@ -1158,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 {
|
||||
|
@ -1178,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,17 @@ func TestFindAllPokers(t *testing.T) {
|
|||
{46, 35, 30, 50, 34, 9, 25, 41, 3, 26, 2, 6, 45},
|
||||
}
|
||||
|
||||
//
|
||||
//牌序- A, K, Q, J,10, 9, 8, 7, 6, 5, 4, 3, 2
|
||||
//黑桃-51,50,49,48,47,46,45,44,43,42,41,40,39
|
||||
//红桃-38,37,36,35,34,33,32,31,30,29,28,27,26
|
||||
//梅花-25,24,23,22,21,20,19,18,17,16,15,14,13
|
||||
//方片-12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
|
||||
//data = [][13]int{
|
||||
// //{31, 42, 14, 49, 23, 25, 12, 6, 33, 20, 34, 21, 7},
|
||||
// {13, 23, 24, 36, 37, 38, 39, 51, 51, 50, 10, 11, 12},
|
||||
//}
|
||||
|
||||
for _, v := range data {
|
||||
cards := v
|
||||
fmt.Println(PokersShow(cards[:]))
|
||||
|
|
|
@ -934,31 +934,30 @@ func AvengersCheckAndSaveLog(sceneEx *AvengersSceneData, playerEx *AvengersPlaye
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
totalin := int64(playerEx.RollGameType.BaseResult.TotalBet)
|
||||
totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet),
|
||||
WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFirstGame: false,
|
||||
IsFree: playerEx.RollGameType.BaseResult.IsFree,
|
||||
WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame,
|
||||
WinTotal: playerEx.RollGameType.BaseResult.WinTotal,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
package base
|
||||
|
||||
// 提供税收和流水,根据代理需求后台进行分账
|
||||
func ProfitDistribution(p *Player, tax, taxex, validFlow int64) {
|
||||
//LogChannelSingleton.WriteMQData(model.GenerateTaxDivide(p.SnId, p.Platform, p.Channel, p.BeUnderAgentCode, p.PackageID, tax, taxex, validFlow, p.scene.GameId, p.scene.GameMode, p.scene.GetDBGameFree().GetId(), p.PromoterTree))
|
||||
}
|
|
@ -0,0 +1,255 @@
|
|||
package base
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/globalsign/mgo/bson"
|
||||
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/mq"
|
||||
)
|
||||
|
||||
/*
|
||||
记录游戏对局记录
|
||||
*/
|
||||
|
||||
type SaveGameDetailedParam struct {
|
||||
LogId string // 日志id
|
||||
Detail string // 游戏详细信息
|
||||
GameTime int64 // 游戏时长
|
||||
Trend20Lately string // 最近20局开奖结果
|
||||
CtrlType int // 调控类型 1控赢 2控输
|
||||
PlayerPool map[int]int // 个人水池分
|
||||
OnlyLog bool // 只返回日志,不保存
|
||||
}
|
||||
|
||||
// SaveGameDetailedLog 保存游戏详细记录
|
||||
func (this *Scene) SaveGameDetailedLog(param *SaveGameDetailedParam) *SaveGameDetailedCopy {
|
||||
if this == nil || param == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if param.GameTime <= 0 {
|
||||
param.GameTime = int64(time.Now().Sub(this.GameNowTime).Seconds())
|
||||
}
|
||||
|
||||
if param.GameTime < 0 {
|
||||
param.GameTime = 0
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
var ret SaveGameDetailedCopy
|
||||
ret.Param = param
|
||||
f := func(plt string) {
|
||||
log := &model.GameDetailedLog{
|
||||
Id: bson.NewObjectId(),
|
||||
LogId: param.LogId,
|
||||
GameId: this.GameId,
|
||||
Platform: plt,
|
||||
MatchId: this.GetMatch().GetMatchSortId(),
|
||||
SceneId: this.SceneId,
|
||||
GameMode: this.GameMode,
|
||||
GameFreeid: this.GetGameFreeId(),
|
||||
PlayerCount: int32(len(this.Players)),
|
||||
GameTiming: int32(param.GameTime),
|
||||
GameBaseBet: this.GetBaseScore(),
|
||||
GameDetailedNote: param.Detail,
|
||||
GameDetailVer: GameDetailedVer[int(this.GameId)],
|
||||
CpCtx: this.CpCtx,
|
||||
Time: now,
|
||||
Trend20Lately: param.Trend20Lately,
|
||||
Ts: now.Unix(),
|
||||
CtrlType: param.CtrlType,
|
||||
PlayerPool: make(map[int]int),
|
||||
CycleId: this.CycleID,
|
||||
}
|
||||
for k, v := range param.PlayerPool {
|
||||
log.PlayerPool[k] = v
|
||||
}
|
||||
if param.OnlyLog {
|
||||
ret.Log = append(ret.Log, log)
|
||||
} else {
|
||||
mq.Write(log)
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
case this.IsCoinScene():
|
||||
mapPlatform := make(map[string]bool)
|
||||
for _, v := range this.Players {
|
||||
if v == nil {
|
||||
continue
|
||||
}
|
||||
if _, ok := mapPlatform[v.Platform]; ok {
|
||||
continue
|
||||
}
|
||||
mapPlatform[v.Platform] = true
|
||||
f(v.Platform)
|
||||
}
|
||||
default:
|
||||
f(this.Platform)
|
||||
}
|
||||
return &ret
|
||||
}
|
||||
|
||||
type SaveGamePlayerListLogParam struct {
|
||||
LogId string // 详情日志id
|
||||
Platform string // 平台
|
||||
Snid int32 // 玩家id
|
||||
PlayerName string // 玩家名字
|
||||
Channel string // 渠道
|
||||
ChannelId string // 推广渠道
|
||||
TotalIn int64 // 总投入
|
||||
TotalOut int64 // 总产出(税前)
|
||||
TaxCoin int64 // 总税收
|
||||
BetAmount int64 // 下注量
|
||||
WinAmountNoAnyTax int64 // 税后赢取额(净利润,正负值)
|
||||
IsFirstGame bool // 是否第一次游戏
|
||||
IsFree bool // 拉霸专用 是否免费
|
||||
WinSmallGame int64 // 拉霸专用 小游戏奖励
|
||||
WinTotal int64 // 拉霸专用 本局输赢
|
||||
GameTime int64 // 游戏时长
|
||||
OnlyLog bool // 只返回日志,不保存
|
||||
}
|
||||
|
||||
// SaveGamePlayerListLog 保存玩家对局记录
|
||||
func (this *Scene) SaveGamePlayerListLog(param *SaveGamePlayerListLogParam) *SaveGamePlayerListLogCopy {
|
||||
if this == nil {
|
||||
return nil
|
||||
}
|
||||
if param == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
p := this.GetPlayer(param.Snid)
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if param.PlayerName == "" {
|
||||
param.PlayerName = p.Name
|
||||
}
|
||||
|
||||
var ret SaveGamePlayerListLogCopy
|
||||
ret.Param = param
|
||||
|
||||
baseScore := this.GetBaseScore()
|
||||
|
||||
// 上报玩家游戏记录
|
||||
if !p.IsRob && (param.IsFree || param.TotalIn != 0 || param.TotalOut != 0) {
|
||||
e := p.ReportGameEvent(&ReportGameEventParam{
|
||||
Tax: param.TaxCoin,
|
||||
Change: param.WinAmountNoAnyTax,
|
||||
In: param.TotalIn,
|
||||
Out: param.TotalOut,
|
||||
GameTime: param.GameTime,
|
||||
OnlyLog: param.OnlyLog,
|
||||
})
|
||||
if e != nil {
|
||||
ret.UpLog = e
|
||||
}
|
||||
}
|
||||
|
||||
// 保存玩家游戏日志
|
||||
now := time.Now()
|
||||
log := &model.GamePlayerListLog{
|
||||
LogId: bson.NewObjectId(),
|
||||
SnId: p.SnId,
|
||||
Name: param.PlayerName,
|
||||
GameId: this.GameId,
|
||||
BaseScore: baseScore,
|
||||
TaxCoin: param.TaxCoin,
|
||||
Platform: param.Platform,
|
||||
Channel: param.Channel,
|
||||
SceneId: this.SceneId,
|
||||
GameMode: this.GameMode,
|
||||
GameFreeid: this.GetGameFreeId(),
|
||||
GameDetailedLogId: param.LogId,
|
||||
IsFirstGame: param.IsFirstGame,
|
||||
BetAmount: param.BetAmount,
|
||||
WinAmountNoAnyTax: param.WinAmountNoAnyTax,
|
||||
TotalIn: param.TotalIn,
|
||||
TotalOut: param.TotalOut,
|
||||
Time: now,
|
||||
RoomType: this.SceneMode,
|
||||
GameDif: this.GetDBGameFree().GetGameDif(),
|
||||
GameClass: this.GetDBGameFree().GetGameClass(),
|
||||
MatchId: this.GetMatch().GetMatchSortId(),
|
||||
MatchType: int64(this.GetMatch().GetMatchType()),
|
||||
Ts: now.Unix(),
|
||||
IsFree: param.IsFree,
|
||||
WinSmallGame: param.WinSmallGame,
|
||||
WinTotal: param.WinTotal,
|
||||
CycleId: this.CycleID,
|
||||
}
|
||||
if param.OnlyLog {
|
||||
ret.Log = append(ret.Log, log)
|
||||
} else {
|
||||
mq.Write(log)
|
||||
}
|
||||
return &ret
|
||||
}
|
||||
|
||||
// SaveGamePlayerListLogCopy 临时记录
|
||||
// 为了拉霸统计游戏时长,需要临时缓存游戏记录
|
||||
type SaveGamePlayerListLogCopy struct {
|
||||
Param *SaveGamePlayerListLogParam
|
||||
Log []*model.GamePlayerListLog
|
||||
UpLog *ReportGameEventOnly // mq上报数据
|
||||
}
|
||||
|
||||
func (s *SaveGamePlayerListLogCopy) Save() {
|
||||
for _, v := range s.Log {
|
||||
mq.Write(v)
|
||||
}
|
||||
if s.UpLog != nil {
|
||||
for _, v := range s.UpLog.Log {
|
||||
mq.Write(v, mq.BackGameRecord)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SaveGameDetailedCopy 临时记录
|
||||
// 为了拉霸统计游戏时长,需要临时缓存游戏记录
|
||||
type SaveGameDetailedCopy struct {
|
||||
Param *SaveGameDetailedParam
|
||||
Log []*model.GameDetailedLog
|
||||
}
|
||||
|
||||
func (s *SaveGameDetailedCopy) Save() {
|
||||
for _, v := range s.Log {
|
||||
mq.Write(v)
|
||||
}
|
||||
}
|
||||
|
||||
// LabaLog 拉霸缓存游戏记录
|
||||
type LabaLog struct {
|
||||
PlayerListLog *SaveGamePlayerListLogCopy
|
||||
GameDetailLog *SaveGameDetailedCopy
|
||||
}
|
||||
|
||||
// Cache 临时缓存
|
||||
func (l *LabaLog) Cache(s *Scene, detailLog *SaveGameDetailedParam, playerListLog *SaveGamePlayerListLogParam) {
|
||||
if s == nil {
|
||||
return
|
||||
}
|
||||
detailLog.OnlyLog = true
|
||||
playerListLog.OnlyLog = true
|
||||
l.GameDetailLog = s.SaveGameDetailedLog(detailLog)
|
||||
l.PlayerListLog = s.SaveGamePlayerListLog(playerListLog)
|
||||
}
|
||||
|
||||
// Save 保存
|
||||
func (l *LabaLog) Save(f func(log *LabaLog)) {
|
||||
f(l)
|
||||
l.PlayerListLog.Save()
|
||||
l.GameDetailLog.Save()
|
||||
l.Clear()
|
||||
}
|
||||
|
||||
// Clear 清空
|
||||
func (l *LabaLog) Clear() {
|
||||
l.PlayerListLog = nil
|
||||
l.GameDetailLog = nil
|
||||
}
|
|
@ -68,27 +68,6 @@ func NewGameWarning(param string) {
|
|||
}), nil, "NewGameWarning").Start()
|
||||
}
|
||||
|
||||
// func WarningLoseCoin(gameFreeId int32, snid int32, loseCoin int64) {
|
||||
// if model.GameParamData.WarningLoseLimit == 0 {
|
||||
// return
|
||||
// }
|
||||
// if loseCoin < model.GameParamData.WarningLoseLimit {
|
||||
// return
|
||||
// }
|
||||
// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningGame":%v,"WarningSnid":%v,"LoseCoin":%v}`,
|
||||
// Warning_LoseCoinLimit, gameFreeId, snid, loseCoin))
|
||||
//
|
||||
|
||||
//func WarningBetCoinCheck(sceneId, gameFreeId int32, snid int32, betCoin int64) {
|
||||
// if model.GameParamData.WarningBetMax == 0 {
|
||||
// return
|
||||
// }
|
||||
// if betCoin > model.GameParamData.WarningBetMax {
|
||||
// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningGame":%v,"WarningScene":%v}`,
|
||||
// Warning_BetCoinMax, snid, gameFreeId, sceneId))
|
||||
// }
|
||||
//}
|
||||
|
||||
func WarningCoinPool(warnType int, gameFreeId int32) {
|
||||
NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningGame":%v}`,
|
||||
warnType, gameFreeId))
|
||||
|
@ -97,24 +76,3 @@ func WarningBlackPlayer(snid, gameFreeId int32) {
|
|||
NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningGame":%v}`,
|
||||
Warning_BlackPlayer, snid, gameFreeId))
|
||||
}
|
||||
|
||||
//func WarningWinnerRate(snid int32, winCoin, loseCoin int64) {
|
||||
// if model.GameParamData.WarningWinRate == 0 {
|
||||
// return
|
||||
// }
|
||||
// if (winCoin+1)/(loseCoin+1) < model.GameParamData.WarningWinRate {
|
||||
// return
|
||||
// }
|
||||
// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningRate":%v,"WinCoin":%v,"LoseCoin":%v}`,
|
||||
// Warning_WinRate, snid, (winCoin+1)/(loseCoin+1), winCoin, loseCoin))
|
||||
//}
|
||||
//func WarningWinnerCoin(snid int32, winCoin, loseCoin int64) {
|
||||
// if model.GameParamData.WarningWinMoney == 0 {
|
||||
// return
|
||||
// }
|
||||
// if (winCoin - loseCoin) < model.GameParamData.WarningWinMoney {
|
||||
// return
|
||||
// }
|
||||
// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningCoin":%v,"WinCoin":%v,"LoseCoin":%v}`,
|
||||
// Warning_WinCoin, snid, (winCoin - loseCoin), winCoin, loseCoin))
|
||||
//}
|
||||
|
|
|
@ -1,300 +0,0 @@
|
|||
package base
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"mongo.games.com/game/model"
|
||||
|
||||
"github.com/globalsign/mgo/bson"
|
||||
"mongo.games.com/goserver/core/basic"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/module"
|
||||
"mongo.games.com/goserver/core/task"
|
||||
)
|
||||
|
||||
// HundredJackListManager 排行榜 key: platform+gamefreeId
|
||||
type HundredJackListManager struct {
|
||||
HundredJackTsList map[string][]*HundredJackInfo
|
||||
HundredJackSortList map[string][]*HundredJackInfo
|
||||
}
|
||||
|
||||
// HundredJackListMgr 实例化
|
||||
var HundredJackListMgr = &HundredJackListManager{
|
||||
HundredJackTsList: make(map[string][]*HundredJackInfo),
|
||||
HundredJackSortList: make(map[string][]*HundredJackInfo),
|
||||
}
|
||||
|
||||
// HundredJackInfo 数据结构
|
||||
type HundredJackInfo struct {
|
||||
model.HundredjackpotLog
|
||||
linkSnids []int32 //点赞人数
|
||||
}
|
||||
|
||||
// ModuleName .
|
||||
func (hm *HundredJackListManager) ModuleName() string {
|
||||
return "HundredJackListManager"
|
||||
}
|
||||
|
||||
// Init .
|
||||
func (hm *HundredJackListManager) Init() {
|
||||
//data := model.
|
||||
}
|
||||
|
||||
// Update .
|
||||
func (hm *HundredJackListManager) Update() {
|
||||
}
|
||||
|
||||
// Shutdown .
|
||||
func (hm *HundredJackListManager) Shutdown() {
|
||||
module.UnregisteModule(hm)
|
||||
}
|
||||
|
||||
// ISInitJackInfo 仅初始化一次
|
||||
var ISInitJackInfo bool
|
||||
|
||||
// InitTsJackInfo 初始化TsJackInfo
|
||||
func (hm *HundredJackListManager) InitTsJackInfo(platform string, freeID int32) {
|
||||
key := fmt.Sprintf("%v-%v", platform, freeID)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
datas, err := model.GetHundredjackpotLogTsByPlatformAndGameFreeID(platform, freeID)
|
||||
if err != nil {
|
||||
logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err)
|
||||
return nil
|
||||
}
|
||||
return datas
|
||||
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
|
||||
datas := data.([]model.HundredjackpotLog)
|
||||
if data != nil && datas != nil {
|
||||
for i := range datas {
|
||||
if i == model.HundredjackpotLogMaxLimitPerQuery {
|
||||
break
|
||||
}
|
||||
data := &HundredJackInfo{
|
||||
HundredjackpotLog: datas[i],
|
||||
}
|
||||
strlikeSnids := strings.Split(datas[i].LinkeSnids, "|")
|
||||
for _, v := range strlikeSnids {
|
||||
if v == "" {
|
||||
break
|
||||
}
|
||||
snid, err := strconv.Atoi(v)
|
||||
if err == nil {
|
||||
data.linkSnids = append(data.linkSnids, int32(snid))
|
||||
}
|
||||
}
|
||||
hm.HundredJackTsList[key] = append(hm.HundredJackTsList[key], data)
|
||||
}
|
||||
// logger.Logger.Warnf("InitTsJackInfo data:%v", datas)
|
||||
} else {
|
||||
hm.HundredJackTsList[key] = []*HundredJackInfo{}
|
||||
}
|
||||
return
|
||||
}), "InitTsJackInfo").Start()
|
||||
}
|
||||
|
||||
// InitSortJackInfo 初始化SortJackInfo
|
||||
func (hm *HundredJackListManager) InitSortJackInfo(platform string, freeID int32) {
|
||||
|
||||
key := fmt.Sprintf("%v-%v", platform, freeID)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
datas, err := model.GetHundredjackpotLogCoinByPlatformAndGameFreeID(platform, freeID)
|
||||
if err != nil {
|
||||
logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err)
|
||||
return nil
|
||||
}
|
||||
return datas
|
||||
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
|
||||
datas := data.([]model.HundredjackpotLog)
|
||||
if data != nil && datas != nil {
|
||||
for i := range datas {
|
||||
if i == model.HundredjackpotLogMaxLimitPerQuery {
|
||||
break
|
||||
}
|
||||
data := &HundredJackInfo{
|
||||
HundredjackpotLog: datas[i],
|
||||
}
|
||||
strlikeSnids := strings.Split(datas[i].LinkeSnids, "|")
|
||||
for _, v := range strlikeSnids {
|
||||
snid, err := strconv.Atoi(v)
|
||||
if err == nil {
|
||||
data.linkSnids = append(data.linkSnids, int32(snid))
|
||||
}
|
||||
}
|
||||
hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key], data)
|
||||
}
|
||||
// logger.Logger.Warnf("InitSortJackInfo data:%v", datas)
|
||||
} else {
|
||||
hm.HundredJackSortList[key] = []*HundredJackInfo{}
|
||||
}
|
||||
return
|
||||
}), "InitSortJackInfo").Start()
|
||||
}
|
||||
|
||||
// InitHundredJackListInfo 初始化 HundredJackListInfo
|
||||
func (hm *HundredJackListManager) InitHundredJackListInfo(platform string, freeID int32) {
|
||||
if ISInitJackInfo {
|
||||
return
|
||||
}
|
||||
key := fmt.Sprintf("%v-%v", platform, freeID)
|
||||
if _, exist := hm.HundredJackTsList[key]; !exist {
|
||||
hm.InitTsJackInfo(platform, freeID)
|
||||
}
|
||||
if _, exist := hm.HundredJackSortList[key]; !exist {
|
||||
hm.InitSortJackInfo(platform, freeID)
|
||||
}
|
||||
ISInitJackInfo = true
|
||||
return
|
||||
}
|
||||
|
||||
// GetJackTsInfo 返回TsInfo
|
||||
func (hm *HundredJackListManager) GetJackTsInfo(platform string, freeID int32) []*HundredJackInfo {
|
||||
key := fmt.Sprintf("%v-%v", platform, freeID)
|
||||
if _, exist := hm.HundredJackTsList[key]; !exist { // 玩家进入scene 已经初始化
|
||||
hm.InitTsJackInfo(platform, freeID)
|
||||
}
|
||||
return hm.HundredJackTsList[key]
|
||||
}
|
||||
|
||||
// GetJackSortInfo 返回SortInfo
|
||||
func (hm *HundredJackListManager) GetJackSortInfo(platform string, freeID int32) []*HundredJackInfo {
|
||||
key := fmt.Sprintf("%v-%v", platform, freeID)
|
||||
if _, exist := hm.HundredJackSortList[key]; !exist {
|
||||
hm.InitSortJackInfo(platform, freeID)
|
||||
}
|
||||
return hm.HundredJackSortList[key]
|
||||
}
|
||||
|
||||
// Insert 插入
|
||||
func (hm *HundredJackListManager) Insert(coin, turncoin int64, snid, roomid, jackType, inGame, vip int32, platform, channel, name string, gamedata []string) {
|
||||
key := fmt.Sprintf("%v-%v", platform, roomid)
|
||||
log := model.NewHundredjackpotLogEx(snid, coin, turncoin, roomid, jackType, inGame, vip, platform, channel, name, gamedata)
|
||||
///////////////////实际不走这里
|
||||
if _, exist := hm.HundredJackTsList[key]; !exist {
|
||||
hm.InitTsJackInfo(platform, roomid)
|
||||
}
|
||||
if _, exist := hm.HundredJackSortList[key]; !exist {
|
||||
hm.InitSortJackInfo(platform, roomid)
|
||||
}
|
||||
/////////////////////
|
||||
hm.InsertLog(log)
|
||||
data := &HundredJackInfo{
|
||||
HundredjackpotLog: *log,
|
||||
}
|
||||
/*logger.Logger.Trace("HundredJackListManager log 1 ", log.SnID, log.LogID, data.GameData)
|
||||
for _, v := range hm.HundredJackTsList[key] {
|
||||
logger.Logger.Trace("HundredJackListManager log 2 ", v.SnID, v.LogID, v.GameData)
|
||||
}*/
|
||||
for i, v := range hm.HundredJackSortList[key] { // 插入
|
||||
if v.Coin < log.Coin {
|
||||
d1 := append([]*HundredJackInfo{}, hm.HundredJackSortList[key][i:]...)
|
||||
hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key][:i], data)
|
||||
hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key], d1...)
|
||||
goto Exit
|
||||
}
|
||||
}
|
||||
if len(hm.HundredJackSortList[key]) < model.HundredjackpotLogMaxLimitPerQuery {
|
||||
hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key], data)
|
||||
}
|
||||
Exit:
|
||||
d1 := append([]*HundredJackInfo{}, hm.HundredJackTsList[key][0:]...)
|
||||
hm.HundredJackTsList[key] = append(hm.HundredJackTsList[key][:0], data)
|
||||
hm.HundredJackTsList[key] = append(hm.HundredJackTsList[key], d1...)
|
||||
var delList []*HundredJackInfo
|
||||
if len(hm.HundredJackTsList[key]) > model.HundredjackpotLogMaxLimitPerQuery {
|
||||
delList = append(delList, hm.HundredJackTsList[key][model.HundredjackpotLogMaxLimitPerQuery:]...)
|
||||
hm.HundredJackTsList[key] = hm.HundredJackTsList[key][:model.HundredjackpotLogMaxLimitPerQuery]
|
||||
}
|
||||
if len(hm.HundredJackSortList[key]) > model.HundredjackpotLogMaxLimitPerQuery {
|
||||
delList = append(delList, hm.HundredJackSortList[key][model.HundredjackpotLogMaxLimitPerQuery:]...)
|
||||
hm.HundredJackSortList[key] = hm.HundredJackSortList[key][:model.HundredjackpotLogMaxLimitPerQuery]
|
||||
}
|
||||
/*for _, v := range hm.HundredJackTsList[key] {
|
||||
logger.Logger.Trace("HundredJackListManager log 3 ", v.SnID, v.LogID, v.GameData)
|
||||
}*/
|
||||
for _, v := range delList {
|
||||
if hm.IsCanDel(v, hm.HundredJackTsList[key], hm.HundredJackSortList[key]) { // 两个排行帮都不包含
|
||||
logger.Logger.Info("HundredJackListManager DelOneJackInfo ", v.LogID)
|
||||
hm.DelOneJackInfo(v.Platform, v.LogID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// IsCanDel 能否删除
|
||||
func (hm *HundredJackListManager) IsCanDel(deldata *HundredJackInfo, tsList, sortList []*HundredJackInfo) bool {
|
||||
for _, v := range tsList {
|
||||
if v.LogID == deldata.LogID {
|
||||
return false
|
||||
}
|
||||
}
|
||||
for _, v := range sortList {
|
||||
if v.LogID == deldata.LogID {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// InsertLog insert db
|
||||
func (hm *HundredJackListManager) InsertLog(log *model.HundredjackpotLog) {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
err := model.InsertHundredjackpotLog(log)
|
||||
if err != nil {
|
||||
logger.Logger.Error("HundredJackListManager Insert ", err)
|
||||
}
|
||||
return err
|
||||
}), nil, "InsertHundredJack").Start()
|
||||
}
|
||||
|
||||
// UpdateLikeNum updata likenum
|
||||
func (hm *HundredJackListManager) UpdateLikeNum(plt string, gid bson.ObjectId, like int32, likesnids string) {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
err := model.UpdateLikeNum(plt, gid, like, likesnids)
|
||||
if err != nil {
|
||||
logger.Logger.Error("HundredJackListManager UpdateHundredLikeNum ", err)
|
||||
}
|
||||
return err
|
||||
}), nil, "UpdateHundredLikeNum").Start()
|
||||
}
|
||||
|
||||
// UpdatePlayBlackNum updata playblacknum
|
||||
func (hm *HundredJackListManager) UpdatePlayBlackNum(plt string, gid bson.ObjectId, playblack int32) []string {
|
||||
var ret []string
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
data, err := model.UpdatePlayBlackNum(plt, gid, playblack)
|
||||
if err != nil {
|
||||
logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err)
|
||||
return nil
|
||||
}
|
||||
return data
|
||||
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
|
||||
if data != nil {
|
||||
ret = data.([]string)
|
||||
logger.Logger.Warnf("UpdatePlayBlackNum data:%v", ret)
|
||||
}
|
||||
return
|
||||
}), "UpdatePlayBlackNum").Start()
|
||||
|
||||
logger.Logger.Error("HundredJackListManager UpdatePlayBlackNum ", ret)
|
||||
if len(ret) == 0 {
|
||||
return ret
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DelOneJackInfo del
|
||||
func (hm *HundredJackListManager) DelOneJackInfo(plt string, gid bson.ObjectId) {
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
err := model.RemoveHundredjackpotLogOne(plt, gid)
|
||||
if err != nil {
|
||||
logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err)
|
||||
}
|
||||
return err
|
||||
}), nil, "DelOneJackInfo").Start()
|
||||
}
|
||||
|
||||
func init() {
|
||||
module.RegisteModule(HundredJackListMgr, time.Hour, 0)
|
||||
}
|
|
@ -2,6 +2,7 @@ package base
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/jinzhu/now"
|
||||
"math"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
@ -621,7 +622,20 @@ func (this *Player) AddRankScore(rankType int32, num int64) {
|
|||
}
|
||||
}
|
||||
|
||||
func (this *Player) ReportGameEvent(tax, taxex, changeCoin, validbet, validFlow, in, out int64) {
|
||||
type ReportGameEventParam struct {
|
||||
Tax int64 // 税收
|
||||
Change int64 // 净输赢,正负值,不带税收
|
||||
In, Out int64 // 投入,产出(税前)
|
||||
GameTime int64 // 游戏时长,秒
|
||||
OnlyLog bool // 只返回数据,不上报
|
||||
}
|
||||
|
||||
type ReportGameEventOnly struct {
|
||||
Param *ReportGameEventParam
|
||||
Log []*model.PlayerGameRecEvent
|
||||
}
|
||||
|
||||
func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEventOnly {
|
||||
// 记录玩家 首次参与该场次的游戏时间 游戏次数
|
||||
var gameFirstTime, gameFreeFirstTime time.Time
|
||||
var gameTimes, gameFreeTimes int64
|
||||
|
@ -638,12 +652,53 @@ func (this *Player) ReportGameEvent(tax, taxex, changeCoin, validbet, validFlow,
|
|||
gameFreeTimes = dataGame.Statics.GameTimes
|
||||
}
|
||||
|
||||
gamingTime := int32(time.Now().Sub(this.scene.GameNowTime).Seconds())
|
||||
mq.Write(model.CreatePlayerGameRecEvent(this.SnId, tax, taxex, changeCoin, validbet, validFlow, in, out,
|
||||
this.scene.GameId, this.scene.GetGameFreeId(), int32(this.scene.GameMode),
|
||||
this.scene.GetRecordId(), this.Channel, this.ChannelId, this.BeUnderAgentCode, this.Platform, this.City, this.DeviceOS,
|
||||
this.CreateTime, gamingTime, gameFirstTime, gameFreeFirstTime, gameTimes, gameFreeTimes, this.LastLoginTime,
|
||||
this.TelephonePromoter, this.DeviceId), mq.BackGameRecord)
|
||||
isNew := int32(0)
|
||||
tCreateDay := now.New(this.CreateTime.Local()).BeginningOfDay()
|
||||
if now.BeginningOfDay().Equal(tCreateDay) {
|
||||
isNew = 1
|
||||
}
|
||||
|
||||
if param.GameTime < 0 {
|
||||
param.GameTime = int64(time.Now().Sub(this.scene.GameNowTime).Seconds())
|
||||
}
|
||||
if param.GameTime < 0 {
|
||||
param.GameTime = 0
|
||||
}
|
||||
|
||||
var ret ReportGameEventOnly
|
||||
ret.Param = param
|
||||
log := &model.PlayerGameRecEvent{
|
||||
Platform: this.Platform,
|
||||
RecordId: this.scene.GetRecordId(),
|
||||
SnId: this.GetSnId(),
|
||||
Channel: this.Channel,
|
||||
ChannelId: this.ChannelId,
|
||||
City: this.City,
|
||||
OS: this.DeviceOS,
|
||||
GameId: this.scene.GameId,
|
||||
ModeId: this.scene.GameMode,
|
||||
Tax: param.Tax,
|
||||
Amount: param.Change,
|
||||
CreateTime: this.CreateTime.Unix(),
|
||||
CreateDayTime: tCreateDay.Unix(),
|
||||
Out: param.Out,
|
||||
In: param.In,
|
||||
IsNew: isNew,
|
||||
GameFreeID: this.scene.GetGameFreeId(),
|
||||
GamingTime: int32(param.GameTime),
|
||||
FirstTime: gameFirstTime.Unix(),
|
||||
PlayTimes: gameTimes,
|
||||
FirstGameTime: gameFreeFirstTime.Unix(),
|
||||
PlayGameTimes: gameFreeTimes,
|
||||
LastLoginTime: this.LastLoginTime.Unix(),
|
||||
DeviceId: this.DeviceId,
|
||||
}
|
||||
if param.OnlyLog {
|
||||
ret.Log = append(ret.Log, log)
|
||||
} else {
|
||||
mq.Write(log, mq.BackGameRecord)
|
||||
}
|
||||
return &ret
|
||||
}
|
||||
|
||||
// 汇总玩家该次游戏总产生的税收
|
||||
|
|
|
@ -87,7 +87,8 @@ type Scene struct {
|
|||
SystemCoinOut int64 //本局游戏机器人营收 机器人赢:正值 机器人输:负值
|
||||
ChessRank []int32
|
||||
RealCtrl bool
|
||||
CycleID string
|
||||
CycleID string // 房卡场多轮对局id
|
||||
LogId string // 游戏每局id
|
||||
}
|
||||
|
||||
func NewScene(args *CreateSceneParam) *Scene {
|
||||
|
@ -160,75 +161,104 @@ func (this *Scene) GetGameFreeId() int32 {
|
|||
func (this *Scene) GetKeyGameId() string {
|
||||
return this.KeyGameId
|
||||
}
|
||||
|
||||
func (this *Scene) SetKeyGameId(keyGameId string) {
|
||||
this.KeyGameId = keyGameId
|
||||
}
|
||||
|
||||
func (this *Scene) GetSceneId() int {
|
||||
return int(this.SceneId)
|
||||
}
|
||||
|
||||
func (this *Scene) SetSceneId(sceneId int) {
|
||||
this.SceneId = int32(sceneId)
|
||||
}
|
||||
|
||||
func (this *Scene) GetGroupId() int32 {
|
||||
return this.GroupId
|
||||
}
|
||||
|
||||
func (this *Scene) SetGroupId(groupId int32) {
|
||||
this.GroupId = groupId
|
||||
}
|
||||
|
||||
func (this *Scene) GetExtraData() interface{} {
|
||||
return this.ExtraData
|
||||
}
|
||||
|
||||
func (this *Scene) SetExtraData(data interface{}) {
|
||||
this.ExtraData = data
|
||||
}
|
||||
|
||||
func (this *Scene) GetSceneState() SceneState {
|
||||
return this.SceneState
|
||||
}
|
||||
|
||||
func (this *Scene) SetSceneState(state SceneState) {
|
||||
this.SceneState = state
|
||||
}
|
||||
|
||||
func (this *Scene) GetGameId() int {
|
||||
return int(this.GameId)
|
||||
}
|
||||
|
||||
func (this *Scene) SetGameId(gameId int) {
|
||||
this.GameId = int32(gameId)
|
||||
}
|
||||
|
||||
func (this *Scene) GetPlayerNum() int {
|
||||
return int(this.WGCreateScene.GetPlayerNum())
|
||||
n := this.WGCreateScene.GetPlayerNum()
|
||||
if n > 0 {
|
||||
return int(n)
|
||||
}
|
||||
return int(this.PlayerNum)
|
||||
}
|
||||
|
||||
func (this *Scene) SetPlayerNum(playerNum int) {
|
||||
this.WGCreateScene.PlayerNum = int32(playerNum)
|
||||
this.PlayerNum = int32(playerNum)
|
||||
}
|
||||
|
||||
func (this *Scene) GetGameMode() int {
|
||||
return int(this.GameMode)
|
||||
}
|
||||
|
||||
func (this *Scene) SetGameMode(gameMode int) {
|
||||
this.GameMode = int32(gameMode)
|
||||
}
|
||||
|
||||
func (this *Scene) GetGaming() bool {
|
||||
return this.Gaming
|
||||
}
|
||||
|
||||
func (this *Scene) SetGaming(gaming bool) {
|
||||
this.Gaming = gaming
|
||||
}
|
||||
|
||||
func (this *Scene) GetTesting() bool {
|
||||
return this.Testing
|
||||
}
|
||||
|
||||
func (this *Scene) SetTesting(testing bool) {
|
||||
this.Testing = testing
|
||||
}
|
||||
|
||||
func (this *Scene) GetCreator() int32 {
|
||||
return this.Creator
|
||||
}
|
||||
|
||||
func (this *Scene) SetCreator(creator int32) {
|
||||
this.Creator = creator
|
||||
}
|
||||
|
||||
func (this *Scene) GetSceneMode() int {
|
||||
return int(this.SceneMode)
|
||||
}
|
||||
|
||||
func (this *Scene) SetSceneMode(sceneMode int) {
|
||||
this.SceneMode = int32(sceneMode)
|
||||
}
|
||||
|
||||
func (this *Scene) GetParams() []int64 {
|
||||
return this.Params
|
||||
}
|
||||
|
@ -236,42 +266,55 @@ func (this *Scene) GetParams() []int64 {
|
|||
func (this *Scene) GetStateStartTime() time.Time {
|
||||
return this.StateStartTime
|
||||
}
|
||||
|
||||
func (this *Scene) SetStateStartTime(stateStartTime time.Time) {
|
||||
this.StateStartTime = stateStartTime
|
||||
}
|
||||
|
||||
func (this *Scene) GetGameStartTime() time.Time {
|
||||
return this.GameStartTime
|
||||
}
|
||||
|
||||
func (this *Scene) SetGameStartTime(gameStartTime time.Time) {
|
||||
this.GameStartTime = gameStartTime
|
||||
}
|
||||
|
||||
func (this *Scene) GetGameNowTime() time.Time {
|
||||
return this.GameNowTime
|
||||
}
|
||||
|
||||
func (this *Scene) SetGameNowTime(gameNowTime time.Time) {
|
||||
this.GameNowTime = gameNowTime
|
||||
}
|
||||
|
||||
func (this *Scene) GetNumOfGames() int {
|
||||
return this.NumOfGames
|
||||
}
|
||||
|
||||
func (this *Scene) SetNumOfGames(numOfGames int) {
|
||||
this.NumOfGames = numOfGames
|
||||
}
|
||||
|
||||
func (this *Scene) GetCpCtx() model.CoinPoolCtx {
|
||||
return this.CpCtx
|
||||
}
|
||||
|
||||
func (this *Scene) SetCpCtx(cpCtx model.CoinPoolCtx) {
|
||||
this.CpCtx = cpCtx
|
||||
}
|
||||
|
||||
func (this *Scene) GetAudiences() map[int32]*Player {
|
||||
return this.audiences
|
||||
}
|
||||
|
||||
func (this *Scene) GetDisbandGen() int {
|
||||
return this.disbandGen
|
||||
}
|
||||
|
||||
func (this *Scene) SetDisbandGen(disbandGen int) {
|
||||
this.disbandGen = disbandGen
|
||||
}
|
||||
|
||||
func (this *Scene) GetScenePolicy() ScenePolicy {
|
||||
return this.sp
|
||||
}
|
||||
|
@ -1403,112 +1446,6 @@ func (this *Scene) ClearAutoPlayer() {
|
|||
}
|
||||
}
|
||||
|
||||
type GameDetailedParam struct {
|
||||
Trend20Lately string //最近20局开奖结果
|
||||
CtrlType int
|
||||
PlayerPool map[int]int
|
||||
CycleId string
|
||||
}
|
||||
|
||||
// 保存详细游戏日志
|
||||
func (this *Scene) SaveGameDetailedLog(logid string, gamedetailednote string, gameDetailedParam *GameDetailedParam) {
|
||||
if this != nil {
|
||||
if !this.Testing { //测试场屏蔽掉
|
||||
trend20Lately := gameDetailedParam.Trend20Lately
|
||||
baseScore := this.GetDBGameFree().GetBaseScore()
|
||||
if common.IsLocalGame(int(this.GameId)) {
|
||||
baseScore = this.BaseScore
|
||||
}
|
||||
if this.IsCoinScene() {
|
||||
mapPlatform := make(map[string]bool)
|
||||
for _, p := range this.Players {
|
||||
if _, ok := mapPlatform[p.Platform]; !ok {
|
||||
mapPlatform[p.Platform] = true
|
||||
log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId),
|
||||
this.GetDBGameFree().GetGameMode(), this.GetDBGameFree().Id, int32(len(this.Players)),
|
||||
int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore,
|
||||
gamedetailednote, p.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[int(this.GameId)], trend20Lately,
|
||||
gameDetailedParam.CtrlType, gameDetailedParam.PlayerPool, gameDetailedParam.CycleId)
|
||||
if log != nil {
|
||||
if this.IsMatchScene() {
|
||||
log.MatchId = this.GetMatch().GetMatchSortId()
|
||||
}
|
||||
if this.IsCustom() {
|
||||
log.CycleId = this.CycleID
|
||||
}
|
||||
mq.Write(log)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId),
|
||||
this.GetDBGameFree().GetGameMode(), this.GetDBGameFree().Id, int32(len(this.Players)),
|
||||
int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore,
|
||||
gamedetailednote, this.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[int(this.GameId)], trend20Lately,
|
||||
gameDetailedParam.CtrlType, gameDetailedParam.PlayerPool, gameDetailedParam.CycleId)
|
||||
if log != nil {
|
||||
if this.IsMatchScene() {
|
||||
log.MatchId = this.GetMatch().GetMatchSortId()
|
||||
}
|
||||
if this.IsCustom() {
|
||||
log.CycleId = this.CycleID
|
||||
}
|
||||
newLog := new(model.GameDetailedLog)
|
||||
*newLog = *log
|
||||
mq.Write(log)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type SaveGamePlayerListLogParam struct {
|
||||
Platform string //平台
|
||||
Channel string //渠道
|
||||
Promoter string //推广员
|
||||
PackageTag string //包标识
|
||||
InviterId int32 //邀请人
|
||||
LogId string //日志id
|
||||
TotalIn int64 //总投入
|
||||
TotalOut int64 //总产出
|
||||
TaxCoin int64 //总税收
|
||||
ClubPumpCoin int64 //俱乐部抽水
|
||||
BetAmount int64 //下注量
|
||||
WinAmountNoAnyTax int64 //税后赢取额(净利润,正负值)
|
||||
ValidBet int64 //有效下注
|
||||
ValidFlow int64 //有效流水
|
||||
IsFirstGame bool //是否第一次游戏
|
||||
IsLeave bool //是否中途离开,用于金花,德州可以中途离开游戏使用
|
||||
IsFree bool //拉霸专用 是否免费
|
||||
WinSmallGame int64 //拉霸专用 小游戏奖励
|
||||
WinTotal int64 //拉霸专用 本局输赢
|
||||
PlayerName string //玩家名字
|
||||
CycleId string // 房卡场对局id
|
||||
}
|
||||
|
||||
func GetSaveGamePlayerListLogParam(platform, channel, promoter, packageTag, logid string,
|
||||
inviterId int32, totalin, totalout, taxCoin, clubPumpCoin, betAmount, winAmountNoAnyTax, validBet, validFlow int64,
|
||||
isFirstGame, isLeave bool) *SaveGamePlayerListLogParam {
|
||||
return &SaveGamePlayerListLogParam{
|
||||
Platform: platform,
|
||||
Channel: channel,
|
||||
Promoter: promoter,
|
||||
PackageTag: packageTag,
|
||||
InviterId: inviterId,
|
||||
LogId: logid,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: taxCoin,
|
||||
ClubPumpCoin: clubPumpCoin,
|
||||
BetAmount: betAmount,
|
||||
WinAmountNoAnyTax: winAmountNoAnyTax,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: isFirstGame,
|
||||
IsLeave: isLeave,
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) SaveFriendRecord(snid int32, isWin int32, billCoin int64, baseScore int32) {
|
||||
if this.SceneMode == common.SceneModePrivate {
|
||||
return
|
||||
|
@ -1519,57 +1456,6 @@ func (this *Scene) SaveFriendRecord(snid int32, isWin int32, billCoin int64, bas
|
|||
}
|
||||
}
|
||||
|
||||
// 保存玩家和GameDetailedLog的映射表
|
||||
func (this *Scene) SaveGamePlayerListLog(snid int32, param *SaveGamePlayerListLogParam) {
|
||||
if this != nil {
|
||||
if !this.Testing { //测试场屏蔽掉 龙虎两边都压,totalin和totalout都=0,这个条件去掉
|
||||
//统计流水值
|
||||
playerEx := this.GetPlayer(snid)
|
||||
//有些结算的时候,玩家已经退场,不要用是否在游戏,0709,修改为扣税后数值
|
||||
if playerEx != nil && !param.IsLeave && !playerEx.IsRob && (param.IsFree || param.TotalIn != 0 || param.TotalOut != 0) {
|
||||
totalFlow := param.ValidFlow * int64(this.GetDBGameFree().GetBetWaterRate()) / 100
|
||||
playerEx.TotalConvertibleFlow += totalFlow
|
||||
playerEx.TotalFlow += totalFlow
|
||||
playerEx.ValidCacheBetTotal += param.ValidBet
|
||||
//报表统计
|
||||
//playerEx.SaveReportForm(int(this.GetDBGameFree().GetGameClass()), this.SceneMode, this.KeyGameId,
|
||||
// param.WinAmountNoAnyTax, totalFlow, param.ValidBet)
|
||||
//分配利润
|
||||
ProfitDistribution(playerEx, param.TaxCoin, param.ClubPumpCoin, totalFlow)
|
||||
//上报游戏事件
|
||||
playerEx.ReportGameEvent(param.TaxCoin, param.ClubPumpCoin, param.WinAmountNoAnyTax, param.ValidBet, totalFlow, param.TotalIn, param.TotalOut)
|
||||
}
|
||||
|
||||
roomType := int32(this.SceneMode)
|
||||
if this.GameId == common.GameId_Avengers ||
|
||||
this.GameId == common.GameId_CaiShen ||
|
||||
this.GameId == common.GameId_EasterIsland ||
|
||||
this.GameId == common.GameId_IceAge ||
|
||||
this.GameId == common.GameId_TamQuoc { //复仇者联盟强制为0,所有场次操作记录放一起
|
||||
roomType = 0
|
||||
}
|
||||
baseScore := this.GetDBGameFree().GetBaseScore()
|
||||
if common.IsLocalGame(int(this.GameId)) {
|
||||
baseScore = this.BaseScore
|
||||
}
|
||||
|
||||
Name := param.PlayerName
|
||||
if playerEx != nil {
|
||||
Name = param.PlayerName
|
||||
}
|
||||
|
||||
log := model.NewGamePlayerListLogEx(snid, param.LogId, param.Platform, param.Channel, param.Promoter, param.PackageTag,
|
||||
this.GameId, baseScore, this.SceneId, int32(this.GetGameMode()),
|
||||
this.GetGameFreeId(), param.TotalIn, param.TotalOut, this.ClubId, this.RoomId, param.TaxCoin, param.ClubPumpCoin, roomType,
|
||||
param.BetAmount, param.WinAmountNoAnyTax, this.KeyGameId, Name, this.GetDBGameFree().GetGameClass(),
|
||||
param.IsFirstGame, this.GetMatch().GetMatchSortId(), int64(this.GetMatch().GetMatchType()), param.IsFree, param.WinSmallGame, param.WinTotal, param.CycleId)
|
||||
if log != nil {
|
||||
mq.Write(log)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) IsPlayerFirst(p *Player) bool {
|
||||
if p == nil {
|
||||
return false
|
||||
|
|
|
@ -1023,31 +1023,31 @@ func CaiShenCheckAndSaveLog(sceneEx *CaiShenSceneData, playerEx *CaiShenPlayerDa
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
totalin := int64(playerEx.RollGameType.BaseResult.TotalBet)
|
||||
totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet),
|
||||
WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: playerEx.RollGameType.BaseResult.IsFree,
|
||||
WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame,
|
||||
WinTotal: playerEx.RollGameType.BaseResult.WinTotal,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -767,6 +767,7 @@ func (e *SceneEx) ToBilled(p1, p2 *PlayerEx, isWin int) (*chesstitians.Chesstiti
|
|||
UserIcon: p1.Head,
|
||||
Platform: p1.Platform,
|
||||
Channel: p1.Channel,
|
||||
ChannelId: p1.ChannelId,
|
||||
Promoter: p1.BeUnderAgentCode,
|
||||
PackageTag: p1.PackageID,
|
||||
InviterId: p1.InviterId,
|
||||
|
|
|
@ -1298,9 +1298,6 @@ func (this *SceneStateBilled) OnEnter(s *base.Scene) {
|
|||
} else {
|
||||
totalout += (o_player.GainCoin + o_player.GainTaxCoin)
|
||||
}
|
||||
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
sceneEx.SaveFriendRecord(o_player.UserId, o_player.IsWin, o_player.GainCoin, sceneEx.GetBaseScore())
|
||||
|
||||
// 游戏数据统计
|
||||
|
@ -1313,16 +1310,29 @@ func (this *SceneStateBilled) OnEnter(s *base.Scene) {
|
|||
})
|
||||
|
||||
// 玩家游戏记录
|
||||
sceneEx.SaveGamePlayerListLog(o_player.UserId,
|
||||
base.GetSaveGamePlayerListLogParam(o_player.Platform, o_player.Channel, o_player.Promoter,
|
||||
o_player.PackageTag, logid, o_player.InviterId, totalin, totalout, o_player.GainTaxCoin,
|
||||
0, 0, o_player.GainCoin, validBet, validFlow, o_player.IsFirst, o_player.IsLeave))
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: o_player.Platform,
|
||||
Snid: o_player.UserId,
|
||||
PlayerName: "",
|
||||
Channel: o_player.Channel,
|
||||
ChannelId: o_player.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: o_player.GainTaxCoin,
|
||||
BetAmount: 0,
|
||||
WinAmountNoAnyTax: o_player.GainCoin,
|
||||
IsFirstGame: o_player.IsFirst,
|
||||
})
|
||||
isSave = true
|
||||
}
|
||||
}
|
||||
if isSave {
|
||||
// 牌局记录
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
})
|
||||
}
|
||||
}
|
||||
sceneEx.NotifySceneRoundPause()
|
||||
|
|
|
@ -781,34 +781,28 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
sceneEx.logid, _ = model.AutoIncGameLogId()
|
||||
info, err := model.MarshalGameNoteByHUNDRED(LogBaseResult)
|
||||
if err == nil {
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: sceneEx.logid,
|
||||
Detail: info,
|
||||
})
|
||||
}
|
||||
|
||||
TotalBetValue := 0
|
||||
totalin := int64(TotalBetValue)
|
||||
totalout := playerEx.gainCoin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
LogId: sceneEx.logid,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(TotalBetValue),
|
||||
WinAmountNoAnyTax: playerEx.gainCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: false,
|
||||
WinSmallGame: 0,
|
||||
WinTotal: 0,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: sceneEx.logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(TotalBetValue),
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
})
|
||||
}
|
||||
|
||||
playerEx.lastIsWin = playerEx.IsWin
|
||||
|
|
|
@ -892,31 +892,31 @@ func EasterIslandCheckAndSaveLog(sceneEx *EasterIslandSceneData, playerEx *Easte
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
totalin := int64(playerEx.RollGameType.BaseResult.TotalBet)
|
||||
totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet),
|
||||
WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: playerEx.RollGameType.BaseResult.IsFree,
|
||||
WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame,
|
||||
WinTotal: playerEx.RollGameType.BaseResult.WinTotal,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -262,13 +262,24 @@ func (this *FishingPlayerData) SaveDetailedLog(s *base.Scene) {
|
|||
info, err := model.MarshalGameNoteByFISH(&fd)
|
||||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
param := base.GetSaveGamePlayerListLogParam(this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, logid,
|
||||
this.InviterId, totalin, totalout, int64(this.sTaxCoin), 0, totalin,
|
||||
totalout, validFlow, validBet, sceneEx.IsPlayerFirst(this.Player), false)
|
||||
sceneEx.SaveGamePlayerListLog(this.SnId, param)
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: this.Platform,
|
||||
Snid: this.SnId,
|
||||
PlayerName: this.Name,
|
||||
Channel: this.Channel,
|
||||
ChannelId: this.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: int64(this.sTaxCoin),
|
||||
BetAmount: totalin,
|
||||
WinAmountNoAnyTax: totalout,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(this.Player),
|
||||
})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
})
|
||||
}
|
||||
|
||||
pack := &server_proto.GWFishRecord{
|
||||
|
|
|
@ -407,7 +407,9 @@ func (this *SceneStateStartFortuneDragon) OnPlayerOp(s *base.Scene, p *base.Play
|
|||
var gameEndStr string
|
||||
var data assemble.GameEnd
|
||||
if err == nil {
|
||||
s.SetGameNowTime(time.Now())
|
||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||
data.Results[0].BetMode = playerEx.BetMode
|
||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||
//logger.Logger.Trace("=====================AddCoin=====TotalBet===", -data.TotalBet)
|
||||
//第一次触发或者正常模式
|
||||
|
@ -512,7 +514,11 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
var totalin, totalout int64
|
||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||
totalin = playerEx.totalBet
|
||||
|
@ -520,25 +526,22 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD
|
|||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||
}
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: totalin,
|
||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
IsFree: playerEx.isFree,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package fortunemouse
|
||||
|
||||
import (
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/protocol/fortunemouse"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/netlib"
|
||||
)
|
||||
|
||||
type CSFortuneMouseOpPacketFactory struct {
|
||||
}
|
||||
type CSFortuneMouseOpHandler struct {
|
||||
}
|
||||
|
||||
func (this *CSFortuneMouseOpPacketFactory) CreatePacket() interface{} {
|
||||
pack := &fortunemouse.CSFortuneMouseOp{}
|
||||
return pack
|
||||
}
|
||||
|
||||
func (this *CSFortuneMouseOpHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||
if op, ok := data.(*fortunemouse.CSFortuneMouseOp); ok {
|
||||
p := base.PlayerMgrSington.GetPlayer(sid)
|
||||
if p == nil {
|
||||
logger.Logger.Warn("CSFortuneMouseOpHandler p == nil")
|
||||
return nil
|
||||
}
|
||||
scene := p.GetScene()
|
||||
if scene == nil {
|
||||
logger.Logger.Warn("CSFortuneMouseOpHandler p.scene == nil")
|
||||
return nil
|
||||
}
|
||||
if !scene.HasPlayer(p) {
|
||||
return nil
|
||||
}
|
||||
if scene.GetScenePolicy() != nil {
|
||||
scene.GetScenePolicy().OnPlayerOp(scene, p, int(op.GetOpCode()), op.GetParams())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func init() {
|
||||
common.RegisterHandler(int(fortunemouse.FortuneMousePID_PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP), &CSFortuneMouseOpHandler{})
|
||||
netlib.RegisterFactory(int(fortunemouse.FortuneMousePID_PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP), &CSFortuneMouseOpPacketFactory{})
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package fortunemouse
|
||||
|
||||
import (
|
||||
"mongo.games.com/game/gamerule/fortunemouse"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/slots"
|
||||
)
|
||||
|
||||
type FortuneMousePlayerData struct {
|
||||
*base.Player
|
||||
leaveTime int32 //离开时间
|
||||
SlotsSession *base.SlotsSession
|
||||
|
||||
BetSizeIndex int64 `json:"bsi"` //选中的单注下标
|
||||
BetLevelIndex int64 `json:"bli"` //选中的等级下标
|
||||
BetLineIndex int64 `json:"bii"` //选中的线数下标
|
||||
BetMode int64 `json:"bm,optional"` //0.常规 1.必中
|
||||
|
||||
taxCoin int64
|
||||
winCoin int64
|
||||
currentLogId string
|
||||
totalBet int64
|
||||
|
||||
isRespin bool //只用于判断是否可以离开
|
||||
}
|
||||
|
||||
type SpinLock struct {
|
||||
ReSpinStatus int `json:"rs,omitempty"` //0.默认 1.第一次触发 2.进行中 3.结束
|
||||
//OXSpecial
|
||||
NewSuperStack []int64 `json:"nss,omitempty"`
|
||||
}
|
||||
|
||||
func (p *FortuneMousePlayerData) init() {
|
||||
p.SlotsSession = base.NewSession(uint64(p.SnId), p.Coin*fortunemouse.NowByte)
|
||||
}
|
||||
func (p *FortuneMousePlayerData) Clear() {
|
||||
p.taxCoin = 0
|
||||
p.winCoin = 0
|
||||
p.currentLogId = ""
|
||||
}
|
||||
|
||||
// 需要带到world上进行数据处理
|
||||
func (p *FortuneMousePlayerData) PushPlayer() map[string]string {
|
||||
cache := slots.SlotsMgrSington.PushPlayer(p.SlotsSession)
|
||||
return cache
|
||||
}
|
||||
|
||||
// 进房的时候需要带进来
|
||||
func (p *FortuneMousePlayerData) PullPlayer(data map[string]string) {
|
||||
slots.SlotsMgrSington.PullPlayer(p.SlotsSession, data)
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package fortunemouse
|
||||
|
||||
import (
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/assemble"
|
||||
)
|
||||
|
||||
type FortuneMouseSceneData struct {
|
||||
*base.Scene //场景
|
||||
players map[int32]*FortuneMousePlayerData //玩家信息
|
||||
BetConfig *assemble.BetConfig
|
||||
}
|
||||
|
||||
func NewFortuneMouseSceneData(s *base.Scene) *FortuneMouseSceneData {
|
||||
sceneEx := &FortuneMouseSceneData{
|
||||
Scene: s,
|
||||
players: make(map[int32]*FortuneMousePlayerData),
|
||||
}
|
||||
sceneEx.Init()
|
||||
return sceneEx
|
||||
}
|
||||
func (s *FortuneMouseSceneData) Init() {
|
||||
|
||||
}
|
||||
|
||||
func (s *FortuneMouseSceneData) Clear() {
|
||||
//应该是水池变一次就判断修改一次
|
||||
//s.slotRateWeight = s.slotRateWeightTotal[0]
|
||||
}
|
||||
func (s *FortuneMouseSceneData) SceneDestroy(force bool) {
|
||||
//销毁房间
|
||||
s.Scene.Destroy(force)
|
||||
}
|
||||
|
||||
func (s *FortuneMouseSceneData) delPlayer(SnId int32) {
|
||||
if _, exist := s.players[SnId]; exist {
|
||||
delete(s.players, SnId)
|
||||
}
|
||||
}
|
||||
func (s *FortuneMouseSceneData) OnPlayerLeave(p *base.Player, reason int) {
|
||||
if /*playerEx*/ _, ok := p.ExtraData.(*FortuneMousePlayerData); ok {
|
||||
|
||||
}
|
||||
s.delPlayer(p.SnId)
|
||||
}
|
|
@ -0,0 +1,594 @@
|
|||
package fortunemouse
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/gamerule/fortunemouse"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/assemble"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/slots"
|
||||
"mongo.games.com/game/model"
|
||||
"mongo.games.com/game/proto"
|
||||
protocol "mongo.games.com/game/protocol/fortunemouse"
|
||||
"mongo.games.com/game/protocol/server"
|
||||
"mongo.games.com/goserver/core"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"time"
|
||||
)
|
||||
|
||||
// ////////////////////////////////////////////////////////////
|
||||
var ScenePolicyFortuneMouseSington = &ScenePolicyFortuneMouse{}
|
||||
|
||||
type ScenePolicyFortuneMouse struct {
|
||||
base.BaseScenePolicy
|
||||
states [fortunemouse.FortuneMouseStateMax]base.SceneState
|
||||
}
|
||||
|
||||
// 创建场景扩展数据
|
||||
func (this *ScenePolicyFortuneMouse) CreateSceneExData(s *base.Scene) interface{} {
|
||||
sceneEx := NewFortuneMouseSceneData(s)
|
||||
if sceneEx != nil {
|
||||
if sceneEx.GetInit() {
|
||||
s.SetExtraData(sceneEx)
|
||||
}
|
||||
}
|
||||
return sceneEx
|
||||
}
|
||||
|
||||
// 创建玩家扩展数据
|
||||
func (this *ScenePolicyFortuneMouse) CreatePlayerExData(s *base.Scene, p *base.Player) interface{} {
|
||||
playerEx := &FortuneMousePlayerData{Player: p}
|
||||
p.SetExtraData(playerEx)
|
||||
return playerEx
|
||||
}
|
||||
|
||||
// 场景开启事件
|
||||
func (this *ScenePolicyFortuneMouse) OnStart(s *base.Scene) {
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnStart, sceneId=", s.GetSceneId())
|
||||
sceneEx := NewFortuneMouseSceneData(s)
|
||||
if sceneEx != nil {
|
||||
if sceneEx.GetInit() {
|
||||
s.SetExtraData(sceneEx)
|
||||
s.ChangeSceneState(fortunemouse.FortuneMouseStateStart)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 场景关闭事件
|
||||
func (this *ScenePolicyFortuneMouse) OnStop(s *base.Scene) {
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnStop , sceneId=", s.GetSceneId())
|
||||
}
|
||||
|
||||
// 场景心跳事件
|
||||
func (this *ScenePolicyFortuneMouse) OnTick(s *base.Scene) {
|
||||
if s == nil {
|
||||
return
|
||||
}
|
||||
if s.GetSceneState() != nil {
|
||||
s.GetSceneState().OnTick(s)
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家进入事件
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerEnter(s *base.Scene, p *base.Player) {
|
||||
if s == nil || p == nil {
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.Name)
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
playerEx := &FortuneMousePlayerData{Player: p}
|
||||
|
||||
playerEx.init()
|
||||
|
||||
d := p.GameData[fortunemouse.GameDataKey]
|
||||
if d != nil {
|
||||
m := make(map[string]string)
|
||||
json.Unmarshal(d.Data.([]byte), &m)
|
||||
playerEx.PullPlayer(m)
|
||||
} else {
|
||||
m := make(map[string]string)
|
||||
//json.Unmarshal(d.Data.([]byte), &m)
|
||||
playerEx.PullPlayer(m)
|
||||
}
|
||||
|
||||
playerEx.SlotsSession.SetCoin(playerEx.Coin * fortunemouse.NowByte)
|
||||
|
||||
playerEx.Clear()
|
||||
|
||||
sceneEx.players[p.SnId] = playerEx
|
||||
|
||||
p.SetExtraData(playerEx)
|
||||
FortuneMouseSendRoomInfo(s, sceneEx, playerEx)
|
||||
|
||||
s.FirePlayerEvent(p, base.PlayerEventEnter, nil)
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家离开事件
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) {
|
||||
if s == nil || p == nil {
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||
if playerEx, ok := p.ExtraData.(*FortuneMousePlayerData); ok {
|
||||
m := playerEx.PushPlayer()
|
||||
if m != nil && len(m) > 0 {
|
||||
b, err := json.Marshal(m)
|
||||
if err != nil {
|
||||
logger.Logger.Error("OnPlayerLeave, json.Marshal error:", err)
|
||||
} else {
|
||||
p.GameData[fortunemouse.GameDataKey] = &model.PlayerGameData{
|
||||
Platform: p.Platform,
|
||||
SnId: p.SnId,
|
||||
Id: fortunemouse.GameDataKey,
|
||||
Data: b,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if sceneEx, ok := s.ExtraData.(*FortuneMouseSceneData); ok {
|
||||
s.FirePlayerEvent(p, base.PlayerEventLeave, nil)
|
||||
sceneEx.OnPlayerLeave(p, reason)
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家掉线
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerDropLine(s *base.Scene, p *base.Player) {
|
||||
if s == nil || p == nil {
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||
s.FirePlayerEvent(p, base.PlayerEventDropLine, nil)
|
||||
}
|
||||
|
||||
// 玩家重连
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerRehold(s *base.Scene, p *base.Player) {
|
||||
if s == nil || p == nil {
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok {
|
||||
FortuneMouseSendRoomInfo(s, sceneEx, playerEx)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 返回房间
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerReturn(s *base.Scene, p *base.Player) {
|
||||
if s == nil || p == nil {
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerReturn, GetSceneId()=", s.GetSceneId(), " player=", p.Name)
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok {
|
||||
//if p.IsMarkFlag(base.PlayerState_Auto) {
|
||||
// p.UnmarkFlag(base.PlayerState_Auto)
|
||||
// p.SyncFlag()
|
||||
//}
|
||||
//发送房间信息给自己
|
||||
FortuneMouseSendRoomInfo(s, sceneEx, playerEx)
|
||||
s.FirePlayerEvent(p, base.PlayerEventReturn, nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func FortuneMouseSendRoomInfo(s *base.Scene, sceneEx *FortuneMouseSceneData, playerEx *FortuneMousePlayerData) {
|
||||
pack := FortuneMouseCreateRoomInfoPacket(s, sceneEx, playerEx)
|
||||
logger.Logger.Trace("RoomInfo: ", pack)
|
||||
playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO), pack)
|
||||
}
|
||||
func FortuneMouseCreateRoomInfoPacket(s *base.Scene, sceneEx *FortuneMouseSceneData, playerEx *FortuneMousePlayerData) interface{} {
|
||||
//房间信息
|
||||
pack := &protocol.SCFortuneMouseRoomInfo{
|
||||
RoomId: s.SceneId,
|
||||
GameId: s.GameId,
|
||||
RoomMode: s.SceneMode,
|
||||
SceneType: s.GetSceneType(),
|
||||
Params: common.CopySliceInt64ToInt32(s.Params),
|
||||
NumOfGames: proto.Int(sceneEx.NumOfGames),
|
||||
State: proto.Int(s.SceneState.GetState()),
|
||||
ParamsEx: s.GetDBGameFree().OtherIntParams,
|
||||
GameFreeId: proto.Int32(s.GetDBGameFree().Id),
|
||||
//BetLimit: s.GetDBGameFree().BetLimit,
|
||||
}
|
||||
|
||||
//自己的信息
|
||||
if playerEx != nil {
|
||||
pd := &protocol.FortuneMousePlayerData{
|
||||
SnId: proto.Int32(playerEx.SnId),
|
||||
Name: proto.String(playerEx.Name),
|
||||
Head: proto.Int32(playerEx.Head),
|
||||
Sex: proto.Int32(playerEx.Sex),
|
||||
Coin: proto.Int64(playerEx.Coin),
|
||||
Pos: proto.Int(playerEx.Pos),
|
||||
Flag: proto.Int(playerEx.GetFlag()),
|
||||
City: proto.String(playerEx.City),
|
||||
HeadOutLine: proto.Int32(playerEx.HeadOutLine),
|
||||
VIP: proto.Int32(playerEx.VIP),
|
||||
}
|
||||
pack.Player = pd
|
||||
}
|
||||
|
||||
//get data
|
||||
Response, err := slots.SlotsMgrSington.Enter(playerEx.SlotsSession, int64(s.GameId))
|
||||
if err == nil {
|
||||
data := assemble.DataToCli(Response).(assemble.TableInfo)
|
||||
pi, _ := json.Marshal(data)
|
||||
pack.PlayerInfo = string(pi)
|
||||
if sceneEx.BetConfig == nil {
|
||||
sceneEx.BetConfig = &data.BetConfig
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Error("slots enter err:", err)
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
return pack
|
||||
}
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||
if s == nil || p == nil {
|
||||
return false
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
|
||||
if s.GetSceneState() != nil {
|
||||
if s.GetSceneState().OnPlayerOp(s, p, opcode, params) {
|
||||
p.SetLastOPTimer(time.Now())
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (this *ScenePolicyFortuneMouse) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||
if s == nil || p == nil {
|
||||
return
|
||||
}
|
||||
logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params)
|
||||
if s.GetSceneState() != nil {
|
||||
s.GetSceneState().OnPlayerEvent(s, p, evtcode, params)
|
||||
}
|
||||
}
|
||||
|
||||
// 当前状态能否换桌
|
||||
func (this *ScenePolicyFortuneMouse) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||
if s == nil || p == nil {
|
||||
return false
|
||||
}
|
||||
if s.GetSceneState() != nil {
|
||||
return s.GetSceneState().CanChangeCoinScene(s, p)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 状态基类
|
||||
type SceneBaseStateFortuneMouse struct {
|
||||
}
|
||||
|
||||
func (this *SceneBaseStateFortuneMouse) GetTimeout(s *base.Scene) int {
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
return int(time.Now().Sub(sceneEx.GetStateStartTime()) / time.Second)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (this *SceneBaseStateFortuneMouse) CanChangeTo(s base.SceneState) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// 当前状态能否换桌
|
||||
func (this *SceneBaseStateFortuneMouse) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||
return true
|
||||
}
|
||||
func (this *SceneBaseStateFortuneMouse) OnEnter(s *base.Scene) {
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
sceneEx.SetStateStartTime(time.Now())
|
||||
}
|
||||
}
|
||||
|
||||
func (this *SceneBaseStateFortuneMouse) OnLeave(s *base.Scene) {}
|
||||
func (this *SceneBaseStateFortuneMouse) OnTick(s *base.Scene) {
|
||||
if time.Now().Sub(s.GameStartTime) > time.Second*3 {
|
||||
if sceneEx, ok := s.ExtraData.(*FortuneMouseSceneData); ok {
|
||||
for _, p := range sceneEx.players {
|
||||
if p.IsOnLine() {
|
||||
p.leaveTime = 0
|
||||
continue
|
||||
}
|
||||
p.leaveTime++
|
||||
if p.leaveTime < 60*2 {
|
||||
continue
|
||||
}
|
||||
//踢出玩家
|
||||
sceneEx.PlayerLeave(p.Player, common.PlayerLeaveReason_LongTimeNoOp, true)
|
||||
}
|
||||
}
|
||||
s.GameStartTime = time.Now()
|
||||
}
|
||||
}
|
||||
func (this *SceneBaseStateFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||
return false
|
||||
}
|
||||
func (this *SceneBaseStateFortuneMouse) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////
|
||||
// 开始状态
|
||||
// ////////////////////////////////////////////////////////////
|
||||
type SceneStateStartFortuneMouse struct {
|
||||
SceneBaseStateFortuneMouse
|
||||
}
|
||||
|
||||
func (this *SceneStateStartFortuneMouse) GetState() int {
|
||||
return fortunemouse.FortuneMouseStateStart
|
||||
}
|
||||
|
||||
func (this *SceneStateStartFortuneMouse) CanChangeTo(s base.SceneState) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// 当前状态能否换桌
|
||||
func (this *SceneStateStartFortuneMouse) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||
if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok {
|
||||
if playerEx.isRespin {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (this *SceneStateStartFortuneMouse) GetTimeout(s *base.Scene) int {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (this *SceneStateStartFortuneMouse) OnEnter(s *base.Scene) {
|
||||
this.SceneBaseStateFortuneMouse.OnEnter(s)
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
sceneEx.SetGameNowTime(time.Now())
|
||||
}
|
||||
}
|
||||
|
||||
// 状态离开时
|
||||
func (this *SceneStateStartFortuneMouse) OnLeave(s *base.Scene) {
|
||||
this.SceneBaseStateFortuneMouse.OnLeave(s)
|
||||
logger.Logger.Tracef("(this *SceneStateStartFortuneMouse) OnLeave, sceneid=%v", s.GetSceneId())
|
||||
}
|
||||
|
||||
// 玩家操作
|
||||
func (this *SceneStateStartFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||
logger.Logger.Tracef("(this *SceneStateStartFortuneMouse) OnPlayerOp, sceneid=%v params=%v", s.GetSceneId(), params)
|
||||
if this.SceneBaseStateFortuneMouse.OnPlayerOp(s, p, opcode, params) {
|
||||
return true
|
||||
}
|
||||
if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok {
|
||||
if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok {
|
||||
switch opcode {
|
||||
case fortunemouse.FortuneMousePlayerOpStart:
|
||||
playerEx.Clear()
|
||||
if len(params) < 3 {
|
||||
pack := &protocol.SCFortuneMouseBilled{
|
||||
OpRetCode: proto.Int32(1),
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
logger.Logger.Trace("SCFortuneMouseBilled", pack.String())
|
||||
playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED), pack)
|
||||
return true
|
||||
}
|
||||
playerEx.BetSizeIndex = params[0]
|
||||
playerEx.BetLevelIndex = params[1]
|
||||
playerEx.BetLineIndex = params[2]
|
||||
//playerEx.BetMode = params[3]
|
||||
needCoin := sceneEx.BetConfig.BetSize[params[0]] * float64(sceneEx.BetConfig.BetLevel[params[1]]) *
|
||||
float64(sceneEx.BetConfig.BetLines[params[2]])
|
||||
if needCoin > float64(playerEx.Coin) {
|
||||
pack := &protocol.SCFortuneMouseBilled{
|
||||
OpRetCode: proto.Int32(1),
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
logger.Logger.Trace("SCFortuneMouseBilled:", pack.String())
|
||||
playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED), pack)
|
||||
return true
|
||||
}
|
||||
|
||||
//playerEx.SlotsSession.SetCoin(playerEx.Coin * fortunemouse.NowByte)
|
||||
//logger.Logger.Trace("=============init dif coin", playerEx.Coin-playerEx.SlotsSession.Coin()/fortunemouse.NowByte)
|
||||
|
||||
//get data
|
||||
Response, err := slots.SlotsMgrSington.Play(playerEx.SlotsSession, &base.SpinReq{
|
||||
GameId: int64(sceneEx.GameId),
|
||||
BetSizeIndex: playerEx.BetSizeIndex,
|
||||
BetLevelIndex: playerEx.BetLevelIndex,
|
||||
BetLineIndex: playerEx.BetLineIndex,
|
||||
BetMode: playerEx.BetMode,
|
||||
Ts: time.Now().Unix(),
|
||||
})
|
||||
var gameEndStr string
|
||||
var data assemble.GameEnd
|
||||
if err == nil {
|
||||
s.SetGameNowTime(time.Now())
|
||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||
var respinStatus int
|
||||
if data.Results[0].ArrSpins[0].Special != nil {
|
||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||
var spinLock SpinLock
|
||||
json.Unmarshal(sp, &spinLock)
|
||||
respinStatus = spinLock.ReSpinStatus
|
||||
}
|
||||
if respinStatus == 0 || respinStatus == 1 {
|
||||
//第一次触发或者正常模式
|
||||
//logger.Logger.Trace("=============addcoin1111 ", -data.TotalBet)
|
||||
playerEx.AddCoin(int64(-data.TotalBet), common.GainWay_HundredSceneLost, base.SyncFlag_ToClient, "system", s.GetSceneName())
|
||||
playerEx.totalBet = int64(data.TotalBet)
|
||||
//logger.Logger.Trace("=======bet======dif++++ ", float64(playerEx.Coin)-data.BetAfterCoin)
|
||||
}
|
||||
var taxCoin float64
|
||||
if data.RoundReward > 0 {
|
||||
//税收比例
|
||||
taxRate := sceneEx.GetDBGameFree().GetTaxRate()
|
||||
if taxRate < 0 || taxRate > 10000 {
|
||||
taxRate = 500
|
||||
}
|
||||
taxCoin = data.RoundReward * float64(taxRate) / 10000
|
||||
data.RoundReward = data.RoundReward - taxCoin
|
||||
playerEx.AddServiceFee(int64(taxCoin))
|
||||
playerEx.taxCoin = int64(taxCoin)
|
||||
playerEx.winCoin = int64(data.RoundReward)
|
||||
}
|
||||
pi, _ := json.Marshal(data)
|
||||
gameEndStr = string(pi)
|
||||
if respinStatus == 0 || respinStatus == 3 {
|
||||
//logger.Logger.Trace("===win==========addcoin222 ", data.RoundReward)
|
||||
playerEx.AddCoin(int64(data.RoundReward), common.GainWay_HundredSceneWin, 0, "system", s.GetSceneName())
|
||||
//logger.Logger.Trace("=======win======dif++++ ", float64(playerEx.Coin)-data.FinalCoin)
|
||||
//免费游戏结束或者正常模式
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: int64(data.RoundReward - data.TotalBet),
|
||||
GainTax: int64(taxCoin),
|
||||
IsAddTimes: true,
|
||||
})
|
||||
}
|
||||
if respinStatus == 0 || respinStatus == 3 {
|
||||
playerEx.isRespin = false
|
||||
} else {
|
||||
playerEx.isRespin = true
|
||||
}
|
||||
} else {
|
||||
logger.Logger.Error("slots Play err:", err)
|
||||
}
|
||||
|
||||
playerEx.SlotsSession.SetCoin(int64(data.FinalCoin) * fortunemouse.NowByte)
|
||||
|
||||
//logger.Logger.Trace("======end=======init dif coin", playerEx.Coin-playerEx.SlotsSession.Coin()/fortunemouse.NowByte)
|
||||
|
||||
if playerEx.Coin != int64(data.FinalCoin) {
|
||||
logger.Logger.Error("==========playerEx.Coin != data.FinalCoin==============", (float64(playerEx.Coin)-data.FinalCoin)/10000)
|
||||
}
|
||||
pack := &protocol.SCFortuneMouseBilled{
|
||||
OpRetCode: proto.Int32(0),
|
||||
GameEndStr: proto.String(gameEndStr),
|
||||
}
|
||||
proto.SetDefaults(pack)
|
||||
logger.Logger.Trace("SCFortuneMouseBilled", pack.String())
|
||||
playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED), pack)
|
||||
|
||||
// 记录本次操作
|
||||
FortuneMouseAndSaveLog(sceneEx, playerEx, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 玩家事件
|
||||
func (this *SceneStateStartFortuneMouse) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||
logger.Logger.Trace("(this *SceneStateStartFortuneMouse) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode)
|
||||
this.SceneBaseStateFortuneMouse.OnPlayerEvent(s, p, evtcode, params)
|
||||
}
|
||||
|
||||
func (this *SceneStateStartFortuneMouse) OnTick(s *base.Scene) {
|
||||
this.SceneBaseStateFortuneMouse.OnTick(s)
|
||||
}
|
||||
|
||||
// //////////////////////////////////////////////////////////////////////////////
|
||||
func (this *ScenePolicyFortuneMouse) RegisteSceneState(state base.SceneState) {
|
||||
if state == nil {
|
||||
return
|
||||
}
|
||||
stateid := state.GetState()
|
||||
if stateid < 0 || stateid >= fortunemouse.FortuneMouseStateMax {
|
||||
return
|
||||
}
|
||||
this.states[stateid] = state
|
||||
}
|
||||
|
||||
func (this *ScenePolicyFortuneMouse) GetSceneState(s *base.Scene, stateid int) base.SceneState {
|
||||
if stateid >= 0 && stateid < fortunemouse.FortuneMouseStateMax {
|
||||
return this.states[stateid]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMousePlayerData, data assemble.GameEnd) {
|
||||
if !playerEx.IsRob {
|
||||
data.SnId = playerEx.SnId
|
||||
var respinStatus int
|
||||
if data.Results[0].ArrSpins[0].Special != nil {
|
||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||
var spinLock SpinLock
|
||||
json.Unmarshal(sp, &spinLock)
|
||||
respinStatus = spinLock.ReSpinStatus
|
||||
}
|
||||
if respinStatus == 0 || respinStatus == 1 {
|
||||
data.TotalBet = 0
|
||||
}
|
||||
info, err := model.MarshalGameNoteByROLL(data)
|
||||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
var totalin, totalout int64
|
||||
if respinStatus == 0 || respinStatus == 1 {
|
||||
totalin = playerEx.totalBet
|
||||
}
|
||||
if respinStatus == 0 || respinStatus == 3 {
|
||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: playerEx.totalBet,
|
||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: totalin == 0,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//统计输下注金币数
|
||||
if !sceneEx.Testing && !playerEx.IsRob {
|
||||
playerBet := &server.PlayerData{
|
||||
SnId: proto.Int32(playerEx.SnId),
|
||||
Bet: proto.Int64(playerEx.CurrentBet),
|
||||
Gain: proto.Int64(int64(data.RoundReward) + playerEx.taxCoin),
|
||||
Tax: proto.Int64(playerEx.taxCoin),
|
||||
Coin: proto.Int64(playerEx.GetCoin()),
|
||||
GameCoinTs: proto.Int64(playerEx.GameCoinTs),
|
||||
}
|
||||
gwPlayerBet := &server.GWPlayerData{
|
||||
SceneId: sceneEx.SceneId,
|
||||
GameFreeId: proto.Int32(sceneEx.GetDBGameFree().GetId()),
|
||||
}
|
||||
gwPlayerBet.Datas = append(gwPlayerBet.Datas, playerBet)
|
||||
sceneEx.SyncPlayerDatas(&base.PlayerDataParam{
|
||||
HasRobotGaming: false,
|
||||
Data: gwPlayerBet,
|
||||
})
|
||||
}
|
||||
|
||||
playerEx.taxCoin = 0
|
||||
playerEx.winCoin = 0
|
||||
|
||||
if sceneEx.CheckNeedDestroy() && data.Results[0].FreeNum <= 0 {
|
||||
sceneEx.SceneDestroy(true)
|
||||
}
|
||||
}
|
||||
func init() {
|
||||
//主状态
|
||||
ScenePolicyFortuneMouseSington.RegisteSceneState(&SceneStateStartFortuneMouse{})
|
||||
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
|
||||
base.RegisteScenePolicy(common.GameId_FortuneMouse, fortunemouse.RoomMode_Classic, ScenePolicyFortuneMouseSington)
|
||||
return nil
|
||||
})
|
||||
}
|
|
@ -405,6 +405,7 @@ func (this *SceneStateStartFortuneOx) OnPlayerOp(s *base.Scene, p *base.Player,
|
|||
var gameEndStr string
|
||||
var data assemble.GameEnd
|
||||
if err == nil {
|
||||
s.SetGameNowTime(time.Now())
|
||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||
var respinStatus int
|
||||
if data.Results[0].ArrSpins[0].Special != nil {
|
||||
|
@ -510,40 +511,49 @@ func (this *ScenePolicyFortuneOx) GetSceneState(s *base.Scene, stateid int) base
|
|||
func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerData, data assemble.GameEnd) {
|
||||
if !playerEx.IsRob {
|
||||
data.SnId = playerEx.SnId
|
||||
if data.Results[0].FreeStatus != 1 && data.Results[0].FreeNumMax != 0 {
|
||||
var respinStatus int
|
||||
if data.Results[0].ArrSpins[0].Special != nil {
|
||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||
var spinLock SpinLock
|
||||
json.Unmarshal(sp, &spinLock)
|
||||
respinStatus = spinLock.ReSpinStatus
|
||||
}
|
||||
if respinStatus != 0 && respinStatus != 1 {
|
||||
data.TotalBet = 0
|
||||
}
|
||||
|
||||
info, err := model.MarshalGameNoteByROLL(data)
|
||||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
var totalin, totalout int64
|
||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||
if respinStatus == 0 || respinStatus == 1 {
|
||||
totalin = playerEx.totalBet
|
||||
}
|
||||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||
if respinStatus == 0 || respinStatus == 3 {
|
||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||
}
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: playerEx.totalBet,
|
||||
BetAmount: totalin,
|
||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
IsFree: totalin == 0,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -405,6 +405,7 @@ func (this *SceneStateStartFortuneRabbit) OnPlayerOp(s *base.Scene, p *base.Play
|
|||
var gameEndStr string
|
||||
var data assemble.GameEnd
|
||||
if err == nil {
|
||||
s.SetGameNowTime(time.Now())
|
||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||
//第一次触发或者正常模式
|
||||
|
@ -511,7 +512,11 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
var totalin, totalout int64
|
||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||
totalin = playerEx.totalBet
|
||||
|
@ -519,25 +524,22 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR
|
|||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||
}
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: playerEx.totalBet,
|
||||
BetAmount: totalin,
|
||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
IsFree: playerEx.isFree,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -405,10 +405,14 @@ func (this *SceneStateStartFortuneTiger) OnPlayerOp(s *base.Scene, p *base.Playe
|
|||
var gameEndStr string
|
||||
var data assemble.GameEnd
|
||||
if err == nil {
|
||||
s.SetGameNowTime(time.Now())
|
||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||
var respinStatus int
|
||||
if data.Results[0].ArrSpins[0].Special != nil {
|
||||
respinStatus = data.Results[0].ArrSpins[0].Special.(SpinLock).ReSpinStatus
|
||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||
var spinLock SpinLock
|
||||
json.Unmarshal(sp, &spinLock)
|
||||
respinStatus = spinLock.ReSpinStatus
|
||||
}
|
||||
if respinStatus == 0 || respinStatus == 1 {
|
||||
//第一次触发或者正常模式
|
||||
|
@ -514,7 +518,11 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
var totalin, totalout int64
|
||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||
totalin = playerEx.totalBet
|
||||
|
@ -522,25 +530,22 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig
|
|||
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||
}
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: playerEx.totalBet,
|
||||
BetAmount: totalin,
|
||||
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
IsFree: totalin == 0,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -326,7 +326,11 @@ func (s *FruitsSceneData) SaveLog(p *FruitsPlayerData, isOffline int) {
|
|||
info, err := model.MarshalGameNoteByROLL(&FruitsType)
|
||||
if err == nil {
|
||||
logId, _ := model.AutoIncGameLogId()
|
||||
s.SaveGameDetailedLog(logId, info, &base.GameDetailedParam{})
|
||||
s.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logId,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
//水池上下文环境s
|
||||
s.CpCtx = p.cpCtx
|
||||
var totalIn, totalOut int64
|
||||
|
@ -336,22 +340,22 @@ func (s *FruitsSceneData) SaveLog(p *FruitsPlayerData, isOffline int) {
|
|||
if nowGetCoin > 0 && isF {
|
||||
totalOut = p.Coin - p.startCoin + betCoin /*+ p.taxCoin*/
|
||||
}
|
||||
s.SaveGamePlayerListLog(p.SnId,
|
||||
&base.SaveGamePlayerListLogParam{
|
||||
Platform: p.Platform,
|
||||
Channel: p.Channel,
|
||||
Promoter: p.BeUnderAgentCode,
|
||||
PackageTag: p.PackageID,
|
||||
InviterId: p.InviterId,
|
||||
LogId: logId,
|
||||
TotalIn: totalIn,
|
||||
TotalOut: totalOut,
|
||||
TaxCoin: p.taxCoin,
|
||||
ClubPumpCoin: 0,
|
||||
BetAmount: totalIn,
|
||||
WinAmountNoAnyTax: p.Coin - p.startCoin,
|
||||
IsFirstGame: s.IsPlayerFirst(p.Player),
|
||||
})
|
||||
s.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logId,
|
||||
Platform: p.Platform,
|
||||
Snid: p.SnId,
|
||||
PlayerName: p.Name,
|
||||
Channel: p.Channel,
|
||||
ChannelId: p.ChannelId,
|
||||
TotalIn: totalIn,
|
||||
TotalOut: totalOut,
|
||||
TaxCoin: p.taxCoin,
|
||||
BetAmount: totalIn,
|
||||
WinAmountNoAnyTax: p.Coin - p.startCoin,
|
||||
IsFirstGame: s.IsPlayerFirst(p.Player),
|
||||
IsFree: totalIn == 0,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
s.GameNowTime = time.Now()
|
||||
if s.CheckNeedDestroy() && p.freeTimes == 0 && p.maryFreeTimes == 0 {
|
||||
|
|
|
@ -942,31 +942,31 @@ func IceAgeCheckAndSaveLog(sceneEx *IceAgeSceneData, playerEx *IceAgePlayerData)
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
totalin := int64(playerEx.RollGameType.BaseResult.TotalBet)
|
||||
totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet),
|
||||
WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: playerEx.RollGameType.BaseResult.IsFree,
|
||||
WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame,
|
||||
WinTotal: playerEx.RollGameType.BaseResult.WinTotal,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import (
|
|||
_ "mongo.games.com/game/gamesrv/caishen"
|
||||
_ "mongo.games.com/game/gamesrv/easterisland"
|
||||
_ "mongo.games.com/game/gamesrv/fortunedragon"
|
||||
_ "mongo.games.com/game/gamesrv/fortunemouse"
|
||||
_ "mongo.games.com/game/gamesrv/fortuneox"
|
||||
_ "mongo.games.com/game/gamesrv/fortunerabbit"
|
||||
_ "mongo.games.com/game/gamesrv/fortunetiger"
|
||||
|
|
|
@ -348,7 +348,11 @@ func (s *RichBlessedSceneData) SaveLog(p *RichBlessedPlayerData, isOffline int)
|
|||
info, err := model.MarshalGameNoteByROLL(&RichBlessed)
|
||||
if err == nil {
|
||||
logId, _ := model.AutoIncGameLogId()
|
||||
s.SaveGameDetailedLog(logId, info, &base.GameDetailedParam{})
|
||||
s.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logId,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
//水池上下文环境s
|
||||
s.CpCtx = p.cpCtx
|
||||
var totalIn, totalOut int64
|
||||
|
@ -358,22 +362,22 @@ func (s *RichBlessedSceneData) SaveLog(p *RichBlessedPlayerData, isOffline int)
|
|||
if nowGetCoin > 0 {
|
||||
totalOut = p.Coin - p.startCoin + betCoin /*+ p.taxCoin*/
|
||||
}
|
||||
s.SaveGamePlayerListLog(p.SnId,
|
||||
&base.SaveGamePlayerListLogParam{
|
||||
Platform: p.Platform,
|
||||
Channel: p.Channel,
|
||||
Promoter: p.BeUnderAgentCode,
|
||||
PackageTag: p.PackageID,
|
||||
InviterId: p.InviterId,
|
||||
LogId: logId,
|
||||
TotalIn: totalIn,
|
||||
TotalOut: totalOut,
|
||||
TaxCoin: p.taxCoin,
|
||||
ClubPumpCoin: 0,
|
||||
BetAmount: totalIn,
|
||||
WinAmountNoAnyTax: p.Coin - p.startCoin,
|
||||
IsFirstGame: s.IsPlayerFirst(p.Player),
|
||||
})
|
||||
s.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logId,
|
||||
Platform: p.Platform,
|
||||
Snid: p.SnId,
|
||||
PlayerName: p.Name,
|
||||
Channel: p.Channel,
|
||||
ChannelId: p.ChannelId,
|
||||
TotalIn: totalIn,
|
||||
TotalOut: totalOut,
|
||||
TaxCoin: p.taxCoin,
|
||||
BetAmount: totalIn,
|
||||
WinAmountNoAnyTax: p.Coin - p.startCoin,
|
||||
IsFirstGame: s.IsPlayerFirst(p.Player),
|
||||
IsFree: totalIn == 0,
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
s.GameNowTime = time.Now()
|
||||
if s.CheckNeedDestroy() && p.freeTimes == 0 {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package errors
|
||||
|
||||
import "github.com/idealeak/goserver/core/logger"
|
||||
import "mongo.games.com/goserver/core/logger"
|
||||
|
||||
var (
|
||||
begins = []Code{ErrorBegin}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package slots
|
||||
|
||||
import (
|
||||
"github.com/idealeak/goserver/core/logger"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/errors"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/global"
|
||||
|
@ -10,6 +9,7 @@ import (
|
|||
"mongo.games.com/game/gamesrv/slotspkg/internal/module/shared"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/slots/machine"
|
||||
"mongo.games.com/game/gamesrv/slotspkg/slots/types/cli"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
)
|
||||
|
||||
func (sm *SlotsMgr) Enter(s *base.SlotsSession, gameId int64) (*cli.SlotsEnterResponse, error) {
|
||||
|
|
|
@ -33,6 +33,7 @@ type PlayerData struct {
|
|||
|
||||
Platform string //平台
|
||||
Channel string //渠道信息
|
||||
ChannelId string
|
||||
PackageID string //推广包标识 对应客户端的packagetag
|
||||
flag int
|
||||
}
|
||||
|
@ -333,6 +334,7 @@ func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) {
|
|||
flag: p.GetFlag(),
|
||||
Platform: p.Platform,
|
||||
Channel: p.Channel,
|
||||
ChannelId: p.ChannelId,
|
||||
PackageID: p.PackageID,
|
||||
CurIsWin: p.CurIsWin,
|
||||
Name: p.Name,
|
||||
|
|
|
@ -1166,33 +1166,28 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
if !playerEx.IsRob {
|
||||
info, err := model.MarshalGameNoteByHUNDRED(LogBaseResult)
|
||||
if err == nil {
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: sceneEx.logid,
|
||||
Detail: info,
|
||||
})
|
||||
}
|
||||
|
||||
totalin := int64(TotalBetValue)
|
||||
totalout := playerEx.gainCoin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: sceneEx.logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(TotalBetValue),
|
||||
WinAmountNoAnyTax: playerEx.gainCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: false,
|
||||
WinSmallGame: 0,
|
||||
WinTotal: 0,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
IsFirstGame: s.IsPlayerFirst(playerEx.Player),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1248,34 +1243,30 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
if !playerEx.IsRob {
|
||||
info, err := model.MarshalGameNoteByHUNDRED(LogBaseResult)
|
||||
if err == nil {
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: sceneEx.logid,
|
||||
Detail: info,
|
||||
})
|
||||
}
|
||||
|
||||
totalin := int64(TotalBetValue)
|
||||
totalout := playerEx.gainCoin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
//validFlow := totalin + totalout
|
||||
//validBet := common.AbsI64(totalin - totalout)
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: sceneEx.logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(TotalBetValue),
|
||||
WinAmountNoAnyTax: playerEx.gainCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: playerEx.IsPlayerFirst,
|
||||
IsFree: false,
|
||||
WinSmallGame: 0,
|
||||
WinTotal: 0,
|
||||
PlayerName: playerEx.Name,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -778,31 +778,31 @@ func TamQuocCheckAndSaveLog(sceneEx *TamQuocSceneData, playerEx *TamQuocPlayerDa
|
|||
if err == nil {
|
||||
logid, _ := model.AutoIncGameLogId()
|
||||
playerEx.currentLogId = logid
|
||||
sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{})
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: logid,
|
||||
Detail: info,
|
||||
GameTime: 2,
|
||||
})
|
||||
totalin := int64(playerEx.RollGameType.BaseResult.TotalBet)
|
||||
totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
logParam := &base.SaveGamePlayerListLogParam{
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet),
|
||||
WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin,
|
||||
ValidBet: validBet,
|
||||
ValidFlow: validFlow,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||
IsFree: playerEx.RollGameType.BaseResult.IsFree,
|
||||
WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame,
|
||||
WinTotal: playerEx.RollGameType.BaseResult.WinTotal,
|
||||
}
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam)
|
||||
GameTime: 2,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ type PlayerEx struct {
|
|||
cards [13]int //手牌信息
|
||||
allGroup map[int]*thirteen.Group //玩家所有牌型
|
||||
cardsO *thirteen.Group //确定的牌型信息
|
||||
preCardsO *thirteen.Group //预确定的牌型
|
||||
isDP bool // 是否倒排
|
||||
gainCoin int64 //本局赢的金币
|
||||
taxCoin int64 //本局税收
|
||||
|
@ -36,6 +37,7 @@ func (this *PlayerEx) Clear() {
|
|||
}
|
||||
this.allGroup = make(map[int]*thirteen.Group)
|
||||
this.cardsO = &thirteen.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1}
|
||||
this.preCardsO = &thirteen.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1}
|
||||
this.isDP = false
|
||||
this.gainCoin = 0
|
||||
this.taxCoin = 0
|
||||
|
|
|
@ -487,6 +487,7 @@ func (this *SceneEx) GetScore(player *PlayerEx) {
|
|||
player.winAllPlayers[p.Pos] += rate
|
||||
p.winAllPlayers[player.Pos] -= rate
|
||||
player.tableScore[3] += rate - 1
|
||||
p.tableScore[3] -= rate - 1
|
||||
}
|
||||
//中墩
|
||||
rate = int64(1)
|
||||
|
@ -509,6 +510,7 @@ func (this *SceneEx) GetScore(player *PlayerEx) {
|
|||
player.winAllPlayers[p.Pos] += rate
|
||||
p.winAllPlayers[player.Pos] -= rate
|
||||
player.tableScore[4] += rate - 1
|
||||
p.tableScore[4] -= rate - 1
|
||||
}
|
||||
//尾墩
|
||||
rate = int64(1)
|
||||
|
@ -529,6 +531,7 @@ func (this *SceneEx) GetScore(player *PlayerEx) {
|
|||
player.winAllPlayers[p.Pos] += rate
|
||||
p.winAllPlayers[player.Pos] -= rate
|
||||
player.tableScore[5] += rate - 1
|
||||
p.tableScore[5] -= rate - 1
|
||||
}
|
||||
if s == 3 {
|
||||
player.winThreePos[p.Pos] = score
|
||||
|
@ -1097,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,11 +181,22 @@ func (this *PolicyThirteen) OnPlayerLeave(s *base.Scene, p *base.Player, reason
|
|||
} else {
|
||||
totalin -= playerEx.gainCoin
|
||||
}
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
sceneEx.SaveGamePlayerListLog(playerEx.SnId, base.GetSaveGamePlayerListLogParam(playerEx.Platform, playerEx.Channel, playerEx.BeUnderAgentCode,
|
||||
playerEx.PackageID, sceneEx.logid, playerEx.InviterId, totalin, totalout, playerEx.taxCoin,
|
||||
0, 0, playerEx.gainCoin, validBet, validFlow, sceneEx.IsPlayerFirst(sceneEx.GetPlayer(playerEx.SnId)), false))
|
||||
//validFlow := totalin + totalout
|
||||
//validBet := common.AbsI64(totalin - totalout)
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: sceneEx.logid,
|
||||
Platform: playerEx.Platform,
|
||||
Snid: playerEx.SnId,
|
||||
PlayerName: playerEx.Name,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: playerEx.taxCoin,
|
||||
BetAmount: 0,
|
||||
WinAmountNoAnyTax: playerEx.gainCoin,
|
||||
IsFirstGame: sceneEx.IsPlayerFirst(sceneEx.GetPlayer(playerEx.SnId)),
|
||||
})
|
||||
|
||||
sceneEx.Statistics(&base.StaticParam{
|
||||
SnId: playerEx.SnId,
|
||||
|
@ -855,10 +866,15 @@ func (this *StateOp) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, param
|
|||
copy(playerEx.cardsO.Mid[:], common.Int64Toint(params[3:8]))
|
||||
copy(playerEx.cardsO.End[:], common.Int64Toint(params[8:]))
|
||||
playerEx.cardsO.PokerType = 0
|
||||
tp := sceneEx.logic.GetSpecialType(playerEx.cards)
|
||||
if tp > 0 {
|
||||
playerEx.cardsO.PokerType = tp
|
||||
}
|
||||
sceneEx.SendSelectCards(playerEx, 0, int64(opcode))
|
||||
} else {
|
||||
sceneEx.SendSelectCards(playerEx, int(params[0]), int64(opcode))
|
||||
}
|
||||
playerEx.preCardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1}
|
||||
playerEx.Trusteeship = 0
|
||||
playerEx.UnmarkFlag(base.PlayerState_Auto)
|
||||
playerEx.deterMine = true
|
||||
|
@ -875,6 +891,38 @@ func (this *StateOp) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, param
|
|||
//提前进入亮牌阶段
|
||||
s.ChangeSceneState(rule.ThirteenWaterSceneStateShowCards)
|
||||
}
|
||||
|
||||
case rule.ThirteenWaterPlayerOpSelect:
|
||||
playerEx.deterMine = false
|
||||
playerEx.cardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1}
|
||||
playerEx.Trusteeship = 0
|
||||
playerEx.UnmarkFlag(base.PlayerState_Auto)
|
||||
pack := &thirteen.SCThirteenPlayerOp{
|
||||
OpRetCode: thirteen.OpResultCode_OPRC_Sucess,
|
||||
OpCode: int32(opcode),
|
||||
OpParam: params,
|
||||
Pos: int32(playerEx.GetPos()),
|
||||
}
|
||||
if len(params) == 13 {
|
||||
//校验牌
|
||||
a := rule.DelCards(playerEx.cards[:], common.Int64Toint(params))
|
||||
if len(a) != 0 {
|
||||
logger.Logger.Error("the cards is error.")
|
||||
returnFunc(thirteen.OpResultCode_OPRC_Error)
|
||||
return true
|
||||
}
|
||||
//牌赋值
|
||||
copy(playerEx.preCardsO.Head[:], common.Int64Toint(params[:3]))
|
||||
copy(playerEx.preCardsO.Mid[:], common.Int64Toint(params[3:8]))
|
||||
copy(playerEx.preCardsO.End[:], common.Int64Toint(params[8:]))
|
||||
playerEx.preCardsO.PokerType = 0
|
||||
tp := sceneEx.logic.GetSpecialType(playerEx.cards)
|
||||
if tp > 0 {
|
||||
playerEx.preCardsO.PokerType = tp
|
||||
}
|
||||
}
|
||||
playerEx.SendToClient(int(thirteen.TWMmoPacketID_PACKET_SCThirteenPlayerOp), pack)
|
||||
|
||||
case rule.ThirteenWaterPlayerOpReset:
|
||||
// 取消确认
|
||||
playerEx.deterMine = false
|
||||
|
@ -902,8 +950,13 @@ func (this *StateOp) OnLeave(s *base.Scene) {
|
|||
|
||||
for _, player := range sceneEx.players {
|
||||
if player != nil && player.IsGameing() {
|
||||
// 使用预选牌
|
||||
if player.preCardsO != nil && player.preCardsO.PokerType != -1 && (player.cardsO == nil || player.cardsO.PokerType == -1) {
|
||||
player.cardsO = player.preCardsO
|
||||
}
|
||||
// 判断是否倒水
|
||||
if player.cardsO != nil && player.cardsO.PokerType != -1 {
|
||||
if player.cardsO.PokerType < 1000000 {
|
||||
if player.cardsO.PokerType == 0 {
|
||||
player.isDP = sceneEx.logic.IsDP(player.cardsO.Head, player.cardsO.Mid, player.cardsO.End)
|
||||
}
|
||||
continue
|
||||
|
@ -1223,11 +1276,8 @@ func (this *StateHit) OnEnter(s *base.Scene) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if sceneEx.isCanAllHitPos != -1 {
|
||||
hitNum++
|
||||
}
|
||||
// 每个打枪加1秒,全垒打再加1秒
|
||||
sceneEx.hitTime += time.Second * (time.Duration(hitNum))
|
||||
// 每个打枪加2秒,全垒打再加2秒
|
||||
sceneEx.hitTime += time.Second * 2 * (time.Duration(hitNum))
|
||||
sceneEx.ShowCards()
|
||||
}
|
||||
}
|
||||
|
@ -1323,7 +1373,7 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
RoomType: sceneEx.GetSceneType(),
|
||||
BaseScore: int32(sceneEx.GetBaseScore()),
|
||||
NowRound: int32(sceneEx.NumOfGames),
|
||||
ClubRate: sceneEx.Scene.PumpCoin,
|
||||
TaxRate: s.GetDBGameFree().GetTaxRate(),
|
||||
}
|
||||
var person []model.ThirteenWaterPerson
|
||||
for _, o_player := range sceneEx.players {
|
||||
|
@ -1390,11 +1440,20 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
} else {
|
||||
totalin -= o_player.gainCoin
|
||||
}
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
sceneEx.SaveGamePlayerListLog(o_player.SnId, base.GetSaveGamePlayerListLogParam(o_player.Platform, o_player.Channel, o_player.BeUnderAgentCode,
|
||||
o_player.PackageID, sceneEx.logid, o_player.InviterId, totalin, totalout, o_player.taxCoin,
|
||||
0, 0, o_player.gainCoin, validBet, validFlow, p.IsFirst, false))
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: sceneEx.logid,
|
||||
Platform: o_player.Platform,
|
||||
Snid: o_player.SnId,
|
||||
PlayerName: o_player.Name,
|
||||
Channel: o_player.Channel,
|
||||
ChannelId: o_player.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: o_player.taxCoin,
|
||||
BetAmount: 0,
|
||||
WinAmountNoAnyTax: o_player.gainCoin,
|
||||
IsFirstGame: p.IsFirst,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1453,10 +1512,11 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
thirteenWaterType.PlayerCount = len(person)
|
||||
info, err := model.MarshalGameNoteByFIGHT(&thirteenWaterType)
|
||||
if err == nil {
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{
|
||||
Trend20Lately: "",
|
||||
CtrlType: sceneEx.ctrlType,
|
||||
PlayerPool: playerPool,
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: sceneEx.logid,
|
||||
Detail: info,
|
||||
CtrlType: sceneEx.ctrlType,
|
||||
PlayerPool: playerPool,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1737,6 +1737,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: playerEx.Head,
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
|
@ -1888,6 +1889,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: losePlayer.Head,
|
||||
Platform: losePlayer.Platform,
|
||||
Channel: losePlayer.Channel,
|
||||
ChannelId: losePlayer.ChannelId,
|
||||
Promoter: losePlayer.BeUnderAgentCode,
|
||||
PackageTag: losePlayer.PackageID,
|
||||
InviterId: losePlayer.InviterId,
|
||||
|
@ -2030,6 +2032,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: lastWinPlayer.Head,
|
||||
Platform: lastWinPlayer.Platform,
|
||||
Channel: lastWinPlayer.Channel,
|
||||
ChannelId: lastWinPlayer.ChannelId,
|
||||
Promoter: lastWinPlayer.BeUnderAgentCode,
|
||||
PackageTag: lastWinPlayer.PackageID,
|
||||
InviterId: lastWinPlayer.InviterId,
|
||||
|
@ -2141,6 +2144,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: playerEx.Head,
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
|
@ -2246,6 +2250,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: playerEx.Head,
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
|
@ -2397,6 +2402,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: playerEx.Head,
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
|
@ -2527,6 +2533,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
UserIcon: playerEx.Head,
|
||||
Platform: playerEx.Platform,
|
||||
Channel: playerEx.Channel,
|
||||
ChannelId: playerEx.ChannelId,
|
||||
Promoter: playerEx.BeUnderAgentCode,
|
||||
PackageTag: playerEx.PackageID,
|
||||
InviterId: playerEx.InviterId,
|
||||
|
@ -2729,8 +2736,6 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
playerEx.UpdatePigBankCoin(o_player.GainCoin)
|
||||
}
|
||||
|
||||
validFlow := totalin + totalout
|
||||
validBet := common.AbsI64(totalin - totalout)
|
||||
sceneEx.SaveFriendRecord(o_player.UserId, o_player.IsWin, o_player.BillCoin, sceneEx.GetBaseScore())
|
||||
|
||||
// 玩家数据统计
|
||||
|
@ -2752,20 +2757,29 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
|||
})
|
||||
|
||||
// 保存玩家游戏记录
|
||||
param := base.GetSaveGamePlayerListLogParam(o_player.Platform, o_player.Channel, o_player.Promoter,
|
||||
o_player.PackageTag, sceneEx.recordId, o_player.InviterId, totalin, totalout, o_player.BillTaxCoin,
|
||||
0, 0, o_player.GainCoin+o_player.BombCoin, validBet, validFlow, o_player.IsFirst, o_player.IsLeave)
|
||||
param.CycleId = sceneEx.CycleID
|
||||
sceneEx.SaveGamePlayerListLog(o_player.UserId, param)
|
||||
sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{
|
||||
LogId: sceneEx.recordId,
|
||||
Platform: o_player.Platform,
|
||||
Snid: o_player.UserId,
|
||||
Channel: o_player.Channel,
|
||||
ChannelId: o_player.ChannelId,
|
||||
TotalIn: totalin,
|
||||
TotalOut: totalout,
|
||||
TaxCoin: o_player.BillTaxCoin,
|
||||
BetAmount: 0,
|
||||
WinAmountNoAnyTax: o_player.GainCoin + o_player.BombCoin,
|
||||
IsFirstGame: o_player.IsFirst,
|
||||
})
|
||||
}
|
||||
}
|
||||
if isSave {
|
||||
// 牌局记录
|
||||
sceneEx.SaveGameDetailedLog(sceneEx.recordId, info, &base.GameDetailedParam{
|
||||
sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{
|
||||
LogId: sceneEx.recordId,
|
||||
Detail: info,
|
||||
Trend20Lately: "",
|
||||
CtrlType: sceneEx.ctrlType,
|
||||
PlayerPool: tienlenType.PlayerPool,
|
||||
CycleId: sceneEx.CycleID,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
11
go.mod
11
go.mod
|
@ -16,7 +16,6 @@ require (
|
|||
github.com/golang-jwt/jwt/v4 v4.5.1
|
||||
github.com/google/go-querystring v1.1.0
|
||||
github.com/howeyc/fsnotify v0.9.0
|
||||
github.com/idealeak/goserver v0.0.0-20201014040547-b8f686262078
|
||||
github.com/jinzhu/now v1.1.5
|
||||
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
|
||||
github.com/mojocn/base64Captcha v1.3.6
|
||||
|
@ -26,13 +25,13 @@ require (
|
|||
github.com/tomas-qstarrs/boost v1.0.3
|
||||
github.com/tomas-qstarrs/excel-converter v1.0.2
|
||||
github.com/wendal/errors v0.0.0-20181209125328-7f31f4b264ec
|
||||
github.com/xuri/excelize/v2 v2.9.0
|
||||
github.com/zegoim/zego_server_assistant/token/go/src v0.0.0-20231013093807-4e80bab42ec3
|
||||
github.com/zeromicro/go-zero v1.7.3
|
||||
go.etcd.io/etcd/client/v3 v3.5.16
|
||||
go.mongodb.org/mongo-driver v1.17.1
|
||||
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
|
||||
google.golang.org/protobuf v1.35.1
|
||||
gorm.io/driver/mysql v1.5.7
|
||||
gorm.io/gorm v1.25.12
|
||||
mongo.games.com/goserver v0.0.0-00010101000000-000000000000
|
||||
)
|
||||
|
@ -70,7 +69,7 @@ require (
|
|||
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/richardlehane/mscfb v1.0.4 // indirect
|
||||
github.com/richardlehane/msoleps v1.0.3 // indirect
|
||||
github.com/richardlehane/msoleps v1.0.4 // indirect
|
||||
github.com/sagikazarmark/locafero v0.4.0 // indirect
|
||||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
|
||||
github.com/shopspring/decimal v1.3.1 // indirect
|
||||
|
@ -92,7 +91,8 @@ require (
|
|||
github.com/xdg-go/scram v1.1.2 // indirect
|
||||
github.com/xdg-go/stringprep v1.0.4 // indirect
|
||||
github.com/xtaci/kcp-go v5.4.20+incompatible // indirect
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect
|
||||
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect
|
||||
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.16 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect
|
||||
|
@ -103,7 +103,7 @@ require (
|
|||
go.uber.org/multierr v1.9.0 // indirect
|
||||
go.uber.org/zap v1.24.0 // indirect
|
||||
golang.org/x/crypto v0.28.0 // indirect
|
||||
golang.org/x/image v0.13.0 // indirect
|
||||
golang.org/x/image v0.18.0 // indirect
|
||||
golang.org/x/net v0.30.0 // indirect
|
||||
golang.org/x/sync v0.8.0 // indirect
|
||||
golang.org/x/sys v0.26.0 // indirect
|
||||
|
@ -115,4 +115,5 @@ require (
|
|||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
gorm.io/driver/mysql v1.5.7 // indirect
|
||||
)
|
||||
|
|
17
go.sum
17
go.sum
|
@ -157,8 +157,6 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T
|
|||
github.com/howeyc/fsnotify v0.9.0 h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY=
|
||||
github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/idealeak/goserver v0.0.0-20201014040547-b8f686262078 h1:0Z5Im7EJiMKEiIQPPApdK0uOtyV5Ylo9wA3N9jWrfsU=
|
||||
github.com/idealeak/goserver v0.0.0-20201014040547-b8f686262078/go.mod h1:ozCWDPw33jhq/GX7nsWS0cFCm5Jyag/Fy0LSQpKXT1I=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/innopals/sls-logrus-hook v0.0.0-20190808032145-2fe1d6f7ce00 h1:QfdUfoZWIzBZ/FMtdUE/3wUwzsMU+PGTld17NDBld3k=
|
||||
github.com/innopals/sls-logrus-hook v0.0.0-20190808032145-2fe1d6f7ce00/go.mod h1:Q24O6QMGImDU3WY71P4YAxNb36NNn5qaznCfMUoXVfc=
|
||||
|
@ -279,8 +277,8 @@ github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7
|
|||
github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM=
|
||||
github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk=
|
||||
github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
|
||||
github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM=
|
||||
github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
|
||||
github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00=
|
||||
github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||
|
@ -386,8 +384,12 @@ github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45
|
|||
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E=
|
||||
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0=
|
||||
github.com/xuri/efp v0.0.0-20200605144744-ba689101faaf/go.mod h1:uBiSUepVYMhGTfDeBKKasV4GpgBlzJ46gXUBAqV8qLk=
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 h1:6932x8ltq1w4utjmfMPVj09jdMlkY0aiA6+Skbtl3/c=
|
||||
github.com/xuri/efp v0.0.0-20220603152613-6918739fd470/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
|
||||
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d h1:llb0neMWDQe87IzJLS4Ci7psK/lVsjIS2otl+1WyRyY=
|
||||
github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
|
||||
github.com/xuri/excelize/v2 v2.9.0 h1:1tgOaEq92IOEumR1/JfYS/eR0KHOCsRv/rYXXh6YJQE=
|
||||
github.com/xuri/excelize/v2 v2.9.0/go.mod h1:uqey4QBZ9gdMeWApPLdhm9x+9o2lq4iVmjiLfBS5hdE=
|
||||
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A=
|
||||
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM=
|
||||
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
|
@ -441,8 +443,9 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL
|
|||
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
|
||||
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
|
||||
golang.org/x/image v0.0.0-20200922025426-e59bae62ef32/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg=
|
||||
golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk=
|
||||
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
|
||||
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
|
|
|
@ -275,49 +275,6 @@ type PlayerGameRecEvent struct {
|
|||
ChannelId string //推广渠道id
|
||||
}
|
||||
|
||||
func CreatePlayerGameRecEvent(snid int32, tax, taxex, amount, validbet, validflow, in, out int64, gameid, gameFreeId, modeid int32, recordId, channel, channelId, promoter,
|
||||
platform, city, os string, createDayTime time.Time, gamingTime int32, firstGameFreeTime, firstGameTime time.Time,
|
||||
playGameFreeTimes, playerGameTimes int64, lastLoginTime time.Time, teleponePromoter int32, deviceId string) *PlayerGameRecEvent {
|
||||
isNewbie := int32(0)
|
||||
tCreateDay := now.New(createDayTime).BeginningOfDay()
|
||||
if now.BeginningOfDay().Equal(tCreateDay) {
|
||||
isNewbie = 1
|
||||
}
|
||||
if gamingTime < 0 {
|
||||
gamingTime = 0
|
||||
}
|
||||
return &PlayerGameRecEvent{RecordId: recordId,
|
||||
SnId: snid,
|
||||
Channel: channel,
|
||||
Promoter: promoter,
|
||||
TelephonePromoter: teleponePromoter,
|
||||
Platform: platform,
|
||||
City: city,
|
||||
OS: os,
|
||||
GameId: gameid,
|
||||
ModeId: modeid,
|
||||
Tax: tax,
|
||||
//Taxex: taxex,
|
||||
Amount: amount,
|
||||
ValidBet: validbet,
|
||||
ValidFlow: validflow,
|
||||
In: in,
|
||||
Out: out,
|
||||
CreateTime: time.Now().Local().Unix(),
|
||||
CreateDayTime: tCreateDay.Local().Unix(),
|
||||
IsNew: isNewbie,
|
||||
GameFreeID: gameFreeId,
|
||||
GamingTime: gamingTime,
|
||||
FirstTime: firstGameFreeTime.Unix(),
|
||||
FirstGameTime: firstGameTime.Unix(),
|
||||
PlayTimes: playGameFreeTimes,
|
||||
PlayGameTimes: playerGameTimes,
|
||||
LastLoginTime: lastLoginTime.Unix(),
|
||||
DeviceId: deviceId,
|
||||
ChannelId: channelId,
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家游戏记录
|
||||
//type PlayerGameRecPayEvent struct {
|
||||
// SnId int32 //用户ID
|
||||
|
|
|
@ -168,8 +168,8 @@ type ThirteenWaterType struct {
|
|||
NowRound int32 //当前局数
|
||||
PlayerCount int //玩家数量
|
||||
BaseScore int32 //底分
|
||||
TaxRate int32 //税率(万分比)
|
||||
PlayerData []ThirteenWaterPerson //玩家信息
|
||||
ClubRate int32 //俱乐部抽水比例
|
||||
}
|
||||
|
||||
type ThirteenWaterPoker struct {
|
||||
|
@ -1536,6 +1536,7 @@ type TienLenPerson struct {
|
|||
UserIcon int32 //玩家头像
|
||||
Platform string `json:"-"`
|
||||
Channel string `json:"-"`
|
||||
ChannelId string `json:"-"`
|
||||
Promoter string `json:"-"`
|
||||
PackageTag string `json:"-"`
|
||||
InviterId int32 `json:"-"`
|
||||
|
@ -1581,6 +1582,7 @@ type ChesstitiansPerson struct {
|
|||
UserIcon int32 //玩家头像
|
||||
Platform string `json:"-"`
|
||||
Channel string `json:"-"`
|
||||
ChannelId string `json:"-"`
|
||||
Promoter string `json:"-"`
|
||||
PackageTag string `json:"-"`
|
||||
InviterId int32 `json:"-"`
|
||||
|
|
|
@ -51,7 +51,7 @@ type GamePlayerListLog struct {
|
|||
GameClass int32 //游戏类型 1棋牌 2电子 3百人 4捕鱼 5视讯 6彩票 7体育
|
||||
MatchId int64
|
||||
MatchType int64 //0.普通场 1.锦标赛 2.冠军赛 3.vip专属
|
||||
Ts int32
|
||||
Ts int64
|
||||
IsFree bool //拉霸专用 是否免费
|
||||
WinSmallGame int64 //拉霸专用 小游戏奖励
|
||||
WinTotal int64 //拉霸专用 输赢
|
||||
|
@ -95,7 +95,7 @@ func NewGamePlayerListLogEx(snid int32, gamedetailedlogid string, platform, chan
|
|||
cl.WinSmallGame = winSmallGame
|
||||
cl.WinTotal = winTotal
|
||||
tNow := time.Now()
|
||||
cl.Ts = int32(tNow.Unix())
|
||||
cl.Ts = tNow.Unix()
|
||||
cl.Time = tNow
|
||||
cl.MatchId = matchid
|
||||
cl.MatchType = matchType
|
||||
|
|
|
@ -0,0 +1,799 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: protocol/cashmania/cashmania.proto
|
||||
|
||||
package cashmania
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
//cashmania
|
||||
//龙
|
||||
type CashManiaPID int32
|
||||
|
||||
const (
|
||||
CashManiaPID_PACKET_CASHMANIA_ZERO CashManiaPID = 0 // 弃用消息号
|
||||
CashManiaPID_PACKET_CASHMANIA_SCCASHMANIAROOMINFO CashManiaPID = 5650 //房间信息
|
||||
CashManiaPID_PACKET_CASHMANIA_CSCASHMANIAOP CashManiaPID = 5651
|
||||
CashManiaPID_PACKET_CASHMANIA_SCCASHMANIAOP CashManiaPID = 5652
|
||||
CashManiaPID_PACKET_CASHMANIA_SCCASHMANIAROOMSTATE CashManiaPID = 5653
|
||||
CashManiaPID_PACKET_CASHMANIA_SCCASHMANIABILLED CashManiaPID = 5654
|
||||
)
|
||||
|
||||
// Enum value maps for CashManiaPID.
|
||||
var (
|
||||
CashManiaPID_name = map[int32]string{
|
||||
0: "PACKET_CASHMANIA_ZERO",
|
||||
5650: "PACKET_CASHMANIA_SCCASHMANIAROOMINFO",
|
||||
5651: "PACKET_CASHMANIA_CSCASHMANIAOP",
|
||||
5652: "PACKET_CASHMANIA_SCCASHMANIAOP",
|
||||
5653: "PACKET_CASHMANIA_SCCASHMANIAROOMSTATE",
|
||||
5654: "PACKET_CASHMANIA_SCCASHMANIABILLED",
|
||||
}
|
||||
CashManiaPID_value = map[string]int32{
|
||||
"PACKET_CASHMANIA_ZERO": 0,
|
||||
"PACKET_CASHMANIA_SCCASHMANIAROOMINFO": 5650,
|
||||
"PACKET_CASHMANIA_CSCASHMANIAOP": 5651,
|
||||
"PACKET_CASHMANIA_SCCASHMANIAOP": 5652,
|
||||
"PACKET_CASHMANIA_SCCASHMANIAROOMSTATE": 5653,
|
||||
"PACKET_CASHMANIA_SCCASHMANIABILLED": 5654,
|
||||
}
|
||||
)
|
||||
|
||||
func (x CashManiaPID) Enum() *CashManiaPID {
|
||||
p := new(CashManiaPID)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x CashManiaPID) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (CashManiaPID) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_protocol_cashmania_cashmania_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (CashManiaPID) Type() protoreflect.EnumType {
|
||||
return &file_protocol_cashmania_cashmania_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x CashManiaPID) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CashManiaPID.Descriptor instead.
|
||||
func (CashManiaPID) EnumDescriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type CashManiaPlayerData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` //名字
|
||||
SnId int32 `protobuf:"varint,2,opt,name=SnId,proto3" json:"SnId,omitempty"` //账号
|
||||
Head int32 `protobuf:"varint,3,opt,name=Head,proto3" json:"Head,omitempty"` //头像
|
||||
Sex int32 `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` //性别
|
||||
Coin int64 `protobuf:"varint,5,opt,name=Coin,proto3" json:"Coin,omitempty"` //金币
|
||||
Pos int32 `protobuf:"varint,6,opt,name=Pos,proto3" json:"Pos,omitempty"` //座位位置
|
||||
Flag int32 `protobuf:"varint,7,opt,name=Flag,proto3" json:"Flag,omitempty"` //二进制标记
|
||||
Params []string `protobuf:"bytes,8,rep,name=Params,proto3" json:"Params,omitempty"` //其他数据 如:ip 等
|
||||
City string `protobuf:"bytes,9,opt,name=City,proto3" json:"City,omitempty"` //城市
|
||||
HeadOutLine int32 `protobuf:"varint,10,opt,name=HeadOutLine,proto3" json:"HeadOutLine,omitempty"` //头像框
|
||||
VIP int32 `protobuf:"varint,11,opt,name=VIP,proto3" json:"VIP,omitempty"`
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) Reset() {
|
||||
*x = CashManiaPlayerData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CashManiaPlayerData) ProtoMessage() {}
|
||||
|
||||
func (x *CashManiaPlayerData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CashManiaPlayerData.ProtoReflect.Descriptor instead.
|
||||
func (*CashManiaPlayerData) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetSnId() int32 {
|
||||
if x != nil {
|
||||
return x.SnId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetHead() int32 {
|
||||
if x != nil {
|
||||
return x.Head
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetSex() int32 {
|
||||
if x != nil {
|
||||
return x.Sex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetCoin() int64 {
|
||||
if x != nil {
|
||||
return x.Coin
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetPos() int32 {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetFlag() int32 {
|
||||
if x != nil {
|
||||
return x.Flag
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetParams() []string {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetCity() string {
|
||||
if x != nil {
|
||||
return x.City
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetHeadOutLine() int32 {
|
||||
if x != nil {
|
||||
return x.HeadOutLine
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CashManiaPlayerData) GetVIP() int32 {
|
||||
if x != nil {
|
||||
return x.VIP
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
//房间信息
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO
|
||||
type SCCashManiaRoomInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RoomId int32 `protobuf:"varint,1,opt,name=RoomId,proto3" json:"RoomId,omitempty"` //房间id
|
||||
GameFreeId int32 `protobuf:"varint,2,opt,name=GameFreeId,proto3" json:"GameFreeId,omitempty"`
|
||||
GameId int32 `protobuf:"varint,3,opt,name=GameId,proto3" json:"GameId,omitempty"` //游戏id
|
||||
RoomMode int32 `protobuf:"varint,4,opt,name=RoomMode,proto3" json:"RoomMode,omitempty"` //游戏模式
|
||||
Params []int32 `protobuf:"varint,5,rep,packed,name=Params,proto3" json:"Params,omitempty"` //规则参数
|
||||
NumOfGames int32 `protobuf:"varint,6,opt,name=NumOfGames,proto3" json:"NumOfGames,omitempty"` //当前第几局
|
||||
State int32 `protobuf:"varint,7,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态
|
||||
ParamsEx []int64 `protobuf:"varint,8,rep,packed,name=ParamsEx,proto3" json:"ParamsEx,omitempty"` //其他参数
|
||||
SceneType int32 `protobuf:"varint,9,opt,name=SceneType,proto3" json:"SceneType,omitempty"` //房间模式
|
||||
Player *CashManiaPlayerData `protobuf:"bytes,10,opt,name=Player,proto3" json:"Player,omitempty"` //房间内的玩家信息
|
||||
PlayerInfo string `protobuf:"bytes,11,opt,name=PlayerInfo,proto3" json:"PlayerInfo,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) Reset() {
|
||||
*x = SCCashManiaRoomInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCCashManiaRoomInfo) ProtoMessage() {}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCCashManiaRoomInfo.ProtoReflect.Descriptor instead.
|
||||
func (*SCCashManiaRoomInfo) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetRoomId() int32 {
|
||||
if x != nil {
|
||||
return x.RoomId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetGameFreeId() int32 {
|
||||
if x != nil {
|
||||
return x.GameFreeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetGameId() int32 {
|
||||
if x != nil {
|
||||
return x.GameId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetRoomMode() int32 {
|
||||
if x != nil {
|
||||
return x.RoomMode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetParams() []int32 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetNumOfGames() int32 {
|
||||
if x != nil {
|
||||
return x.NumOfGames
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetState() int32 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetParamsEx() []int64 {
|
||||
if x != nil {
|
||||
return x.ParamsEx
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetSceneType() int32 {
|
||||
if x != nil {
|
||||
return x.SceneType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetPlayer() *CashManiaPlayerData {
|
||||
if x != nil {
|
||||
return x.Player
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomInfo) GetPlayerInfo() string {
|
||||
if x != nil {
|
||||
return x.PlayerInfo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
//玩家操作
|
||||
//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP
|
||||
type CSCashManiaOp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码 0.spin
|
||||
Params []int64 `protobuf:"varint,2,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数 下注索引编号
|
||||
}
|
||||
|
||||
func (x *CSCashManiaOp) Reset() {
|
||||
*x = CSCashManiaOp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CSCashManiaOp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CSCashManiaOp) ProtoMessage() {}
|
||||
|
||||
func (x *CSCashManiaOp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CSCashManiaOp.ProtoReflect.Descriptor instead.
|
||||
func (*CSCashManiaOp) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *CSCashManiaOp) GetOpCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CSCashManiaOp) GetParams() []int64 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//玩家操作返回
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP
|
||||
type SCCashManiaOp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码
|
||||
OpRetCode int32 `protobuf:"varint,2,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //操作结果 1.金币不足 2.低于该值不能押注
|
||||
Params []int64 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数
|
||||
}
|
||||
|
||||
func (x *SCCashManiaOp) Reset() {
|
||||
*x = SCCashManiaOp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaOp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCCashManiaOp) ProtoMessage() {}
|
||||
|
||||
func (x *SCCashManiaOp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCCashManiaOp.ProtoReflect.Descriptor instead.
|
||||
func (*SCCashManiaOp) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaOp) GetOpCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaOp) GetOpRetCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpRetCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaOp) GetParams() []int64 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//房间状态
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE
|
||||
type SCCashManiaRoomState struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
State int32 `protobuf:"varint,1,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态
|
||||
SubState int32 `protobuf:"varint,2,opt,name=SubState,proto3" json:"SubState,omitempty"` //房间当前子状态
|
||||
Params []int32 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //状态参数
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomState) Reset() {
|
||||
*x = SCCashManiaRoomState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomState) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCCashManiaRoomState) ProtoMessage() {}
|
||||
|
||||
func (x *SCCashManiaRoomState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCCashManiaRoomState.ProtoReflect.Descriptor instead.
|
||||
func (*SCCashManiaRoomState) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomState) GetState() int32 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomState) GetSubState() int32 {
|
||||
if x != nil {
|
||||
return x.SubState
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaRoomState) GetParams() []int32 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED
|
||||
type SCCashManiaBilled struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpRetCode int32 `protobuf:"varint,1,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //0.spin成功 1.spin失败
|
||||
GameEndStr string `protobuf:"bytes,2,opt,name=GameEndStr,proto3" json:"GameEndStr,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SCCashManiaBilled) Reset() {
|
||||
*x = SCCashManiaBilled{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaBilled) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCCashManiaBilled) ProtoMessage() {}
|
||||
|
||||
func (x *SCCashManiaBilled) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_cashmania_cashmania_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCCashManiaBilled.ProtoReflect.Descriptor instead.
|
||||
func (*SCCashManiaBilled) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *SCCashManiaBilled) GetOpRetCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpRetCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCCashManiaBilled) GetGameEndStr() string {
|
||||
if x != nil {
|
||||
return x.GameEndStr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_protocol_cashmania_cashmania_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_protocol_cashmania_cashmania_proto_rawDesc = []byte{
|
||||
0x0a, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x61, 0x73, 0x68, 0x6d,
|
||||
0x61, 0x6e, 0x69, 0x61, 0x2f, 0x63, 0x61, 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x61, 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x22,
|
||||
0xfd, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x61, 0x50, 0x6c, 0x61,
|
||||
0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53,
|
||||
0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x48,
|
||||
0x65, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x03, 0x53, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73,
|
||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x46,
|
||||
0x6c, 0x61, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52,
|
||||
0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18,
|
||||
0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x48,
|
||||
0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x56, 0x49, 0x50, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x56, 0x49, 0x50, 0x22,
|
||||
0xe1, 0x02, 0x0a, 0x13, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x61, 0x52,
|
||||
0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12,
|
||||
0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d,
|
||||
0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d,
|
||||
0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20,
|
||||
0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x4e,
|
||||
0x75, 0x6d, 0x4f, 0x66, 0x47, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x0a, 0x4e, 0x75, 0x6d, 0x4f, 0x66, 0x47, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x53,
|
||||
0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74,
|
||||
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x18, 0x08, 0x20,
|
||||
0x03, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x50,
|
||||
0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x61,
|
||||
0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69,
|
||||
0x61, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x50, 0x6c, 0x61,
|
||||
0x79, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x6e, 0x66,
|
||||
0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x22, 0x3f, 0x0a, 0x0d, 0x43, 0x53, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e,
|
||||
0x69, 0x61, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x22, 0x5d, 0x0a, 0x0d, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61,
|
||||
0x6e, 0x69, 0x61, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18,
|
||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a,
|
||||
0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72,
|
||||
0x61, 0x6d, 0x73, 0x22, 0x60, 0x0a, 0x14, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e,
|
||||
0x69, 0x61, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53,
|
||||
0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74,
|
||||
0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x50,
|
||||
0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x51, 0x0a, 0x11, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d,
|
||||
0x61, 0x6e, 0x69, 0x61, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x70,
|
||||
0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4f,
|
||||
0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x47, 0x61,
|
||||
0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x2a, 0xf3, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x73,
|
||||
0x68, 0x4d, 0x61, 0x6e, 0x69, 0x61, 0x50, 0x49, 0x44, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x5a, 0x45,
|
||||
0x52, 0x4f, 0x10, 0x00, 0x12, 0x29, 0x0a, 0x24, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43,
|
||||
0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, 0x43, 0x41, 0x53, 0x48, 0x4d,
|
||||
0x41, 0x4e, 0x49, 0x41, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x92, 0x2c, 0x12,
|
||||
0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41,
|
||||
0x4e, 0x49, 0x41, 0x5f, 0x43, 0x53, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x4f,
|
||||
0x50, 0x10, 0x93, 0x2c, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43,
|
||||
0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, 0x43, 0x41, 0x53, 0x48, 0x4d,
|
||||
0x41, 0x4e, 0x49, 0x41, 0x4f, 0x50, 0x10, 0x94, 0x2c, 0x12, 0x2a, 0x0a, 0x25, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43,
|
||||
0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41,
|
||||
0x54, 0x45, 0x10, 0x95, 0x2c, 0x12, 0x27, 0x0a, 0x22, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, 0x43, 0x41, 0x53, 0x48,
|
||||
0x4d, 0x41, 0x4e, 0x49, 0x41, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x96, 0x2c, 0x42, 0x29,
|
||||
0x5a, 0x27, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f,
|
||||
0x63, 0x61, 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_protocol_cashmania_cashmania_proto_rawDescOnce sync.Once
|
||||
file_protocol_cashmania_cashmania_proto_rawDescData = file_protocol_cashmania_cashmania_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_protocol_cashmania_cashmania_proto_rawDescGZIP() []byte {
|
||||
file_protocol_cashmania_cashmania_proto_rawDescOnce.Do(func() {
|
||||
file_protocol_cashmania_cashmania_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_cashmania_cashmania_proto_rawDescData)
|
||||
})
|
||||
return file_protocol_cashmania_cashmania_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_protocol_cashmania_cashmania_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_protocol_cashmania_cashmania_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_protocol_cashmania_cashmania_proto_goTypes = []interface{}{
|
||||
(CashManiaPID)(0), // 0: cashmania.CashManiaPID
|
||||
(*CashManiaPlayerData)(nil), // 1: cashmania.CashManiaPlayerData
|
||||
(*SCCashManiaRoomInfo)(nil), // 2: cashmania.SCCashManiaRoomInfo
|
||||
(*CSCashManiaOp)(nil), // 3: cashmania.CSCashManiaOp
|
||||
(*SCCashManiaOp)(nil), // 4: cashmania.SCCashManiaOp
|
||||
(*SCCashManiaRoomState)(nil), // 5: cashmania.SCCashManiaRoomState
|
||||
(*SCCashManiaBilled)(nil), // 6: cashmania.SCCashManiaBilled
|
||||
}
|
||||
var file_protocol_cashmania_cashmania_proto_depIdxs = []int32{
|
||||
1, // 0: cashmania.SCCashManiaRoomInfo.Player:type_name -> cashmania.CashManiaPlayerData
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_protocol_cashmania_cashmania_proto_init() }
|
||||
func file_protocol_cashmania_cashmania_proto_init() {
|
||||
if File_protocol_cashmania_cashmania_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_protocol_cashmania_cashmania_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CashManiaPlayerData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_cashmania_cashmania_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCCashManiaRoomInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_cashmania_cashmania_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CSCashManiaOp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_cashmania_cashmania_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCCashManiaOp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_cashmania_cashmania_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCCashManiaRoomState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_cashmania_cashmania_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCCashManiaBilled); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_protocol_cashmania_cashmania_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_protocol_cashmania_cashmania_proto_goTypes,
|
||||
DependencyIndexes: file_protocol_cashmania_cashmania_proto_depIdxs,
|
||||
EnumInfos: file_protocol_cashmania_cashmania_proto_enumTypes,
|
||||
MessageInfos: file_protocol_cashmania_cashmania_proto_msgTypes,
|
||||
}.Build()
|
||||
File_protocol_cashmania_cashmania_proto = out.File
|
||||
file_protocol_cashmania_cashmania_proto_rawDesc = nil
|
||||
file_protocol_cashmania_cashmania_proto_goTypes = nil
|
||||
file_protocol_cashmania_cashmania_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
syntax = "proto3";
|
||||
package cashmania;
|
||||
option go_package = "mongo.games.com/game/protocol/cashmania";
|
||||
|
||||
//cashmania
|
||||
//龙
|
||||
enum CashManiaPID {
|
||||
PACKET_CASHMANIA_ZERO = 0;// 弃用消息号
|
||||
PACKET_CASHMANIA_SCCASHMANIAROOMINFO = 5650; //房间信息
|
||||
PACKET_CASHMANIA_CSCASHMANIAOP = 5651;
|
||||
PACKET_CASHMANIA_SCCASHMANIAOP = 5652;
|
||||
PACKET_CASHMANIA_SCCASHMANIAROOMSTATE = 5653;
|
||||
PACKET_CASHMANIA_SCCASHMANIABILLED = 5654;
|
||||
}
|
||||
|
||||
message CashManiaPlayerData {
|
||||
string Name = 1; //名字
|
||||
int32 SnId = 2; //账号
|
||||
int32 Head = 3; //头像
|
||||
int32 Sex = 4; //性别
|
||||
int64 Coin = 5; //金币
|
||||
int32 Pos = 6; //座位位置
|
||||
int32 Flag = 7; //二进制标记
|
||||
repeated string Params = 8; //其他数据 如:ip 等
|
||||
string City = 9; //城市
|
||||
int32 HeadOutLine = 10; //头像框
|
||||
int32 VIP = 11;
|
||||
}
|
||||
//房间信息
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO
|
||||
message SCCashManiaRoomInfo {
|
||||
int32 RoomId = 1; //房间id
|
||||
int32 GameFreeId = 2;
|
||||
int32 GameId = 3; //游戏id
|
||||
int32 RoomMode = 4; //游戏模式
|
||||
repeated int32 Params = 5; //规则参数
|
||||
int32 NumOfGames = 6; //当前第几局
|
||||
int32 State = 7; //房间当前状态
|
||||
repeated int64 ParamsEx = 8; //其他参数
|
||||
int32 SceneType = 9; //房间模式
|
||||
CashManiaPlayerData Player = 10; //房间内的玩家信息
|
||||
string PlayerInfo = 11;
|
||||
}
|
||||
//玩家操作
|
||||
//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP
|
||||
message CSCashManiaOp {
|
||||
int32 OpCode = 1; //操作码 0.spin
|
||||
repeated int64 Params = 2; //操作参数 下注索引编号
|
||||
}
|
||||
//玩家操作返回
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP
|
||||
message SCCashManiaOp {
|
||||
int32 OpCode = 1; //操作码
|
||||
int32 OpRetCode = 2; //操作结果 1.金币不足 2.低于该值不能押注
|
||||
repeated int64 Params = 3; //操作参数
|
||||
}
|
||||
//房间状态
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE
|
||||
message SCCashManiaRoomState {
|
||||
int32 State = 1; //房间当前状态
|
||||
int32 SubState = 2; //房间当前子状态
|
||||
repeated int32 Params = 3; //状态参数
|
||||
}
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED
|
||||
message SCCashManiaBilled{
|
||||
int32 OpRetCode = 1;//0.spin成功 1.spin失败
|
||||
string GameEndStr = 2;
|
||||
}
|
|
@ -159,31 +159,39 @@
|
|||
### samloc.proto
|
||||
- 5550~5569
|
||||
|
||||
### thirteen.protp
|
||||
### thirteen.proto
|
||||
- 5570~5580
|
||||
|
||||
### smallrocket.protp
|
||||
### smallrocket.proto
|
||||
- 5581~5599
|
||||
|
||||
### fortunedragon.prot
|
||||
### fortunedragon.proto
|
||||
|
||||
- 5600~5609
|
||||
|
||||
### fortunerabbit.prot
|
||||
### fortunerabbit.proto
|
||||
|
||||
- 5610~5619
|
||||
|
||||
### fortuneox.prot
|
||||
### fortuneox.proto
|
||||
|
||||
- 5620~5629
|
||||
|
||||
### fortunetiger.prot
|
||||
### fortunetiger.proto
|
||||
|
||||
- 5630~5639
|
||||
|
||||
### fortunemouse.prot
|
||||
### fortunemouse.proto
|
||||
|
||||
- 5640~5649
|
||||
|
||||
### cashmania.proto
|
||||
|
||||
- 5650~5659
|
||||
|
||||
### gatesofolympus.proto
|
||||
|
||||
- 5660~5669
|
||||
|
||||
### game.proto(玩家离开)
|
||||
- 8000~8099
|
|
@ -0,0 +1,806 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1-devel
|
||||
// protoc v3.19.4
|
||||
// source: protocol/gatesofolympus/gatesofolympus.proto
|
||||
|
||||
package gatesofolympus
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
//gatesofolympus
|
||||
//龙
|
||||
type GatesOfOlympusPID int32
|
||||
|
||||
const (
|
||||
GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_ZERO GatesOfOlympusPID = 0 // 弃用消息号
|
||||
GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO GatesOfOlympusPID = 5660 //房间信息
|
||||
GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP GatesOfOlympusPID = 5661
|
||||
GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP GatesOfOlympusPID = 5662
|
||||
GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE GatesOfOlympusPID = 5663
|
||||
GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED GatesOfOlympusPID = 5664
|
||||
)
|
||||
|
||||
// Enum value maps for GatesOfOlympusPID.
|
||||
var (
|
||||
GatesOfOlympusPID_name = map[int32]string{
|
||||
0: "PACKET_GATESOFOLYMPUS_ZERO",
|
||||
5660: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO",
|
||||
5661: "PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP",
|
||||
5662: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP",
|
||||
5663: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE",
|
||||
5664: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED",
|
||||
}
|
||||
GatesOfOlympusPID_value = map[string]int32{
|
||||
"PACKET_GATESOFOLYMPUS_ZERO": 0,
|
||||
"PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO": 5660,
|
||||
"PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP": 5661,
|
||||
"PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP": 5662,
|
||||
"PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE": 5663,
|
||||
"PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED": 5664,
|
||||
}
|
||||
)
|
||||
|
||||
func (x GatesOfOlympusPID) Enum() *GatesOfOlympusPID {
|
||||
p := new(GatesOfOlympusPID)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x GatesOfOlympusPID) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (GatesOfOlympusPID) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (GatesOfOlympusPID) Type() protoreflect.EnumType {
|
||||
return &file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x GatesOfOlympusPID) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GatesOfOlympusPID.Descriptor instead.
|
||||
func (GatesOfOlympusPID) EnumDescriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type GatesOfOlympusPlayerData struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` //名字
|
||||
SnId int32 `protobuf:"varint,2,opt,name=SnId,proto3" json:"SnId,omitempty"` //账号
|
||||
Head int32 `protobuf:"varint,3,opt,name=Head,proto3" json:"Head,omitempty"` //头像
|
||||
Sex int32 `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` //性别
|
||||
Coin int64 `protobuf:"varint,5,opt,name=Coin,proto3" json:"Coin,omitempty"` //金币
|
||||
Pos int32 `protobuf:"varint,6,opt,name=Pos,proto3" json:"Pos,omitempty"` //座位位置
|
||||
Flag int32 `protobuf:"varint,7,opt,name=Flag,proto3" json:"Flag,omitempty"` //二进制标记
|
||||
Params []string `protobuf:"bytes,8,rep,name=Params,proto3" json:"Params,omitempty"` //其他数据 如:ip 等
|
||||
City string `protobuf:"bytes,9,opt,name=City,proto3" json:"City,omitempty"` //城市
|
||||
HeadOutLine int32 `protobuf:"varint,10,opt,name=HeadOutLine,proto3" json:"HeadOutLine,omitempty"` //头像框
|
||||
VIP int32 `protobuf:"varint,11,opt,name=VIP,proto3" json:"VIP,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) Reset() {
|
||||
*x = GatesOfOlympusPlayerData{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*GatesOfOlympusPlayerData) ProtoMessage() {}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use GatesOfOlympusPlayerData.ProtoReflect.Descriptor instead.
|
||||
func (*GatesOfOlympusPlayerData) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetSnId() int32 {
|
||||
if x != nil {
|
||||
return x.SnId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetHead() int32 {
|
||||
if x != nil {
|
||||
return x.Head
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetSex() int32 {
|
||||
if x != nil {
|
||||
return x.Sex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetCoin() int64 {
|
||||
if x != nil {
|
||||
return x.Coin
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetPos() int32 {
|
||||
if x != nil {
|
||||
return x.Pos
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetFlag() int32 {
|
||||
if x != nil {
|
||||
return x.Flag
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetParams() []string {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetCity() string {
|
||||
if x != nil {
|
||||
return x.City
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetHeadOutLine() int32 {
|
||||
if x != nil {
|
||||
return x.HeadOutLine
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *GatesOfOlympusPlayerData) GetVIP() int32 {
|
||||
if x != nil {
|
||||
return x.VIP
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
//房间信息
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO
|
||||
type SCGatesOfOlympusRoomInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
RoomId int32 `protobuf:"varint,1,opt,name=RoomId,proto3" json:"RoomId,omitempty"` //房间id
|
||||
GameFreeId int32 `protobuf:"varint,2,opt,name=GameFreeId,proto3" json:"GameFreeId,omitempty"`
|
||||
GameId int32 `protobuf:"varint,3,opt,name=GameId,proto3" json:"GameId,omitempty"` //游戏id
|
||||
RoomMode int32 `protobuf:"varint,4,opt,name=RoomMode,proto3" json:"RoomMode,omitempty"` //游戏模式
|
||||
Params []int32 `protobuf:"varint,5,rep,packed,name=Params,proto3" json:"Params,omitempty"` //规则参数
|
||||
NumOfGames int32 `protobuf:"varint,6,opt,name=NumOfGames,proto3" json:"NumOfGames,omitempty"` //当前第几局
|
||||
State int32 `protobuf:"varint,7,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态
|
||||
ParamsEx []int64 `protobuf:"varint,8,rep,packed,name=ParamsEx,proto3" json:"ParamsEx,omitempty"` //其他参数
|
||||
SceneType int32 `protobuf:"varint,9,opt,name=SceneType,proto3" json:"SceneType,omitempty"` //房间模式
|
||||
Player *GatesOfOlympusPlayerData `protobuf:"bytes,10,opt,name=Player,proto3" json:"Player,omitempty"` //房间内的玩家信息
|
||||
PlayerInfo string `protobuf:"bytes,11,opt,name=PlayerInfo,proto3" json:"PlayerInfo,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) Reset() {
|
||||
*x = SCGatesOfOlympusRoomInfo{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCGatesOfOlympusRoomInfo) ProtoMessage() {}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCGatesOfOlympusRoomInfo.ProtoReflect.Descriptor instead.
|
||||
func (*SCGatesOfOlympusRoomInfo) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetRoomId() int32 {
|
||||
if x != nil {
|
||||
return x.RoomId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetGameFreeId() int32 {
|
||||
if x != nil {
|
||||
return x.GameFreeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetGameId() int32 {
|
||||
if x != nil {
|
||||
return x.GameId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetRoomMode() int32 {
|
||||
if x != nil {
|
||||
return x.RoomMode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetParams() []int32 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetNumOfGames() int32 {
|
||||
if x != nil {
|
||||
return x.NumOfGames
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetState() int32 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetParamsEx() []int64 {
|
||||
if x != nil {
|
||||
return x.ParamsEx
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetSceneType() int32 {
|
||||
if x != nil {
|
||||
return x.SceneType
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetPlayer() *GatesOfOlympusPlayerData {
|
||||
if x != nil {
|
||||
return x.Player
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomInfo) GetPlayerInfo() string {
|
||||
if x != nil {
|
||||
return x.PlayerInfo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
//玩家操作
|
||||
//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP
|
||||
type CSGatesOfOlympusOp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码 0.spin
|
||||
Params []int64 `protobuf:"varint,2,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数 下注索引编号
|
||||
}
|
||||
|
||||
func (x *CSGatesOfOlympusOp) Reset() {
|
||||
*x = CSGatesOfOlympusOp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CSGatesOfOlympusOp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*CSGatesOfOlympusOp) ProtoMessage() {}
|
||||
|
||||
func (x *CSGatesOfOlympusOp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use CSGatesOfOlympusOp.ProtoReflect.Descriptor instead.
|
||||
func (*CSGatesOfOlympusOp) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *CSGatesOfOlympusOp) GetOpCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *CSGatesOfOlympusOp) GetParams() []int64 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//玩家操作返回
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP
|
||||
type SCGatesOfOlympusOp struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码
|
||||
OpRetCode int32 `protobuf:"varint,2,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //操作结果 1.金币不足 2.低于该值不能押注
|
||||
Params []int64 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusOp) Reset() {
|
||||
*x = SCGatesOfOlympusOp{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusOp) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCGatesOfOlympusOp) ProtoMessage() {}
|
||||
|
||||
func (x *SCGatesOfOlympusOp) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCGatesOfOlympusOp.ProtoReflect.Descriptor instead.
|
||||
func (*SCGatesOfOlympusOp) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusOp) GetOpCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusOp) GetOpRetCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpRetCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusOp) GetParams() []int64 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//房间状态
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE
|
||||
type SCGatesOfOlympusRoomState struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
State int32 `protobuf:"varint,1,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态
|
||||
SubState int32 `protobuf:"varint,2,opt,name=SubState,proto3" json:"SubState,omitempty"` //房间当前子状态
|
||||
Params []int32 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //状态参数
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomState) Reset() {
|
||||
*x = SCGatesOfOlympusRoomState{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomState) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCGatesOfOlympusRoomState) ProtoMessage() {}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomState) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[4]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCGatesOfOlympusRoomState.ProtoReflect.Descriptor instead.
|
||||
func (*SCGatesOfOlympusRoomState) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{4}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomState) GetState() int32 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomState) GetSubState() int32 {
|
||||
if x != nil {
|
||||
return x.SubState
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusRoomState) GetParams() []int32 {
|
||||
if x != nil {
|
||||
return x.Params
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED
|
||||
type SCGatesOfOlympusBilled struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpRetCode int32 `protobuf:"varint,1,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //0.spin成功 1.spin失败
|
||||
GameEndStr string `protobuf:"bytes,2,opt,name=GameEndStr,proto3" json:"GameEndStr,omitempty"`
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusBilled) Reset() {
|
||||
*x = SCGatesOfOlympusBilled{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusBilled) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*SCGatesOfOlympusBilled) ProtoMessage() {}
|
||||
|
||||
func (x *SCGatesOfOlympusBilled) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[5]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use SCGatesOfOlympusBilled.ProtoReflect.Descriptor instead.
|
||||
func (*SCGatesOfOlympusBilled) Descriptor() ([]byte, []int) {
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{5}
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusBilled) GetOpRetCode() int32 {
|
||||
if x != nil {
|
||||
return x.OpRetCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *SCGatesOfOlympusBilled) GetGameEndStr() string {
|
||||
if x != nil {
|
||||
return x.GameEndStr
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
var File_protocol_gatesofolympus_gatesofolympus_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc = []byte{
|
||||
0x0a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x73,
|
||||
0x6f, 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f,
|
||||
0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e,
|
||||
0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x22, 0x82,
|
||||
0x02, 0x0a, 0x18, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75,
|
||||
0x73, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x4e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53,
|
||||
0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x05, 0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x65, 0x78, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69,
|
||||
0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x50, 0x6f, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12,
|
||||
0x12, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x46,
|
||||
0x6c, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20,
|
||||
0x03, 0x28, 0x09, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x43,
|
||||
0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12,
|
||||
0x20, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0a,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e,
|
||||
0x65, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x49, 0x50, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||
0x56, 0x49, 0x50, 0x22, 0xf0, 0x02, 0x0a, 0x18, 0x53, 0x43, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f,
|
||||
0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f,
|
||||
0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||
0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x47, 0x61,
|
||||
0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x61, 0x6d, 0x65,
|
||||
0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x4e, 0x75, 0x6d, 0x4f, 0x66, 0x47, 0x61, 0x6d,
|
||||
0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4e, 0x75, 0x6d, 0x4f, 0x66, 0x47,
|
||||
0x61, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x18, 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61,
|
||||
0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x54,
|
||||
0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65,
|
||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x0a,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, 0x66, 0x6f, 0x6c,
|
||||
0x79, 0x6d, 0x70, 0x75, 0x73, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79,
|
||||
0x6d, 0x70, 0x75, 0x73, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06,
|
||||
0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72,
|
||||
0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x50, 0x6c, 0x61, 0x79,
|
||||
0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x44, 0x0a, 0x12, 0x43, 0x53, 0x47, 0x61, 0x74, 0x65,
|
||||
0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06,
|
||||
0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70,
|
||||
0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02,
|
||||
0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x62, 0x0a, 0x12,
|
||||
0x53, 0x43, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73,
|
||||
0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||
0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x70,
|
||||
0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4f,
|
||||
0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61,
|
||||
0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
|
||||
0x22, 0x65, 0x0a, 0x19, 0x53, 0x43, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79,
|
||||
0x6d, 0x70, 0x75, 0x73, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a,
|
||||
0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74,
|
||||
0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
|
||||
0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52,
|
||||
0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x56, 0x0a, 0x16, 0x53, 0x43, 0x47, 0x61, 0x74,
|
||||
0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x42, 0x69, 0x6c, 0x6c, 0x65,
|
||||
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||
0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x2a,
|
||||
0xaf, 0x02, 0x0a, 0x11, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70,
|
||||
0x75, 0x73, 0x50, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x5f, 0x5a,
|
||||
0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||
0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x5f, 0x53,
|
||||
0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x52,
|
||||
0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x9c, 0x2c, 0x12, 0x2d, 0x0a, 0x28, 0x50, 0x41,
|
||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d,
|
||||
0x50, 0x55, 0x53, 0x5f, 0x43, 0x53, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59,
|
||||
0x4d, 0x50, 0x55, 0x53, 0x4f, 0x50, 0x10, 0x9d, 0x2c, 0x12, 0x2d, 0x0a, 0x28, 0x50, 0x41, 0x43,
|
||||
0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50,
|
||||
0x55, 0x53, 0x5f, 0x53, 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d,
|
||||
0x50, 0x55, 0x53, 0x4f, 0x50, 0x10, 0x9e, 0x2c, 0x12, 0x34, 0x0a, 0x2f, 0x50, 0x41, 0x43, 0x4b,
|
||||
0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55,
|
||||
0x53, 0x5f, 0x53, 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50,
|
||||
0x55, 0x53, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x9f, 0x2c, 0x12, 0x31,
|
||||
0x0a, 0x2c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46,
|
||||
0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x5f, 0x53, 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f,
|
||||
0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xa0,
|
||||
0x2c, 0x42, 0x2e, 0x5a, 0x2c, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,
|
||||
0x6f, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75,
|
||||
0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_rawDescOnce sync.Once
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData = file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP() []byte {
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_rawDescOnce.Do(func() {
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData)
|
||||
})
|
||||
return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||
var file_protocol_gatesofolympus_gatesofolympus_proto_goTypes = []interface{}{
|
||||
(GatesOfOlympusPID)(0), // 0: gatesofolympus.GatesOfOlympusPID
|
||||
(*GatesOfOlympusPlayerData)(nil), // 1: gatesofolympus.GatesOfOlympusPlayerData
|
||||
(*SCGatesOfOlympusRoomInfo)(nil), // 2: gatesofolympus.SCGatesOfOlympusRoomInfo
|
||||
(*CSGatesOfOlympusOp)(nil), // 3: gatesofolympus.CSGatesOfOlympusOp
|
||||
(*SCGatesOfOlympusOp)(nil), // 4: gatesofolympus.SCGatesOfOlympusOp
|
||||
(*SCGatesOfOlympusRoomState)(nil), // 5: gatesofolympus.SCGatesOfOlympusRoomState
|
||||
(*SCGatesOfOlympusBilled)(nil), // 6: gatesofolympus.SCGatesOfOlympusBilled
|
||||
}
|
||||
var file_protocol_gatesofolympus_gatesofolympus_proto_depIdxs = []int32{
|
||||
1, // 0: gatesofolympus.SCGatesOfOlympusRoomInfo.Player:type_name -> gatesofolympus.GatesOfOlympusPlayerData
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_protocol_gatesofolympus_gatesofolympus_proto_init() }
|
||||
func file_protocol_gatesofolympus_gatesofolympus_proto_init() {
|
||||
if File_protocol_gatesofolympus_gatesofolympus_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*GatesOfOlympusPlayerData); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCGatesOfOlympusRoomInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CSGatesOfOlympusOp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCGatesOfOlympusOp); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCGatesOfOlympusRoomState); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*SCGatesOfOlympusBilled); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 6,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_protocol_gatesofolympus_gatesofolympus_proto_goTypes,
|
||||
DependencyIndexes: file_protocol_gatesofolympus_gatesofolympus_proto_depIdxs,
|
||||
EnumInfos: file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes,
|
||||
MessageInfos: file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes,
|
||||
}.Build()
|
||||
File_protocol_gatesofolympus_gatesofolympus_proto = out.File
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc = nil
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_goTypes = nil
|
||||
file_protocol_gatesofolympus_gatesofolympus_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
syntax = "proto3";
|
||||
package gatesofolympus;
|
||||
option go_package = "mongo.games.com/game/protocol/gatesofolympus";
|
||||
|
||||
//gatesofolympus
|
||||
//龙
|
||||
enum GatesOfOlympusPID {
|
||||
PACKET_GATESOFOLYMPUS_ZERO = 0;// 弃用消息号
|
||||
PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO = 5660; //房间信息
|
||||
PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP = 5661;
|
||||
PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP = 5662;
|
||||
PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE = 5663;
|
||||
PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED = 5664;
|
||||
}
|
||||
|
||||
message GatesOfOlympusPlayerData {
|
||||
string Name = 1; //名字
|
||||
int32 SnId = 2; //账号
|
||||
int32 Head = 3; //头像
|
||||
int32 Sex = 4; //性别
|
||||
int64 Coin = 5; //金币
|
||||
int32 Pos = 6; //座位位置
|
||||
int32 Flag = 7; //二进制标记
|
||||
repeated string Params = 8; //其他数据 如:ip 等
|
||||
string City = 9; //城市
|
||||
int32 HeadOutLine = 10; //头像框
|
||||
int32 VIP = 11;
|
||||
}
|
||||
//房间信息
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO
|
||||
message SCGatesOfOlympusRoomInfo {
|
||||
int32 RoomId = 1; //房间id
|
||||
int32 GameFreeId = 2;
|
||||
int32 GameId = 3; //游戏id
|
||||
int32 RoomMode = 4; //游戏模式
|
||||
repeated int32 Params = 5; //规则参数
|
||||
int32 NumOfGames = 6; //当前第几局
|
||||
int32 State = 7; //房间当前状态
|
||||
repeated int64 ParamsEx = 8; //其他参数
|
||||
int32 SceneType = 9; //房间模式
|
||||
GatesOfOlympusPlayerData Player = 10; //房间内的玩家信息
|
||||
string PlayerInfo = 11;
|
||||
}
|
||||
//玩家操作
|
||||
//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP
|
||||
message CSGatesOfOlympusOp {
|
||||
int32 OpCode = 1; //操作码 0.spin
|
||||
repeated int64 Params = 2; //操作参数 下注索引编号
|
||||
}
|
||||
//玩家操作返回
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP
|
||||
message SCGatesOfOlympusOp {
|
||||
int32 OpCode = 1; //操作码
|
||||
int32 OpRetCode = 2; //操作结果 1.金币不足 2.低于该值不能押注
|
||||
repeated int64 Params = 3; //操作参数
|
||||
}
|
||||
//房间状态
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE
|
||||
message SCGatesOfOlympusRoomState {
|
||||
int32 State = 1; //房间当前状态
|
||||
int32 SubState = 2; //房间当前子状态
|
||||
repeated int32 Params = 3; //状态参数
|
||||
}
|
||||
//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED
|
||||
message SCGatesOfOlympusBilled{
|
||||
int32 OpRetCode = 1;//0.spin成功 1.spin失败
|
||||
string GameEndStr = 2;
|
||||
}
|
|
@ -386,7 +386,7 @@ type CSThirteenPlayerOp struct {
|
|||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏
|
||||
OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 6预选
|
||||
// 确定牌时,两种参数规则,都可以
|
||||
// 第一种:玩家从推荐牌型中选择一个,把Poker.IndexType发过来(减少数据传输)
|
||||
// 第二种:按头墩中墩尾墩顺序把牌发过来
|
||||
|
|
|
@ -73,7 +73,7 @@ message SCThirteenPlayerCards {
|
|||
//玩家操作
|
||||
//PACKET_CSThirteenPlayerOp
|
||||
message CSThirteenPlayerOp {
|
||||
int32 OpCode = 1; // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏
|
||||
int32 OpCode = 1; // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 6预选
|
||||
|
||||
// 确定牌时,两种参数规则,都可以
|
||||
// 第一种:玩家从推荐牌型中选择一个,把Poker.IndexType发过来(减少数据传输)
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
# ---> Go
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||
#
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
*.xlsx
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
local_test.go
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
|
||||
.idea
|
||||
.vscode
|
||||
log
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# statistics
|
||||
|
||||
数据分析服务
|
||||
* mongodb同步到mysql
|
||||
* 接收消息队列数据
|
||||
* 历史数据查询
|
||||
* 数据统计
|
|
@ -0,0 +1,8 @@
|
|||
set GOPATH=D:\godev
|
||||
go env -w GO111MODULE=on
|
||||
|
||||
set CGO_ENABLED=0
|
||||
set GOOS=linux
|
||||
set GOARCH=amd64
|
||||
go build
|
||||
pause
|
|
@ -0,0 +1,8 @@
|
|||
package constant
|
||||
|
||||
const (
|
||||
InviteScoreTypeBind = 1 // 绑定邀请码
|
||||
InviteScoreTypePay = 2 // 充值返佣
|
||||
InviteScoreTypeRecharge = 3 // 充值完成
|
||||
InviteScoreTypePayMe = 4 // 充值(自己)
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
# 平台id
|
||||
platforms:
|
||||
- 1
|
||||
|
||||
# 几秒同步一次数据
|
||||
# 注册表,登录日志表
|
||||
update_second: 60
|
||||
# 注册表每次同步多少条数据
|
||||
update_account_num: 100
|
||||
# 登录日志每次同步多少条数据
|
||||
update_login_num: 100
|
||||
# 几秒读取一次玩家id列表
|
||||
update_second_snid: 30
|
||||
# 最多触发几个玩家数据更新
|
||||
update_snid_num: 100
|
||||
|
||||
# 邀请数据统计
|
||||
# 几秒读取一次邀请记录
|
||||
update_second_invite: 10
|
||||
# 一次最多读取多少条邀请记录
|
||||
update_invite_num: 30
|
||||
|
||||
# 道具获得数量统计
|
||||
# 几秒读取一次道具日志
|
||||
update_second_item: 10
|
||||
# 一次最多读取多少道具日志
|
||||
update_item_num: 100
|
|
@ -0,0 +1,53 @@
|
|||
global:
|
||||
user:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_global
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
||||
log:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_log
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
||||
monitor:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_monitor
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
||||
platforms:
|
||||
0:
|
||||
user:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_user_plt_000
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
||||
log:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_log_plt_000
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
||||
1:
|
||||
user:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_user_plt_001
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
||||
log:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 27017
|
||||
Database: win88_log_plt_001
|
||||
Username:
|
||||
Password:
|
||||
Options:
|
|
@ -0,0 +1,38 @@
|
|||
platforms:
|
||||
global:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 3306
|
||||
Database: win88_user
|
||||
Username: root
|
||||
Password: 123456
|
||||
Options: charset=utf8mb4&parseTime=True&loc=Local
|
||||
0:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 3306
|
||||
Database: win88_plt_000
|
||||
Username: root
|
||||
Password: 123456
|
||||
Options: charset=utf8mb4&parseTime=True&loc=Local
|
||||
1:
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 3306
|
||||
Database: win88_plt_001
|
||||
Username: root
|
||||
Password: 123456
|
||||
Options: charset=utf8mb4&parseTime=True&loc=Local
|
||||
count: # 破产日志库
|
||||
HostName: 127.0.0.1
|
||||
HostPort: 3306
|
||||
Database: dbmis_count
|
||||
Username: root
|
||||
Password: 123456
|
||||
Options: charset=utf8mb4&parseTime=True&loc=Local
|
||||
|
||||
# 最大空闲连接数
|
||||
MaxIdleConns: 10
|
||||
# 最大连接数
|
||||
MaxOpenConns: 100
|
||||
# 连接可复用的最大时间
|
||||
ConnMaxLifetime: 3600
|
||||
# 连接最大空闲时间
|
||||
ConnMaxIdletime: 0
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<seelog type="adaptive" mininterval="2000000" maxinterval="100000000" critmsgcount="500" minlevel="trace">
|
||||
<exceptions>
|
||||
<exception filepattern="test*" minlevel="error"/>
|
||||
</exceptions>
|
||||
<outputs formatid="all">
|
||||
<rollingfile formatid="all" type="size" filename="./all.log" maxsize="50000000" maxrolls="5" />
|
||||
<filter levels="info,trace,warn">
|
||||
<console formatid="fmtinfo"/>
|
||||
</filter>
|
||||
<filter levels="error,critical" formatid="fmterror">
|
||||
<console/>
|
||||
<file path="errors.log"/>
|
||||
</filter>
|
||||
</outputs>
|
||||
<formats>
|
||||
<format id="fmtinfo" format="[%Date][%Time] [%Level] %Msg%n"/>
|
||||
<format id="fmterror" format="[%Date][%Time] [%LEVEL] [%FuncShort @ %File.%Line] %Msg%n"/>
|
||||
<format id="all" format="[%Date][%Time] [%Level] [@ %File.%Line] %Msg%n"/>
|
||||
<format id="criticalemail" format="Critical error on our server!\n %Time %Date %RelFile %Func %Msg \nSent by Seelog"/>
|
||||
</formats>
|
||||
</seelog>
|
|
@ -0,0 +1,212 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
"mongo.games.com/goserver/core/logger"
|
||||
"mongo.games.com/goserver/core/mongox"
|
||||
"mongo.games.com/goserver/core/mysqlx"
|
||||
"mongo.games.com/goserver/core/utils"
|
||||
"mongo.games.com/goserver/core/viperx"
|
||||
|
||||
mongomodel "mongo.games.com/game/statistics/modelmongo"
|
||||
mysqlmodel "mongo.games.com/game/statistics/modelmysql"
|
||||
"mongo.games.com/game/statistics/static"
|
||||
"mongo.games.com/game/statistics/syn"
|
||||
)
|
||||
|
||||
var VP *viper.Viper
|
||||
|
||||
// DoTick 定时执行
|
||||
func DoTick(ctx context.Context, wg *sync.WaitGroup, duration time.Duration, fu func(ctx context.Context)) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.After(duration):
|
||||
utils.RecoverPanicFunc() // 捕获异常
|
||||
fu(ctx)
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
// DoTickPlatform 定时执行,根据platform执行
|
||||
func DoTickPlatform(ctx context.Context, wg *sync.WaitGroup, duration time.Duration, batchSize int,
|
||||
fu func(ctx context.Context, platform string, batchSize int)) {
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case <-time.After(duration):
|
||||
utils.RecoverPanicFunc() // 捕获异常
|
||||
wg := new(sync.WaitGroup)
|
||||
for _, v := range VP.GetStringSlice("platforms") {
|
||||
platform := v
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
fu(ctx, platform, batchSize)
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func main() {
|
||||
VP = viperx.GetViper("config.yaml")
|
||||
// mongo
|
||||
vp := viperx.GetViper("mongo.yaml")
|
||||
// mongo初始化
|
||||
conf := &mongox.Config{}
|
||||
err := vp.Unmarshal(conf)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("mongo config error: %v", err))
|
||||
}
|
||||
mongox.Init(conf)
|
||||
defer mongox.Close()
|
||||
|
||||
// mysql
|
||||
vp = viperx.GetViper("mysql.yaml")
|
||||
myConf := &mysqlx.Config{}
|
||||
err = vp.Unmarshal(myConf)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("mysql config error: %v", err))
|
||||
}
|
||||
mysqlx.Init(myConf)
|
||||
defer mysqlx.Close()
|
||||
|
||||
mysqlx.SetAutoMigrateTables(mysqlmodel.Tables)
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
|
||||
DoTick(ctx, wg, time.Duration(VP.GetInt64("update_second"))*time.Second, SyncSnId)
|
||||
|
||||
DoTick(ctx, wg, time.Duration(VP.GetInt64("update_second_snid"))*time.Second, func(ctx context.Context) {
|
||||
wg := new(sync.WaitGroup)
|
||||
for _, v := range VP.GetStringSlice("platforms") {
|
||||
platform := v
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
Static(platform)
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
})
|
||||
|
||||
DoTick(ctx, wg, time.Duration(VP.GetInt64("update_second_invite"))*time.Second, SyncInvite)
|
||||
|
||||
DoTickPlatform(ctx, wg, time.Duration(VP.GetInt64("update_second_item"))*time.Second, VP.GetInt("update_item_num"),
|
||||
func(ctx context.Context, platform string, batchSize int) {
|
||||
err := syn.ItemGainDone(&syn.Data[mongomodel.ItemLog]{
|
||||
Platform: platform,
|
||||
BatchSize: batchSize,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("SyncItem error:%v", err)
|
||||
}
|
||||
})
|
||||
|
||||
logger.Logger.Info("start")
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, os.Kill)
|
||||
sig := <-c
|
||||
logger.Logger.Infof("closing down (signal: %v)", sig)
|
||||
|
||||
// release
|
||||
cancel()
|
||||
wg.Wait()
|
||||
|
||||
logger.Logger.Info("closed")
|
||||
}
|
||||
|
||||
// SyncSnId 同步注册和登录日志
|
||||
func SyncSnId(ctx context.Context) {
|
||||
wg := new(sync.WaitGroup)
|
||||
for _, v := range VP.GetStringSlice("platforms") {
|
||||
platform := v
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
_, err := syn.UserAccount(platform, VP.GetInt("update_account_num"))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("SyncUserAccount error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
_, err = syn.LogLogin(platform, VP.GetInt("update_login_num"))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("SyncLogLogin error: %v", err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
// Static 玩家id触发数据统计
|
||||
func Static(platform string) {
|
||||
// 查询需要更新的玩家id
|
||||
var ids []*mysqlmodel.UserID
|
||||
db, err := mysqlx.GetDatabase(platform)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("GetDatabase error: %v", err)
|
||||
return
|
||||
}
|
||||
if err := db.Limit(VP.GetInt("update_snid_num")).Find(&ids).Error; err != nil {
|
||||
logger.Logger.Warnf("Get UserID error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
if len(ids) == 0 {
|
||||
logger.Logger.Tracef("Static: no need to update")
|
||||
return
|
||||
}
|
||||
|
||||
// 统计玩家跳出记录
|
||||
if err := static.UserLogin(platform, ids); err != nil {
|
||||
logger.Logger.Errorf("StaticUserLogin error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
// 删除更新过的玩家id
|
||||
if err := db.Delete(ids).Error; err != nil {
|
||||
logger.Logger.Errorf("Delete error: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// SyncInvite 同步邀请数据
|
||||
func SyncInvite(ctx context.Context) {
|
||||
wg := new(sync.WaitGroup)
|
||||
for _, v := range VP.GetStringSlice("platforms") {
|
||||
platform := v
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
err := syn.SyncInviteScore(platform, VP.GetInt("update_invite_num"))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("SyncInviteScore error: %v", err)
|
||||
return
|
||||
}
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package modelmongo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
const LogGamePlayerListLog = "log_gameplayerlistlog"
|
||||
|
||||
type GamePlayerListLog struct {
|
||||
LogId primitive.ObjectID `bson:"_id"`
|
||||
SnId int32 //用户Id
|
||||
Name string //名称
|
||||
GameId int32 //游戏id
|
||||
BaseScore int32 //游戏底注
|
||||
ClubId int32 //俱乐部Id
|
||||
ClubRoom string //俱乐部包间
|
||||
TaxCoin int64 //税收
|
||||
ClubPumpCoin int64 //俱乐部额外抽水
|
||||
Platform string //平台id
|
||||
Channel string //渠道
|
||||
Promoter string //推广员
|
||||
PackageTag string //包标识
|
||||
SceneId int32 //场景ID
|
||||
GameMode int32 //游戏类型
|
||||
GameFreeid int32 //游戏类型房间号
|
||||
GameDetailedLogId string //游戏记录Id
|
||||
IsFirstGame bool //是否第一次游戏
|
||||
//对于拉霸类:BetAmount=100 WinAmountNoAnyTax=0 (表示投入多少、收益多少,值>=0)
|
||||
//拉霸类小游戏会是:BetAmount=0 WinAmountNoAnyTax=100 (投入0、收益多少,值>=0)
|
||||
//对战场:BetAmount=0 WinAmountNoAnyTax=100 (投入会有是0、收益有正负,WinAmountNoAnyTax=100则盈利,WinAmountNoAnyTax=-100则输100)
|
||||
BetAmount int64 //下注金额
|
||||
WinAmountNoAnyTax int64 //盈利金额,不包含任何税
|
||||
TotalIn int64 //本局投入
|
||||
TotalOut int64 //本局产出
|
||||
Time time.Time //记录时间
|
||||
RoomType int32 //房间类型
|
||||
GameDif string //游戏标识
|
||||
GameClass int32 //游戏类型 1棋牌 2电子 3百人 4捕鱼 5视讯 6彩票 7体育
|
||||
MatchId int32
|
||||
MatchType int32 //0.普通场 1.锦标赛 2.冠军赛 3.vip专属
|
||||
Ts int32
|
||||
IsFree bool //拉霸专用 是否免费
|
||||
WinSmallGame int64 //拉霸专用 小游戏奖励
|
||||
WinTotal int64 //拉霸专用 输赢
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package modelmongo
|
||||
|
||||
import (
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
const LogInviteScore = "log_invitescore"
|
||||
|
||||
type InviteScore struct {
|
||||
Id primitive.ObjectID `bson:"_id"`
|
||||
UpSnid int // 上级代理
|
||||
DownSnid int // 下级代理
|
||||
Level int // 代理层级 例如 1:DownSnid 是 UpSnid 的 1 级代理; 2: DownSnid 是 UpSnid 的 2 级代理
|
||||
Tp int // 返佣类型
|
||||
Rate int // 返佣比例
|
||||
Score int // 积分
|
||||
Money int // 充值金额
|
||||
Ts int // 时间戳
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package modelmongo
|
||||
|
||||
import "go.mongodb.org/mongo-driver/bson/primitive"
|
||||
|
||||
const LogItem = "log_itemlog"
|
||||
|
||||
type ItemInfo struct {
|
||||
ItemId int32
|
||||
ItemNum int64
|
||||
}
|
||||
|
||||
type ItemLog struct {
|
||||
LogId primitive.ObjectID `bson:"_id"`
|
||||
Platform string //平台
|
||||
SnId int32 //玩家id
|
||||
LogType int32 //记录类型 0.获取 1.消耗
|
||||
ItemId int32 //道具id
|
||||
ItemName string //道具名称
|
||||
Count int64 //个数
|
||||
CreateTs int64 //记录时间
|
||||
Remark string //备注
|
||||
TypeId int32 // 变化类型
|
||||
GameId int32 // 游戏id,游戏中获得时有值
|
||||
GameFreeId int32 // 场次id,游戏中获得时有值
|
||||
Cost []*ItemInfo // 消耗的道具
|
||||
Id string // 撤销的id,兑换失败
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package modelmongo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
const LogLogin = "log_login"
|
||||
|
||||
const (
|
||||
LogTypeLogin int32 = iota // 登录
|
||||
LogTypeLogout // 登出
|
||||
LogTypeRehold // 重连
|
||||
LogTypeDrop // 掉线
|
||||
)
|
||||
|
||||
type LoginLog struct {
|
||||
LogId primitive.ObjectID `bson:"_id"`
|
||||
Platform string //平台id
|
||||
SnId int32
|
||||
LogType int32
|
||||
Ts int64
|
||||
Time time.Time
|
||||
GameId int // 玩家掉线时所在游戏id
|
||||
LastGameID int // 玩家最后所在游戏id
|
||||
ChannelId string // 推广渠道
|
||||
|
||||
DeviceName string
|
||||
AppVersion string
|
||||
BuildVersion string
|
||||
AppChannel string
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package modelmongo
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
const UserAccount = "user_account"
|
||||
|
||||
type Account struct {
|
||||
AccountId primitive.ObjectID `bson:"_id"`
|
||||
SnId int32 // 玩家账号直接在这里生成
|
||||
Platform string // 平台
|
||||
RegisterTs int64 // 注册时间戳
|
||||
RegisteTime time.Time
|
||||
ChannelId string // 推广渠道
|
||||
|
||||
Tel string `gorm:"index"`
|
||||
DeviceName string `gorm:"index"`
|
||||
AppVersion string `gorm:"index"`
|
||||
BuildVersion string `gorm:"index"`
|
||||
AppChannel string `gorm:"index"`
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package modelmysql
|
||||
|
||||
type Bankrupt struct {
|
||||
Id int `json:"id" gorm:"column:id"`
|
||||
Platform int `json:"platform" gorm:"column:platform"`
|
||||
Snid int `json:"snid" gorm:"column:snid"`
|
||||
RegTs int `json:"register_time" gorm:"column:register_time"`
|
||||
GameId int `json:"game_id" gorm:"column:game_id"`
|
||||
GameFreeId int `json:"game_free_id" gorm:"column:game_free_id"`
|
||||
Coin int `json:"use_coin" gorm:"column:use_coin"`
|
||||
Ts int `json:"bankrupt_time" gorm:"column:bankrupt_time"`
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package modelmysql
|
||||
|
||||
type LogInviteScoreMid struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
MID string
|
||||
}
|
||||
|
||||
type LogInviteScore struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
UpSnid int `gorm:"index"` // 上级代理
|
||||
DownSnid int `gorm:"index"` // 下级代理
|
||||
Level int `gorm:"index"` // 代理层级 例如 1:DownSnid 是 UpSnid 的 1 级代理; 2: DownSnid 是 UpSnid 的 2 级代理
|
||||
Tp int `gorm:"index"` // 返佣类型
|
||||
Rate int `gorm:"index"` // 返佣比例
|
||||
Score int `gorm:"index"` // 积分
|
||||
Money int `gorm:"index"` // 充值金额
|
||||
Ts int `gorm:"index"` // 时间戳
|
||||
}
|
||||
|
||||
type LogInviteUser struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Psnid int `gorm:"index"` // 当前玩家
|
||||
Snid int `gorm:"index"` // 一级代理
|
||||
Level int `gorm:"index"` // 代理层级 例如 1:DownSnid 是 UpSnid 的 1 级代理; 2: DownSnid 是 UpSnid 的 2 级代理
|
||||
Ts int `gorm:"index"` // 绑定时间
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package modelmysql
|
||||
|
||||
// ItemGain 道具获得数量,以小时,道具id,做主键
|
||||
type ItemGain struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Hour int64 `gorm:"index:idx_item"` // 小时时间戳,每小时统计一次
|
||||
ItemId int32 `gorm:"index:idx_item"` // 道具id
|
||||
ItemNum int64 // 道具数量
|
||||
}
|
||||
|
||||
// ItemTotalGain 道具获得总数
|
||||
type ItemTotalGain struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
ItemId int32 `gorm:"index"` // 道具id
|
||||
ItemNum int64 // 道具数量
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package modelmysql
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
LogTypeLogin = 1 // 登录
|
||||
LogTypeRehold = 2 // 重连
|
||||
LogTypeOffline = 3 // 离线
|
||||
)
|
||||
|
||||
type LogLogin struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Snid int `gorm:"index"`
|
||||
OnlineType int `gorm:"index"`
|
||||
//OnlineTs int `gorm:"index"`
|
||||
OnlineTime time.Time `gorm:"index"`
|
||||
OfflineType int `gorm:"index"`
|
||||
//OfflineTs int `gorm:"index"`
|
||||
OfflineTime time.Time `gorm:"index"`
|
||||
ChannelId string `gorm:"index"` // 推广渠道
|
||||
|
||||
DeviceName string `gorm:"index"`
|
||||
AppVersion string `gorm:"index"`
|
||||
BuildVersion string `gorm:"index"`
|
||||
AppChannel string `gorm:"index"`
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package modelmysql
|
||||
|
||||
type LogLoginMid struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
MID string
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package modelmysql
|
||||
|
||||
const (
|
||||
MidTypeItem = 1 // 道具记录
|
||||
)
|
||||
|
||||
type LogMid struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Tp int `gorm:"index"` // 类型
|
||||
MID string
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package modelmysql
|
||||
|
||||
// 需要自动迁移的表添加在这里 Tables
|
||||
|
||||
var Tables = []interface{}{
|
||||
&LogLogin{},
|
||||
&LogLoginMid{},
|
||||
&UserAccount{},
|
||||
&UserLogin{},
|
||||
&UserID{},
|
||||
&LogInviteScoreMid{},
|
||||
&LogInviteScore{},
|
||||
&LogInviteUser{},
|
||||
&LogMid{},
|
||||
&ItemGain{},
|
||||
&ItemTotalGain{},
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package modelmysql
|
||||
|
||||
import "time"
|
||||
|
||||
type UserAccount struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
MID string
|
||||
Snid int `gorm:"index"`
|
||||
//RegisterTs int `gorm:"index"`
|
||||
RegisterTime time.Time `gorm:"index"`
|
||||
ChannelId string `gorm:"index"` // 推广渠道
|
||||
|
||||
DeviceName string `gorm:"index"`
|
||||
AppVersion string `gorm:"index"`
|
||||
BuildVersion string `gorm:"index"`
|
||||
AppChannel string `gorm:"index"`
|
||||
Tel string `gorm:"index"`
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package modelmysql
|
||||
|
||||
/*
|
||||
服务定期查询注册和登录信息,然后获取玩家id,保存到这张表中;用于后续触发和玩家相关的数据统计
|
||||
*/
|
||||
|
||||
type UserID struct {
|
||||
Snid int `gorm:"primaryKey"`
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package modelmysql
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
OutTypRegister = 1 // 注册
|
||||
OutTypeLogin = 2 // 登录
|
||||
OutTypeGaming = 3 // 游戏中
|
||||
OutTypeGameOver = 4 // 游戏结束
|
||||
)
|
||||
|
||||
type UserLogin struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Snid int `gorm:"uniqueIndex"`
|
||||
//OnlineTs int `gorm:"index"`
|
||||
OnlineTime time.Time `gorm:"index"`
|
||||
//OfflineTs int `gorm:"index"`
|
||||
OfflineTime time.Time `gorm:"index"`
|
||||
OutType int `gorm:"index"` // 跳出类型
|
||||
GameID int `gorm:"index"` // 游戏id
|
||||
Age int
|
||||
Sex int
|
||||
DeviceName string `gorm:"index"`
|
||||
AppVersion string `gorm:"index"`
|
||||
BuildVersion string `gorm:"index"`
|
||||
AppChannel string `gorm:"index"`
|
||||
Tel string `gorm:"index"`
|
||||
ChannelId string `gorm:"index"` // 推广渠道
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
package mq
|
|
@ -0,0 +1 @@
|
|||
接收消息队列
|
|
@ -0,0 +1 @@
|
|||
业务统计
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue