优化游戏类型判断

This commit is contained in:
sk 2024-05-16 18:39:31 +08:00
parent 3828311520
commit 0739d1eb12
35 changed files with 650 additions and 879 deletions

View File

@ -91,23 +91,20 @@ const (
GameId_Thr_XHJ = 901 //DG Game
)
// IsTienLen TienLen游戏
func IsTienLen(gameId int) bool {
return InSliceInt32(GetTienlenGameID(), int32(gameId))
}
func GetTienlenGameID() []int32 {
//todo 还要维护游戏id,好麻烦,还容易忘
return []int32{
GameId_TienLen, GameId_TienLen_yl,
GameId_TienLen_toend, GameId_TienLen_yl_toend,
GameId_TienLen_m, GameId_TienLen_m_toend,
GameId_TienLenSelect, GameId_TienLenSelect_toend,
GameId_TienLenSelect_yl, GameId_TienLenSelect_yl_toend,
GameId_TienLenRank, GameId_TienLenRank_toend,
GameId_TienLenRank_yl, GameId_TienLenRank_yl_toend,
}
}
const (
GameDifTienlen = "207" // tienlen
GameDifThirteen = "211" // 十三张
GameDifChess = "521" // 象棋
GameDifFish = "401" // 捕鱼
GameDifRocket = "607" // 小火箭
GameDifCaiShen = "301" // 财神
GameDifAvengers = "302" // 复仇者联盟
GameDifEaster = "303" // 复活节岛
GameDifIceAge = "304" // 冰河世纪
GameDifTamQuoc = "305" // 百战成神
GameDifFruits = "306" // 水果机
GameDifRichblessed = "307" // 多彩多福
)
// IsTienLenYuLe TienLen娱乐
func IsTienLenYuLe(gameId int) bool {
@ -138,39 +135,6 @@ func IsTienLenToEnd(gameId int) bool {
return false
}
// IsChess 象棋游戏
func IsChess(gameId int) bool {
switch gameId {
case GameId_Chesstitians,
GameId_ChesstitiansMakruk,
GameId_ChesstitiansCambodian,
GameId_ChesstitiansCambodianRobot:
return true
}
return false
}
// IsThirteen 十三张游戏
func IsThirteen(gameId int) bool {
switch gameId {
case GameID_Thirteen4,
GameID_Thirteen8,
GameID_ThirteenFree,
GameID_ThirteenFreeLaiZi:
return true
}
return false
}
// IsThirteen 十三张游戏
func IsSmallRocket(gameId int) bool {
switch gameId {
case GameId_SmallRoket:
return true
}
return false
}
// IsLocalGame 自动分场模式的游戏
// 根据 DB_Createroom.xlsx 给玩家分场或创建房间
func IsLocalGame(gameId int) bool {
@ -185,14 +149,6 @@ func IsLocalGame(gameId int) bool {
return false
}
// IsPlayerPool 需要统计在个人水池的游戏
func IsPlayerPool(gameId int) bool {
if IsTienLen(gameId) || IsThirteen(gameId) {
return true
}
return false
}
// 房间编号区间
const (
PrivateSceneStartId = 10000000
@ -219,23 +175,6 @@ const (
SceneMode_Thr //三方房间
)
// 场景级别
//const (
// SceneLvl_Test = -1 // 试玩场(不要钱)
// SceneLvl_Experience = 0 // 体验场(花小钱)
// SceneLvl_Primary = 1 // 初级场
// SceneLvl_Middle = 2 // 中级场
// SceneLvl_Senior = 3 // 高级场
// SceneLvl_Professor = 4 // 专家场
//)
// 房费选项
//const (
// RoomFee_Owner int32 = iota //房主
// RoomFee_AA //AA
// RoomFee_Max
//)
const (
Platform_Rob = "__$G_P$__"
Platform_Sys = "0"

Binary file not shown.

View File

@ -220,7 +220,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "208",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -278,7 +278,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "208",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -336,7 +336,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "208",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -394,7 +394,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "209",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -452,7 +452,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "209",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -510,7 +510,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "209",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -568,7 +568,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "210",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -626,7 +626,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "210",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -684,7 +684,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "210",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -742,7 +742,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "240",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -800,7 +800,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "240",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -857,7 +857,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "240",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -913,7 +913,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "240",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -969,7 +969,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "240",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1025,7 +1025,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "240",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1083,7 +1083,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "244",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1141,7 +1141,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "244",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1198,7 +1198,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "244",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1254,7 +1254,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "244",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1310,7 +1310,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "244",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1366,7 +1366,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "244",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1424,7 +1424,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "241",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1482,7 +1482,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "241",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1539,7 +1539,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "241",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1595,7 +1595,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "241",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1651,7 +1651,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "241",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1707,7 +1707,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "241",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1765,7 +1765,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "245",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1823,7 +1823,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "245",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1880,7 +1880,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "245",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1936,7 +1936,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "245",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -1992,7 +1992,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "245",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2048,7 +2048,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "245",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2108,7 +2108,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "242",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2168,7 +2168,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "242",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2227,7 +2227,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "242",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2285,7 +2285,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "242",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2343,7 +2343,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "242",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2401,7 +2401,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "242",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2461,7 +2461,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "246",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2521,7 +2521,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "246",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2580,7 +2580,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "246",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2638,7 +2638,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "246",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2696,7 +2696,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "246",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2754,7 +2754,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "246",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2814,7 +2814,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "243",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2874,7 +2874,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "243",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2933,7 +2933,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "243",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -2991,7 +2991,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "243",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3049,7 +3049,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "243",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3107,7 +3107,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "243",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3167,7 +3167,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "247",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3227,7 +3227,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "247",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3286,7 +3286,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "247",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3344,7 +3344,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "247",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3402,7 +3402,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "247",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3460,7 +3460,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "247",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3509,7 +3509,7 @@
200000
],
"SameIpLimit": 1,
"GameDif": "807",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -3557,7 +3557,7 @@
200000
],
"SameIpLimit": 1,
"GameDif": "808",
"GameDif": "207",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4160,7 +4160,7 @@
200000
],
"SameIpLimit": 1,
"GameDif": "522",
"GameDif": "521",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4212,7 +4212,7 @@
800000
],
"SameIpLimit": 1,
"GameDif": "522",
"GameDif": "521",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4264,7 +4264,7 @@
2000000
],
"SameIpLimit": 1,
"GameDif": "522",
"GameDif": "521",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4316,7 +4316,7 @@
2000000
],
"SameIpLimit": 1,
"GameDif": "522",
"GameDif": "521",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4368,7 +4368,7 @@
2000000
],
"SameIpLimit": 1,
"GameDif": "522",
"GameDif": "521",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4740,7 +4740,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "212",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4794,7 +4794,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "212",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4847,7 +4847,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "212",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4900,7 +4900,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "212",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -4953,7 +4953,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "212",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5006,7 +5006,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "212",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5060,7 +5060,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "213",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5114,7 +5114,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "213",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5168,7 +5168,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "213",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5222,7 +5222,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "214",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5276,7 +5276,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "214",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [
@ -5330,7 +5330,7 @@
],
"TaxRate": 500,
"SameIpLimit": 1,
"GameDif": "214",
"GameDif": "211",
"GameClass": 1,
"PlatformName": "越南棋牌",
"MaxBetCoin": [

View File

@ -1,5 +1,5 @@
6Ó†Ô†Õ†Ö†׆"¡<>À„=
.л<EFBFBD>и<EFBFBD>й<>к<>"Ё<>Р<>=
Wг<>д<>е<EFBFBD>ж<>и<>л<>з<>й<EFBFBD>к<>" Ё<><10>­т
]г<EFBFBD>ж<>м<>и<>й<>к<>л<>д<>е<>з<EFBFBD>"Ђ<>є
.и<>й<>к<EFBFBD>л<EFBFBD>"Ё<>Р<>=
Wг<>д<>з<EFBFBD>й<>л<>е<>ж<>и<EFBFBD>к<>" Ё<><10>­т
]д<EFBFBD>к<>л<>г<>е<>ж<>з<>и<>й<>м<EFBFBD>"Ђ<>є

Binary file not shown.

View File

@ -8,9 +8,11 @@ import (
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"mongo.games.com/game/common"
"mongo.games.com/game/dbproxy/mongo"
"mongo.games.com/game/model"
"mongo.games.com/game/srvdata"
"mongo.games.com/goserver/core/logger"
)
@ -454,7 +456,7 @@ func (svc *GamePlayerListSvc) GetWinCoinListTienlen(args *model.FindWinCoinListA
var tc []*M
err := c.Pipe([]bson.M{
{"$match": bson.M{
"gameid": bson.M{"$in": common.GetTienlenGameID()},
"gameid": bson.M{"$in": srvdata.GameFreeMgr.GetGameId(common.GameDifTienlen)},
"ts": bson.M{"$gte": args.StartTs, "$lte": args.EndTs},
}},
{"$group": bson.M{
@ -517,7 +519,7 @@ func (svc *GamePlayerListSvc) GetWinCoinTienlen(args *model.FindWinCoinArgs, ret
err := c.Pipe([]bson.M{
{"$match": bson.M{
"snid": args.SnId,
"gameid": bson.M{"$in": common.GetTienlenGameID()},
"gameid": bson.M{"$in": srvdata.GameFreeMgr.GetGameId(common.GameDifTienlen)},
"ts": bson.M{"$gte": args.StartTs, "$lte": args.EndTs},
}},
{"$group": bson.M{

View File

@ -32,7 +32,7 @@ func (this *CSAvengersOpHandler) Process(s *netlib.Session, packetid int, data i
logger.Logger.Warn("CSAvengersOpHandler p.scene == nil")
return nil
}
if scene.GameId != common.GameId_Avengers {
if scene.KeyGameDif != common.GameDifAvengers {
logger.Logger.Error("CSAvengersOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -513,7 +513,7 @@ func (this *CoinPoolManager) GetCoinPoolSetting(platform string, gamefreeid, gro
// GetCoinPoolSettingByGame 获取水池配置
func (this *CoinPoolManager) GetCoinPoolSettingByGame(platform string, gameId, gameMode, groupId int32) (settings []*webapi.CoinPoolSetting) {
ids, _ := srvdata.DataMgr.GetGameFreeIds(gameId, gameMode)
ids, _ := srvdata.GameFreeMgr.GetGameFreeIds(gameId, gameMode)
for _, id := range ids {
setting := this.GetCoinPoolSetting(platform, id, groupId)
if setting != nil {

View File

@ -16,7 +16,6 @@ import (
//rawproto "github.com/golang/protobuf/proto"
"math/rand"
"strconv"
"time"
)
@ -145,7 +144,7 @@ func NewPlayer(sid int64, data []byte, ws, gs *netlib.Session) *Player {
// 需要make的统一在这里初始化默认值别的地方就不用再初始化了
p.PlayerData = model.PlayerData{
TotalGameData: make(map[int][]*model.PlayerGameTotal),
//TotalGameData: make(map[int][]*model.PlayerGameTotal),
GDatas: make(map[string]*model.PlayerGameInfo),
ShopTotal: make(map[int32]*model.ShopTotal),
ShopLastLookTime: make(map[int32]int64),
@ -714,38 +713,29 @@ func (this *Player) AddServiceFee(tax int64) {
}
}
func (this *Player) GetStaticsData(gameDiff string) (winCoin int64, lostCoin int64) {
if this.PlayerData.GDatas != nil {
if data, ok := this.PlayerData.GDatas[gameDiff]; ok {
winCoin, lostCoin = data.Statics.TotalOut, data.Statics.TotalIn
return
}
}
return
}
func (this *Player) SaveReportForm(showId, sceneMode int, keyGameId string, profitCoin, flow int64, validBet int64) {
//个人报表统计
if this.TotalGameData == nil {
this.TotalGameData = make(map[int][]*model.PlayerGameTotal)
}
if this.TotalGameData[showId] == nil {
this.TotalGameData[showId] = []*model.PlayerGameTotal{new(model.PlayerGameTotal)}
}
td := this.TotalGameData[showId][len(this.TotalGameData[showId])-1]
td.ProfitCoin += profitCoin
td.BetCoin += validBet
td.FlowCoin += flow
///////////////最多盈利
if pgs, exist := this.GDatas[keyGameId]; exist {
if pgs.Statics.MaxSysOut < profitCoin {
pgs.Statics.MaxSysOut = profitCoin
}
} else {
gs := model.NewPlayerGameStatics()
gs.MaxSysOut = profitCoin
this.GDatas[keyGameId] = &model.PlayerGameInfo{FirstTime: time.Now(), Statics: *gs}
}
}
//func (this *Player) SaveReportForm(showId, sceneMode int, keyGameId string, profitCoin, flow int64, validBet int64) {
// //个人报表统计
// if this.TotalGameData == nil {
// this.TotalGameData = make(map[int][]*model.PlayerGameTotal)
// }
// if this.TotalGameData[showId] == nil {
// this.TotalGameData[showId] = []*model.PlayerGameTotal{new(model.PlayerGameTotal)}
// }
// td := this.TotalGameData[showId][len(this.TotalGameData[showId])-1]
// td.ProfitCoin += profitCoin
// td.BetCoin += validBet
// td.FlowCoin += flow
// ///////////////最多盈利
// if pgs, exist := this.GDatas[keyGameId]; exist {
// if pgs.Statics.MaxSysOut < profitCoin {
// pgs.Statics.MaxSysOut = profitCoin
// }
// } else {
// gs := model.NewPlayerGameStatics()
// gs.MaxSysOut = profitCoin
// this.GDatas[keyGameId] = &model.PlayerGameInfo{FirstTime: time.Now(), Statics: *gs}
// }
//}
// Statics 弃用,使用 Scene.Statistics 方法
// 个人投入产出汇总以游戏id为key存储
@ -860,109 +850,6 @@ func (this *Player) Statics(keyGameId string, keyGameFreeId string, gain int64,
////}
}
//func (this *Player) CheckType(gamefreeId, gameId int32) *server.DB_PlayerType {
// types := srvdata.PlayerTypeMgrSington.GetPlayerType(gamefreeId)
// cnt := len(types)
// if cnt > 0 {
// var pgs *model.PlayerGameStatics
// if this.GDatas != nil {
// if d, exist := this.GDatas[strconv.Itoa(int(gameId))]; exist {
// pgs = &d.Statics
// }
// }
//
// //赔率 产出/投入 万分比
// odds := int64(float64(float64(pgs.TotalOut+1)/float64(pgs.TotalIn+1)) * 10000)
// if odds > 10000000 {
// odds = 10000000
// }
// for i := 0; i < cnt; i++ {
// t := types[i]
// if t != nil {
// if this.CoinPayTotal >= int64(t.GetPayLowerLimit()) && this.CoinPayTotal <= int64(t.GetPayUpperLimit()) &&
// pgs.GameTimes >= int64(t.GetGameTimeLowerLimit()) && pgs.GameTimes <= int64(t.GetGameTimeUpperLimit()) &&
// pgs.TotalIn >= int64(t.GetTotalInLowerLimit()) && pgs.TotalIn <= int64(t.GetTotalInUpperLimit()) &&
// odds >= int64(t.GetOddsLowerLimit()) && odds <= int64(t.GetOddsUpperLimit()) {
// return t
// }
// }
// }
// }
// return nil
//}
// 计算玩家赔率 产出/投入
func (this *Player) LoseRate(gamefreeId, gameId int32) (rate float64) {
rate = -1
if this.GDatas != nil {
if d, exist := this.GDatas[strconv.Itoa(int(gameId))]; exist {
rate = float64(float64(d.Statics.TotalOut+1) / float64(d.Statics.TotalIn+1))
return rate
}
}
return rate
}
// 计算玩家赔率 产出/投入
func (this *Player) LoseRateKeyGameid(gameKeyId string) (rate float64) {
rate = -1
var pgs *model.PlayerGameStatics
if this.GDatas != nil {
if d, exist := this.GDatas[gameKeyId]; exist {
pgs = &d.Statics
}
}
rate = float64(float64(pgs.TotalOut+1) / float64(pgs.TotalIn+1))
return
}
// 是否是新手判定
//
// func (this *Player) IsFoolPlayerBy(gameId string) {
// if this.IsRob || this.GDatas == nil {
// return
// }
// if this.GDatas[gameId] == nil {
// return
// }
// if this.IsFoolPlayer == nil {
// this.IsFoolPlayer = make(map[string]bool)
// }
// if model.GameParamData.BirdPlayerFlag == false {
// this.IsFoolPlayer[gameId] = false
// return
// }
// playerDate := this.GDatas[gameId]
// //金花游戏局数小于10局并且总产出<100000并且总产出/(总投入+10000<=2的玩家定义为新手玩家
// if playerDate.Statics.GameTimes < 10 && playerDate.Statics.TotalOut < 100000 &&
// playerDate.Statics.TotalOut/(playerDate.Statics.TotalIn+10000) <= 2 {
// this.IsFoolPlayer[gameId] = true
// } else {
// this.IsFoolPlayer[gameId] = false
// }
// }
//func (this *Player) PlayerGameNewCheck(gameDiff string) bool {
// if this.IsRob {
// return false
// }
// if this.GDatas == nil {
// return true
// }
// gameId := gameDiff
// if this.GDatas[gameId] == nil {
// return true
// }
// playerDate := this.GDatas[gameId]
// if playerDate.Statics.GameTimes > int64(model.GameParamData.GamePlayerCheckNum) {
// return true
// } else {
// return false
// }
//}
func (this *Player) SendTrusteeshipTips() {
pack := &player.SCTrusteeshipTips{
Trusteeship: proto.Int32(this.Trusteeship),

View File

@ -102,8 +102,9 @@ type Scene struct {
replayAddId int32
KeyGameId string //游戏类型唯一ID
KeyGamefreeId string //游戏场次唯一id
GroupId int32 //分组id
bEnterAfterStart bool //是否允许中途加入
KeyGameDif string
GroupId int32 //分组id
bEnterAfterStart bool //是否允许中途加入
ClubId int32
RoomId string //俱乐部那个包间
RoomPos int32 //房间桌号
@ -247,9 +248,9 @@ func (this *Scene) init() bool {
}
}
//this.keyGameId = strconv.Itoa(int(this.dbGameFree.GetGameId()))
this.KeyGameId = this.DbGameFree.GetGameDif()
this.KeyGameId = strconv.Itoa(int(this.DbGameFree.GetGameId()))
this.KeyGamefreeId = strconv.Itoa(int(this.DbGameFree.GetId()))
this.KeyGameDif = this.DbGameFree.GetGameDif()
}
// test
//for i := 0; i < 100; i++ {
@ -1746,8 +1747,8 @@ func (this *Scene) SaveGamePlayerListLog(snid int32, param *SaveGamePlayerListLo
playerEx.TotalFlow += totalFlow
playerEx.ValidCacheBetTotal += param.ValidBet
//报表统计
playerEx.SaveReportForm(int(this.DbGameFree.GetGameClass()), this.SceneMode, this.KeyGameId,
param.WinAmountNoAnyTax, totalFlow, param.ValidBet)
//playerEx.SaveReportForm(int(this.DbGameFree.GetGameClass()), this.SceneMode, this.KeyGameId,
// param.WinAmountNoAnyTax, totalFlow, param.ValidBet)
//分配利润
ProfitDistribution(playerEx, param.TaxCoin, param.ClubPumpCoin, totalFlow)
//上报游戏事件
@ -2583,7 +2584,7 @@ func (this *Scene) Statistics(param *StaticParam) {
}
p.WinCoin += totalOut
p.TaxCoin += param.GainTax
if isPlayerPool && common.IsPlayerPool(this.GameId) {
if isPlayerPool && srvdata.GameFreeMgr.IsPlayerPool(this.GameId) {
p.TotalOut += totalOut
p.PlayerTax += param.GainTax
}
@ -2592,7 +2593,7 @@ func (this *Scene) Statistics(param *StaticParam) {
p.FailTimes++
}
p.FailCoin += totalIn
if isPlayerPool && common.IsPlayerPool(this.GameId) {
if isPlayerPool && srvdata.GameFreeMgr.IsPlayerPool(this.GameId) {
p.TotalIn += totalIn
}
} else {

View File

@ -32,7 +32,7 @@ func (this *CSCaiShenOpHandler) Process(s *netlib.Session, packetid int, data in
logger.Logger.Warn("CSCaiShenOpHandler p.scene == nil")
return nil
}
if scene.GameId != common.GameId_CaiShen {
if scene.KeyGameDif != common.GameDifCaiShen {
logger.Logger.Error("CSCaiShenOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -30,7 +30,7 @@ func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interf
logger.Logger.Warn("CSPlayerOpHandler p.scene == nil")
return nil
}
if !common.IsChess(scene.GetGameId()) {
if scene.KeyGameDif != common.GameDifChess {
logger.Logger.Error("CSPlayerOpHandler gameId Error ", scene.GameId)
return nil
}
@ -72,7 +72,7 @@ func (h *CSPlayerDevOpHandler) Process(s *netlib.Session, packetid int, data int
logger.Logger.Warn("CSPlayerDevOpHandler p.scene == nil")
return nil
}
if !common.IsChess(scene.GetGameId()) {
if scene.KeyGameDif != common.GameDifChess {
logger.Logger.Error("CSPlayerDevOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -1,10 +1,10 @@
package chesstitians
import (
"time"
rule "mongo.games.com/game/gamerule/chess"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/model"
"time"
)
// PlayerEx 玩家身上的额外数据
@ -32,9 +32,6 @@ func (p *PlayerEx) init() {
p.oldGrade = 0
p.totalTime = 0
p.lastTime = time.Time{}
if !p.GetScene().IsMatchScene() && !p.GetScene().IsPrivateScene() { //非比赛场 非私有房间
p.LoadPlayerGameInfo(p.GetScene().KeyGameId)
}
}
func (p *PlayerEx) Clear() {
@ -54,21 +51,6 @@ func (p *PlayerEx) CanOp() bool {
return false
}
func (p *PlayerEx) LoadPlayerGameInfo(keyGameId string) {
if p.IsRob {
return
}
if p.GDatas == nil {
p.GDatas = make(map[string]*model.PlayerGameInfo)
}
if data, exist := p.GDatas[keyGameId]; !exist {
data = new(model.PlayerGameInfo)
data.Statics.TotalOut = 920000
data.Statics.TotalIn = 1000000
p.GDatas[keyGameId] = data
}
}
// GetTotalTime 获取玩家总下棋消耗的操作时长,单位秒
func (p *PlayerEx) GetTotalTime() int32 {
if s := p.GetScene(); s != nil && s.GetSceneState().GetState() == rule.SceneStatePlayerOp && p.IsGameing() {

View File

@ -32,7 +32,7 @@ func (this *CSEasterIslandOpHandler) Process(s *netlib.Session, packetid int, da
logger.Logger.Warn("CSEasterIslandOpHandler p.scene == nil")
return nil
}
if scene.GameId != common.GameId_EasterIsland {
if scene.KeyGameDif != common.GameDifEaster {
logger.Logger.Error("CSEasterIslandOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -33,7 +33,7 @@ func (this *CSIceAgeOpHandler) Process(s *netlib.Session, packetid int, data int
logger.Logger.Warn("CSIceAgeOpHandler p.scene == nil")
return nil
}
if scene.GameId != common.GameId_IceAge {
if scene.KeyGameDif != common.GameDifIceAge {
logger.Logger.Error("CSIceAgeOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -33,7 +33,7 @@ func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interf
return nil
}
if !common.IsSmallRocket(scene.GetGameId()) {
if scene.KeyGameDif != common.GameDifRocket {
logger.Logger.Error("CSPlayerOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -3,7 +3,7 @@ package tamquoc
import (
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/game/common"
"mongo.games.com/game/gamesrv/base"
"mongo.games.com/game/protocol/tamquoc"
@ -32,7 +32,7 @@ func (this *CSTamQuocOpHandler) Process(s *netlib.Session, packetid int, data in
logger.Logger.Warn("CSTamQuocOpHandler p.scene == nil")
return nil
}
if scene.GameId != common.GameId_TamQuoc {
if scene.KeyGameDif != common.GameDifTamQuoc {
logger.Logger.Error("CSTamQuocOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -30,7 +30,7 @@ func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interf
logger.Logger.Warn("CSPlayerOpHandler p.scene == nil")
return nil
}
if !common.IsThirteen(scene.GetGameId()) {
if scene.KeyGameDif != common.GameDifThirteen {
logger.Logger.Error("CSPlayerOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -31,7 +31,7 @@ func (this *CSTienLenPlayerOpHandler) Process(s *netlib.Session, packetid int, d
logger.Logger.Warn("CSTienLenPlayerOpHandler p.scene == nil")
return nil
}
if !common.IsTienLen(scene.GetGameId()) {
if scene.KeyGameDif != common.GameDifTienlen {
logger.Logger.Error("CSTienLenPlayerOpHandler gameId Error ", scene.GameId)
return nil
}

View File

@ -1575,7 +1575,6 @@ func (this *TienLenSceneData) SendHandCardOdds() {
if player.IsGameing() && !player.IsRob {
pack := &tienlen.SCTienLenCardTest{}
pack.Totalout, pack.Totalin = player.TotalOutIn(int32(this.GetGameId()))
pack.LoseRate = player.LoseRate(this.GetGameFreeId(), int32(this.GetGameId()))
if Grades != nil {
pack.Grades = make(map[int32]int32)
for id, grade := range Grades {
@ -2023,34 +2022,12 @@ func (this *TienLenSceneData) SystemCoinOut() int64 {
return systemGain
}
func (this *TienLenSceneData) IsTienlenPlayerFirst(p *base.Player) bool {
if p == nil {
return false
}
if p.IsRobot() {
return false
}
if common.InSliceInt32(common.GetTienlenGameID(), int32(this.GameId)) {
if data, ok := p.GDatas[this.KeyGameId]; ok {
if data.Statics.GameTimes < 1 {
return true
}
return false
}
return true
}
return false
}
func (this *TienLenSceneData) SendFirstGiveTimeItem(p *base.Player) {
if p.IsRobot() {
return
}
if this.IsTienlenPlayerFirst(p) && !p.PlayerData.IsTakeExpireItem {
if !p.PlayerData.IsTakeExpireItem {
itemID := int32(60001)
itemData := srvdata.PBDB_GameItemMgr.GetData(itemID)
if itemData == nil {

View File

@ -320,108 +320,108 @@ type MatchFreeSignupRec struct {
}
type PlayerData struct {
Id bson.ObjectId `bson:"_id"`
AccountId string //账号id
AccountType int32 //账号类型
SnId int32 //数字唯一id
NiceId int32 //靓号
Name string //名字
Remark string //备注
Platform string //平台
Channel string //渠道信息
DeviceOS string //设备操作系统
DeviceId string //设备id
PackageID string //推广包标识 对应客户端的packagetag
Package string //包信息 android:包名 ios:bundleid
IsRob bool //是否是机器人
Head int32 //头像
HeadUrl string //头像
Sex int32 //性别
HeadOutLine int32 //头像框
VIP int32 //VIP帐号 等级
GMLevel int32 //GM等级
WinTimes int32 //胜利次数
FailTimes int32 //失败次数
DrawTimes int32 //平局次数
WinCoin int64 //总赢钱数量(税前)
FailCoin int64 //总输钱数量
TaxCoin int64 //总税收
Tel string //电话号码
Ip string //最后登录ip地址
RegIp string //注册ip地址
City string //城市
Params string //其他参数
AlipayAccount string //支付宝账号
AlipayAccName string //支付宝实名
Bank string //绑定的银行名称
BankAccount string //绑定的银行账号
BankAccName string //绑定的银行账号
Coin int64 //金豆
CoinPayTs int64 //金豆冲账时间戳
CoinPayTotal int64 //在线总充值金额
MoneyPayTotal int64 //在线总充值金额(实充)
CoinExchangeTotal int64 //总提现金额 兑换
SafeBoxCoin int64 //保险箱金币
SafeBoxPassword string //保险箱密码
Diamond int64 //钻石
InviterId int32 //邀请人Id
InviterName string //邀请人名称
InviterHead int32 //邀请人头像
BeUnderAgentCode string //隶属经销商(推广人)
SubBeUnderAgentCode string //经销商子id
Flags int64 //标记
GameCoinTs int64 //游服金币对账时间戳
Ver int32 //数据版本号
CheckSum uint32 //校验码(预防暴库修改数据)
UpgradeTime time.Time //升级账号时间,绑定手机号时间
CreateTime time.Time //创建时间
LastLoginTime time.Time //最后登陆时间
LastLogoutTime time.Time //缓存数据清除时间,最后数据持久化时间
AllowSpeakTime int64 //允许下次发言的时间戳
AgentType int32 //代理类型 0:普通用户 其它为代理
GameTax int64 //总游戏税收
SafeBoxCoinTs int64 //保险箱冲账时间戳
WhiteFlag int32 //特殊白名单标记
WBCoinTotalOut int64 //加入黑白名单后玩家总产出
WBCoinTotalIn int64 //加入黑白名单后玩家总投入
WBCoinLimit int64 //黑白名单输赢额度,额度变为0时自动解除黑白名单
WBMaxNum int32 //黑白名单最大干预次数
WBTime time.Time //黑白名单操作时间
WBState int32 //调控状态
TotalCoin int64 //总金币
PromoterTree int32 //推广树信息
TotalConvertibleFlow int64 //玩家流水总额 默认1:1 //流水统计使用
TotalFlow int64 //历史总流水
CanExchangeBeforeRecharge int64 //充值之前可兑换金额 //流水统计使用
LastRechargeWinCoin int64 //充值后流水
BlacklistType int32 //黑名单作用域和后台一样都是采用位标记的表示形式 // 0是不限制 第1位是游戏登录 第2位是兑换 第3位是充值注意这个地方是黑名单管理的作用域+1 //主要是为了在mgo没有设置黑名单类型的时候默认是不限制的
ForceVip int32 //强制VIP等级通过后台设置如果设置了当前值就不再通过paytotal计算vip等级
LastExchangeTime int64 //最后兑换时间
LastExchangeOrder string //最后的赠与订单
LogicLevels []int32 //用户分层信息
AutomaticTags []int32 //用户自动化标记
TelephonePromoter int32 //电销推广员标识,用于电销标记
TelephoneCallNum int32 //电销次数
Ticket int64 //比赛券
TicketPayTs int64 //比赛券冲账时间点
TicketTotal int64 //累计总获得比赛券数量
TicketTotalDel int64 //累计清理掉的数量
Grade int64 //积分
TagKey int32 //包标识关键字
LoginTimes int //用户登录次数
YesterdayGameData *PlayerGameCtrlData //昨日游戏统计数据
TodayGameData *PlayerGameCtrlData //今日游戏统计数据
IsFoolPlayer map[string]bool //每个游戏是否是新手玩家
TotalGameData map[int][]*PlayerGameTotal //统计数据 1.棋牌 2.电子 3.捕鱼 4.视讯 5.彩票 6.体育 7.个人房间 8.俱乐部房间 9.三方游戏
GDatas map[string]*PlayerGameInfo //玩家游戏统计数据 key:gameFreeId, key:gameid
MarkInfo string //用来备注玩家信息
DeviceInfo string //设备信息
WBLevel int32 //黑白名单 白:[1,10] 黑:[-1,-10]
ShopTotal map[int32]*ShopTotal //key为商品id
ShopLastLookTime map[int32]int64 //商品上一次的观看时间
Roles *RolePetInfo //人物
Pets *RolePetInfo //宠物
WelfData *WelfareData //活动数据
Id bson.ObjectId `bson:"_id"`
AccountId string //账号id
AccountType int32 //账号类型
SnId int32 //数字唯一id
NiceId int32 //靓号
Name string //名字
Remark string //备注
Platform string //平台
Channel string //渠道信息
DeviceOS string //设备操作系统
DeviceId string //设备id
PackageID string //推广包标识 对应客户端的packagetag
Package string //包信息 android:包名 ios:bundleid
IsRob bool //是否是机器人
Head int32 //头像
HeadUrl string //头像
Sex int32 //性别
HeadOutLine int32 //头像框
VIP int32 //VIP帐号 等级
GMLevel int32 //GM等级
WinTimes int32 //胜利次数
FailTimes int32 //失败次数
DrawTimes int32 //平局次数
WinCoin int64 //总赢钱数量(税前)
FailCoin int64 //总输钱数量
TaxCoin int64 //总税收
Tel string //电话号码
Ip string //最后登录ip地址
RegIp string //注册ip地址
City string //城市
Params string //其他参数
AlipayAccount string //支付宝账号
AlipayAccName string //支付宝实名
Bank string //绑定的银行名称
BankAccount string //绑定的银行账号
BankAccName string //绑定的银行账号
Coin int64 //金豆
CoinPayTs int64 //金豆冲账时间戳
CoinPayTotal int64 //在线总充值金额
MoneyPayTotal int64 //在线总充值金额(实充)
CoinExchangeTotal int64 //总提现金额 兑换
SafeBoxCoin int64 //保险箱金币
SafeBoxPassword string //保险箱密码
Diamond int64 //钻石
InviterId int32 //邀请人Id
InviterName string //邀请人名称
InviterHead int32 //邀请人头像
BeUnderAgentCode string //隶属经销商(推广人)
SubBeUnderAgentCode string //经销商子id
Flags int64 //标记
GameCoinTs int64 //游服金币对账时间戳
Ver int32 //数据版本号
CheckSum uint32 //校验码(预防暴库修改数据)
UpgradeTime time.Time //升级账号时间,绑定手机号时间
CreateTime time.Time //创建时间
LastLoginTime time.Time //最后登陆时间
LastLogoutTime time.Time //缓存数据清除时间,最后数据持久化时间
AllowSpeakTime int64 //允许下次发言的时间戳
AgentType int32 //代理类型 0:普通用户 其它为代理
GameTax int64 //总游戏税收
SafeBoxCoinTs int64 //保险箱冲账时间戳
WhiteFlag int32 //特殊白名单标记
WBCoinTotalOut int64 //加入黑白名单后玩家总产出
WBCoinTotalIn int64 //加入黑白名单后玩家总投入
WBCoinLimit int64 //黑白名单输赢额度,额度变为0时自动解除黑白名单
WBMaxNum int32 //黑白名单最大干预次数
WBTime time.Time //黑白名单操作时间
WBState int32 //调控状态
TotalCoin int64 //总金币
PromoterTree int32 //推广树信息
TotalConvertibleFlow int64 //玩家流水总额 默认1:1 //流水统计使用
TotalFlow int64 //历史总流水
CanExchangeBeforeRecharge int64 //充值之前可兑换金额 //流水统计使用
LastRechargeWinCoin int64 //充值后流水
BlacklistType int32 //黑名单作用域和后台一样都是采用位标记的表示形式 // 0是不限制 第1位是游戏登录 第2位是兑换 第3位是充值注意这个地方是黑名单管理的作用域+1 //主要是为了在mgo没有设置黑名单类型的时候默认是不限制的
ForceVip int32 //强制VIP等级通过后台设置如果设置了当前值就不再通过paytotal计算vip等级
LastExchangeTime int64 //最后兑换时间
LastExchangeOrder string //最后的赠与订单
LogicLevels []int32 //用户分层信息
AutomaticTags []int32 //用户自动化标记
TelephonePromoter int32 //电销推广员标识,用于电销标记
TelephoneCallNum int32 //电销次数
Ticket int64 //比赛券
TicketPayTs int64 //比赛券冲账时间点
TicketTotal int64 //累计总获得比赛券数量
TicketTotalDel int64 //累计清理掉的数量
Grade int64 //积分
TagKey int32 //包标识关键字
LoginTimes int //用户登录次数
YesterdayGameData *PlayerGameCtrlData //昨日游戏统计数据
TodayGameData *PlayerGameCtrlData //今日游戏统计数据
IsFoolPlayer map[string]bool //每个游戏是否是新手玩家
//TotalGameData map[int][]*PlayerGameTotal //统计数据 1.棋牌 2.电子 3.捕鱼 4.视讯 5.彩票 6.体育 7.个人房间 8.俱乐部房间 9.三方游戏
GDatas map[string]*PlayerGameInfo //玩家游戏统计数据 key:gameFreeId, key:gameid
MarkInfo string //用来备注玩家信息
DeviceInfo string //设备信息
WBLevel int32 //黑白名单 白:[1,10] 黑:[-1,-10]
ShopTotal map[int32]*ShopTotal //key为商品id
ShopLastLookTime map[int32]int64 //商品上一次的观看时间
Roles *RolePetInfo //人物
Pets *RolePetInfo //宠物
WelfData *WelfareData //活动数据
*SignData
VipMatchTimes int32 //VIP比赛场参与次数
ChessGrade int64 // 国际象棋游戏积分
@ -770,12 +770,12 @@ func NewPlayerData(acc string, name string, id int32, channel, platform string,
WBCoinLimit: 0,
YesterdayGameData: NewPlayerGameCtrlData(),
TodayGameData: NewPlayerGameCtrlData(),
TotalGameData: make(map[int][]*PlayerGameTotal),
GDatas: make(map[string]*PlayerGameInfo),
TagKey: tagkey,
ShopTotal: make(map[int32]*ShopTotal),
ShopLastLookTime: make(map[int32]int64),
IsFoolPlayer: make(map[string]bool),
//TotalGameData: make(map[int][]*PlayerGameTotal),
GDatas: make(map[string]*PlayerGameInfo),
TagKey: tagkey,
ShopTotal: make(map[int32]*ShopTotal),
ShopLastLookTime: make(map[int32]int64),
IsFoolPlayer: make(map[string]bool),
//测试数据
PowerList: []int32{1}, //默认炮台
UnMaxPower: 10, //初始化炮倍最小倍数
@ -824,13 +824,13 @@ func NewPlayerDataThird(acc string, name, headUrl string, id int32, channel, pla
PackageID: packTag,
YesterdayGameData: NewPlayerGameCtrlData(),
TodayGameData: NewPlayerGameCtrlData(),
TotalGameData: make(map[int][]*PlayerGameTotal),
GDatas: make(map[string]*PlayerGameInfo),
TagKey: tagkey,
ShopTotal: make(map[int32]*ShopTotal),
ShopLastLookTime: make(map[int32]int64),
AccountType: accountType,
DeviceOS: deviceOS,
//TotalGameData: make(map[int][]*PlayerGameTotal),
GDatas: make(map[string]*PlayerGameInfo),
TagKey: tagkey,
ShopTotal: make(map[int32]*ShopTotal),
ShopLastLookTime: make(map[int32]int64),
AccountType: accountType,
DeviceOS: deviceOS,
}
pd.InitNewData(params)

View File

@ -123,20 +123,13 @@ func (this *ProtobufDataLoader) Reload(fileFullPath string) error {
}
var DataMgr = &dataMgr{
loaders: make(map[string]DataLoader),
afterLoaders: make(map[string][]DataLoader),
cacheGameFreeId: make(map[int32]CacheGameType),
loaders: make(map[string]DataLoader),
afterLoaders: make(map[string][]DataLoader),
}
type dataMgr struct {
loaders map[string]DataLoader
afterLoaders map[string][]DataLoader
cacheGameFreeId map[int32]CacheGameType
}
type CacheGameType struct {
Ids []int32
GameType int32
}
// register 注册数据加载器,这个应该只是自动生产的代码中会用到,其它地方用不到
@ -160,19 +153,3 @@ func (this *dataMgr) GetLoader(name string) []DataLoader {
}
return ret
}
func (this *dataMgr) GetGameFreeIds(gameId, gameMode int32) (ids []int32, gameType int32) {
key := gameId<<16 | gameMode
if data, exist := this.cacheGameFreeId[key]; exist {
return data.Ids, data.GameType
} else {
for _, dbGameFree := range PBDB_GameFreeMgr.Datas.Arr {
if dbGameFree.GetGameId() == gameId && dbGameFree.GetGameMode() == gameMode {
ids = append(ids, dbGameFree.GetId())
gameType = dbGameFree.GetGameType()
}
}
this.cacheGameFreeId[key] = CacheGameType{Ids: ids, GameType: gameType}
}
return
}

87
srvdata/gamefreemgr.go Normal file
View File

@ -0,0 +1,87 @@
package srvdata
import "mongo.games.com/game/common"
func init() {
DataMgr.RegisterLoader("DB_GameFree.dat", GameFreeMgr)
}
var GameFreeMgr = &GameFree{
GameId: make(map[string][]int32),
GameMode: make(map[int32]map[int32][]int32),
}
type GameFree struct {
GameId map[string][]int32 // GameDif:[]GameId
GameMode map[int32]map[int32][]int32
}
func (this *GameFree) Load(fileFullPath string) error {
this.GameMode = make(map[int32]map[int32][]int32)
this.GameId = make(map[string][]int32)
for _, v := range PBDB_GameFreeMgr.Datas.Arr {
// GameMode
vv, ok := this.GameMode[v.GameId]
if !ok {
vv = make(map[int32][]int32)
this.GameMode[v.GameId] = vv
}
_, ok = vv[v.GameMode]
if !ok {
this.GameMode[v.GameId][v.GameMode] = []int32{v.Id}
} else {
this.GameMode[v.GameId][v.GameMode] = append(this.GameMode[v.GameId][v.GameMode], v.Id)
}
// GameId
this.GameId[v.GameDif] = append(this.GameId[v.GameDif], v.GameId)
}
return nil
}
func (this *GameFree) Reload(fileFullPath string) error {
return this.Load(fileFullPath)
}
func (this *GameFree) GetGameFreeIds(gameId, gameMode int32) (ids []int32, gameType int32) {
mode, ok := this.GameMode[gameId]
if !ok {
return nil, 0
}
ids, ok = mode[gameMode]
if len(ids) > 0 {
data := PBDB_GameFreeMgr.GetData(ids[0])
if data != nil {
gameType = data.GameType
}
}
return
}
func (this *GameFree) GetGameId(gameDif string) []int32 {
return this.GameId[gameDif]
}
func (this *GameFree) IsGameDif(gameId int32, gameDif string) bool {
mode, ok := this.GameMode[gameId]
if !ok {
return false
}
for _, v := range mode {
if len(v) > 0 {
data := PBDB_GameFreeMgr.GetData(v[0])
if data == nil {
return false
}
return data.GameDif == gameDif
} else {
return false
}
}
return false
}
// IsPlayerPool 需要统计在个人水池的游戏
func (this *GameFree) IsPlayerPool(gameId int) bool {
return this.IsGameDif(int32(gameId), common.GameDifTienlen) || this.IsGameDif(int32(gameId), common.GameDifThirteen)
}

View File

@ -1,289 +1,275 @@
package main
import (
"mongo.games.com/game/common"
"mongo.games.com/game/model"
"mongo.games.com/game/proto"
"mongo.games.com/game/protocol/server"
"mongo.games.com/goserver/core/basic"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/netlib"
"mongo.games.com/goserver/core/task"
"mongo.games.com/goserver/srvlib"
"strconv"
"time"
)
type DWThirdRebateMessagePacketFactory struct {
}
type DWThirdRebateMessageHandler struct {
}
func (this *DWThirdRebateMessagePacketFactory) CreatePacket() interface{} {
pack := &server.DWThirdRebateMessage{}
return pack
}
func (this *DWThirdRebateMessageHandler) Process(s *netlib.Session, packetid int, data interface{}) error {
logger.Logger.Trace("DWThirdRebateMessageHandler Process recv ", data)
if msg, ok := data.(*server.DWThirdRebateMessage); ok {
//TODO
SendAckToDataSrv(msg.GetTag(), 2)
if msg.GetAvailableBet() <= 0 {
logger.Logger.Warn("DWThirdRebateMessageHandler is error: AvailableBet= ", msg.GetAvailableBet())
return nil
}
//p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
//if p != nil {
// p.dirty = true
// //actRandCoinMgr.OnPlayerLiuShui(p, msg.GetAvailableBet())
//}
//
//thirdId := strconv.Itoa(int(ThirdPltGameMappingConfig.FindThirdIdByThird(msg.GetThird())))
//rebateTask := RebateInfoMgrSington.rebateTask[strconv.Itoa(int(msg.GetPlt()))]
//if rebateTask != nil {
// Third := rebateTask.RebateGameThirdCfg[thirdId]
// if Third != nil {
// p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
// if p == nil {
// logger.Logger.Trace("DWThirdRebateMessageHandler p == nil ", msg.GetSnid())
// OfflinePlayerMgrSington.GetOfflinePlayer(msg.GetSnid(), func(op *OfflinePlayer, asyn bool) {
// if op == nil {
// return
// }
// if op.IsRob {
// return
// }
//
// if data, ok := op.RebateData[thirdId]; ok {
// data.ValidBetTotal += msg.GetAvailableBet()
// } else {
// op.RebateData[thirdId] = &model.RebateData{
// ValidBetTotal: msg.GetAvailableBet(),
// }
// }
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
// //注意流控防止该任务过渡占用登陆队列可以在datasrv上配置心跳和maxdone来控制
// return model.SavePlayerRebate(op.PlayerData, thirdId)
// }), task.CompleteNotifyWrapper(func(data interface{}, tt *task.Task) {
// if data != nil {
// logger.Logger.Errorf("SavePlayerRebate error:%v snid:%v platform:%v AvailableBet:%v", data, msg.GetSnid(), msg.GetThird(), msg.GetAvailableBet())
// } else {
// p = PlayerMgrSington.GetPlayerBySnId(msg.GetSnid()) //说明更新任务排在了玩家登陆的后面(造成了脏读,重新应用下该次下注)
// if p != nil {
// if data, ok := p.RebateData[thirdId]; ok {
// data.ValidBetTotal += msg.GetAvailableBet()
// } else {
// p.RebateData[thirdId] = &model.RebateData{
// ValidBetTotal: msg.GetAvailableBet(),
// }
// }
// p.dirty = true
// }
// }
// }), "SavePlayerRebate").StartByExecutor(op.AccountId) //保证和玩家存取在一条线程内(避免脏读或者脏写)
// }, false)
// return nil
// }
// if p.IsRob {
// logger.Logger.Trace("DWThirdRebateMessageHandler p is rob ", msg.GetSnid())
// return nil
// }
// if data, ok := p.RebateData[thirdId]; ok {
// data.ValidBetTotal += msg.GetAvailableBet()
// } else {
// p.RebateData[thirdId] = &model.RebateData{
// ValidBetTotal: msg.GetAvailableBet(),
// }
// }
//
// p.dirty = true
// //p.CountRebate(thirdId, 1)
// } else {
// logger.Logger.Trace("DWThirdRebateMessageHandler Third is nil. ", msg.GetPlt(), msg.GetThird())
// }
//} else {
// logger.Logger.Trace("DWThirdRebateMessageHandler rebateTask is nil. ", msg.GetPlt(), msg.GetThird())
//}
}
return nil
}
type DWThirdRoundMessagePacketFactory struct {
}
type DWThirdRoundMessageHandler struct {
}
func (this *DWThirdRoundMessagePacketFactory) CreatePacket() interface{} {
pack := &server.DWThirdRoundMessage{}
return pack
}
func (this *DWThirdRoundMessageHandler) Process(s *netlib.Session, packetid int, data interface{}) error {
logger.Logger.Trace("DWThirdRoundMessageHandler Process recv ", data)
if msg, ok := data.(*server.DWThirdRoundMessage); ok {
//todo
//获取到对应的gamefreeid,三方的特殊处理了只寻找对应大类的第一个gamefreeid,因为这个游戏都在不停的变,很多都不一致
if thirdID := ThirdPltGameMappingConfig.FindThirdIdByThird(msg.GetThird()); thirdID != 0 {
var dbGamefreeInfo *server.DB_GameFree
platform := msg.GetPlatform()
if platform != 0 {
pltGameInfo := PlatformMgrSingleton.GetGameFree(strconv.Itoa(int(platform)), thirdID)
if pltGameInfo != nil {
dbGamefreeInfo = pltGameInfo.DbGameFree
}
}
player := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
if player != nil {
str := strconv.Itoa(int(thirdID))
//处理三方全民流水问题
totalOut := int32(0)
totalIn := int32(0)
if dbGamefreeInfo != nil {
isBind := int32(0)
if player.Tel != "" {
isBind = 1
}
if msg.GetProfitCoinInTime() < 0 {
totalIn = msg.GetBetCoinInTime()
} else {
totalOut = msg.GetBetCoinInTime()
}
isQuMin := false
//pt := PlatformMgrSingleton.GetPackageTag(player.PackageID)
//if pt != nil && pt.SpreadTag == 1 {
// isQuMin = true
//}
if isQuMin || !model.GameParamData.QMOptimization {
QMFlowMgr.AddPlayerStatement(player.SnId, isBind, totalOut, totalIn, thirdID,
player.Platform, player.PackageID, dbGamefreeInfo)
}
availableBet := int64(totalOut + totalIn)
availableBet = availableBet * int64(dbGamefreeInfo.GetBetWaterRate()) / 100
if availableBet > 0 {
player.TotalConvertibleFlow += availableBet
player.TotalFlow += availableBet
player.dirty = true
//今日流水增加
player.TodayGameData.TodayConvertibleFlow += availableBet
}
}
if gd, ok := player.GDatas[str]; ok {
gd.Statics.GameTimes += int64(msg.GetAccRoundsInTime())
gd.Statics.TotalOut += int64(totalOut)
gd.Statics.TotalIn += int64(totalIn)
if gd.Statics.MaxSysOut < int64(msg.GetOneroundMaxwin()) {
gd.Statics.MaxSysOut = int64(msg.GetOneroundMaxwin())
}
} else {
gs := model.NewPlayerGameStatics()
gs.GameTimes = int64(msg.GetAccRoundsInTime())
gs.MaxSysOut = int64(msg.GetOneroundMaxwin())
gs.TotalOut = int64(totalOut)
gs.TotalIn = int64(totalIn)
player.GDatas[str] = &model.PlayerGameInfo{
FirstTime: time.Now(),
Statics: *gs,
}
}
if player.TotalGameData == nil {
player.TotalGameData = make(map[int][]*model.PlayerGameTotal)
}
showId := 9
if len(player.TotalGameData[showId]) == 0 {
player.TotalGameData[showId] = []*model.PlayerGameTotal{new(model.PlayerGameTotal)}
}
cnt := len(player.TotalGameData[showId])
if cnt > 0 {
td := player.TotalGameData[showId][cnt-1]
if td == nil {
td = &model.PlayerGameTotal{}
player.TotalGameData[showId][cnt-1] = td
}
if td != nil {
td.ProfitCoin += int64(msg.GetProfitCoinInTime())
td.BetCoin += int64(msg.GetBetCoinInTime())
td.FlowCoin += int64(msg.GetFlowCoinInTime())
}
}
//洗码
//三方游戏,通过进出场的营收差洗码
washingCoin := msg.GetProfitCoinInTime()
if washingCoin < 0 {
washingCoin = -washingCoin
}
washedCoin := player.WashingCoin(int64(washingCoin))
if washedCoin > 0 {
logger.Logger.Tracef("三方游戏洗码:snid=%v,washingCoin=%v,gamefreeid=%v", player.SnId, washedCoin, thirdID)
}
//五福红包游戏局数检测
//actRandCoinMgr.OnPlayerGameTimes(player, int64(msg.GetAccRoundsInTime()))
} else {
if dbGamefreeInfo != nil {
totalOut := int32(0)
totalIn := int32(0)
if msg.GetProfitCoinInTime() < 0 {
totalIn = msg.GetBetCoinInTime()
} else {
totalOut = msg.GetBetCoinInTime()
}
QMFlowMgr.AddOffPlayerStatement(msg.GetSnid(), totalOut, totalIn, thirdID, dbGamefreeInfo)
availableBet := int64(totalOut + totalIn)
availableBet = availableBet * int64(dbGamefreeInfo.GetBetWaterRate()) / 100
if availableBet > 0 {
PlayerCacheMgrSingleton.Get(strconv.Itoa(int(msg.GetPlatform())), msg.GetSnid(), func(op *PlayerCacheItem, asyn, isnew bool) {
if op == nil {
return
}
if op.IsRob {
return
}
//总流水累加
op.TotalConvertibleFlow += availableBet
op.TotalFlow += availableBet
//今日流水增加,todo 这个地方没有考虑彩票导致的跨天,或者注单延迟导致的今日流水问题
op.TodayGameData.TodayConvertibleFlow += availableBet
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
//注意流控防止该任务过渡占用登陆队列可以在datasrv上配置心跳和maxdone来控制
return model.UpdatePlayerExchageFlow(op.Platform, op.SnId, op.TotalConvertibleFlow, op.TotalFlow)
}), nil).StartByExecutor(strconv.Itoa(int(op.SnId)))
}, false)
}
}
}
}
}
return nil
}
func init() {
netlib.RegisterHandler(int(server.SSPacketID_PACKET_DW_ThirdRebateMessage), &DWThirdRebateMessageHandler{})
netlib.RegisterFactory(int(server.SSPacketID_PACKET_DW_ThirdRebateMessage), &DWThirdRebateMessagePacketFactory{})
netlib.RegisterHandler(int(server.SSPacketID_PACKET_DW_ThirdRoundMessage), &DWThirdRoundMessageHandler{})
netlib.RegisterFactory(int(server.SSPacketID_PACKET_DW_ThirdRoundMessage), &DWThirdRoundMessagePacketFactory{})
}
//type DWThirdRebateMessagePacketFactory struct {
//}
//type DWThirdRebateMessageHandler struct {
//}
//
//func (this *DWThirdRebateMessagePacketFactory) CreatePacket() interface{} {
// pack := &server.DWThirdRebateMessage{}
// return pack
//}
//func (this *DWThirdRebateMessageHandler) Process(s *netlib.Session, packetid int, data interface{}) error {
// logger.Logger.Trace("DWThirdRebateMessageHandler Process recv ", data)
// if msg, ok := data.(*server.DWThirdRebateMessage); ok {
// //TODO
// SendAckToDataSrv(msg.GetTag(), 2)
// if msg.GetAvailableBet() <= 0 {
// logger.Logger.Warn("DWThirdRebateMessageHandler is error: AvailableBet= ", msg.GetAvailableBet())
// return nil
// }
//
// //p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
// //if p != nil {
// // p.dirty = true
// // //actRandCoinMgr.OnPlayerLiuShui(p, msg.GetAvailableBet())
// //}
// //
// //thirdId := strconv.Itoa(int(ThirdPltGameMappingConfig.FindThirdIdByThird(msg.GetThird())))
// //rebateTask := RebateInfoMgrSington.rebateTask[strconv.Itoa(int(msg.GetPlt()))]
// //if rebateTask != nil {
// // Third := rebateTask.RebateGameThirdCfg[thirdId]
// // if Third != nil {
// // p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
// // if p == nil {
// // logger.Logger.Trace("DWThirdRebateMessageHandler p == nil ", msg.GetSnid())
// // OfflinePlayerMgrSington.GetOfflinePlayer(msg.GetSnid(), func(op *OfflinePlayer, asyn bool) {
// // if op == nil {
// // return
// // }
// // if op.IsRob {
// // return
// // }
// //
// // if data, ok := op.RebateData[thirdId]; ok {
// // data.ValidBetTotal += msg.GetAvailableBet()
// // } else {
// // op.RebateData[thirdId] = &model.RebateData{
// // ValidBetTotal: msg.GetAvailableBet(),
// // }
// // }
// // task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
// // //注意流控防止该任务过渡占用登陆队列可以在datasrv上配置心跳和maxdone来控制
// // return model.SavePlayerRebate(op.PlayerData, thirdId)
// // }), task.CompleteNotifyWrapper(func(data interface{}, tt *task.Task) {
// // if data != nil {
// // logger.Logger.Errorf("SavePlayerRebate error:%v snid:%v platform:%v AvailableBet:%v", data, msg.GetSnid(), msg.GetThird(), msg.GetAvailableBet())
// // } else {
// // p = PlayerMgrSington.GetPlayerBySnId(msg.GetSnid()) //说明更新任务排在了玩家登陆的后面(造成了脏读,重新应用下该次下注)
// // if p != nil {
// // if data, ok := p.RebateData[thirdId]; ok {
// // data.ValidBetTotal += msg.GetAvailableBet()
// // } else {
// // p.RebateData[thirdId] = &model.RebateData{
// // ValidBetTotal: msg.GetAvailableBet(),
// // }
// // }
// // p.dirty = true
// // }
// // }
// // }), "SavePlayerRebate").StartByExecutor(op.AccountId) //保证和玩家存取在一条线程内(避免脏读或者脏写)
// // }, false)
// // return nil
// // }
// // if p.IsRob {
// // logger.Logger.Trace("DWThirdRebateMessageHandler p is rob ", msg.GetSnid())
// // return nil
// // }
// // if data, ok := p.RebateData[thirdId]; ok {
// // data.ValidBetTotal += msg.GetAvailableBet()
// // } else {
// // p.RebateData[thirdId] = &model.RebateData{
// // ValidBetTotal: msg.GetAvailableBet(),
// // }
// // }
// //
// // p.dirty = true
// // //p.CountRebate(thirdId, 1)
// // } else {
// // logger.Logger.Trace("DWThirdRebateMessageHandler Third is nil. ", msg.GetPlt(), msg.GetThird())
// // }
// //} else {
// // logger.Logger.Trace("DWThirdRebateMessageHandler rebateTask is nil. ", msg.GetPlt(), msg.GetThird())
// //}
// }
// return nil
//}
//
//type DWThirdRoundMessagePacketFactory struct {
//}
//type DWThirdRoundMessageHandler struct {
//}
//
//func (this *DWThirdRoundMessagePacketFactory) CreatePacket() interface{} {
// pack := &server.DWThirdRoundMessage{}
// return pack
//}
//func (this *DWThirdRoundMessageHandler) Process(s *netlib.Session, packetid int, data interface{}) error {
// logger.Logger.Trace("DWThirdRoundMessageHandler Process recv ", data)
//
// if msg, ok := data.(*server.DWThirdRoundMessage); ok {
// //todo
// //获取到对应的gamefreeid,三方的特殊处理了只寻找对应大类的第一个gamefreeid,因为这个游戏都在不停的变,很多都不一致
// if thirdID := ThirdPltGameMappingConfig.FindThirdIdByThird(msg.GetThird()); thirdID != 0 {
// var dbGamefreeInfo *server.DB_GameFree
// platform := msg.GetPlatform()
// if platform != 0 {
// pltGameInfo := PlatformMgrSingleton.GetGameFree(strconv.Itoa(int(platform)), thirdID)
// if pltGameInfo != nil {
// dbGamefreeInfo = pltGameInfo.DbGameFree
// }
// }
//
// player := PlayerMgrSington.GetPlayerBySnId(msg.GetSnid())
// if player != nil {
// str := strconv.Itoa(int(thirdID))
// //处理三方全民流水问题
// totalOut := int32(0)
// totalIn := int32(0)
// if dbGamefreeInfo != nil {
// isBind := int32(0)
// if player.Tel != "" {
// isBind = 1
// }
//
// if msg.GetProfitCoinInTime() < 0 {
// totalIn = msg.GetBetCoinInTime()
// } else {
// totalOut = msg.GetBetCoinInTime()
// }
// isQuMin := false
// //pt := PlatformMgrSingleton.GetPackageTag(player.PackageID)
// //if pt != nil && pt.SpreadTag == 1 {
// // isQuMin = true
// //}
// if isQuMin || !model.GameParamData.QMOptimization {
// QMFlowMgr.AddPlayerStatement(player.SnId, isBind, totalOut, totalIn, thirdID,
// player.Platform, player.PackageID, dbGamefreeInfo)
// }
//
// availableBet := int64(totalOut + totalIn)
// availableBet = availableBet * int64(dbGamefreeInfo.GetBetWaterRate()) / 100
// if availableBet > 0 {
// player.TotalConvertibleFlow += availableBet
// player.TotalFlow += availableBet
// player.dirty = true
// //今日流水增加
// player.TodayGameData.TodayConvertibleFlow += availableBet
// }
// }
// if gd, ok := player.GDatas[str]; ok {
// gd.Statics.GameTimes += int64(msg.GetAccRoundsInTime())
// gd.Statics.TotalOut += int64(totalOut)
// gd.Statics.TotalIn += int64(totalIn)
// if gd.Statics.MaxSysOut < int64(msg.GetOneroundMaxwin()) {
// gd.Statics.MaxSysOut = int64(msg.GetOneroundMaxwin())
// }
// } else {
// gs := model.NewPlayerGameStatics()
// gs.GameTimes = int64(msg.GetAccRoundsInTime())
// gs.MaxSysOut = int64(msg.GetOneroundMaxwin())
// gs.TotalOut = int64(totalOut)
// gs.TotalIn = int64(totalIn)
// player.GDatas[str] = &model.PlayerGameInfo{
// FirstTime: time.Now(),
// Statics: *gs,
// }
// }
//
// if player.TotalGameData == nil {
// player.TotalGameData = make(map[int][]*model.PlayerGameTotal)
// }
// showId := 9
// if len(player.TotalGameData[showId]) == 0 {
// player.TotalGameData[showId] = []*model.PlayerGameTotal{new(model.PlayerGameTotal)}
// }
// cnt := len(player.TotalGameData[showId])
// if cnt > 0 {
// td := player.TotalGameData[showId][cnt-1]
// if td == nil {
// td = &model.PlayerGameTotal{}
// player.TotalGameData[showId][cnt-1] = td
// }
// if td != nil {
// td.ProfitCoin += int64(msg.GetProfitCoinInTime())
// td.BetCoin += int64(msg.GetBetCoinInTime())
// td.FlowCoin += int64(msg.GetFlowCoinInTime())
// }
// }
//
// //洗码
// //三方游戏,通过进出场的营收差洗码
// washingCoin := msg.GetProfitCoinInTime()
// if washingCoin < 0 {
// washingCoin = -washingCoin
// }
// washedCoin := player.WashingCoin(int64(washingCoin))
// if washedCoin > 0 {
// logger.Logger.Tracef("三方游戏洗码:snid=%v,washingCoin=%v,gamefreeid=%v", player.SnId, washedCoin, thirdID)
// }
// //五福红包游戏局数检测
// //actRandCoinMgr.OnPlayerGameTimes(player, int64(msg.GetAccRoundsInTime()))
// } else {
// if dbGamefreeInfo != nil {
// totalOut := int32(0)
// totalIn := int32(0)
// if msg.GetProfitCoinInTime() < 0 {
// totalIn = msg.GetBetCoinInTime()
// } else {
// totalOut = msg.GetBetCoinInTime()
// }
// QMFlowMgr.AddOffPlayerStatement(msg.GetSnid(), totalOut, totalIn, thirdID, dbGamefreeInfo)
// availableBet := int64(totalOut + totalIn)
// availableBet = availableBet * int64(dbGamefreeInfo.GetBetWaterRate()) / 100
// if availableBet > 0 {
// PlayerCacheMgrSingleton.Get(strconv.Itoa(int(msg.GetPlatform())), msg.GetSnid(), func(op *PlayerCacheItem, asyn, isnew bool) {
// if op == nil {
// return
// }
// if op.IsRob {
// return
// }
// //总流水累加
// op.TotalConvertibleFlow += availableBet
// op.TotalFlow += availableBet
// //今日流水增加,todo 这个地方没有考虑彩票导致的跨天,或者注单延迟导致的今日流水问题
// op.TodayGameData.TodayConvertibleFlow += availableBet
// task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
// //注意流控防止该任务过渡占用登陆队列可以在datasrv上配置心跳和maxdone来控制
// return model.UpdatePlayerExchageFlow(op.Platform, op.SnId, op.TotalConvertibleFlow, op.TotalFlow)
// }), nil).StartByExecutor(strconv.Itoa(int(op.SnId)))
// }, false)
// }
// }
// }
// }
// }
//
// return nil
//}
//func init() {
// netlib.RegisterHandler(int(server.SSPacketID_PACKET_DW_ThirdRebateMessage), &DWThirdRebateMessageHandler{})
// netlib.RegisterFactory(int(server.SSPacketID_PACKET_DW_ThirdRebateMessage), &DWThirdRebateMessagePacketFactory{})
// netlib.RegisterHandler(int(server.SSPacketID_PACKET_DW_ThirdRoundMessage), &DWThirdRoundMessageHandler{})
// netlib.RegisterFactory(int(server.SSPacketID_PACKET_DW_ThirdRoundMessage), &DWThirdRoundMessagePacketFactory{})
//}
// 暂时约定为result=1正常result=-1错误
func SendAckToDataSrv(snid uint64, result int32) bool {
datasrvSess := srvlib.ServerSessionMgrSington.GetSession(common.GetSelfAreaId(), common.DataServerType, common.DataServerId)
if datasrvSess != nil {
pack := &server.WDACKThirdRebateMessage{
Tag: proto.Uint64(snid),
Result: proto.Int32(result),
}
proto.SetDefaults(pack)
datasrvSess.Send(int(server.SSPacketID_PACKET_WD_ACKThirdRebateMessage), pack)
return true
} else {
logger.Logger.Error("datasrv server not found.")
}
return false
}
//func SendAckToDataSrv(snid uint64, result int32) bool {
// datasrvSess := srvlib.ServerSessionMgrSington.GetSession(common.GetSelfAreaId(), common.DataServerType, common.DataServerId)
// if datasrvSess != nil {
// pack := &server.WDACKThirdRebateMessage{
// Tag: proto.Uint64(snid),
// Result: proto.Int32(result),
// }
// proto.SetDefaults(pack)
// datasrvSess.Send(int(server.SSPacketID_PACKET_WD_ACKThirdRebateMessage), pack)
// return true
// } else {
// logger.Logger.Error("datasrv server not found.")
// }
// return false
//}
//func init() {
// go func() {

View File

@ -479,7 +479,7 @@ func init() {
}
}
//tienlen 游戏场次
if common.IsTienLen(scene.gameId) {
if scene.dbGameFree.GameDif == common.GameDifTienlen {
TaskSubjectSingleton.Touch(common.TaskTypeTienlenCount, &TaskData{
SnId: player.SnId,
GameID: scene.gameId,

View File

@ -289,7 +289,7 @@ func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int3
if platform == nil {
return nums[:]
}
ids, _ := srvdata.DataMgr.GetGameFreeIds(gameId, gameMode)
ids, _ := srvdata.GameFreeMgr.GetGameFreeIds(gameId, gameMode)
for _, id := range ids {
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
if gps != nil {

View File

@ -212,7 +212,7 @@ func (this *GameSession) AddScene(s *Scene) {
//msg.RealCtrl = WBCtrlCfgMgr.GetRealCtrl(s.limitPlatform.IdStr)
}
// 象棋游戏添加段位配置
if common.IsChess(s.gameId) {
if s.dbGameFree != nil && s.dbGameFree.GameDif == common.GameDifChess && platform != nil {
msg.ChessRank = ChessRankMgrSington.GetChessRankArr(platform.Name, int32(s.gameId))
}
proto.SetDefaults(msg)

View File

@ -312,7 +312,7 @@ func (this *HundredSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []
return nums[:]
}
ids, _ := srvdata.DataMgr.GetGameFreeIds(gameId, gameMode)
ids, _ := srvdata.GameFreeMgr.GetGameFreeIds(gameId, gameMode)
for _, id := range ids {
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
if gps != nil {

View File

@ -554,7 +554,7 @@ func (this *Player) SendGameConfig(gameId int32, plf, chl string) {
}
// 游戏配置
if common.IsChess(int(gameId)) {
if srvdata.GameFreeMgr.IsGameDif(gameId, common.GameDifChess) {
cfg := ChessRankMgrSington.GetChessRankConfig(this.GetPlatform().Name, gameId)
for _, v := range cfg.GetDatas() {
pack.ChessRanks = append(pack.ChessRanks, &hall_proto.ChessRankInfo{
@ -1681,7 +1681,7 @@ func (this *Player) UnmarshalData(data []byte, scene *Scene) {
}
this.PlayerData.YesterdayGameData = pd.YesterdayGameData
this.PlayerData.IsFoolPlayer = pd.IsFoolPlayer
this.PlayerData.TotalGameData = pd.TotalGameData
//this.PlayerData.TotalGameData = pd.TotalGameData
this.PlayerData.WinTimes = pd.WinTimes
this.PlayerData.FailTimes = pd.FailTimes
this.PlayerData.DrawTimes = pd.DrawTimes
@ -2205,7 +2205,7 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) {
*/
}
this.OnTimeDayTotal(continuous, t)
//this.OnTimeDayTotal(continuous, t)
//商城数据更新
this.ShopTotal = make(map[int32]*model.ShopTotal)
@ -2251,17 +2251,17 @@ func (this *Player) OnDayTimer(login, continuous bool, t int) {
TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏
}
func (this *Player) OnTimeDayTotal(continuous bool, t int) {
for k, tgd := range this.TotalGameData {
for i := 0; i < t; i++ {
tgd = append(tgd, new(model.PlayerGameTotal))
}
if len(tgd) > 30 {
tgd = tgd[len(tgd)-30:]
}
this.TotalGameData[k] = tgd
}
}
//func (this *Player) OnTimeDayTotal(continuous bool, t int) {
// for k, tgd := range this.TotalGameData {
// for i := 0; i < t; i++ {
// tgd = append(tgd, new(model.PlayerGameTotal))
// }
// if len(tgd) > 30 {
// tgd = tgd[len(tgd)-30:]
// }
// this.TotalGameData[k] = tgd
// }
//}
func (this *Player) OnMonthTimer() {
//判断是否一天即可过滤0点多次切换
@ -4428,13 +4428,13 @@ func (this *Player) InviteTask(scoreType int32, gameId int32, n int64) {
case common.InviteScoreTypeGameTimes:
score := 0
switch {
case common.IsTienLen(int(gameId)):
case srvdata.GameFreeMgr.IsGameDif(gameId, common.GameDifTienlen):
score = 500
case common.IsThirteen(int(gameId)):
case srvdata.GameFreeMgr.IsGameDif(gameId, common.GameDifThirteen):
score = 300
case common.IsSmallRocket(int(gameId)):
case srvdata.GameFreeMgr.IsGameDif(gameId, common.GameDifRocket):
score = 30
case common.IsChess(int(gameId)):
case srvdata.GameFreeMgr.IsGameDif(gameId, common.GameDifChess):
score = 100
}
SaveInviteScore(&model.InviteScore{

View File

@ -236,17 +236,6 @@ func (psm *PrivateSceneMgr) OnDestroyScene(scene *Scene) {
//sendClubMail_ClubCreateRoomRefund(scene.creator, scene.limitPlatform.Name, int32(scene.sceneId), int64(tax), int64(returnCoin))
}
}
//if p != nil {
// //统计创建房间数量
// key := scene.dbGameFree.GetGameDif()
// if gd, ok := p.GameData[key]; ok {
// gd.CreateRoomTimes--
// } else {
// p.GameData[key] = &model.PlayerGameStatics{
// CreateRoomTimes: 0,
// }
// }
//}
}
if p != nil {

View File

@ -3,6 +3,7 @@ package main
import (
"math"
"math/rand"
"strconv"
"time"
rawproto "google.golang.org/protobuf/proto"
@ -548,9 +549,8 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
msg.RankScore = make(map[int32]int64)
rankScore := this.dbGameFree.GetRankScoreParams()
if len(rankScore) == 2 {
//todo 根据游戏id获取排位类型不太方便
switch {
case common.IsTienLen(int(this.dbGameFree.GetGameId())):
case this.dbGameFree.GameDif == common.GameDifTienlen:
msg.RankScore[tienlen.RankType] = int64(common.RandInt(int(rankScore[0]), int(rankScore[1])))
}
}
@ -1100,9 +1100,10 @@ func (this *Scene) GetBlackPlayerCnt() int {
func (this *Scene) GetLostPlayerCnt() int {
var cnt int
keyGameId := strconv.Itoa(int(this.dbGameFree.GetGameId()))
for _, p := range this.players {
if p.GDatas != nil {
if d, exist := p.GDatas[this.dbGameFree.GetGameDif()]; exist {
if d, exist := p.GDatas[keyGameId]; exist {
if d.Statics.TotalIn > d.Statics.TotalOut {
cnt++
}
@ -1114,9 +1115,10 @@ func (this *Scene) GetLostPlayerCnt() int {
func (this *Scene) GetWinPlayerCnt() int {
var cnt int
keyGameId := strconv.Itoa(int(this.dbGameFree.GetGameId()))
for _, p := range this.players {
if p.GDatas != nil {
if d, exist := p.GDatas[this.dbGameFree.GetGameDif()]; exist {
if d, exist := p.GDatas[keyGameId]; exist {
if d.Statics.TotalIn < d.Statics.TotalOut {
cnt++
}
@ -1130,17 +1132,6 @@ func (this *Scene) GetTruePlayerCnt() int {
return len(this.players) - this.robotNum
}
// 炸金花房间有几个新手
func (this *Scene) GetFoolPlayerCnt() int {
var cnt int
for _, p := range this.players {
if p.IsFoolPlayer != nil && p.IsFoolPlayer[this.dbGameFree.GetGameDif()] {
cnt++
}
}
return cnt
}
func (this *Scene) GetPlayerType(gameid, gamefreeid int32) (types []int32) {
for _, p := range this.players {
t := int32(0)

View File

@ -69,53 +69,6 @@ func (this *PBDB_GameFreeMgrEx) GetGameFreeIdByGameDif(gameDif string) int32 {
return 0
}
//
//var RobotCarryMgrEx = &PBDB_RobotGameMgrEx{
// pool: make(map[int32][]*server.DB_RobotGame),
//}
//
//type PBDB_RobotGameMgrEx struct {
// pool map[int32][]*server.DB_RobotGame
//}
//
//func (this *PBDB_RobotGameMgrEx) Reload() {
// for _, item := range srvdata.PBDB_RobotGameMgr.Datas.Arr {
// if pp, exist := this.pool[item.GetId()]; exist {
// pp = append(pp, item)
// this.pool[item.GetId()] = pp
// } else {
// this.pool[item.GetId()] = []*server.DB_RobotGame{item}
// }
// }
//}
//
//func (this *PBDB_RobotGameMgrEx) RandOneCarry(gamefreeId int32) (int32, int32, int32, bool) {
// if pp, exist := this.pool[gamefreeId]; exist {
// if len(pp) > 0 {
// item := pp[rand.Intn(len(pp))]
// enterCoin := item.GetEnterCoin()
// //尽量避免有重复的
// if enterCoin > 100000000 { //100W以上
// enterCoin = rand.Int31n(enterCoin%100000000+1) + enterCoin/100000000*100000000
// } else if enterCoin > 10000000 { //10W以上
// enterCoin = rand.Int31n(enterCoin%10000000+1) + enterCoin/10000000*10000000
// } else if enterCoin > 1000000 { //1W以上
// enterCoin = rand.Int31n(enterCoin%1000000+1) + enterCoin/1000000*1000000
// } else if enterCoin > 100000 { //1k以上
// enterCoin = rand.Int31n(enterCoin%100000+1) + enterCoin/100000*100000
// } else if enterCoin > 10000 { //1百以上
// enterCoin = rand.Int31n(enterCoin%10000+1) + enterCoin/10000*10000
// } else if enterCoin > 1000 { //十以上
// enterCoin = rand.Int31n(enterCoin%1000+1) + enterCoin/1000*1000
// } else if enterCoin > 100 { //1以上
// enterCoin = rand.Int31n(enterCoin%100+1) + enterCoin/100*100
// }
// return enterCoin, item.GetLeaveCoin(), item.GetGameTimes(), true
// }
// }
// return 0, 0, 0, false
//}
func init() {
srvdata.DataMgr.RegisterLoader("DB_GameFree.dat", GameFreeMgrEx)
}

View File

@ -163,19 +163,19 @@ func (t *TaskHandle) AllTask(id int, data any) {
// 游戏类型
switch v.GetGameType() {
case common.TaskGameTypeTienlen:
if !common.IsTienLen(info.GameID) {
if !srvdata.GameFreeMgr.IsGameDif(int32(info.GameID), common.GameDifTienlen) {
continue
}
case common.TaskGameTypeThirteen:
if !common.IsThirteen(info.GameID) {
if !srvdata.GameFreeMgr.IsGameDif(int32(info.GameID), common.GameDifThirteen) {
continue
}
case common.TaskGameTypeChess:
if !common.IsChess(info.GameID) {
if !srvdata.GameFreeMgr.IsGameDif(int32(info.GameID), common.GameDifChess) {
continue
}
case common.TaskGameTypeSmallRocket:
if !common.IsSmallRocket(info.GameID) {
if !srvdata.GameFreeMgr.IsGameDif(int32(info.GameID), common.GameDifRocket) {
continue
}
default:

View File

@ -35,7 +35,7 @@ func (this *QueryCoinPoolTransactHandler) OnExcute(tNode *transact.TransNode, ud
//gameType = pgg.DbGameFree.GetGameType()
}
} else {
ids, _ = srvdata.DataMgr.GetGameFreeIds(data.GameId, data.GameMode)
ids, _ = srvdata.GameFreeMgr.GetGameFreeIds(data.GameId, data.GameMode)
}
for sid, gs := range GameSessMgrSington.servers {
if common.InSliceInt32(gs.gameIds, data.GameId) || len(gs.gameIds) == 0 {

Binary file not shown.