Merge branch 'develop' into release
This commit is contained in:
commit
50da2721fb
|
|
@ -86,6 +86,7 @@ const (
|
||||||
GameId_CaoThap = 605 //CaoThap
|
GameId_CaoThap = 605 //CaoThap
|
||||||
GameId_AngerUncle = 606 // 愤怒大叔
|
GameId_AngerUncle = 606 // 愤怒大叔
|
||||||
GameId_SmallRoket = 607 // 小火箭
|
GameId_SmallRoket = 607 // 小火箭
|
||||||
|
GameId_Clawdoll = 608 // 娃娃机
|
||||||
__GameId_ThrGame_Min__ = 700 //################三方类################
|
__GameId_ThrGame_Min__ = 700 //################三方类################
|
||||||
GameId_Thr_Dg = 701 //DG Game
|
GameId_Thr_Dg = 701 //DG Game
|
||||||
GameId_Thr_XHJ = 901 //DG Game
|
GameId_Thr_XHJ = 901 //DG Game
|
||||||
|
|
@ -104,6 +105,7 @@ const (
|
||||||
GameDifTamQuoc = "305" // 百战成神
|
GameDifTamQuoc = "305" // 百战成神
|
||||||
GameDifFruits = "306" // 水果机
|
GameDifFruits = "306" // 水果机
|
||||||
GameDifRichblessed = "307" // 多彩多福
|
GameDifRichblessed = "307" // 多彩多福
|
||||||
|
GameDifClawdoll = "608" // 娃娃机
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsTienLenYuLe TienLen娱乐
|
// IsTienLenYuLe TienLen娱乐
|
||||||
|
|
@ -297,6 +299,8 @@ const (
|
||||||
GainWaySkinUpGrade = 101 // 皮肤升级消耗
|
GainWaySkinUpGrade = 101 // 皮肤升级消耗
|
||||||
GainWayItemFen = 102 // 道具分解消耗
|
GainWayItemFen = 102 // 道具分解消耗
|
||||||
GainWayItemFenGain = 103 // 道具分解获得
|
GainWayItemFenGain = 103 // 道具分解获得
|
||||||
|
GainWayGuide = 104 //新手引导奖励
|
||||||
|
GainWayVipGift9 = 105 //vip等级礼包
|
||||||
)
|
)
|
||||||
|
|
||||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||||
|
|
@ -838,3 +842,14 @@ var (
|
||||||
300003: 70,
|
300003: 70,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
AttributeGuideStep = 1 // 引导步骤
|
||||||
|
AttributeGuideSkip = 2 // 跳过引导
|
||||||
|
AttributeGuideTest = 3 // 测试引导
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
On = 1 // 开启
|
||||||
|
Off = 2 // 关闭
|
||||||
|
)
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -6390,6 +6390,39 @@
|
||||||
],
|
],
|
||||||
"PlayerWaterRate": 100,
|
"PlayerWaterRate": 100,
|
||||||
"BetWaterRate": 100
|
"BetWaterRate": 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 6080001,
|
||||||
|
"Name": "娃娃机",
|
||||||
|
"Title": "1",
|
||||||
|
"GameId": 608,
|
||||||
|
"GameRule": 60800,
|
||||||
|
"GameType": 1,
|
||||||
|
"SceneType": 1,
|
||||||
|
"Desc": "0",
|
||||||
|
"ShowType": 3,
|
||||||
|
"ShowId": 60800,
|
||||||
|
"BaseScore": 1000,
|
||||||
|
"Turn": 60800,
|
||||||
|
"BetDec": "1000",
|
||||||
|
"Ai": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"OtherIntParams": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"RobotNumRng": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SameIpLimit": 1,
|
||||||
|
"GameDif": "608",
|
||||||
|
"GameClass": 2,
|
||||||
|
"PlatformName": "越南棋牌",
|
||||||
|
"MaxBetCoin": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PlayerWaterRate": 100,
|
||||||
|
"BetWaterRate": 100
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -195,6 +195,11 @@
|
||||||
"Name": "多财多福",
|
"Name": "多财多福",
|
||||||
"GameId": 307,
|
"GameId": 307,
|
||||||
"GameDif": "307"
|
"GameDif": "307"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 60800,
|
||||||
|
"Name": "娃娃机",
|
||||||
|
"GameId": 608
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
BIN
data/DB_VIP.dat
BIN
data/DB_VIP.dat
Binary file not shown.
192
data/DB_VIP.json
192
data/DB_VIP.json
|
|
@ -3,8 +3,8 @@
|
||||||
{
|
{
|
||||||
"Name": "不是VIP",
|
"Name": "不是VIP",
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
100000,
|
0,
|
||||||
2
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -28,7 +28,12 @@
|
||||||
"获得专属头像框",
|
"获得专属头像框",
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
]
|
],
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 1000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 1,
|
"Id": 1,
|
||||||
|
|
@ -36,8 +41,8 @@
|
||||||
"Count": 1000,
|
"Count": 1000,
|
||||||
"VipExp": 1000,
|
"VipExp": 1000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
100000,
|
0,
|
||||||
100
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -63,7 +68,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 1
|
"MatchFreeTimes": 1,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 2000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 2,
|
"Id": 2,
|
||||||
|
|
@ -71,8 +81,8 @@
|
||||||
"Count": 2000,
|
"Count": 2000,
|
||||||
"VipExp": 2000,
|
"VipExp": 2000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
150000,
|
0,
|
||||||
150
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -98,7 +108,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 2
|
"MatchFreeTimes": 2,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 3000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 3,
|
"Id": 3,
|
||||||
|
|
@ -106,8 +121,8 @@
|
||||||
"Count": 5000,
|
"Count": 5000,
|
||||||
"VipExp": 5000,
|
"VipExp": 5000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
200000,
|
0,
|
||||||
200
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -133,7 +148,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 3
|
"MatchFreeTimes": 3,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 4000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 4,
|
"Id": 4,
|
||||||
|
|
@ -141,8 +161,8 @@
|
||||||
"Count": 10000,
|
"Count": 10000,
|
||||||
"VipExp": 10000,
|
"VipExp": 10000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
300000,
|
0,
|
||||||
250
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -168,7 +188,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 4
|
"MatchFreeTimes": 4,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 5000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 5,
|
"Id": 5,
|
||||||
|
|
@ -176,8 +201,8 @@
|
||||||
"Count": 20000,
|
"Count": 20000,
|
||||||
"VipExp": 20000,
|
"VipExp": 20000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
400000,
|
0,
|
||||||
300
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -203,7 +228,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 5
|
"MatchFreeTimes": 5,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 6000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 6,
|
"Id": 6,
|
||||||
|
|
@ -211,8 +241,8 @@
|
||||||
"Count": 50000,
|
"Count": 50000,
|
||||||
"VipExp": 50000,
|
"VipExp": 50000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
500000,
|
0,
|
||||||
350
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -238,7 +268,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 6
|
"MatchFreeTimes": 6,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 7000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 7,
|
"Id": 7,
|
||||||
|
|
@ -246,8 +281,8 @@
|
||||||
"Count": 100000,
|
"Count": 100000,
|
||||||
"VipExp": 100000,
|
"VipExp": 100000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
600000,
|
0,
|
||||||
400
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -273,7 +308,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 7
|
"MatchFreeTimes": 7,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 8000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 8,
|
"Id": 8,
|
||||||
|
|
@ -281,8 +321,8 @@
|
||||||
"Count": 200000,
|
"Count": 200000,
|
||||||
"VipExp": 200000,
|
"VipExp": 200000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
700000,
|
0,
|
||||||
450
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -308,7 +348,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 8
|
"MatchFreeTimes": 8,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 9000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 9,
|
"Id": 9,
|
||||||
|
|
@ -316,8 +361,8 @@
|
||||||
"Count": 500000,
|
"Count": 500000,
|
||||||
"VipExp": 500000,
|
"VipExp": 500000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
800000,
|
0,
|
||||||
500
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -343,7 +388,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 9
|
"MatchFreeTimes": 9,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 10000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 10,
|
"Id": 10,
|
||||||
|
|
@ -351,8 +401,8 @@
|
||||||
"Count": 1000000,
|
"Count": 1000000,
|
||||||
"VipExp": 1000000,
|
"VipExp": 1000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
900000,
|
0,
|
||||||
550
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -378,7 +428,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 10
|
"MatchFreeTimes": 10,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 11000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 11,
|
"Id": 11,
|
||||||
|
|
@ -386,8 +441,8 @@
|
||||||
"Count": 2000000,
|
"Count": 2000000,
|
||||||
"VipExp": 2000000,
|
"VipExp": 2000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
1000000,
|
0,
|
||||||
600
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -413,7 +468,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 11
|
"MatchFreeTimes": 11,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 12000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 12,
|
"Id": 12,
|
||||||
|
|
@ -421,8 +481,8 @@
|
||||||
"Count": 5000000,
|
"Count": 5000000,
|
||||||
"VipExp": 5000000,
|
"VipExp": 5000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
2000000,
|
0,
|
||||||
650
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -448,7 +508,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 12
|
"MatchFreeTimes": 12,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 13000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 13,
|
"Id": 13,
|
||||||
|
|
@ -456,8 +521,8 @@
|
||||||
"Count": 10000000,
|
"Count": 10000000,
|
||||||
"VipExp": 10000000,
|
"VipExp": 10000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
3000000,
|
0,
|
||||||
700
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -483,7 +548,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 13
|
"MatchFreeTimes": 13,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 14000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 14,
|
"Id": 14,
|
||||||
|
|
@ -491,8 +561,8 @@
|
||||||
"Count": 20000000,
|
"Count": 20000000,
|
||||||
"VipExp": 20000000,
|
"VipExp": 20000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
4000000,
|
0,
|
||||||
750
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -518,7 +588,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 14
|
"MatchFreeTimes": 14,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 15000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 15,
|
"Id": 15,
|
||||||
|
|
@ -526,8 +601,8 @@
|
||||||
"Count": 50000000,
|
"Count": 50000000,
|
||||||
"VipExp": 50000000,
|
"VipExp": 50000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
5000000,
|
0,
|
||||||
800
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -553,7 +628,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 15
|
"MatchFreeTimes": 15,
|
||||||
|
"Privilege9": [
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PrivilegeShow": 16000
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 16,
|
"Id": 16,
|
||||||
|
|
@ -561,8 +641,8 @@
|
||||||
"Count": 100000000,
|
"Count": 100000000,
|
||||||
"VipExp": 100000000,
|
"VipExp": 100000000,
|
||||||
"Privilege1": [
|
"Privilege1": [
|
||||||
6000000,
|
0,
|
||||||
850
|
0
|
||||||
],
|
],
|
||||||
"Privilege2": [
|
"Privilege2": [
|
||||||
0,
|
0,
|
||||||
|
|
@ -588,12 +668,12 @@
|
||||||
"获得专属炮台",
|
"获得专属炮台",
|
||||||
"更多VIP功能正待开发"
|
"更多VIP功能正待开发"
|
||||||
],
|
],
|
||||||
"MatchFreeTimes": 16
|
"MatchFreeTimes": 16,
|
||||||
},
|
"Privilege9": [
|
||||||
{
|
0,
|
||||||
"ParamName": [
|
0
|
||||||
""
|
],
|
||||||
]
|
"PrivilegeShow": 17000
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
罘
|
||||||
|
荅
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"Arr": [
|
||||||
|
{
|
||||||
|
"Id": 1,
|
||||||
|
"SkinId": 300003
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 2,
|
||||||
|
"SkinId": 300004,
|
||||||
|
"VIPLevel": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"GameName":"娃娃机",
|
||||||
|
"GameId":608,
|
||||||
|
"GameMode":[0],
|
||||||
|
"SceneType":[1],
|
||||||
|
"CanForceStart":false,
|
||||||
|
"MinPlayerCnt":1,
|
||||||
|
"DefaultPlayerCnt":1,
|
||||||
|
"MaxIndex":0,
|
||||||
|
"TimeFreeStart":0,
|
||||||
|
"TimeFreeEnd":0,
|
||||||
|
"DependentPlayerCnt":true,
|
||||||
|
"EnterAfterStart":false,
|
||||||
|
"PerGameTakeCard":100,
|
||||||
|
"ViewLogCnt":-1,
|
||||||
|
"BetState":0,
|
||||||
|
"Params":[
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
"VerifyClientVersion":true,
|
"VerifyClientVersion":true,
|
||||||
"SrvMaintain":false,
|
"SrvMaintain":false,
|
||||||
"WhiteHttpAddr": [],
|
"WhiteHttpAddr": [],
|
||||||
"HundredScenePreCreate":true,
|
"HundredScenePreCreate":false,
|
||||||
"WriteEventLog": true,
|
"WriteEventLog": true,
|
||||||
"SpreadAccountQPT":100,
|
"SpreadAccountQPT":100,
|
||||||
"FakeVerifyCode":"123456",
|
"FakeVerifyCode":"123456",
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
"ClosePreCreateRoom": true,
|
"ClosePreCreateRoom": true,
|
||||||
"AgoraAddress": "http://47.105.78.29:8081",
|
"AgoraAddress": "http://47.105.78.29:8081",
|
||||||
"InviteUrl": "http://47.105.78.29:8000/",
|
"InviteUrl": "http://47.105.78.29:8000/",
|
||||||
|
"GuideTs": 1723790567,
|
||||||
"RankTimeout": 2,
|
"RankTimeout": 2,
|
||||||
"PermitInitScore": 0
|
"PermitInitScore": 0
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package mq
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/broker"
|
||||||
|
"mongo.games.com/goserver/core/broker/rabbitmq"
|
||||||
|
|
||||||
|
"mongo.games.com/game/dbproxy/svc"
|
||||||
|
"mongo.games.com/game/model"
|
||||||
|
"mongo.games.com/game/mq"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
mq.RegisterSubscriber(mq.DBVipGiftLog, func(e broker.Event) (err error) {
|
||||||
|
msg := e.Message()
|
||||||
|
if msg != nil {
|
||||||
|
defer func() {
|
||||||
|
e.Ack()
|
||||||
|
}()
|
||||||
|
|
||||||
|
var log model.DbVip
|
||||||
|
err = json.Unmarshal(msg.Body, &log)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
c := svc.DbVipLogCollection(log.Platform)
|
||||||
|
if c != nil {
|
||||||
|
err = c.Insert(log)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}, broker.Queue(mq.DBVipGiftLog), broker.DisableAutoAck(), rabbitmq.DurableQueue())
|
||||||
|
}
|
||||||
|
|
@ -2,17 +2,26 @@ package svc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"net/rpc"
|
||||||
|
|
||||||
|
"github.com/globalsign/mgo"
|
||||||
"github.com/globalsign/mgo/bson"
|
"github.com/globalsign/mgo/bson"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
"mongo.games.com/game/dbproxy/mongo"
|
"mongo.games.com/game/dbproxy/mongo"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"net/rpc"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
MatchAwardLogDBErr = errors.New("log_matchawardlog db open failed.")
|
MatchAwardDBErr = errors.New("log_matchawardlog db open failed")
|
||||||
)
|
)
|
||||||
|
|
||||||
func MatchAwardLogCollection(plt string) *mongo.Collection {
|
type MatchAwardLog struct {
|
||||||
|
AwardNum map[string]map[int32]int32 // 奖励数量
|
||||||
|
Platform string
|
||||||
|
}
|
||||||
|
|
||||||
|
func MatchAwardCollection(plt string) *mongo.Collection {
|
||||||
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, model.MatchAwardLogDBName)
|
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, model.MatchAwardLogDBName)
|
||||||
if s != nil {
|
if s != nil {
|
||||||
c, _ := s.DB().C(model.MatchAwardLogCollName)
|
c, _ := s.DB().C(model.MatchAwardLogCollName)
|
||||||
|
|
@ -21,47 +30,55 @@ func MatchAwardLogCollection(plt string) *mongo.Collection {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertOrUpdateMatchAwardLog(logs ...*model.MatchAwardLog) (err error) {
|
type MatchAwardSvc struct {
|
||||||
for _, log := range logs {
|
|
||||||
clog := MatchAwardLogCollection(log.Platform)
|
|
||||||
if clog == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = clog.Upsert(nil, log)
|
|
||||||
if err != nil {
|
|
||||||
// 处理错误
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MatchAwardLogSvc struct {
|
func (svc *MatchAwardSvc) UpsertMatchAward(req *model.MatchAward, ret *bool) (err error) {
|
||||||
}
|
c := MatchAwardCollection(req.Platform)
|
||||||
|
if c == nil {
|
||||||
|
return MatchAwardDBErr
|
||||||
|
}
|
||||||
|
|
||||||
func (svc *MatchAwardLogSvc) InsertOrUpdateMatchAwardLog(args []*model.MatchAwardLog, ret *bool) (err error) {
|
_, err = c.Upsert(nil, req)
|
||||||
err = InsertOrUpdateMatchAwardLog(args...)
|
|
||||||
if err == nil {
|
|
||||||
*ret = true
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func GetMatchAward(plt string, ret *model.MatchAwardLog) (err error) {
|
|
||||||
clog := MatchAwardLogCollection(plt)
|
|
||||||
if clog == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
selecter := bson.M{"platform": plt}
|
|
||||||
err = clog.Find(selecter).One(&ret)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
logger.Logger.Errorf("UpsertMatchAward err:%v", err)
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
|
||||||
func (svc *MatchAwardLogSvc) GetMatchAward(Plt string, ret *model.MatchAwardLog) (err error) {
|
|
||||||
err = GetMatchAward(Plt, ret)
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
func init() {
|
|
||||||
rpc.Register(new(MatchAwardLogSvc))
|
func (svc *MatchAwardSvc) GetMatchAward(plt string, ret *model.MatchAward) (err error) {
|
||||||
|
c := MatchAwardCollection(plt)
|
||||||
|
if c == nil {
|
||||||
|
return MatchAwardDBErr
|
||||||
|
}
|
||||||
|
|
||||||
|
// 旧数据
|
||||||
|
old := &MatchAwardLog{}
|
||||||
|
err = c.Find(bson.M{"platform": "1"}).One(old)
|
||||||
|
if err == nil {
|
||||||
|
for k, v := range old.AwardNum {
|
||||||
|
d := &model.MatchAward{
|
||||||
|
Platform: k,
|
||||||
|
Award: make(map[int32]int32),
|
||||||
|
}
|
||||||
|
for kk, vv := range v {
|
||||||
|
d.Award[kk] = vv
|
||||||
|
}
|
||||||
|
var b bool
|
||||||
|
svc.UpsertMatchAward(d, &b)
|
||||||
|
}
|
||||||
|
c.Remove(bson.M{"platform": "1"})
|
||||||
|
}
|
||||||
|
// 旧数据
|
||||||
|
|
||||||
|
err = nil
|
||||||
|
err = c.Find(nil).One(ret)
|
||||||
|
if err != nil && err != mgo.ErrNotFound {
|
||||||
|
logger.Logger.Errorf("GetMatchAward err:%v", err)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rpc.Register(new(MatchAwardSvc))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -354,6 +354,11 @@ func (svc *PlayerDataSvc) GetPlayerDataBySnId(args *model.GetPlayerDataBySnIdArg
|
||||||
}
|
}
|
||||||
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
|
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
|
||||||
}
|
}
|
||||||
|
if p.GuideStep >= 0 && p.CreateTime.Unix() < model.GameParamData.GuideTs {
|
||||||
|
p.GuideStep = -1
|
||||||
|
param["guidestep"] = p.GuideStep
|
||||||
|
cplayerdata.Update(bson.M{"snid": args.SnId}, bson.M{"$set": param})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var code string
|
var code string
|
||||||
|
|
|
||||||
|
|
@ -38,4 +38,7 @@ const (
|
||||||
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
|
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
|
||||||
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
|
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
|
||||||
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
|
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
|
||||||
|
ETCDKEY_GUIDE = "/game/guide_config" //新手引导配置
|
||||||
|
ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众
|
||||||
|
ETCDKEY_Spirit = "/game/spirit" // 小精灵配置
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
// key:监听的key
|
// key:监听的key
|
||||||
// msgType:数据类型
|
// msgType:数据类型
|
||||||
// f:数据变更回调方法, completeKey:完整键, isInit:第一次主动拉取数据,event:事件类型, data:已经反序列化的数据,类型为msgType,是指针类型
|
// f:数据变更回调方法, completeKey:完整键, isInit:第一次主动拉取数据,event:事件类型, data:已经反序列化的数据,类型为msgType,是指针类型
|
||||||
|
// **isInit** 为true时,表示是第一次主动拉取数据,此时允许耗时操作。为false时,表示是监听到数据变更,此时不允许耗时操作。
|
||||||
func Register(key string, msgType interface{}, f func(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{})) {
|
func Register(key string, msgType interface{}, f func(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{})) {
|
||||||
createFunc := func() interface{} {
|
createFunc := func() interface{} {
|
||||||
tp := reflect.TypeOf(msgType)
|
tp := reflect.TypeOf(msgType)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package clawdoll
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// 场景状态
|
||||||
|
const (
|
||||||
|
ClawDollSceneStateWait int = iota //等待状态
|
||||||
|
ClawDollSceneStateStart //开始倒计时
|
||||||
|
ClawDollSceneStatePlayGame //游戏中
|
||||||
|
ClawDollSceneStateBilled //结算
|
||||||
|
ClawDollSceneStateMax
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ClawDollSceneWaitTimeout = time.Second * 2 //等待倒计时
|
||||||
|
ClawDollSceneStartTimeout = time.Second * 6 //开始倒计时
|
||||||
|
ClawDollSceneBilledTimeout = time.Second * 2 //结算
|
||||||
|
)
|
||||||
|
|
||||||
|
// 玩家操作
|
||||||
|
const (
|
||||||
|
ClawDollPlayerOpScore = iota + 1 // 上分
|
||||||
|
ClawDollPlayerOpGo // 下抓
|
||||||
|
ClawDollPlayerOpMove // 移动方向
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
package clawdoll
|
||||||
|
|
||||||
|
type Logic struct {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package action
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/protocol/machine"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
)
|
||||||
|
|
||||||
|
var MachineMap = make(map[int]string)
|
||||||
|
|
||||||
|
func MSDollMachineList(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
|
logger.Logger.Tracef("TestHandler %v", data)
|
||||||
|
MachineMap = make(map[int]string)
|
||||||
|
if msg, ok := data.(*machine.MSDollMachineList); ok {
|
||||||
|
for i, info := range msg.Data {
|
||||||
|
MachineMap[i+1] = info.VideoAddr
|
||||||
|
logger.Logger.Tracef("MachineMap[%v] = %v", i, info.VideoAddr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
netlib.Register(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), &machine.MSDollMachineList{}, MSDollMachineList)
|
||||||
|
}
|
||||||
|
|
@ -114,7 +114,7 @@ type Player struct {
|
||||||
sparams map[int]string //字符参数
|
sparams map[int]string //字符参数
|
||||||
IsLocal bool //是否本地player
|
IsLocal bool //是否本地player
|
||||||
Items map[int32]int64 //背包数据
|
Items map[int32]int64 //背包数据
|
||||||
MatchParams []int32 //比赛参数 排名、段位、假snid、假角色
|
MatchParams []int32 //比赛参数 排名、段位、假snid、假角色、假皮肤
|
||||||
MatchRobotGrades []MatchRobotGrade
|
MatchRobotGrades []MatchRobotGrade
|
||||||
TestLog []string // 调试日志
|
TestLog []string // 调试日志
|
||||||
RankScore map[int32]int64 // 段位积分
|
RankScore map[int32]int64 // 段位积分
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ type DB_FishOutMgrEx struct {
|
||||||
func (this *DB_FishOutMgrEx) InitFishAppear() {
|
func (this *DB_FishOutMgrEx) InitFishAppear() {
|
||||||
this.FishOutPool = make(map[int32]*AppearFish)
|
this.FishOutPool = make(map[int32]*AppearFish)
|
||||||
for _, v := range srvdata.PBDB_FishOutMgr.Datas.Arr {
|
for _, v := range srvdata.PBDB_FishOutMgr.Datas.Arr {
|
||||||
logger.Logger.Tracef("初始化房间出鱼列表 fishId = %v", v.Id)
|
//logger.Logger.Tracef("初始化房间出鱼列表 fishId = %v", v.Id)
|
||||||
this.FishOutPool[v.Id] = &AppearFish{
|
this.FishOutPool[v.Id] = &AppearFish{
|
||||||
FishId: v.Id,
|
FishId: v.Id,
|
||||||
Exp: v.Exp,
|
Exp: v.Exp,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package base
|
package base
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/protocol/machine"
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
"mongo.games.com/goserver/core/netlib"
|
||||||
"mongo.games.com/goserver/srvlib"
|
"mongo.games.com/goserver/srvlib"
|
||||||
|
|
@ -27,6 +29,10 @@ func (this *SrvSessMgr) OnRegiste(s *netlib.Session) {
|
||||||
} else if srvInfo.GetType() == int32(common.RobotServerType) {
|
} else if srvInfo.GetType() == int32(common.RobotServerType) {
|
||||||
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (RobotSrv):", s)
|
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (RobotSrv):", s)
|
||||||
NpcServerAgentSingleton.OnConnected()
|
NpcServerAgentSingleton.OnConnected()
|
||||||
|
} else if srvInfo.GetType() == 10 {
|
||||||
|
logger.Logger.Warn("(this *SrvSessMgr) OnRegiste (Machine):", s)
|
||||||
|
s.Send(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{})
|
||||||
|
fmt.Printf("与娃娃机服务器连接成功\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
package clawdoll
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/protocol/clawdoll"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CSPlayerOpPacketFactory struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type CSPlayerOpHandler struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *CSPlayerOpPacketFactory) CreatePacket() interface{} {
|
||||||
|
pack := &clawdoll.CSCLAWDOLLOp{}
|
||||||
|
return pack
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *CSPlayerOpHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
|
logger.Logger.Trace("CSPlayerOpHandler Process recv ", data)
|
||||||
|
if msg, ok := data.(*clawdoll.CSCLAWDOLLOp); ok {
|
||||||
|
p := base.PlayerMgrSington.GetPlayer(sid)
|
||||||
|
if p == nil {
|
||||||
|
logger.Logger.Warn("CSPlayerOpHandler p == nil")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
scene := p.GetScene()
|
||||||
|
if scene == nil {
|
||||||
|
logger.Logger.Warn("CSPlayerOpHandler p.scene == nil")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if scene.KeyGameDif != common.GameDifClawdoll {
|
||||||
|
logger.Logger.Error("CSPlayerOpHandler gameId Error ", scene.GameId)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if !scene.HasPlayer(p) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
sp := scene.GetScenePolicy()
|
||||||
|
if sp != nil {
|
||||||
|
sp.OnPlayerOp(scene, p, int(msg.GetOpCode()), msg.GetParams())
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSPlayerOpHandler{})
|
||||||
|
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_CLAWDOLL_PLAYEROP), &CSPlayerOpPacketFactory{})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package clawdoll
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PlayerEx struct {
|
||||||
|
*base.Player //玩家信息
|
||||||
|
|
||||||
|
gainCoin int64 // 本局赢的金币
|
||||||
|
taxCoin int64 // 本局税收
|
||||||
|
odds int32
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayerEx) Clear(baseScore int32) {
|
||||||
|
this.UnmarkFlag(base.PlayerState_WaitNext)
|
||||||
|
this.UnmarkFlag(base.PlayerState_GameBreak)
|
||||||
|
this.MarkFlag(base.PlayerState_Ready)
|
||||||
|
|
||||||
|
this.gainCoin = 0
|
||||||
|
this.taxCoin = 0
|
||||||
|
this.odds = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
|
||||||
|
if !this.IsGameing() {
|
||||||
|
logger.Logger.Trace("(this *PlayerEx) CanOp return false ", this.SnId)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayerEx) CanPayCoinByPos() bool {
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 游戏新一局 设置数据
|
||||||
|
func (this *PlayerEx) ReStartGame() {
|
||||||
|
this.ReDataStartGame()
|
||||||
|
this.gainCoin = 0
|
||||||
|
this.taxCoin = 0
|
||||||
|
this.odds = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
func (this *PlayerEx) InitData(baseScore int32) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重置下注数据
|
||||||
|
func (this *PlayerEx) ResetData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 游戏新一局 设置数据
|
||||||
|
func (this *PlayerEx) ReDataStartGame() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayerEx) CanPlayerOpInState(sceneState int) bool {
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 能否退出游戏
|
||||||
|
func (this *PlayerEx) CanLeaveScene(sceneState int) bool {
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
package clawdoll
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/protocol/clawdoll"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
rule "mongo.games.com/game/gamerule/clawdoll"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PlayerData struct {
|
||||||
|
SnId int32
|
||||||
|
Head int32 //头像框
|
||||||
|
VIP int32 //VIP帐号 等级
|
||||||
|
Name string //名字
|
||||||
|
Sex int32 //性别
|
||||||
|
IsRob bool
|
||||||
|
|
||||||
|
Coin int64
|
||||||
|
gainCoin int64 //本局赢的金币
|
||||||
|
taxCoin int64 //本局税收
|
||||||
|
isBilled bool //是否结算
|
||||||
|
CurIsWin int64 //当局输赢 负数:输 正数:赢
|
||||||
|
|
||||||
|
InviterId int32 //邀请人Id
|
||||||
|
BeUnderAgentCode string //隶属经销商(推广人)
|
||||||
|
IsPlayerFirst bool
|
||||||
|
|
||||||
|
Platform string //平台
|
||||||
|
Channel string //渠道信息
|
||||||
|
PackageID string //推广包标识 对应客户端的packagetag
|
||||||
|
flag int
|
||||||
|
}
|
||||||
|
|
||||||
|
type SceneEx struct {
|
||||||
|
*base.Scene // 场景
|
||||||
|
logic *rule.Logic //
|
||||||
|
players map[int32]*PlayerEx // 玩家信息
|
||||||
|
PlayerBackup map[int32]*PlayerData // 本局离场玩家数据备份
|
||||||
|
seats []*PlayerEx // 本局游戏中的玩家状态数据
|
||||||
|
|
||||||
|
RoundId int // 局数,第几局
|
||||||
|
robotNum int // 参与游戏的机器人数量
|
||||||
|
logid string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 游戏是否能开始
|
||||||
|
func (this *SceneEx) CanStart() bool {
|
||||||
|
//人数>=1自动开始
|
||||||
|
if len(this.players) >= 0 && (this.GetRealPlayerNum() >= 0 || this.IsPreCreateScene()) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 从房间删除玩家
|
||||||
|
func (this *SceneEx) delPlayer(p *base.Player) {
|
||||||
|
if p, exist := this.players[p.SnId]; exist {
|
||||||
|
this.seats[p.GetPos()] = nil
|
||||||
|
delete(this.players, p.SnId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 广播玩家离开
|
||||||
|
func (this *SceneEx) BroadcastPlayerLeave(p *base.Player, reason int) {
|
||||||
|
scLeavePack := &clawdoll.SCCLAWDOLLPlayerLeave{
|
||||||
|
Pos: proto.Int(p.GetPos()),
|
||||||
|
}
|
||||||
|
proto.SetDefaults(scLeavePack)
|
||||||
|
|
||||||
|
this.Broadcast(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PlayerLeave), scLeavePack, p.GetSid())
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家离开事件
|
||||||
|
func (this *SceneEx) OnPlayerLeave(p *base.Player, reason int) {
|
||||||
|
this.delPlayer(p)
|
||||||
|
this.BroadcastPlayerLeave(p, reason)
|
||||||
|
}
|
||||||
|
func (this *SceneEx) SceneDestroy(force bool) {
|
||||||
|
//销毁房间
|
||||||
|
this.Scene.Destroy(force)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *SceneEx) playerOpPack(snId int32, opcode int, opRetCode clawdoll.OpResultCode, params []int64) *clawdoll.SCCLAWDOLLOp {
|
||||||
|
pack := &clawdoll.SCCLAWDOLLOp{
|
||||||
|
SnId: proto.Int32(snId),
|
||||||
|
OpCode: proto.Int32(int32(opcode)),
|
||||||
|
Params: params,
|
||||||
|
OpRetCode: clawdoll.OpResultCode_OPRC_Success,
|
||||||
|
}
|
||||||
|
|
||||||
|
proto.SetDefaults(pack)
|
||||||
|
return pack
|
||||||
|
}
|
||||||
|
|
||||||
|
// OnPlayerSCOp 发送玩家操作情况
|
||||||
|
func (e *SceneEx) OnPlayerSCOp(p *base.Player, opcode int, opRetCode clawdoll.OpResultCode, params []int64) {
|
||||||
|
pack := e.playerOpPack(p.SnId, opcode, opRetCode, params)
|
||||||
|
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_PLAYEROP), pack)
|
||||||
|
logger.Logger.Tracef("OnPlayerSCOp %s", pack)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 房间信息打包
|
||||||
|
func (this *SceneEx) ClawdollCreateRoomInfoPacket(s *base.Scene, p *base.Player) interface{} {
|
||||||
|
pack := &clawdoll.SCCLAWDOLLRoomInfo{
|
||||||
|
RoomId: proto.Int(s.GetSceneId()),
|
||||||
|
GameId: proto.Int(s.GetGameId()),
|
||||||
|
RoomMode: proto.Int(s.GetSceneMode()),
|
||||||
|
Params: common.CopySliceInt64ToInt32(s.Params),
|
||||||
|
State: proto.Int(s.GetSceneState().GetState()),
|
||||||
|
TimeOut: proto.Int(s.GetSceneState().GetTimeout(s)),
|
||||||
|
TotalPlayer: proto.Int(len(this.players)),
|
||||||
|
RoundId: proto.Int(this.RoundId),
|
||||||
|
ParamsEx: nil,
|
||||||
|
GameFreeId: 0,
|
||||||
|
BaseScore: proto.Int32(this.GetBaseScore()),
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家信息
|
||||||
|
for _, playerEx := range this.players {
|
||||||
|
|
||||||
|
if p.SnId == playerEx.SnId {
|
||||||
|
pd := &clawdoll.CLAWDOLLPlayerData{
|
||||||
|
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),
|
||||||
|
Flag: proto.Int(playerEx.GetFlag()),
|
||||||
|
HeadOutLine: proto.Int32(playerEx.HeadOutLine),
|
||||||
|
VIP: proto.Int32(playerEx.VIP),
|
||||||
|
|
||||||
|
WinCoin: proto.Int64(playerEx.gainCoin),
|
||||||
|
}
|
||||||
|
|
||||||
|
pack.Players = append(pack.Players, pd)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
proto.SetDefaults(pack)
|
||||||
|
if p != nil {
|
||||||
|
p.SyncFlag()
|
||||||
|
}
|
||||||
|
|
||||||
|
return pack
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewClawdollSceneData(s *base.Scene) *SceneEx {
|
||||||
|
sceneEx := &SceneEx{
|
||||||
|
Scene: s,
|
||||||
|
logic: new(rule.Logic),
|
||||||
|
players: make(map[int32]*PlayerEx),
|
||||||
|
seats: make([]*PlayerEx, s.GetPlayerNum()),
|
||||||
|
PlayerBackup: make(map[int32]*PlayerData),
|
||||||
|
}
|
||||||
|
|
||||||
|
return sceneEx
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneEx) init() bool {
|
||||||
|
this.Clear()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查上分是否合法
|
||||||
|
func (this *SceneEx) CheckPayOp(betVal int64, takeMul int64) bool { //游戏底分
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneEx) Clear() {
|
||||||
|
this.robotNum = 0
|
||||||
|
this.PlayerBackup = make(map[int32]*PlayerData)
|
||||||
|
this.RoundId = 0
|
||||||
|
|
||||||
|
for i := 0; i < this.GetPlayerNum(); i++ {
|
||||||
|
if this.seats[i] != nil {
|
||||||
|
this.seats[i].Clear(this.GetBaseScore())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) {
|
||||||
|
this.PlayerBackup[p.SnId] = &PlayerData{
|
||||||
|
SnId: p.SnId,
|
||||||
|
gainCoin: p.gainCoin,
|
||||||
|
taxCoin: p.taxCoin,
|
||||||
|
isBilled: isBilled,
|
||||||
|
IsRob: p.IsRob,
|
||||||
|
Coin: p.Coin,
|
||||||
|
Head: p.Head,
|
||||||
|
flag: p.GetFlag(),
|
||||||
|
Platform: p.Platform,
|
||||||
|
Channel: p.Channel,
|
||||||
|
PackageID: p.PackageID,
|
||||||
|
CurIsWin: p.CurIsWin,
|
||||||
|
Name: p.Name,
|
||||||
|
Sex: p.Sex,
|
||||||
|
VIP: p.VIP,
|
||||||
|
InviterId: p.InviterId,
|
||||||
|
IsPlayerFirst: this.IsPlayerFirst(p.Player),
|
||||||
|
BeUnderAgentCode: p.BeUnderAgentCode,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,576 @@
|
||||||
|
package clawdoll
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/protocol/clawdoll"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
rule "mongo.games.com/game/gamerule/clawdoll"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/proto"
|
||||||
|
)
|
||||||
|
|
||||||
|
var PolicyClawdollSingleton = &PolicyClawdoll{}
|
||||||
|
|
||||||
|
type PolicyClawdoll struct {
|
||||||
|
base.BaseScenePolicy
|
||||||
|
states [rule.ClawDollSceneStateMax]base.SceneState
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) CreateSceneExData(s *base.Scene) interface{} {
|
||||||
|
sceneEx := NewClawdollSceneData(s)
|
||||||
|
if sceneEx != nil {
|
||||||
|
if sceneEx.init() {
|
||||||
|
s.ExtraData = sceneEx
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sceneEx
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) CreatePlayerExData(s *base.Scene, p *base.Player) interface{} {
|
||||||
|
playerEx := &PlayerEx{Player: p}
|
||||||
|
if playerEx != nil {
|
||||||
|
p.ExtraData = playerEx
|
||||||
|
}
|
||||||
|
return playerEx
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnStart(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnStart, sceneId=", s.GetSceneId())
|
||||||
|
|
||||||
|
sceneEx := NewClawdollSceneData(s)
|
||||||
|
if sceneEx != nil {
|
||||||
|
if sceneEx.init() {
|
||||||
|
s.ExtraData = sceneEx
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateWait)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnStop(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnStop , sceneId=", s.GetSceneId())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnTick(s *base.Scene) {
|
||||||
|
if s == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if s.SceneState != nil {
|
||||||
|
s.SceneState.OnTick(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerEnter(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
pos := -1
|
||||||
|
for i := 0; i < sceneEx.GetPlayerNum(); i++ {
|
||||||
|
if sceneEx.seats[i] == nil {
|
||||||
|
pos = i
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if pos != -1 {
|
||||||
|
playerEx := &PlayerEx{Player: p}
|
||||||
|
sceneEx.seats[pos] = playerEx
|
||||||
|
sceneEx.players[p.SnId] = playerEx
|
||||||
|
|
||||||
|
baseScore := sceneEx.GetBaseScore()
|
||||||
|
|
||||||
|
p.Pos = pos
|
||||||
|
p.ExtraData = playerEx
|
||||||
|
playerEx.Clear(baseScore)
|
||||||
|
|
||||||
|
if sceneEx.Gaming {
|
||||||
|
p.MarkFlag(base.PlayerState_WaitNext)
|
||||||
|
p.UnmarkFlag(base.PlayerState_Ready)
|
||||||
|
}
|
||||||
|
|
||||||
|
//给自己发送房间信息
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventEnter, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) {
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !this.CanChangeCoinScene(s, p) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
playerEx, ok := p.ExtraData.(*PlayerEx)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
isBilled := false
|
||||||
|
|
||||||
|
// 游戏已开始,玩家离开,备份玩家数据
|
||||||
|
if sceneEx.Gaming {
|
||||||
|
sceneEx.BackupPlayer(playerEx, isBilled)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理玩家数据
|
||||||
|
sceneEx.OnPlayerLeave(p, reason)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventLeave, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerDropLine(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventDropLine, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerRehold(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if _, ok := p.ExtraData.(*PlayerEx); ok {
|
||||||
|
//发送房间信息给自己
|
||||||
|
if p.IsGameing() {
|
||||||
|
p.MarkFlag(base.PlayerState_Ready)
|
||||||
|
}
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventRehold, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerReturn(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if _, ok := p.ExtraData.(*PlayerEx); ok {
|
||||||
|
//发送房间信息给自己
|
||||||
|
if p.IsGameing() {
|
||||||
|
p.MarkFlag(base.PlayerState_Ready)
|
||||||
|
}
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventReturn, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
|
||||||
|
if s.SceneState != nil {
|
||||||
|
p.LastOPTimer = time.Now()
|
||||||
|
p.Trusteeship = 0
|
||||||
|
return s.SceneState.OnPlayerOp(s, p, opcode, params)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *PolicyClawdoll) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params)
|
||||||
|
if s.SceneState != nil {
|
||||||
|
s.SceneState.OnPlayerEvent(s, p, evtcode, params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) IsCompleted(s *base.Scene) bool {
|
||||||
|
if s == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
return !sceneEx.Gaming
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) IsCanForceStart(s *base.Scene) bool {
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
return len(s.Players) >= 2 && !sceneEx.Gaming
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) ForceStart(s *base.Scene) {
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if sceneEx.SceneState.GetState() == rule.ClawDollSceneStateWait {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前状态能否退出游戏
|
||||||
|
func (this *PolicyClawdoll) 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 true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) SendRoomInfo(s *base.Scene, p *base.Player, sceneEx *SceneEx) {
|
||||||
|
pack := sceneEx.ClawdollCreateRoomInfoPacket(s, p)
|
||||||
|
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_ROOMINFO), pack)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 广播房间状态
|
||||||
|
func ClawdollBroadcastRoomState(s *base.Scene, params ...float32) {
|
||||||
|
pack := &clawdoll.SCCLAWDOLLRoomState{
|
||||||
|
State: proto.Int(s.SceneState.GetState()),
|
||||||
|
Params: params,
|
||||||
|
}
|
||||||
|
s.Broadcast(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_CLAWDOLL_ROOMSTATE), pack, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
//=====================================
|
||||||
|
// BaseState 状态基类
|
||||||
|
//=====================================
|
||||||
|
|
||||||
|
type BaseState struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) GetTimeout(s *base.Scene) int {
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
return int(time.Now().Sub(sceneEx.StateStartTime) / time.Second)
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) CanChangeTo(s base.SceneState) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||||
|
|
||||||
|
//playerEx, ok := p.ExtraData.(*PlayerEx)
|
||||||
|
//if !ok {
|
||||||
|
// return false
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//if !playerEx.CanLeaveScene(s.GetSceneState().GetState()) {
|
||||||
|
// return false
|
||||||
|
//}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) OnEnter(s *base.Scene) {
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
sceneEx.StateStartTime = time.Now()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) OnLeave(s *base.Scene) {}
|
||||||
|
|
||||||
|
func (this *BaseState) OnTick(s *base.Scene) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *BaseState) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
}
|
||||||
|
|
||||||
|
//=====================================
|
||||||
|
// StateWait 等待中
|
||||||
|
//=====================================
|
||||||
|
|
||||||
|
type StateWait struct {
|
||||||
|
BaseState
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateWait) GetState() int {
|
||||||
|
return rule.ClawDollSceneStateWait
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateWait) CanChangeTo(s base.SceneState) bool {
|
||||||
|
if s.GetState() == rule.ClawDollSceneStateStart {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateWait) GetTimeout(s *base.Scene) int {
|
||||||
|
|
||||||
|
return this.BaseState.GetTimeout(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateWait) OnEnter(s *base.Scene) {
|
||||||
|
this.BaseState.OnEnter(s)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if s.Gaming {
|
||||||
|
s.NotifySceneRoundPause()
|
||||||
|
}
|
||||||
|
s.Gaming = false
|
||||||
|
|
||||||
|
ClawdollBroadcastRoomState(s, float32(0), float32(0))
|
||||||
|
|
||||||
|
if sceneEx.CanStart() {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家事件
|
||||||
|
func (this *StateWait) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
logger.Logger.Trace("(this *StateWait) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode)
|
||||||
|
this.BaseState.OnPlayerEvent(s, p, evtcode, params)
|
||||||
|
if _, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
switch evtcode {
|
||||||
|
case base.PlayerEventLeave:
|
||||||
|
case base.PlayerEventEnter:
|
||||||
|
if !p.IsReady() {
|
||||||
|
p.MarkFlag(base.PlayerState_Ready)
|
||||||
|
p.SyncFlag()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateWait) OnTick(s *base.Scene) {
|
||||||
|
this.BaseState.OnTick(s)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if s.CheckNeedDestroy() {
|
||||||
|
sceneEx.SceneDestroy(true)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneWaitTimeout {
|
||||||
|
//切换到准备开局状态
|
||||||
|
if sceneEx.CanStart() {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//=====================================
|
||||||
|
// StateStart 开始倒计时
|
||||||
|
//=====================================
|
||||||
|
|
||||||
|
type StateStart struct {
|
||||||
|
BaseState
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateStart) GetState() int {
|
||||||
|
return rule.ClawDollSceneStateStart
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateStart) CanChangeTo(s base.SceneState) bool {
|
||||||
|
switch s.GetState() {
|
||||||
|
case rule.ClawDollSceneStatePlayGame:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateStart) OnEnter(s *base.Scene) {
|
||||||
|
this.BaseState.OnEnter(s)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
ClawdollBroadcastRoomState(s, float32(0), float32(0))
|
||||||
|
s.Gaming = false
|
||||||
|
sceneEx.GameNowTime = time.Now()
|
||||||
|
sceneEx.NumOfGames++
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateStart) OnTick(s *base.Scene) {
|
||||||
|
this.BaseState.OnTick(s)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneStartTimeout {
|
||||||
|
//切换到等待操作状态
|
||||||
|
if sceneEx.CanStart() {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStatePlayGame)
|
||||||
|
} else {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateWait)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateStart) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
if this.BaseState.OnPlayerOp(s, p, opcode, params) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateStart) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
logger.Logger.Trace("(this *StateStart) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode)
|
||||||
|
this.BaseState.OnPlayerEvent(s, p, evtcode, params)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
switch evtcode {
|
||||||
|
case base.PlayerEventLeave:
|
||||||
|
if !sceneEx.CanStart() {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateWait)
|
||||||
|
}
|
||||||
|
case base.PlayerEventEnter:
|
||||||
|
if !p.IsReady() {
|
||||||
|
p.MarkFlag(base.PlayerState_Ready)
|
||||||
|
p.SyncFlag()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// =====================================
|
||||||
|
// PlayGame 游戏中
|
||||||
|
// =====================================
|
||||||
|
type PlayGame struct {
|
||||||
|
BaseState
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayGame) GetState() int {
|
||||||
|
return rule.ClawDollSceneStatePlayGame
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayGame) CanChangeTo(s base.SceneState) bool {
|
||||||
|
switch s.GetState() {
|
||||||
|
case rule.ClawDollSceneStateBilled:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayGame) OnEnter(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *PlayGame) OnEnter, sceneid=", s.GetSceneId())
|
||||||
|
|
||||||
|
this.BaseState.OnEnter(s)
|
||||||
|
|
||||||
|
s.Gaming = true
|
||||||
|
|
||||||
|
ClawdollBroadcastRoomState(s, float32(0), float32(0))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
|
||||||
|
logger.Logger.Trace("StatePlayGame OnPlayerOp-----SnId:", p.SnId, " opcode: ", opcode, " params:", params)
|
||||||
|
|
||||||
|
if this.BaseState.OnPlayerOp(s, p, opcode, params) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PlayGame) OnTick(s *base.Scene) {
|
||||||
|
this.BaseState.OnTick(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
//=====================================
|
||||||
|
// StateBilled 结算
|
||||||
|
//=====================================
|
||||||
|
|
||||||
|
type StateBilled struct {
|
||||||
|
BaseState
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateBilled) GetState() int {
|
||||||
|
return rule.ClawDollSceneStateBilled
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateBilled) CanChangeTo(s base.SceneState) bool {
|
||||||
|
switch s.GetState() {
|
||||||
|
case rule.ClawDollSceneStateStart:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateBilled) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateBilled) OnEnter(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *StateBilled) OnEnter, sceneid=", s.GetSceneId())
|
||||||
|
this.BaseState.OnEnter(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateBilled) OnLeave(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *StateBilled) OnLeave, sceneid=", s.GetSceneId())
|
||||||
|
this.BaseState.OnLeave(s)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
|
||||||
|
sceneEx.PlayerBackup = make(map[int32]*PlayerData)
|
||||||
|
|
||||||
|
if s.CheckNeedDestroy() {
|
||||||
|
sceneEx.SceneDestroy(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateBilled) OnTick(s *base.Scene) {
|
||||||
|
this.BaseState.OnTick(s)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
if time.Now().Sub(sceneEx.StateStartTime) > rule.ClawDollSceneBilledTimeout {
|
||||||
|
if sceneEx.CanStart() {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateStart)
|
||||||
|
} else {
|
||||||
|
s.ChangeSceneState(rule.ClawDollSceneStateWait)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// // //////////////////////////////////////////////////////////////////////////////
|
||||||
|
func (this *PolicyClawdoll) RegisteSceneState(state base.SceneState) {
|
||||||
|
if state == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
stateid := state.GetState()
|
||||||
|
|
||||||
|
if stateid < 0 || stateid >= rule.ClawDollSceneStateMax {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.states[stateid] = state
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *PolicyClawdoll) GetSceneState(s *base.Scene, stateid int) base.SceneState {
|
||||||
|
if stateid >= 0 && stateid < rule.ClawDollSceneStateMax {
|
||||||
|
return this.states[stateid]
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
PolicyClawdollSingleton.RegisteSceneState(&StateWait{})
|
||||||
|
PolicyClawdollSingleton.RegisteSceneState(&StateStart{})
|
||||||
|
PolicyClawdollSingleton.RegisteSceneState(&PlayGame{})
|
||||||
|
PolicyClawdollSingleton.RegisteSceneState(&StateBilled{})
|
||||||
|
|
||||||
|
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
|
||||||
|
base.RegisteScenePolicy(common.GameId_Clawdoll, 0, PolicyClawdollSingleton)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -569,7 +569,7 @@ func (this *TienLenSceneData) SendHandCard_Match() {
|
||||||
}
|
}
|
||||||
grades = append(grades, gi)
|
grades = append(grades, gi)
|
||||||
}
|
}
|
||||||
realWin := 0 //-1最差 0正常 1最好
|
realWin := 1 //-1最差 0正常 1最好
|
||||||
switch realWin {
|
switch realWin {
|
||||||
case -1:
|
case -1:
|
||||||
sort.Slice(grades, func(i, j int) bool {
|
sort.Slice(grades, func(i, j int) bool {
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,11 @@ func (this *ScenePolicyTienLen) OnPlayerEnter(s *base.Scene, p *base.Player) {
|
||||||
playerData.CopyRoleId = p.MatchParams[3]
|
playerData.CopyRoleId = p.MatchParams[3]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(p.MatchParams) > 4 {
|
||||||
|
if p.MatchParams[4] != 0 {
|
||||||
|
playerData.SkinId = p.MatchParams[4]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pack := &tienlen.SCTienLenPlayerEnter{
|
pack := &tienlen.SCTienLenPlayerEnter{
|
||||||
Data: playerData,
|
Data: playerData,
|
||||||
|
|
@ -475,6 +480,11 @@ func TienLenCreateRoomInfoPacket(s *base.Scene, p *base.Player, sceneEx *TienLen
|
||||||
pd.CopyRoleId = p.MatchParams[3]
|
pd.CopyRoleId = p.MatchParams[3]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(p.MatchParams) > 4 {
|
||||||
|
if p.MatchParams[4] != 0 {
|
||||||
|
pd.SkinId = p.MatchParams[4]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pack.IsOutRecord = playerEx.CanUseRecordItem()
|
pack.IsOutRecord = playerEx.CanUseRecordItem()
|
||||||
pack.ItemRecExpireTime = playerEx.ItemRecExpireTime
|
pack.ItemRecExpireTime = playerEx.ItemRecExpireTime
|
||||||
|
|
@ -498,6 +508,11 @@ func TienLenCreateRoomInfoPacket(s *base.Scene, p *base.Player, sceneEx *TienLen
|
||||||
pd1.CopyRoleId = nowPlayer.MatchParams[3]
|
pd1.CopyRoleId = nowPlayer.MatchParams[3]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(nowPlayer.MatchParams) > 4 {
|
||||||
|
if nowPlayer.MatchParams[4] != 0 {
|
||||||
|
pd1.SkinId = nowPlayer.MatchParams[4]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//手牌
|
//手牌
|
||||||
for j := int32(0); j < rule.HandCardNum; j++ {
|
for j := int32(0); j < rule.HandCardNum; j++ {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
|
|
||||||
var platform string
|
var platform string
|
||||||
var snid int32
|
var snid int32
|
||||||
|
var createTs int64
|
||||||
var p *model.PlayerData
|
var p *model.PlayerData
|
||||||
if s != nil {
|
if s != nil {
|
||||||
var pdi = s.GetAttribute(common.ClientSessionAttribute_PlayerData)
|
var pdi = s.GetAttribute(common.ClientSessionAttribute_PlayerData)
|
||||||
|
|
@ -42,6 +43,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
if p != nil {
|
if p != nil {
|
||||||
platform = p.Platform
|
platform = p.Platform
|
||||||
snid = p.SnId
|
snid = p.SnId
|
||||||
|
createTs = p.CreateTime.Unix()
|
||||||
}
|
}
|
||||||
|
|
||||||
//LogChannelSingleton.WriteLog(&model.ClientLog{
|
//LogChannelSingleton.WriteLog(&model.ClientLog{
|
||||||
|
|
@ -56,6 +58,7 @@ func CSClientLog(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
Platform: platform,
|
Platform: platform,
|
||||||
Snid: snid,
|
Snid: snid,
|
||||||
Ts: time.Now().Unix(),
|
Ts: time.Now().Unix(),
|
||||||
|
CreateTs: createTs,
|
||||||
})
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
package action
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"mongo.games.com/game/machine/machinedoll"
|
||||||
|
"mongo.games.com/game/protocol/machine"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 移动
|
||||||
|
func SMDollMachinePerateHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
|
msg, ok := data.(*machine.SMDollMachineoPerate)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
conn := machinedoll.ConnMap[int(msg.Id)]
|
||||||
|
if conn == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if msg.Perate == 1 {
|
||||||
|
//向前移动
|
||||||
|
machinedoll.Backward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
machinedoll.BackwardStop(conn)
|
||||||
|
} else if msg.Perate == 2 {
|
||||||
|
//向后移动
|
||||||
|
machinedoll.Forward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
machinedoll.ForwardStop(conn)
|
||||||
|
} else if msg.Perate == 3 {
|
||||||
|
//向左移动
|
||||||
|
machinedoll.Left(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
machinedoll.LeftStop(conn)
|
||||||
|
} else if msg.Perate == 4 {
|
||||||
|
//向右移动
|
||||||
|
machinedoll.Right(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
machinedoll.RightStop(conn)
|
||||||
|
} else if msg.Perate == 5 {
|
||||||
|
//投币
|
||||||
|
machinedoll.Coin(conn)
|
||||||
|
machinedoll.Backward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
machinedoll.BackwardStop(conn)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下抓
|
||||||
|
func SMDollMachineGrabHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
|
msg, ok := data.(*machine.SMDollMachineGrab)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
conn := machinedoll.ConnMap[int(msg.Id)]
|
||||||
|
if conn == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
typeId := msg.TypeId
|
||||||
|
if typeId == 1 {
|
||||||
|
//弱抓
|
||||||
|
machinedoll.WeakGrab(conn)
|
||||||
|
} else if typeId == 2 {
|
||||||
|
//强力抓
|
||||||
|
machinedoll.Grab(conn)
|
||||||
|
} else if typeId == 3 {
|
||||||
|
//必中抓
|
||||||
|
machinedoll.SetPower(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
machinedoll.Grab(conn)
|
||||||
|
}
|
||||||
|
//返回消息
|
||||||
|
session.Send(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), &machine.MSDollMachineGrab{
|
||||||
|
Snid: msg.Snid,
|
||||||
|
Id: msg.GetId(),
|
||||||
|
Result: 1,
|
||||||
|
})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 与游戏服务器连接成功,向游戏服务器推送所有娃娃机连接
|
||||||
|
func SMGameLinkSucceedHandler(session *netlib.Session, packetId int, data interface{}) error {
|
||||||
|
logger.Logger.Trace("与游戏服务器连接成功!!\n")
|
||||||
|
fmt.Printf("与游戏服务器连接成功!!\n")
|
||||||
|
//开始向游戏服务器发送娃娃机连接信息
|
||||||
|
msg := &machine.MSDollMachineList{}
|
||||||
|
for i, _ := range machinedoll.ConnMap {
|
||||||
|
info := &machine.DollMachine{}
|
||||||
|
info.Id = int32(i)
|
||||||
|
info.VideoAddr = "www.baidu.com"
|
||||||
|
msg.Data = append(msg.Data, info)
|
||||||
|
}
|
||||||
|
session.Send(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), msg)
|
||||||
|
fmt.Printf("开始向游戏服务器发送娃娃机连接信息!\n", msg)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func init() {
|
||||||
|
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachinePerate), &machine.SMDollMachineoPerate{}, SMDollMachinePerateHandler)
|
||||||
|
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), &machine.SMDollMachineGrab{}, SMDollMachineGrabHandler)
|
||||||
|
//链接成功 返回消息
|
||||||
|
netlib.Register(int(machine.DollMachinePacketID_PACKET_SMGameLinkSucceed), &machine.SMGameLinkSucceed{}, SMGameLinkSucceedHandler)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
{
|
||||||
|
"netlib": {
|
||||||
|
"SrvInfo": {
|
||||||
|
"Name": "MachineServer",
|
||||||
|
"Type": 10,
|
||||||
|
"Id": 1001,
|
||||||
|
"AreaID": 1,
|
||||||
|
"Banner": [
|
||||||
|
"=================",
|
||||||
|
"machine server",
|
||||||
|
"================="
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"IoServices": [
|
||||||
|
{
|
||||||
|
"Id": 1001,
|
||||||
|
"Type": 10,
|
||||||
|
"AreaId": 1,
|
||||||
|
"Name": "Gamesrv",
|
||||||
|
"Ip": "127.0.0.1",
|
||||||
|
"Port": 7001,
|
||||||
|
"Protocol":"tcp",
|
||||||
|
"Path":"/",
|
||||||
|
"MaxDone": 20000,
|
||||||
|
"MaxPend": 20000,
|
||||||
|
"MaxPacket": 65535,
|
||||||
|
"MaxConn": 1,
|
||||||
|
"RcvBuff": 819200,
|
||||||
|
"SndBuff": 819200,
|
||||||
|
"WriteTimeout": 300,
|
||||||
|
"ReadTimeout": 300,
|
||||||
|
"IsClient": true,
|
||||||
|
"IsAutoReconn": true,
|
||||||
|
"IsInnerLink": true,
|
||||||
|
"NoDelay": true,
|
||||||
|
"SupportFragment": true,
|
||||||
|
"AuthKey": "1234567890",
|
||||||
|
"FilterChain": ["session-filter-auth"],
|
||||||
|
"HandlerChain": ["session-srv-registe","handler-game-close"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"Options": {
|
||||||
|
"QueueBacklog": 1024,
|
||||||
|
"MaxDone": 1024,
|
||||||
|
"Interval": 100
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"executor": {
|
||||||
|
"Options": {
|
||||||
|
"QueueBacklog": 1024,
|
||||||
|
"MaxDone": 1024,
|
||||||
|
"Interval": 0
|
||||||
|
},
|
||||||
|
"Worker": {
|
||||||
|
"WorkerCnt": 8,
|
||||||
|
"Options": {
|
||||||
|
"QueueBacklog": 1024,
|
||||||
|
"MaxDone": 1024,
|
||||||
|
"Interval": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"timer": {
|
||||||
|
"Options": {
|
||||||
|
"QueueBacklog": 1024,
|
||||||
|
"MaxDone": 1024,
|
||||||
|
"Interval": 100
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cmdline": {
|
||||||
|
"SupportCmdLine": true
|
||||||
|
},
|
||||||
|
"signal": {
|
||||||
|
"SupportSignal": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<seelog type="adaptive" mininterval="2000000" maxinterval="100000000" critmsgcount="500" minlevel="info">
|
||||||
|
<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,error">
|
||||||
|
<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,3 @@
|
||||||
|
[
|
||||||
|
"192.168.31.221:8800"
|
||||||
|
]
|
||||||
|
|
@ -0,0 +1,381 @@
|
||||||
|
package machinedoll
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 向前aa 05 01 50 01 01 54 dd
|
||||||
|
func Forward(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x01, 0x01}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向前停止aa 05 01 50 01 00 55 dd
|
||||||
|
func ForwardStop(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x01, 0x00}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向后
|
||||||
|
// aa 05 01 50 02 01 57 dd
|
||||||
|
func Backward(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x02, 0x01}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向后停止aa 05 01 50 02 00 56 dd
|
||||||
|
func BackwardStop(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x02, 0x00}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向左aa 05 01 50 03 01 56 dd
|
||||||
|
func Left(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x03, 0x01}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向左停止aa 05 01 50 03 00 57 dd
|
||||||
|
func LeftStop(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x03, 0x00}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向右
|
||||||
|
func Right(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x04, 0x01}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 向右停止aa 05 01 50 04 00 50 dd
|
||||||
|
func RightStop(conn net.Conn) {
|
||||||
|
instruction := []byte{0xaa, 0x05, 0x01, 0x50, 0x04, 0x00}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 强抓下抓
|
||||||
|
func Grab(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x05, 0x01, 0x50, 0x06, 0x01}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
_, err = conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 弱抓aa 05 01 50 06 00 52 dd
|
||||||
|
func WeakGrab(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x05, 0x01, 0x50, 0x06, 0x00}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 投币
|
||||||
|
func Coin(conn net.Conn) {
|
||||||
|
moveCommand := []byte{0xaa, 0x08, 0x01, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00}
|
||||||
|
moveCommand = calculateChecksum(moveCommand)
|
||||||
|
// 发送指令到服务端
|
||||||
|
_, err := conn.Write(moveCommand)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if buf[4] == 1 {
|
||||||
|
fmt.Println("上分成功!!!!n = ", n)
|
||||||
|
}
|
||||||
|
if buf[4] == 0 {
|
||||||
|
fmt.Println("上分失败!!!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 剩余局数清零
|
||||||
|
func ClearRemainingGames(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x03, 0x01, 0x32}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算校验码
|
||||||
|
func calculateChecksum(data []byte) []byte {
|
||||||
|
var value = byte(0)
|
||||||
|
for i, datum := range data {
|
||||||
|
if i > 0 {
|
||||||
|
value ^= datum
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fmt.Println("校验码 value = ", value)
|
||||||
|
data = append(data, value, 0xdd)
|
||||||
|
return data
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启音乐
|
||||||
|
func OpenMusic(conn net.Conn) {
|
||||||
|
data[43] = 0x01
|
||||||
|
instruction := []byte{0xAA, 0x33, 0x01, 0x06}
|
||||||
|
instruction = append(instruction, data...)
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭音乐
|
||||||
|
func CloseMusic(conn net.Conn) {
|
||||||
|
data[43] = 0x00
|
||||||
|
instruction := []byte{0xAA, 0x33, 0x01, 0x06}
|
||||||
|
instruction = append(instruction, data...)
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 恢复出厂设置
|
||||||
|
func RestoreFactorySettings(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x03, 0x01, 0x38}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重启主板
|
||||||
|
func Reboot(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x03, 0x01, 0x39}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暂停服务
|
||||||
|
func StopServer(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x03, 0x01, 0x37}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开启服务
|
||||||
|
func StartServer(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x03, 0x01, 0x36}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询基础参数
|
||||||
|
func queryBaseParam(conn net.Conn) {
|
||||||
|
instruction := []byte{0xAA, 0x03, 0x01, 0x05}
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置强力
|
||||||
|
func SetPower(conn net.Conn) {
|
||||||
|
data[3] = 0x00
|
||||||
|
data[16] = 0x01
|
||||||
|
data[17] = 0xE0
|
||||||
|
data[18] = 0x13
|
||||||
|
data[19] = 0x88
|
||||||
|
fmt.Println("data.len = ", len(data))
|
||||||
|
instruction := []byte{0xAA, 0x33, 0x01, 0x06}
|
||||||
|
instruction = append(instruction, data...)
|
||||||
|
instruction = calculateChecksum(instruction)
|
||||||
|
_, err := conn.Write(instruction)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send command to server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 读取服务端的响应
|
||||||
|
buf := make([]byte, 1024)
|
||||||
|
n, err := conn.Read(buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to read response from server:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
fmt.Println("n", n)
|
||||||
|
}
|
||||||
|
|
||||||
|
var data = []byte{
|
||||||
|
0x65,
|
||||||
|
0x00,
|
||||||
|
0x0F,
|
||||||
|
0x02,
|
||||||
|
0x0F,
|
||||||
|
0x00,
|
||||||
|
0x01,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x01,
|
||||||
|
0xC8,
|
||||||
|
0x00,
|
||||||
|
0x7C,
|
||||||
|
0x01,
|
||||||
|
0x5A,
|
||||||
|
0x00,
|
||||||
|
0xE0,
|
||||||
|
0x01,
|
||||||
|
0xC8,
|
||||||
|
0x00,
|
||||||
|
0x14,
|
||||||
|
0x32,
|
||||||
|
0x32,
|
||||||
|
0x50,
|
||||||
|
0x34,
|
||||||
|
0x08,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x78,
|
||||||
|
0x00,
|
||||||
|
0x32,
|
||||||
|
0x02,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0xC8,
|
||||||
|
0x00,
|
||||||
|
0x96,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x00,
|
||||||
|
0x0F,
|
||||||
|
0x07,
|
||||||
|
0x08,
|
||||||
|
0x00,
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,255 @@
|
||||||
|
package machinedoll
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"mongo.games.com/goserver/core/timer"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"mongo.games.com/game/protocol/machine"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"mongo.games.com/goserver/srvlib"
|
||||||
|
"net"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
var GameConn *netlib.Session
|
||||||
|
var ConnMap = make(map[int]net.Conn)
|
||||||
|
|
||||||
|
type MachineManager struct {
|
||||||
|
DelConnMap map[int]string
|
||||||
|
}
|
||||||
|
|
||||||
|
var MachineMgr = &MachineManager{
|
||||||
|
DelConnMap: make(map[int]string),
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MachineManager) ModuleName() string {
|
||||||
|
return "MachineManager"
|
||||||
|
}
|
||||||
|
|
||||||
|
// 心跳间隔时间(秒)
|
||||||
|
const heartbeatInterval = 1
|
||||||
|
|
||||||
|
func (this *MachineManager) Init() {
|
||||||
|
var serverAddrs []string
|
||||||
|
programDir, err := os.Getwd()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error getting working directory:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
configFile := filepath.Join(programDir, "machineIPConfig.json")
|
||||||
|
fmt.Println("构建配置文件的路径", configFile)
|
||||||
|
fileData, err := os.ReadFile(configFile)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Error("Read robot account file error:", err)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
if err = json.Unmarshal(fileData, &serverAddrs); err != nil {
|
||||||
|
logger.Logger.Error("Unmarshal robot account data error:", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//与娃娃机创建连接
|
||||||
|
// 遍历每个服务器地址,建立连接
|
||||||
|
for i, addr := range serverAddrs {
|
||||||
|
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to connect to server:", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ConnMap[i+1] = conn
|
||||||
|
go this.StartHeartbeat(i+1, &conn, addr)
|
||||||
|
}
|
||||||
|
fmt.Println("Connected to server:\n", ConnMap[1].RemoteAddr())
|
||||||
|
fmt.Println("投币请按Q!!!!")
|
||||||
|
fmt.Println("w向前s向后a向左d向右 j强力抓取k弱力抓取!")
|
||||||
|
// 监听 WASD 按键事件
|
||||||
|
/* go listenKeyboardEvents(ConnMap[1])
|
||||||
|
|
||||||
|
// 监听中断信号,等待用户退出
|
||||||
|
waitForUserExit()*/
|
||||||
|
}
|
||||||
|
func (this *MachineManager) StartHeartbeat(id int, conn *net.Conn, addr string) {
|
||||||
|
// 定期发送心跳包
|
||||||
|
ticker := time.NewTicker(heartbeatInterval * time.Second)
|
||||||
|
defer ticker.Stop()
|
||||||
|
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-ticker.C:
|
||||||
|
// 发送心跳包
|
||||||
|
_, err := (*conn).Write([]byte("heartbeat"))
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Failed to send heartbeat:", err)
|
||||||
|
delete(ConnMap, id)
|
||||||
|
this.DelConnMap[id] = addr
|
||||||
|
//通知游戏服
|
||||||
|
this.UpdateToGameServer()
|
||||||
|
fmt.Println("删除链接!!!!!!addr = ", addr)
|
||||||
|
go timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
|
||||||
|
this.ReConnect()
|
||||||
|
return true
|
||||||
|
}), nil, time.Duration(5)*time.Second, 100)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重连
|
||||||
|
func (this *MachineManager) ReConnect() bool {
|
||||||
|
fmt.Println("================重连============")
|
||||||
|
delIds := []int{}
|
||||||
|
status := false
|
||||||
|
for id, addr := range this.DelConnMap {
|
||||||
|
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ConnMap[id] = conn
|
||||||
|
delIds = append(delIds, id)
|
||||||
|
status = true
|
||||||
|
}
|
||||||
|
for _, id := range delIds {
|
||||||
|
delete(this.DelConnMap, id)
|
||||||
|
fmt.Println("重新链接成功!!!!!!id = ", id)
|
||||||
|
}
|
||||||
|
if status {
|
||||||
|
this.UpdateToGameServer()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *MachineManager) UpdateToGameServer() {
|
||||||
|
msg := &machine.MSDollMachineList{}
|
||||||
|
for i, _ := range ConnMap {
|
||||||
|
info := &machine.DollMachine{}
|
||||||
|
info.Id = int32(i)
|
||||||
|
info.VideoAddr = "www.baidu.com"
|
||||||
|
msg.Data = append(msg.Data, info)
|
||||||
|
}
|
||||||
|
SendToGameServer(int(machine.DollMachinePacketID_PACKET_MSDollMachineList), msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SendToGameServer(pid int, msg interface{}) {
|
||||||
|
if GameConn == nil {
|
||||||
|
GameConn = srvlib.ServerSessionMgrSington.GetSession(1, 7, 701)
|
||||||
|
}
|
||||||
|
if GameConn != nil {
|
||||||
|
GameConn.Send(pid, msg)
|
||||||
|
} else {
|
||||||
|
logger.Logger.Error("GameConn is nil !")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
MachineMgr.Init()
|
||||||
|
}
|
||||||
|
|
||||||
|
func listenKeyboardEvents(conn net.Conn) {
|
||||||
|
for {
|
||||||
|
// 读取键盘事件
|
||||||
|
key := readKeyboardEvent()
|
||||||
|
switch key {
|
||||||
|
case "w":
|
||||||
|
Backward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
BackwardStop(conn)
|
||||||
|
case "W":
|
||||||
|
Backward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
BackwardStop(conn)
|
||||||
|
case "a":
|
||||||
|
Left(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
LeftStop(conn)
|
||||||
|
case "A":
|
||||||
|
Left(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
LeftStop(conn)
|
||||||
|
case "s":
|
||||||
|
Forward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
ForwardStop(conn)
|
||||||
|
case "S":
|
||||||
|
Forward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
ForwardStop(conn)
|
||||||
|
case "d":
|
||||||
|
Right(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
RightStop(conn)
|
||||||
|
case "D":
|
||||||
|
Right(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
RightStop(conn)
|
||||||
|
case "j":
|
||||||
|
Grab(conn)
|
||||||
|
case "J":
|
||||||
|
SetPower(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
Grab(conn)
|
||||||
|
|
||||||
|
case "k":
|
||||||
|
WeakGrab(conn)
|
||||||
|
case "K":
|
||||||
|
WeakGrab(conn)
|
||||||
|
|
||||||
|
case "q":
|
||||||
|
Coin(conn)
|
||||||
|
Backward(conn)
|
||||||
|
time.Sleep(200 * time.Millisecond)
|
||||||
|
BackwardStop(conn)
|
||||||
|
case "Q":
|
||||||
|
Coin(conn)
|
||||||
|
Backward(conn)
|
||||||
|
time.Sleep(150 * time.Millisecond)
|
||||||
|
BackwardStop(conn)
|
||||||
|
case "1":
|
||||||
|
RestoreFactorySettings(conn)
|
||||||
|
case "2":
|
||||||
|
OpenMusic(conn)
|
||||||
|
case "3":
|
||||||
|
Reboot(conn)
|
||||||
|
case "4":
|
||||||
|
StopServer(conn)
|
||||||
|
case "5":
|
||||||
|
StartServer(conn)
|
||||||
|
case "6":
|
||||||
|
ClearRemainingGames(conn)
|
||||||
|
case "7":
|
||||||
|
SetPower(conn)
|
||||||
|
case "8":
|
||||||
|
CloseMusic(conn)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func readKeyboardEvent() string {
|
||||||
|
var b [1]byte
|
||||||
|
var done uint32
|
||||||
|
err := syscall.ReadFile(syscall.Stdin, b[:], &done, nil)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return string(b[:])
|
||||||
|
}
|
||||||
|
|
||||||
|
func waitForUserExit() {
|
||||||
|
// 创建一个信号通道
|
||||||
|
signalChan := make(chan os.Signal, 1)
|
||||||
|
|
||||||
|
// 监听中断信号
|
||||||
|
signal.Notify(signalChan, os.Interrupt)
|
||||||
|
|
||||||
|
// 等待用户按下 Ctrl+C 退出
|
||||||
|
<-signalChan
|
||||||
|
fmt.Println("退出程序...")
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "mongo.games.com/game"
|
||||||
|
_ "mongo.games.com/game/machine/action"
|
||||||
|
"mongo.games.com/goserver/core"
|
||||||
|
"mongo.games.com/goserver/core/module"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defer core.ClosePackages()
|
||||||
|
core.LoadPackages("config.json")
|
||||||
|
w := module.Start()
|
||||||
|
w.Wait("main()")
|
||||||
|
}
|
||||||
|
|
@ -243,7 +243,7 @@ func init() {
|
||||||
admin.MyAdminApp.Route("/api/player/update_tel", WorldSrvApi)
|
admin.MyAdminApp.Route("/api/player/update_tel", WorldSrvApi)
|
||||||
// 删除账号
|
// 删除账号
|
||||||
admin.MyAdminApp.Route("/api/player/delete", WorldSrvApi)
|
admin.MyAdminApp.Route("/api/player/delete", WorldSrvApi)
|
||||||
//添加道具
|
// 添加道具
|
||||||
admin.MyAdminApp.Route("/api/player/AddItem", WorldSrvApi)
|
admin.MyAdminApp.Route("/api/player/AddItem", WorldSrvApi)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,14 @@ type ClientLog struct {
|
||||||
Platform string // 平台id
|
Platform string // 平台id
|
||||||
Snid int32 // 玩家id
|
Snid int32 // 玩家id
|
||||||
Ts int64 // 时间戳
|
Ts int64 // 时间戳
|
||||||
|
CreateTs int64 // 注册时间
|
||||||
|
}
|
||||||
|
|
||||||
|
type CustomData struct {
|
||||||
|
Event string `json:"event"` // 新手引导 guide
|
||||||
|
Platform string `json:"platform"` // 平台id
|
||||||
|
GuideTp int32 `json:"guide_tp"` // 新手引导类型 1完成步骤 2跳过新手引导
|
||||||
|
N int64 `json:"n"` // 完成步骤的序号,或者跳过新手引导的序号
|
||||||
}
|
}
|
||||||
|
|
||||||
type ClientLogMysql ClientLog
|
type ClientLogMysql ClientLog
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,11 @@ type AllConfig struct {
|
||||||
*webapi.RankTypeConfig
|
*webapi.RankTypeConfig
|
||||||
//获奖记录配置
|
//获奖记录配置
|
||||||
*webapi.AwardLogConfig
|
*webapi.AwardLogConfig
|
||||||
|
// 新手引导配置
|
||||||
|
*webapi.GuideConfig
|
||||||
|
MatchAudience map[int32]*webapi.MatchAudience // 比赛观众列表
|
||||||
|
// 小精灵配置
|
||||||
|
*webapi.SpiritConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
type GlobalConfig struct {
|
type GlobalConfig struct {
|
||||||
|
|
@ -161,6 +166,7 @@ func (cm *ConfigMgr) GetConfig(platform string) *AllConfig {
|
||||||
EntrySwitch: make(map[int32]*webapi.EntrySwitch),
|
EntrySwitch: make(map[int32]*webapi.EntrySwitch),
|
||||||
ShopInfos: make(map[int32]*ShopInfo),
|
ShopInfos: make(map[int32]*ShopInfo),
|
||||||
ChannelSwitch: make(map[int32]*webapi.ChannelSwitchConfig),
|
ChannelSwitch: make(map[int32]*webapi.ChannelSwitchConfig),
|
||||||
|
MatchAudience: make(map[int32]*webapi.MatchAudience),
|
||||||
}
|
}
|
||||||
cm.platform[platform] = c
|
cm.platform[platform] = c
|
||||||
}
|
}
|
||||||
|
|
@ -354,3 +360,18 @@ func (cm *ConfigMgr) GetSkinSkillMaxLevel(plt string, skinId int32) int32 {
|
||||||
}
|
}
|
||||||
return level
|
return level
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (cm *ConfigMgr) AddMatchAudience(d *webapi.MatchAudience) {
|
||||||
|
cfg := cm.GetConfig(d.Platform)
|
||||||
|
cfg.MatchAudience[d.GetSnId()] = d
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cm *ConfigMgr) DelMatchAudience(d *webapi.MatchAudience) {
|
||||||
|
delete(cm.GetConfig(d.Platform).MatchAudience, d.GetSnId())
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsMatchAudience 是不是比赛场观众
|
||||||
|
func (cm *ConfigMgr) IsMatchAudience(plt string, snId int32) bool {
|
||||||
|
_, ok := cm.GetConfig(plt).MatchAudience[snId]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,8 @@ type GameParam struct {
|
||||||
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
|
TestRankMatchAward bool // 测试段位奖励领取通知,直接改玩家排位积分使玩家获得奖励
|
||||||
RankPlayerPermitMaxNum int32 // 赛季通行证积分排行榜最大人数
|
RankPlayerPermitMaxNum int32 // 赛季通行证积分排行榜最大人数
|
||||||
PermitInitScore int64 // 赛季通行证初始积分
|
PermitInitScore int64 // 赛季通行证初始积分
|
||||||
|
GuideStepMaxNum int32 // 新手引导步骤最大值
|
||||||
|
GuideTs int64 // 新手引导时间戳,小于这个时间的玩家不显示新手引导
|
||||||
}
|
}
|
||||||
|
|
||||||
var GameParamPath = "../data/gameparam.json"
|
var GameParamPath = "../data/gameparam.json"
|
||||||
|
|
@ -209,4 +211,10 @@ func InitGameParam() {
|
||||||
if GameParamData.RankPlayerPermitMaxNum == 0 {
|
if GameParamData.RankPlayerPermitMaxNum == 0 {
|
||||||
GameParamData.RankPlayerPermitMaxNum = 20
|
GameParamData.RankPlayerPermitMaxNum = 20
|
||||||
}
|
}
|
||||||
|
if GameParamData.GuideStepMaxNum == 0 {
|
||||||
|
GameParamData.GuideStepMaxNum = 4
|
||||||
|
}
|
||||||
|
if GameParamData.GuideTs == 0 {
|
||||||
|
GameParamData.GuideTs = 1724623200
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
model/jyb.go
15
model/jyb.go
|
|
@ -279,3 +279,18 @@ func Code2Id(code string) (uint64, error) {
|
||||||
}
|
}
|
||||||
return id, nil
|
return id, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type JybItem struct {
|
||||||
|
Id int32 `json:"id"`
|
||||||
|
Num int32 `json:"num"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type JybLog struct {
|
||||||
|
Platform string `json:"platform"` // 平台
|
||||||
|
Id string `json:"jybId"` // 礼包id
|
||||||
|
Ts int64 `json:"ts"` // 时间戳
|
||||||
|
SnId int32 `json:"snid"` // 玩家id
|
||||||
|
Tp int32 `json:"tp"` // 礼包类型 1:通用礼包 2:专属礼包
|
||||||
|
Name string `json:"name"` // 礼包名称
|
||||||
|
Award []*JybItem `json:"award"` // 礼包奖励
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,30 +4,29 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 比赛详情
|
|
||||||
type MatchAwardLog struct {
|
|
||||||
AwardNum map[string]map[int32]int32 // 奖励数量
|
|
||||||
Platform string
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
MatchAwardLogDBName = "log"
|
MatchAwardLogDBName = "log"
|
||||||
MatchAwardLogCollName = "log_matchawardlog"
|
MatchAwardLogCollName = "log_matchawardlog"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewMatchAwardLog() *MatchAwardLog {
|
type MatchAward struct {
|
||||||
return &MatchAwardLog{}
|
Platform string `bson:"-"`
|
||||||
|
Award map[int32]int32
|
||||||
}
|
}
|
||||||
|
|
||||||
func InsertOrUpdateMatchAwardLog(logs ...*MatchAwardLog) (err error) {
|
func UpsertMatchAward(data *MatchAward) error {
|
||||||
if rpcCli == nil {
|
if rpcCli == nil {
|
||||||
return ErrRPClientNoConn
|
return ErrRPClientNoConn
|
||||||
}
|
}
|
||||||
var ret bool
|
var ret bool
|
||||||
return rpcCli.CallWithTimeout("MatchAwardLogSvc.InsertOrUpdateMatchAwardLog", logs, &ret, time.Second*30)
|
return rpcCli.CallWithTimeout("MatchAwardSvc.UpsertMatchAward", data, &ret, time.Second*30)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMatchAwardLog(platform string) (ret MatchAwardLog, err error) {
|
func GetMatchAward(platform string) (ret *MatchAward, err error) {
|
||||||
err = rpcCli.CallWithTimeout("MatchAwardLogSvc.GetMatchAward", platform, &ret, time.Second*30)
|
if rpcCli == nil {
|
||||||
return ret, err
|
return nil, ErrRPClientNoConn
|
||||||
|
}
|
||||||
|
ret = new(MatchAward)
|
||||||
|
err = rpcCli.CallWithTimeout("MatchAwardSvc.GetMatchAward", platform, ret, time.Second*30)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -494,6 +494,7 @@ type PlayerData struct {
|
||||||
DiamondLotteryScore int64 //钻石抽奖幸运值
|
DiamondLotteryScore int64 //钻石抽奖幸运值
|
||||||
VCardCost int64 // 消耗v卡数量
|
VCardCost int64 // 消耗v卡数量
|
||||||
MoneyTotal int64 // 现金总充值金额,不包含api加币时的现金
|
MoneyTotal int64 // 现金总充值金额,不包含api加币时的现金
|
||||||
|
GuideStep int32 // 引导步骤;跳过引导后,该值会置为-1
|
||||||
}
|
}
|
||||||
|
|
||||||
// 七日签到数据
|
// 七日签到数据
|
||||||
|
|
@ -533,7 +534,7 @@ type WelfareData struct {
|
||||||
ContinuousPayTickets int64 //连续充值 时间戳
|
ContinuousPayTickets int64 //连续充值 时间戳
|
||||||
BlindBoxId int32 //已经领取盲盒序号
|
BlindBoxId int32 //已经领取盲盒序号
|
||||||
ContPayDay int32 //首充 从1开始
|
ContPayDay int32 //首充 从1开始
|
||||||
VIPBag map[int32]map[int32]int32 //VIP充值礼包 key1-vipLevel key2 - shopId value- shopType (每日礼包 shopId的写死为0 value = 1)
|
VIPBag map[int32]map[int32]int32 //VIP充值礼包 vip等级:商品id:商品获得类型;特殊用法, 商品id为0代表vip每日礼包 1代表vip等级礼包
|
||||||
Task map[int32]*TaskData // 任务
|
Task map[int32]*TaskData // 任务
|
||||||
PhoneLotteryTask map[int32]*TaskData // 抽手机任务
|
PhoneLotteryTask map[int32]*TaskData // 抽手机任务
|
||||||
PigBank *PigBankData // 存钱罐
|
PigBank *PigBankData // 存钱罐
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ type DbVip struct {
|
||||||
Platform string //平台
|
Platform string //平台
|
||||||
SnId int32 //玩家id
|
SnId int32 //玩家id
|
||||||
VipLevel int32 //领取礼包的VIP等级
|
VipLevel int32 //领取礼包的VIP等级
|
||||||
Type int32 //领取类型 0-每日礼包 1-每日金币礼包 2-固定礼包
|
Type int32 //领取类型 0-每日礼包 1-每日金币礼包 2-固定礼包 9-等级礼包
|
||||||
ConsumeType int32 //消耗类型
|
ConsumeType int32 //消耗类型
|
||||||
ConsumeNum int64 //消耗数量
|
ConsumeNum int64 //消耗数量
|
||||||
ItemInfo []ItemInfo //道具 获得
|
ItemInfo []ItemInfo //道具 获得
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package mq
|
package mq
|
||||||
|
|
||||||
// 后台消息
|
// 后台消息
|
||||||
|
|
||||||
const (
|
const (
|
||||||
BackBankrupt = "log_bankrupt"
|
BackBankrupt = "log_bankrupt"
|
||||||
BackClientLog = "log_clientlog_mysql"
|
BackClientLog = "log_clientlog_mysql"
|
||||||
|
|
@ -15,7 +16,11 @@ const (
|
||||||
BackSystemPermitExchange = "back_permitexchange"
|
BackSystemPermitExchange = "back_permitexchange"
|
||||||
BackSystemPermitJoin = "back_permitjoin"
|
BackSystemPermitJoin = "back_permitjoin"
|
||||||
BackSystemPermitTask = "back_permittask"
|
BackSystemPermitTask = "back_permittask"
|
||||||
|
BackSystemJyb = "back_jyblog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// dbproxy 消息
|
// dbproxy 消息
|
||||||
const ()
|
|
||||||
|
const (
|
||||||
|
DBVipGiftLog = "db_vipgift"
|
||||||
|
)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,103 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
package clawdoll;
|
||||||
|
option go_package = "mongo.games.com/game/protocol/clawdoll";
|
||||||
|
|
||||||
|
//娃娃机
|
||||||
|
enum CLAWDOLLPacketID {
|
||||||
|
PACKET_CLAWDOLL_ZERO = 0; //弃用消息号
|
||||||
|
PACKET_SC_CLAWDOLL_ROOMINFO = 5601; //房间信息
|
||||||
|
PACKET_CS_CLAWDOLL_PLAYEROP = 5602; //玩家操作(客户->服务)
|
||||||
|
PACKET_SC_CLAWDOLL_PLAYEROP = 5603; //玩家操作(服务->客户)
|
||||||
|
PACKET_SC_CLAWDOLL_ROOMSTATE = 5604; //房间状态
|
||||||
|
PACKET_SC_CLAWDOLL_GAMEBILLED = 5605; //游戏结算
|
||||||
|
PACKET_SC_CLAWDOLL_PlayerEnter = 5606; // 玩家进入
|
||||||
|
PACKET_SC_CLAWDOLL_PlayerLeave = 5607; // 玩家离开
|
||||||
|
PACKET_SC_CLAWDOLL_PLAYERINFO = 5608; // 玩家状态信息变化
|
||||||
|
}
|
||||||
|
|
||||||
|
//操作结果
|
||||||
|
enum OpResultCode {
|
||||||
|
OPRC_Success = 0; //成功
|
||||||
|
OPRC_Error = 1; //失败
|
||||||
|
OPRC_CoinNotEnough = 2; //钱不够
|
||||||
|
OPRC_PosAlReadyPlaying = 3; //本局位置已存在玩家
|
||||||
|
}
|
||||||
|
|
||||||
|
message CLAWDOLLPlayerData {
|
||||||
|
string Name = 1; //名字
|
||||||
|
int32 SnId = 2; //账号
|
||||||
|
int32 Head = 3; //头像
|
||||||
|
int32 Sex = 4; //性别
|
||||||
|
int64 Coin = 5; //金币
|
||||||
|
int32 HeadOutLine = 6; //头像框
|
||||||
|
int32 VIP = 7;
|
||||||
|
int32 Flag = 8; //二进制标记 第一位:是否掉线(0:在线 1:掉线) 第二位:是否准备(0:未准备 1:已准备)
|
||||||
|
|
||||||
|
int64 WinCoin = 9; // 本局赢分
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//房间信息
|
||||||
|
message SCCLAWDOLLRoomInfo {
|
||||||
|
int32 RoomId = 1; //房间id
|
||||||
|
int32 GameId = 2; //游戏id
|
||||||
|
int32 RoomMode = 3; //游戏模式
|
||||||
|
repeated int32 Params = 4; //规则参数
|
||||||
|
int32 State = 5; //房间当前状态
|
||||||
|
int32 TimeOut = 6; //该状态已经历时间 单位:秒
|
||||||
|
repeated CLAWDOLLPlayerData Players = 7; //房间内的玩家信息
|
||||||
|
int32 TotalPlayer = 8; //房间总人数
|
||||||
|
int32 RoundId = 9; //当前局数ID
|
||||||
|
repeated int32 ParamsEx = 10; //其他参数
|
||||||
|
|
||||||
|
int32 GameFreeId = 15;
|
||||||
|
int32 BaseScore = 16; //基础分
|
||||||
|
}
|
||||||
|
|
||||||
|
//玩家操作
|
||||||
|
message CSCLAWDOLLOp {
|
||||||
|
int32 OpCode = 1;
|
||||||
|
repeated int64 Params = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//玩家操作返回
|
||||||
|
message SCCLAWDOLLOp {
|
||||||
|
int32 SnId = 1; //玩家ID
|
||||||
|
int32 OpCode = 2; //操作码
|
||||||
|
repeated int64 Params = 3; //操作参数 同上 CSCLAWDOLLOp
|
||||||
|
OpResultCode OpRetCode = 4; //操作结果
|
||||||
|
}
|
||||||
|
|
||||||
|
//发送给客户端的数据 单局结算
|
||||||
|
message SCCLAWDOLLRoundGameBilled {
|
||||||
|
int32 RoundId = 1; //牌局ID
|
||||||
|
int32 ClowResult = 2; //抓取结果
|
||||||
|
int64 Award = 3; //获奖金额
|
||||||
|
int64 Balance = 4; //玩家余额
|
||||||
|
}
|
||||||
|
|
||||||
|
//房间状态
|
||||||
|
message SCCLAWDOLLRoomState {
|
||||||
|
int32 State = 1; //房间当前状态
|
||||||
|
repeated float Params = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//玩家信息
|
||||||
|
message SCCLAWDOLLPlayerInfo {
|
||||||
|
int32 SnId = 1; //玩家ID
|
||||||
|
int64 gainCoin = 2; //本局赢取
|
||||||
|
int64 Coin = 3; // 玩家
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//玩家进入
|
||||||
|
//PACKET_SCCLAWDOLLPlayerEnter
|
||||||
|
message SCCLAWDOLLPlayerEnter {
|
||||||
|
CLAWDOLLPlayerData Data = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//玩家离开
|
||||||
|
//PACKET_SCCLAWDOLLPlayerLeave
|
||||||
|
message SCCLAWDOLLPlayerLeave {
|
||||||
|
int32 Pos = 1; //玩家位置
|
||||||
|
}
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
- 2000~4999 client->worldsrv
|
- 2000~4999 client->worldsrv
|
||||||
- 5000~9999 client->gamesrv
|
- 5000~9999 client->gamesrv
|
||||||
- 10000~12000 client->ranksrv
|
- 10000~12000 client->ranksrv
|
||||||
|
- 20000~29999 gamesrv->machine
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
# worldsrv
|
# worldsrv
|
||||||
|
|
@ -65,7 +66,7 @@
|
||||||
- 2720~2739
|
- 2720~2739
|
||||||
|
|
||||||
#### tournament(锦标赛)
|
#### tournament(锦标赛)
|
||||||
- 2740~2759
|
- 2740~2779
|
||||||
|
|
||||||
#### RankMatch 排位赛
|
#### RankMatch 排位赛
|
||||||
- 2780~2800
|
- 2780~2800
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,537 @@
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.27.1-devel
|
||||||
|
// protoc v3.19.4
|
||||||
|
// source: dollmachine.proto
|
||||||
|
|
||||||
|
package dollmachine
|
||||||
|
|
||||||
|
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)
|
||||||
|
)
|
||||||
|
|
||||||
|
//S-GAME M-娃娃机主机
|
||||||
|
//娃娃机协议
|
||||||
|
type DollMachinePacketID int32
|
||||||
|
|
||||||
|
const (
|
||||||
|
DollMachinePacketID_PACKET_SMDollMachineZero DollMachinePacketID = 0
|
||||||
|
DollMachinePacketID_PACKET_SMDollMachineMove DollMachinePacketID = 3001
|
||||||
|
DollMachinePacketID_PACKET_SMDollMachineGrab DollMachinePacketID = 3002
|
||||||
|
DollMachinePacketID_PACKET_MSDollMachineGrab DollMachinePacketID = 3003
|
||||||
|
DollMachinePacketID_PACKET_MSDollMachineList DollMachinePacketID = 3004
|
||||||
|
)
|
||||||
|
|
||||||
|
// Enum value maps for DollMachinePacketID.
|
||||||
|
var (
|
||||||
|
DollMachinePacketID_name = map[int32]string{
|
||||||
|
0: "PACKET_SMDollMachineZero",
|
||||||
|
3001: "PACKET_SMDollMachineMove",
|
||||||
|
3002: "PACKET_SMDollMachineGrab",
|
||||||
|
3003: "PACKET_MSDollMachineGrab",
|
||||||
|
3004: "PACKET_MSDollMachineList",
|
||||||
|
}
|
||||||
|
DollMachinePacketID_value = map[string]int32{
|
||||||
|
"PACKET_SMDollMachineZero": 0,
|
||||||
|
"PACKET_SMDollMachineMove": 3001,
|
||||||
|
"PACKET_SMDollMachineGrab": 3002,
|
||||||
|
"PACKET_MSDollMachineGrab": 3003,
|
||||||
|
"PACKET_MSDollMachineList": 3004,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (x DollMachinePacketID) Enum() *DollMachinePacketID {
|
||||||
|
p := new(DollMachinePacketID)
|
||||||
|
*p = x
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x DollMachinePacketID) String() string {
|
||||||
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (DollMachinePacketID) Descriptor() protoreflect.EnumDescriptor {
|
||||||
|
return file_dollmachine_proto_enumTypes[0].Descriptor()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (DollMachinePacketID) Type() protoreflect.EnumType {
|
||||||
|
return &file_dollmachine_proto_enumTypes[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x DollMachinePacketID) Number() protoreflect.EnumNumber {
|
||||||
|
return protoreflect.EnumNumber(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DollMachinePacketID.Descriptor instead.
|
||||||
|
func (DollMachinePacketID) EnumDescriptor() ([]byte, []int) {
|
||||||
|
return file_dollmachine_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
//移动
|
||||||
|
type SMDollMachineMove struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
|
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
|
||||||
|
Direction int32 `protobuf:"varint,3,opt,name=Direction,proto3" json:"Direction,omitempty"` // 1-前 2-后 3-左 4-右
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineMove) Reset() {
|
||||||
|
*x = SMDollMachineMove{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dollmachine_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineMove) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SMDollMachineMove) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SMDollMachineMove) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dollmachine_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 SMDollMachineMove.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SMDollMachineMove) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dollmachine_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineMove) GetSnid() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Snid
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineMove) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineMove) GetDirection() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Direction
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
//下抓
|
||||||
|
type SMDollMachineGrab struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1-弱力抓 2 -强力抓 3-必出抓
|
||||||
|
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
|
||||||
|
Snid int32 `protobuf:"varint,3,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) Reset() {
|
||||||
|
*x = SMDollMachineGrab{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dollmachine_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SMDollMachineGrab) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dollmachine_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 SMDollMachineGrab.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SMDollMachineGrab) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dollmachine_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) GetTypeId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.TypeId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) GetSnid() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Snid
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回下抓结果
|
||||||
|
type MSDollMachineGrab struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
|
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
|
||||||
|
Result int32 `protobuf:"varint,3,opt,name=Result,proto3" json:"Result,omitempty"` //1-中奖 其他未中奖
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) Reset() {
|
||||||
|
*x = MSDollMachineGrab{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dollmachine_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MSDollMachineGrab) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dollmachine_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 MSDollMachineGrab.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MSDollMachineGrab) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dollmachine_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) GetSnid() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Snid
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) GetResult() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Result
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回所有娃娃机连接
|
||||||
|
type MSDollMachineList struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Data []*DollMachine `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) Reset() {
|
||||||
|
*x = MSDollMachineList{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dollmachine_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MSDollMachineList) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dollmachine_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 MSDollMachineList.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MSDollMachineList) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dollmachine_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) GetData() []*DollMachine {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DollMachine struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
|
||||||
|
Status int32 `protobuf:"varint,2,opt,name=Status,proto3" json:"Status,omitempty"` //1-空闲 2-无法使用
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) Reset() {
|
||||||
|
*x = DollMachine{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_dollmachine_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DollMachine) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DollMachine) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_dollmachine_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 DollMachine.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DollMachine) Descriptor() ([]byte, []int) {
|
||||||
|
return file_dollmachine_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) GetStatus() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Status
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_dollmachine_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_dollmachine_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x11, 0x64, 0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x64, 0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
|
||||||
|
0x22, 0x55, 0x0a, 0x11, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
|
||||||
|
0x65, 0x4d, 0x6f, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||||
|
0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x69, 0x72,
|
||||||
|
0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x44, 0x69,
|
||||||
|
0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4f, 0x0a, 0x11, 0x53, 0x4d, 0x44, 0x6f, 0x6c,
|
||||||
|
0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x16, 0x0a, 0x06,
|
||||||
|
0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79,
|
||||||
|
0x70, 0x65, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
|
||||||
|
0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
|
||||||
|
0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x22, 0x4f, 0x0a, 0x11, 0x4d, 0x53, 0x44, 0x6f,
|
||||||
|
0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x12, 0x0a,
|
||||||
|
0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69,
|
||||||
|
0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49,
|
||||||
|
0x64, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
|
0x05, 0x52, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x41, 0x0a, 0x11, 0x4d, 0x53, 0x44,
|
||||||
|
0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c,
|
||||||
|
0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64,
|
||||||
|
0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x44, 0x6f, 0x6c, 0x6c, 0x4d,
|
||||||
|
0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x35, 0x0a, 0x0b,
|
||||||
|
0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49,
|
||||||
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53,
|
||||||
|
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x74, 0x61,
|
||||||
|
0x74, 0x75, 0x73, 0x2a, 0xaf, 0x01, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||||
|
0x69, 0x6e, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50,
|
||||||
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||||
|
0x69, 0x6e, 0x65, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43,
|
||||||
|
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
|
||||||
|
0x65, 0x4d, 0x6f, 0x76, 0x65, 0x10, 0xb9, 0x17, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
|
||||||
|
0x45, 0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
|
||||||
|
0x47, 0x72, 0x61, 0x62, 0x10, 0xba, 0x17, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47,
|
||||||
|
0x72, 0x61, 0x62, 0x10, 0xbb, 0x17, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
||||||
|
0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x10, 0xbc, 0x17, 0x42, 0x2b, 0x5a, 0x29, 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, 0x64, 0x6f, 0x6c, 0x6c, 0x6d, 0x61, 0x63, 0x68, 0x69,
|
||||||
|
0x6e, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_dollmachine_proto_rawDescOnce sync.Once
|
||||||
|
file_dollmachine_proto_rawDescData = file_dollmachine_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_dollmachine_proto_rawDescGZIP() []byte {
|
||||||
|
file_dollmachine_proto_rawDescOnce.Do(func() {
|
||||||
|
file_dollmachine_proto_rawDescData = protoimpl.X.CompressGZIP(file_dollmachine_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_dollmachine_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_dollmachine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
|
var file_dollmachine_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||||
|
var file_dollmachine_proto_goTypes = []interface{}{
|
||||||
|
(DollMachinePacketID)(0), // 0: dollmachine.DollMachinePacketID
|
||||||
|
(*SMDollMachineMove)(nil), // 1: dollmachine.SMDollMachineMove
|
||||||
|
(*SMDollMachineGrab)(nil), // 2: dollmachine.SMDollMachineGrab
|
||||||
|
(*MSDollMachineGrab)(nil), // 3: dollmachine.MSDollMachineGrab
|
||||||
|
(*MSDollMachineList)(nil), // 4: dollmachine.MSDollMachineList
|
||||||
|
(*DollMachine)(nil), // 5: dollmachine.DollMachine
|
||||||
|
}
|
||||||
|
var file_dollmachine_proto_depIdxs = []int32{
|
||||||
|
5, // 0: dollmachine.MSDollMachineList.data:type_name -> dollmachine.DollMachine
|
||||||
|
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_dollmachine_proto_init() }
|
||||||
|
func file_dollmachine_proto_init() {
|
||||||
|
if File_dollmachine_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_dollmachine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SMDollMachineMove); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dollmachine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SMDollMachineGrab); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dollmachine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*MSDollMachineGrab); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dollmachine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*MSDollMachineList); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_dollmachine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DollMachine); 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_dollmachine_proto_rawDesc,
|
||||||
|
NumEnums: 1,
|
||||||
|
NumMessages: 5,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_dollmachine_proto_goTypes,
|
||||||
|
DependencyIndexes: file_dollmachine_proto_depIdxs,
|
||||||
|
EnumInfos: file_dollmachine_proto_enumTypes,
|
||||||
|
MessageInfos: file_dollmachine_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_dollmachine_proto = out.File
|
||||||
|
file_dollmachine_proto_rawDesc = nil
|
||||||
|
file_dollmachine_proto_goTypes = nil
|
||||||
|
file_dollmachine_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
package dollmachine;
|
||||||
|
option go_package = "mongo.games.com/game/protocol/dollmachine";
|
||||||
|
|
||||||
|
//S-GAME M-娃娃机主机
|
||||||
|
//娃娃机协议
|
||||||
|
enum DollMachinePacketID {
|
||||||
|
PACKET_SMDollMachineZero = 0;
|
||||||
|
PACKET_SMDollMachineMove = 3001;
|
||||||
|
PACKET_SMDollMachineGrab = 3002;
|
||||||
|
PACKET_MSDollMachineGrab = 3003;
|
||||||
|
PACKET_MSDollMachineList = 3004;
|
||||||
|
}
|
||||||
|
|
||||||
|
//移动
|
||||||
|
message SMDollMachineMove{
|
||||||
|
int32 Snid = 1;
|
||||||
|
int32 Id = 2; //娃娃机标识
|
||||||
|
int32 Direction = 3; // 1-前 2-后 3-左 4-右
|
||||||
|
}
|
||||||
|
|
||||||
|
//下抓
|
||||||
|
message SMDollMachineGrab{
|
||||||
|
int32 TypeId = 1;//1-弱力抓 2 -强力抓 3-必出抓
|
||||||
|
int32 Id =2; //娃娃机标识
|
||||||
|
int32 Snid = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回下抓结果
|
||||||
|
message MSDollMachineGrab{
|
||||||
|
int32 Snid = 1;
|
||||||
|
int32 Id = 2; //娃娃机标识
|
||||||
|
int32 Result = 3;//1-中奖 其他未中奖
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回所有娃娃机连接
|
||||||
|
message MSDollMachineList{
|
||||||
|
repeated DollMachine data = 1;
|
||||||
|
}
|
||||||
|
message DollMachine{
|
||||||
|
int32 Id = 1;
|
||||||
|
int32 Status = 2; //1-空闲 2-无法使用
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,594 @@
|
||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.27.1-devel
|
||||||
|
// protoc v3.19.4
|
||||||
|
// source: machine.proto
|
||||||
|
|
||||||
|
package machine
|
||||||
|
|
||||||
|
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)
|
||||||
|
)
|
||||||
|
|
||||||
|
//娃娃机协议
|
||||||
|
type DollMachinePacketID int32
|
||||||
|
|
||||||
|
const (
|
||||||
|
DollMachinePacketID_PACKET_SMDollMachineZero DollMachinePacketID = 0
|
||||||
|
DollMachinePacketID_PACKET_SMGameLinkSucceed DollMachinePacketID = 20000
|
||||||
|
DollMachinePacketID_PACKET_SMDollMachinePerate DollMachinePacketID = 20001
|
||||||
|
DollMachinePacketID_PACKET_SMDollMachineGrab DollMachinePacketID = 20002
|
||||||
|
DollMachinePacketID_PACKET_MSDollMachineGrab DollMachinePacketID = 20003
|
||||||
|
DollMachinePacketID_PACKET_MSDollMachineList DollMachinePacketID = 20004
|
||||||
|
)
|
||||||
|
|
||||||
|
// Enum value maps for DollMachinePacketID.
|
||||||
|
var (
|
||||||
|
DollMachinePacketID_name = map[int32]string{
|
||||||
|
0: "PACKET_SMDollMachineZero",
|
||||||
|
20000: "PACKET_SMGameLinkSucceed",
|
||||||
|
20001: "PACKET_SMDollMachinePerate",
|
||||||
|
20002: "PACKET_SMDollMachineGrab",
|
||||||
|
20003: "PACKET_MSDollMachineGrab",
|
||||||
|
20004: "PACKET_MSDollMachineList",
|
||||||
|
}
|
||||||
|
DollMachinePacketID_value = map[string]int32{
|
||||||
|
"PACKET_SMDollMachineZero": 0,
|
||||||
|
"PACKET_SMGameLinkSucceed": 20000,
|
||||||
|
"PACKET_SMDollMachinePerate": 20001,
|
||||||
|
"PACKET_SMDollMachineGrab": 20002,
|
||||||
|
"PACKET_MSDollMachineGrab": 20003,
|
||||||
|
"PACKET_MSDollMachineList": 20004,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func (x DollMachinePacketID) Enum() *DollMachinePacketID {
|
||||||
|
p := new(DollMachinePacketID)
|
||||||
|
*p = x
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x DollMachinePacketID) String() string {
|
||||||
|
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (DollMachinePacketID) Descriptor() protoreflect.EnumDescriptor {
|
||||||
|
return file_machine_proto_enumTypes[0].Descriptor()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (DollMachinePacketID) Type() protoreflect.EnumType {
|
||||||
|
return &file_machine_proto_enumTypes[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x DollMachinePacketID) Number() protoreflect.EnumNumber {
|
||||||
|
return protoreflect.EnumNumber(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DollMachinePacketID.Descriptor instead.
|
||||||
|
func (DollMachinePacketID) EnumDescriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
//通知链接成功
|
||||||
|
type SMGameLinkSucceed struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMGameLinkSucceed) Reset() {
|
||||||
|
*x = SMGameLinkSucceed{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_machine_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMGameLinkSucceed) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SMGameLinkSucceed) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SMGameLinkSucceed) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_machine_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 SMGameLinkSucceed.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SMGameLinkSucceed) Descriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
//操作
|
||||||
|
type SMDollMachineoPerate struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
|
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
|
||||||
|
Perate int32 `protobuf:"varint,3,opt,name=Perate,proto3" json:"Perate,omitempty"` // 1-前 2-后 3-左 4-右 5-投币
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineoPerate) Reset() {
|
||||||
|
*x = SMDollMachineoPerate{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_machine_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineoPerate) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SMDollMachineoPerate) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SMDollMachineoPerate) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_machine_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 SMDollMachineoPerate.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SMDollMachineoPerate) Descriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineoPerate) GetSnid() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Snid
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineoPerate) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineoPerate) GetPerate() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Perate
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
//下抓
|
||||||
|
type SMDollMachineGrab struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` //1-弱力抓 2 -强力抓 3-必出抓
|
||||||
|
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
|
||||||
|
Snid int32 `protobuf:"varint,3,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) Reset() {
|
||||||
|
*x = SMDollMachineGrab{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_machine_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SMDollMachineGrab) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_machine_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 SMDollMachineGrab.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SMDollMachineGrab) Descriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) GetTypeId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.TypeId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SMDollMachineGrab) GetSnid() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Snid
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回下抓结果
|
||||||
|
type MSDollMachineGrab struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Snid int32 `protobuf:"varint,1,opt,name=Snid,proto3" json:"Snid,omitempty"`
|
||||||
|
Id int32 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"` //娃娃机标识
|
||||||
|
Result int32 `protobuf:"varint,3,opt,name=Result,proto3" json:"Result,omitempty"` //1-中奖 其他未中奖
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) Reset() {
|
||||||
|
*x = MSDollMachineGrab{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_machine_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MSDollMachineGrab) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_machine_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 MSDollMachineGrab.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MSDollMachineGrab) Descriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) GetSnid() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Snid
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineGrab) GetResult() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Result
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回所有娃娃机连接
|
||||||
|
type MSDollMachineList struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Data []*DollMachine `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) Reset() {
|
||||||
|
*x = MSDollMachineList{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_machine_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MSDollMachineList) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_machine_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 MSDollMachineList.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MSDollMachineList) Descriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MSDollMachineList) GetData() []*DollMachine {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type DollMachine struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
|
||||||
|
VideoAddr string `protobuf:"bytes,2,opt,name=VideoAddr,proto3" json:"VideoAddr,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) Reset() {
|
||||||
|
*x = DollMachine{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_machine_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DollMachine) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DollMachine) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_machine_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 DollMachine.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DollMachine) Descriptor() ([]byte, []int) {
|
||||||
|
return file_machine_proto_rawDescGZIP(), []int{5}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DollMachine) GetVideoAddr() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.VideoAddr
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_machine_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_machine_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x0d, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||||
|
0x07, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x22, 0x13, 0x0a, 0x11, 0x53, 0x4d, 0x47, 0x61,
|
||||||
|
0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x22, 0x52, 0x0a,
|
||||||
|
0x14, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x6f, 0x50,
|
||||||
|
0x65, 0x72, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||||
|
0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x65, 0x72,
|
||||||
|
0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x50, 0x65, 0x72, 0x61, 0x74,
|
||||||
|
0x65, 0x22, 0x4f, 0x0a, 0x11, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69,
|
||||||
|
0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x16, 0x0a, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64,
|
||||||
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x0e,
|
||||||
|
0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12,
|
||||||
|
0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e,
|
||||||
|
0x69, 0x64, 0x22, 0x4f, 0x0a, 0x11, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68,
|
||||||
|
0x69, 0x6e, 0x65, 0x47, 0x72, 0x61, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x18,
|
||||||
|
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49,
|
||||||
|
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x52,
|
||||||
|
0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x65, 0x73,
|
||||||
|
0x75, 0x6c, 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63,
|
||||||
|
0x68, 0x69, 0x6e, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
|
||||||
|
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
|
||||||
|
0x2e, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61,
|
||||||
|
0x74, 0x61, 0x22, 0x3b, 0x0a, 0x0b, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e,
|
||||||
|
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49,
|
||||||
|
0x64, 0x12, 0x1c, 0x0a, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02,
|
||||||
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x41, 0x64, 0x64, 0x72, 0x2a,
|
||||||
|
0xd5, 0x01, 0x0a, 0x13, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50,
|
||||||
|
0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5a,
|
||||||
|
0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||||
|
0x53, 0x4d, 0x47, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x75, 0x63, 0x63, 0x65, 0x65,
|
||||||
|
0x64, 0x10, 0xa0, 0x9c, 0x01, 0x12, 0x20, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||||
|
0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x50, 0x65, 0x72,
|
||||||
|
0x61, 0x74, 0x65, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x53, 0x4d, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47,
|
||||||
|
0x72, 0x61, 0x62, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x47,
|
||||||
|
0x72, 0x61, 0x62, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x4d, 0x53, 0x44, 0x6f, 0x6c, 0x6c, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x4c,
|
||||||
|
0x69, 0x73, 0x74, 0x10, 0xa4, 0x9c, 0x01, 0x42, 0x27, 0x5a, 0x25, 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, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_machine_proto_rawDescOnce sync.Once
|
||||||
|
file_machine_proto_rawDescData = file_machine_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_machine_proto_rawDescGZIP() []byte {
|
||||||
|
file_machine_proto_rawDescOnce.Do(func() {
|
||||||
|
file_machine_proto_rawDescData = protoimpl.X.CompressGZIP(file_machine_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_machine_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_machine_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
|
var file_machine_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
|
var file_machine_proto_goTypes = []interface{}{
|
||||||
|
(DollMachinePacketID)(0), // 0: machine.DollMachinePacketID
|
||||||
|
(*SMGameLinkSucceed)(nil), // 1: machine.SMGameLinkSucceed
|
||||||
|
(*SMDollMachineoPerate)(nil), // 2: machine.SMDollMachineoPerate
|
||||||
|
(*SMDollMachineGrab)(nil), // 3: machine.SMDollMachineGrab
|
||||||
|
(*MSDollMachineGrab)(nil), // 4: machine.MSDollMachineGrab
|
||||||
|
(*MSDollMachineList)(nil), // 5: machine.MSDollMachineList
|
||||||
|
(*DollMachine)(nil), // 6: machine.DollMachine
|
||||||
|
}
|
||||||
|
var file_machine_proto_depIdxs = []int32{
|
||||||
|
6, // 0: machine.MSDollMachineList.data:type_name -> machine.DollMachine
|
||||||
|
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_machine_proto_init() }
|
||||||
|
func file_machine_proto_init() {
|
||||||
|
if File_machine_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_machine_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SMGameLinkSucceed); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_machine_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SMDollMachineoPerate); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_machine_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SMDollMachineGrab); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_machine_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*MSDollMachineGrab); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_machine_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*MSDollMachineList); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_machine_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DollMachine); 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_machine_proto_rawDesc,
|
||||||
|
NumEnums: 1,
|
||||||
|
NumMessages: 6,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_machine_proto_goTypes,
|
||||||
|
DependencyIndexes: file_machine_proto_depIdxs,
|
||||||
|
EnumInfos: file_machine_proto_enumTypes,
|
||||||
|
MessageInfos: file_machine_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_machine_proto = out.File
|
||||||
|
file_machine_proto_rawDesc = nil
|
||||||
|
file_machine_proto_goTypes = nil
|
||||||
|
file_machine_proto_depIdxs = nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
package machine;
|
||||||
|
option go_package = "mongo.games.com/game/protocol/machine";
|
||||||
|
|
||||||
|
//S-GAME M-娃娃机主机
|
||||||
|
|
||||||
|
//娃娃机协议
|
||||||
|
enum DollMachinePacketID {
|
||||||
|
PACKET_SMDollMachineZero = 0;
|
||||||
|
PACKET_SMGameLinkSucceed = 20000;
|
||||||
|
PACKET_SMDollMachinePerate = 20001;
|
||||||
|
PACKET_SMDollMachineGrab = 20002;
|
||||||
|
PACKET_MSDollMachineGrab = 20003;
|
||||||
|
PACKET_MSDollMachineList = 20004;
|
||||||
|
}
|
||||||
|
//通知链接成功
|
||||||
|
message SMGameLinkSucceed{
|
||||||
|
}
|
||||||
|
|
||||||
|
//操作
|
||||||
|
message SMDollMachineoPerate{
|
||||||
|
int32 Snid = 1;
|
||||||
|
int32 Id = 2; //娃娃机标识
|
||||||
|
int32 Perate = 3; // 1-前 2-后 3-左 4-右 5-投币
|
||||||
|
}
|
||||||
|
|
||||||
|
//下抓
|
||||||
|
message SMDollMachineGrab{
|
||||||
|
int32 TypeId = 1;//1-弱力抓 2 -强力抓 3-必出抓
|
||||||
|
int32 Id =2; //娃娃机标识
|
||||||
|
int32 Snid = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回下抓结果
|
||||||
|
message MSDollMachineGrab{
|
||||||
|
int32 Snid = 1;
|
||||||
|
int32 Id = 2; //娃娃机标识
|
||||||
|
int32 Result = 3;//1-中奖 其他未中奖
|
||||||
|
}
|
||||||
|
|
||||||
|
//返回所有娃娃机连接
|
||||||
|
message MSDollMachineList{
|
||||||
|
repeated DollMachine data = 1;
|
||||||
|
}
|
||||||
|
message DollMachine{
|
||||||
|
int32 Id = 1;
|
||||||
|
string VideoAddr = 2;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -75,6 +75,13 @@ enum OpResultCode {
|
||||||
|
|
||||||
OPRC_Hundred_YouHadBetCannotLeave = 7001; //赢下注不能离开
|
OPRC_Hundred_YouHadBetCannotLeave = 7001; //赢下注不能离开
|
||||||
OPRC_Hundred_YouHadBankerCannotLeave = 7002; //已上庄不能离开
|
OPRC_Hundred_YouHadBankerCannotLeave = 7002; //已上庄不能离开
|
||||||
|
|
||||||
|
OPRC_GuideStep_Finish = 8001; //该引导步骤已完成
|
||||||
|
OPRC_GuideStep_Front = 8002; //前一个引导步骤未完成
|
||||||
|
OPRC_GuideStep_End = 8003; //新手引导已结束
|
||||||
|
OPRC_Guide_Close = 8004; //新手引导已关闭
|
||||||
|
OPRC_Guide_Skip = 8005; //新手引导已跳过
|
||||||
|
OPRC_Guide_SkipClose = 8006; //新手引导不能跳过
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取玩家数据消息id
|
//获取玩家数据消息id
|
||||||
|
|
@ -197,7 +204,6 @@ enum PlayerPacketID {
|
||||||
PACKET_SCBillList = 2813; // 账变记录
|
PACKET_SCBillList = 2813; // 账变记录
|
||||||
PACKET_CSSavePlayerInfo = 2814; // 保存个人资料
|
PACKET_CSSavePlayerInfo = 2814; // 保存个人资料
|
||||||
PACKET_SCSavePlayerInfo = 2815; // 保存个人资料
|
PACKET_SCSavePlayerInfo = 2815; // 保存个人资料
|
||||||
|
|
||||||
PACKET_CS_PhoneLotteryInfo = 2816;//请求抽奖信息
|
PACKET_CS_PhoneLotteryInfo = 2816;//请求抽奖信息
|
||||||
PACKET_SC_PhoneLotteryInfo = 2817;//返回抽奖信息
|
PACKET_SC_PhoneLotteryInfo = 2817;//返回抽奖信息
|
||||||
PACKET_CS_PhoneLottery = 2818;//请求抽奖
|
PACKET_CS_PhoneLottery = 2818;//请求抽奖
|
||||||
|
|
@ -222,7 +228,10 @@ enum PlayerPacketID {
|
||||||
PACKET_SCAwardLog = 2837; //返回获奖记录
|
PACKET_SCAwardLog = 2837; //返回获奖记录
|
||||||
PACKET_CSPopUpWindowsConfig = 2838;//请求弹窗配置
|
PACKET_CSPopUpWindowsConfig = 2838;//请求弹窗配置
|
||||||
PACKET_SCPopUpWindowsConfig = 2839;//返回弹窗配置
|
PACKET_SCPopUpWindowsConfig = 2839;//返回弹窗配置
|
||||||
|
PACKET_CSUpdateAttribute = 2840;//请求更新属性
|
||||||
|
PACKET_SCUpdateAttribute = 2841;//返回更新属性
|
||||||
|
PACKET_SCGuideConfig = 2842;//返回引导配置
|
||||||
|
PACKET_SCDataConfig = 2843;//通知配置更新
|
||||||
}
|
}
|
||||||
|
|
||||||
// 账变记录
|
// 账变记录
|
||||||
|
|
@ -334,6 +343,7 @@ message PlayerData {
|
||||||
repeated int32 RequestAddFriend = 49;//请求添加好友信息
|
repeated int32 RequestAddFriend = 49;//请求添加好友信息
|
||||||
int32 UseSkinId = 50; // 皮肤id
|
int32 UseSkinId = 50; // 皮肤id
|
||||||
string ChannelID = 51; // 渠道ID
|
string ChannelID = 51; // 渠道ID
|
||||||
|
int32 GuideStep = 52; // 引导步骤; 最小为0,-1表示跳过引导了
|
||||||
}
|
}
|
||||||
|
|
||||||
//周卡数据
|
//周卡数据
|
||||||
|
|
@ -977,15 +987,17 @@ message SCVIPBuy {
|
||||||
//VIP领取
|
//VIP领取
|
||||||
//PACKET_CS_DRAWVIPGIFT
|
//PACKET_CS_DRAWVIPGIFT
|
||||||
message CSVIPDraw {
|
message CSVIPDraw {
|
||||||
int32 Id = 1; // 领取编号 0.每日礼包
|
int32 Id = 1; // 领取编号 0.每日礼包 1.等级礼包(Privilege9)
|
||||||
|
int32 Vip = 2; //领取的礼包vip等级
|
||||||
}
|
}
|
||||||
|
|
||||||
//VIP领取
|
//VIP领取
|
||||||
//PACKET_SC_DRAWVIPGIFT
|
//PACKET_SC_DRAWVIPGIFT
|
||||||
message SCVIPDraw {
|
message SCVIPDraw {
|
||||||
int32 Id = 1; // 领取编号 0.每日礼包 1.每日金币礼包 2.VIP礼包
|
int32 Id = 1; // 领取编号
|
||||||
int32 Vip = 2; //领取的礼包vip等级
|
int32 Vip = 2; //领取的礼包vip等级
|
||||||
OpResultCode OpRetCode = 3; //操作结果
|
OpResultCode OpRetCode = 3; //操作结果
|
||||||
|
map<int64,int64> Award = 4; //获得奖励
|
||||||
}
|
}
|
||||||
|
|
||||||
//VIP信息
|
//VIP信息
|
||||||
|
|
@ -998,7 +1010,7 @@ message VIPcfg {
|
||||||
repeated ItemInfo Item = 2; // 道具
|
repeated ItemInfo Item = 2; // 道具
|
||||||
int32 VipEx = 3; // VIP经验
|
int32 VipEx = 3; // VIP经验
|
||||||
int64 Price = 4; // 金额
|
int64 Price = 4; // 金额
|
||||||
repeated int32 Privilege1 = 5; //每日礼包
|
map<int64,int64> Privilege1 = 5; //每日礼包
|
||||||
repeated int32 LineId = 6; //头像框Id
|
repeated int32 LineId = 6; //头像框Id
|
||||||
repeated int32 Privilege2 = 7; //每日金币礼包1金币值2代表充值的金额
|
repeated int32 Privilege2 = 7; //每日金币礼包1金币值2代表充值的金额
|
||||||
repeated int32 Privilege3 = 8;//VIP商城刷新次数和商品数量
|
repeated int32 Privilege3 = 8;//VIP商城刷新次数和商品数量
|
||||||
|
|
@ -1010,8 +1022,10 @@ message VIPcfg {
|
||||||
int32 Privilege8 = 14;//VIP客服标识
|
int32 Privilege8 = 14;//VIP客服标识
|
||||||
int32 ShopId2 = 15;
|
int32 ShopId2 = 15;
|
||||||
int32 ShopId7 = 16;
|
int32 ShopId7 = 16;
|
||||||
repeated int32 BagStatus = 17;//每日礼包|每日金币礼包|固定VIP礼包 0可领取 1不可领取
|
repeated int32 BagStatus = 17;//每日礼包|每日金币礼包|固定VIP礼包|等级礼包 0可领取 1不可领取
|
||||||
int32 MatchFreeTimes = 18;// 比赛免费次数
|
int32 MatchFreeTimes = 18;// 比赛免费次数
|
||||||
|
map<int64,int64> Privilege9 = 19; // vip免费礼包,每个vip等级领取一次
|
||||||
|
int32 PrivilegeShow = 20;// Privilege9 原价
|
||||||
}
|
}
|
||||||
|
|
||||||
//VIP信息
|
//VIP信息
|
||||||
|
|
@ -1052,6 +1066,9 @@ message PayItem {
|
||||||
message SCPayGoodsInfo{
|
message SCPayGoodsInfo{
|
||||||
repeated int32 Gold = 1;// 0.金币 1.钻石 3.经验
|
repeated int32 Gold = 1;// 0.金币 1.钻石 3.经验
|
||||||
repeated PayItem Item = 2;// 道具
|
repeated PayItem Item = 2;// 道具
|
||||||
|
int32 ShopId = 3;// 商品id
|
||||||
|
int64 Money = 4;// 现金
|
||||||
|
string Name = 5;// 名称
|
||||||
}
|
}
|
||||||
|
|
||||||
// 资源更新
|
// 资源更新
|
||||||
|
|
@ -1312,3 +1329,42 @@ message WindowsInfo{
|
||||||
int32 PartNum = 4;//参与人数
|
int32 PartNum = 4;//参与人数
|
||||||
int32 GainNum = 5;//领取人数
|
int32 GainNum = 5;//领取人数
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//PACKET_CSUpdateAttribute
|
||||||
|
message CSUpdateAttribute{
|
||||||
|
int32 Tp = 1; // 1.更新新手引导阶段 2.跳过新手引导 3.更新新手引导状态(测试用)
|
||||||
|
repeated int64 Param = 2;
|
||||||
|
}
|
||||||
|
//PACKET_SCUpdateAttribute
|
||||||
|
message SCUpdateAttribute{
|
||||||
|
OpResultCode OpRetCode = 1; //操作结果
|
||||||
|
int32 Tp = 2;
|
||||||
|
repeated int64 Param = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
//PACKET_SCGuideConfig
|
||||||
|
message SCGuideConfig{
|
||||||
|
int32 On = 2; // 引导开关 1开启 2关闭
|
||||||
|
int32 Skip = 3; // 引导跳过开关 1开启 2关闭
|
||||||
|
}
|
||||||
|
|
||||||
|
message Config{
|
||||||
|
// Tp 类型:
|
||||||
|
// 1:小精灵快捷入口 On开关 Value地址
|
||||||
|
// 2: ...
|
||||||
|
// ...
|
||||||
|
int32 Tp = 1;
|
||||||
|
bool On = 2;
|
||||||
|
string Value = 3;
|
||||||
|
int64 Num = 4;
|
||||||
|
repeated string Values = 5;
|
||||||
|
repeated int64 Nums = 6;
|
||||||
|
repeated bool Ons = 7;
|
||||||
|
map<int64,int64> Map = 8;
|
||||||
|
map<string,string> MapStr = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
//PACKET_SCDataConfig
|
||||||
|
message SCDataConfig{
|
||||||
|
repeated Config Cfg = 1;
|
||||||
|
}
|
||||||
|
|
@ -10496,6 +10496,8 @@ type DB_VIP struct {
|
||||||
Award map[int64]int64 `protobuf:"bytes,18,rep,name=Award,proto3" json:"Award,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
Award map[int64]int64 `protobuf:"bytes,18,rep,name=Award,proto3" json:"Award,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||||
ParamName []string `protobuf:"bytes,19,rep,name=ParamName,proto3" json:"ParamName,omitempty"`
|
ParamName []string `protobuf:"bytes,19,rep,name=ParamName,proto3" json:"ParamName,omitempty"`
|
||||||
MatchFreeTimes int32 `protobuf:"varint,20,opt,name=MatchFreeTimes,proto3" json:"MatchFreeTimes,omitempty"`
|
MatchFreeTimes int32 `protobuf:"varint,20,opt,name=MatchFreeTimes,proto3" json:"MatchFreeTimes,omitempty"`
|
||||||
|
Privilege9 []int32 `protobuf:"varint,21,rep,packed,name=Privilege9,proto3" json:"Privilege9,omitempty"`
|
||||||
|
PrivilegeShow int32 `protobuf:"varint,22,opt,name=PrivilegeShow,proto3" json:"PrivilegeShow,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DB_VIP) Reset() {
|
func (x *DB_VIP) Reset() {
|
||||||
|
|
@ -10670,6 +10672,20 @@ func (x *DB_VIP) GetMatchFreeTimes() int32 {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIP) GetPrivilege9() []int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Privilege9
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIP) GetPrivilegeShow() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.PrivilegeShow
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
type DB_VIPArray struct {
|
type DB_VIPArray struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
|
|
@ -10717,6 +10733,116 @@ func (x *DB_VIPArray) GetArr() []*DB_VIP {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DB_VIPShow struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
|
||||||
|
SkinId int32 `protobuf:"varint,2,opt,name=SkinId,proto3" json:"SkinId,omitempty"`
|
||||||
|
VIPLevel int32 `protobuf:"varint,3,opt,name=VIPLevel,proto3" json:"VIPLevel,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShow) Reset() {
|
||||||
|
*x = DB_VIPShow{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pbdata_proto_msgTypes[138]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShow) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DB_VIPShow) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DB_VIPShow) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pbdata_proto_msgTypes[138]
|
||||||
|
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 DB_VIPShow.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DB_VIPShow) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pbdata_proto_rawDescGZIP(), []int{138}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShow) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShow) GetSkinId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.SkinId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShow) GetVIPLevel() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.VIPLevel
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type DB_VIPShowArray struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Arr []*DB_VIPShow `protobuf:"bytes,1,rep,name=Arr,proto3" json:"Arr,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShowArray) Reset() {
|
||||||
|
*x = DB_VIPShowArray{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pbdata_proto_msgTypes[139]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShowArray) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DB_VIPShowArray) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DB_VIPShowArray) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pbdata_proto_msgTypes[139]
|
||||||
|
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 DB_VIPShowArray.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DB_VIPShowArray) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pbdata_proto_rawDescGZIP(), []int{139}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DB_VIPShowArray) GetArr() []*DB_VIPShow {
|
||||||
|
if x != nil {
|
||||||
|
return x.Arr
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var File_pbdata_proto protoreflect.FileDescriptor
|
var File_pbdata_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
var file_pbdata_proto_rawDesc = []byte{
|
var file_pbdata_proto_rawDesc = []byte{
|
||||||
|
|
@ -12099,7 +12225,7 @@ var file_pbdata_proto_rawDesc = []byte{
|
||||||
0x03, 0x44, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x54, 0x69, 0x70, 0x73, 0x41,
|
0x03, 0x44, 0x65, 0x73, 0x22, 0x31, 0x0a, 0x0c, 0x44, 0x42, 0x5f, 0x54, 0x69, 0x70, 0x73, 0x41,
|
||||||
0x72, 0x72, 0x61, 0x79, 0x12, 0x21, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28,
|
0x72, 0x72, 0x61, 0x79, 0x12, 0x21, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28,
|
||||||
0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x54, 0x69,
|
0x0b, 0x32, 0x0f, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x54, 0x69,
|
||||||
0x70, 0x73, 0x52, 0x03, 0x41, 0x72, 0x72, 0x22, 0x88, 0x06, 0x0a, 0x06, 0x44, 0x42, 0x5f, 0x56,
|
0x70, 0x73, 0x52, 0x03, 0x41, 0x72, 0x72, 0x22, 0xce, 0x06, 0x0a, 0x06, 0x44, 0x42, 0x5f, 0x56,
|
||||||
0x49, 0x50, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
|
0x49, 0x50, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
|
||||||
0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18,
|
||||||
|
|
@ -12140,21 +12266,34 @@ var file_pbdata_proto_rawDesc = []byte{
|
||||||
0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x4e, 0x61, 0x6d,
|
0x18, 0x13, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x4e, 0x61, 0x6d,
|
||||||
0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x46, 0x72, 0x65, 0x65, 0x54, 0x69,
|
0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x46, 0x72, 0x65, 0x65, 0x54, 0x69,
|
||||||
0x6d, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68,
|
0x6d, 0x65, 0x73, 0x18, 0x14, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x4d, 0x61, 0x74, 0x63, 0x68,
|
||||||
0x46, 0x72, 0x65, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x69,
|
0x46, 0x72, 0x65, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x72, 0x69,
|
||||||
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x37, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x39, 0x18, 0x15, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x50,
|
||||||
|
0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x39, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x72, 0x69,
|
||||||
|
0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x16, 0x20, 0x01, 0x28, 0x05,
|
||||||
|
0x52, 0x0d, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x53, 0x68, 0x6f, 0x77, 0x1a,
|
||||||
|
0x3d, 0x0a, 0x0f, 0x50, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x37, 0x45, 0x6e, 0x74,
|
||||||
|
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||||
|
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
|
||||||
|
0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38,
|
||||||
|
0x0a, 0x0a, 0x41, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
|
||||||
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
|
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
|
||||||
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
|
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76,
|
||||||
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x41, 0x77, 0x61, 0x72,
|
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2f, 0x0a, 0x0b, 0x44, 0x42, 0x5f, 0x56,
|
||||||
0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
|
0x49, 0x50, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x20, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01,
|
||||||
0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42,
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02,
|
0x5f, 0x56, 0x49, 0x50, 0x52, 0x03, 0x41, 0x72, 0x72, 0x22, 0x50, 0x0a, 0x0a, 0x44, 0x42, 0x5f,
|
||||||
0x38, 0x01, 0x22, 0x2f, 0x0a, 0x0b, 0x44, 0x42, 0x5f, 0x56, 0x49, 0x50, 0x41, 0x72, 0x72, 0x61,
|
0x56, 0x49, 0x50, 0x53, 0x68, 0x6f, 0x77, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
|
||||||
0x79, 0x12, 0x20, 0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
|
0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49,
|
||||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x56, 0x49, 0x50, 0x52, 0x03,
|
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x12,
|
||||||
0x41, 0x72, 0x72, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d,
|
0x1a, 0x0a, 0x08, 0x56, 0x49, 0x50, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
0x05, 0x52, 0x08, 0x56, 0x49, 0x50, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x37, 0x0a, 0x0f, 0x44,
|
||||||
0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x42, 0x5f, 0x56, 0x49, 0x50, 0x53, 0x68, 0x6f, 0x77, 0x41, 0x72, 0x72, 0x61, 0x79, 0x12, 0x24,
|
||||||
0x74, 0x6f, 0x33,
|
0x0a, 0x03, 0x41, 0x72, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x65,
|
||||||
|
0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x56, 0x49, 0x50, 0x53, 0x68, 0x6f, 0x77, 0x52,
|
||||||
|
0x03, 0x41, 0x72, 0x72, 0x42, 0x26, 0x5a, 0x24, 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, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -12169,7 +12308,7 @@ func file_pbdata_proto_rawDescGZIP() []byte {
|
||||||
return file_pbdata_proto_rawDescData
|
return file_pbdata_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_pbdata_proto_msgTypes = make([]protoimpl.MessageInfo, 151)
|
var file_pbdata_proto_msgTypes = make([]protoimpl.MessageInfo, 153)
|
||||||
var file_pbdata_proto_goTypes = []interface{}{
|
var file_pbdata_proto_goTypes = []interface{}{
|
||||||
(*DB_ActSign)(nil), // 0: server.DB_ActSign
|
(*DB_ActSign)(nil), // 0: server.DB_ActSign
|
||||||
(*DB_ActSignArray)(nil), // 1: server.DB_ActSignArray
|
(*DB_ActSignArray)(nil), // 1: server.DB_ActSignArray
|
||||||
|
|
@ -12309,19 +12448,21 @@ var file_pbdata_proto_goTypes = []interface{}{
|
||||||
(*DB_TipsArray)(nil), // 135: server.DB_TipsArray
|
(*DB_TipsArray)(nil), // 135: server.DB_TipsArray
|
||||||
(*DB_VIP)(nil), // 136: server.DB_VIP
|
(*DB_VIP)(nil), // 136: server.DB_VIP
|
||||||
(*DB_VIPArray)(nil), // 137: server.DB_VIPArray
|
(*DB_VIPArray)(nil), // 137: server.DB_VIPArray
|
||||||
nil, // 138: server.DB_CollectBox.ItemIDEntry
|
(*DB_VIPShow)(nil), // 138: server.DB_VIPShow
|
||||||
nil, // 139: server.DB_GameItem.GainEntry
|
(*DB_VIPShowArray)(nil), // 139: server.DB_VIPShowArray
|
||||||
nil, // 140: server.DB_GiftBox.ItemIDEntry
|
nil, // 140: server.DB_CollectBox.ItemIDEntry
|
||||||
nil, // 141: server.DB_GiftCard.RewardsEntry
|
nil, // 141: server.DB_GameItem.GainEntry
|
||||||
nil, // 142: server.DB_GiftCard.DayRewardsEntry
|
nil, // 142: server.DB_GiftBox.ItemIDEntry
|
||||||
nil, // 143: server.DB_PetSkill.ItemConsumEntry
|
nil, // 143: server.DB_GiftCard.RewardsEntry
|
||||||
nil, // 144: server.DB_PropExchange.CostEntry
|
nil, // 144: server.DB_GiftCard.DayRewardsEntry
|
||||||
nil, // 145: server.DB_PropExchange.GainEntry
|
nil, // 145: server.DB_PetSkill.ItemConsumEntry
|
||||||
nil, // 146: server.DB_Skin.UnlockItemEntry
|
nil, // 146: server.DB_PropExchange.CostEntry
|
||||||
nil, // 147: server.DB_SkinLevel.UpItemEntry
|
nil, // 147: server.DB_PropExchange.GainEntry
|
||||||
nil, // 148: server.DB_Task.AwardEntry
|
nil, // 148: server.DB_Skin.UnlockItemEntry
|
||||||
nil, // 149: server.DB_VIP.Privilege7Entry
|
nil, // 149: server.DB_SkinLevel.UpItemEntry
|
||||||
nil, // 150: server.DB_VIP.AwardEntry
|
nil, // 150: server.DB_Task.AwardEntry
|
||||||
|
nil, // 151: server.DB_VIP.Privilege7Entry
|
||||||
|
nil, // 152: server.DB_VIP.AwardEntry
|
||||||
}
|
}
|
||||||
var file_pbdata_proto_depIdxs = []int32{
|
var file_pbdata_proto_depIdxs = []int32{
|
||||||
0, // 0: server.DB_ActSignArray.Arr:type_name -> server.DB_ActSign
|
0, // 0: server.DB_ActSignArray.Arr:type_name -> server.DB_ActSign
|
||||||
|
|
@ -12336,7 +12477,7 @@ var file_pbdata_proto_depIdxs = []int32{
|
||||||
18, // 9: server.DB_ChessMatchRulesArray.Arr:type_name -> server.DB_ChessMatchRules
|
18, // 9: server.DB_ChessMatchRulesArray.Arr:type_name -> server.DB_ChessMatchRules
|
||||||
20, // 10: server.DB_ChessRankArray.Arr:type_name -> server.DB_ChessRank
|
20, // 10: server.DB_ChessRankArray.Arr:type_name -> server.DB_ChessRank
|
||||||
22, // 11: server.DB_ClientVerArray.Arr:type_name -> server.DB_ClientVer
|
22, // 11: server.DB_ClientVerArray.Arr:type_name -> server.DB_ClientVer
|
||||||
138, // 12: server.DB_CollectBox.ItemID:type_name -> server.DB_CollectBox.ItemIDEntry
|
140, // 12: server.DB_CollectBox.ItemID:type_name -> server.DB_CollectBox.ItemIDEntry
|
||||||
24, // 13: server.DB_CollectBoxArray.Arr:type_name -> server.DB_CollectBox
|
24, // 13: server.DB_CollectBoxArray.Arr:type_name -> server.DB_CollectBox
|
||||||
26, // 14: server.DB_CollectBoxGainArray.Arr:type_name -> server.DB_CollectBoxGain
|
26, // 14: server.DB_CollectBoxGainArray.Arr:type_name -> server.DB_CollectBoxGain
|
||||||
28, // 15: server.DB_CrashSearchArray.Arr:type_name -> server.DB_CrashSearch
|
28, // 15: server.DB_CrashSearchArray.Arr:type_name -> server.DB_CrashSearch
|
||||||
|
|
@ -12353,7 +12494,7 @@ var file_pbdata_proto_depIdxs = []int32{
|
||||||
50, // 26: server.DB_GamMatchLVArray.Arr:type_name -> server.DB_GamMatchLV
|
50, // 26: server.DB_GamMatchLVArray.Arr:type_name -> server.DB_GamMatchLV
|
||||||
52, // 27: server.DB_GameCoinPoolArray.Arr:type_name -> server.DB_GameCoinPool
|
52, // 27: server.DB_GameCoinPoolArray.Arr:type_name -> server.DB_GameCoinPool
|
||||||
54, // 28: server.DB_GameFreeArray.Arr:type_name -> server.DB_GameFree
|
54, // 28: server.DB_GameFreeArray.Arr:type_name -> server.DB_GameFree
|
||||||
139, // 29: server.DB_GameItem.Gain:type_name -> server.DB_GameItem.GainEntry
|
141, // 29: server.DB_GameItem.Gain:type_name -> server.DB_GameItem.GainEntry
|
||||||
56, // 30: server.DB_GameItemArray.Arr:type_name -> server.DB_GameItem
|
56, // 30: server.DB_GameItemArray.Arr:type_name -> server.DB_GameItem
|
||||||
58, // 31: server.DB_GameMatchLevelArray.Arr:type_name -> server.DB_GameMatchLevel
|
58, // 31: server.DB_GameMatchLevelArray.Arr:type_name -> server.DB_GameMatchLevel
|
||||||
60, // 32: server.DB_GameRuleArray.Arr:type_name -> server.DB_GameRule
|
60, // 32: server.DB_GameRuleArray.Arr:type_name -> server.DB_GameRule
|
||||||
|
|
@ -12362,10 +12503,10 @@ var file_pbdata_proto_depIdxs = []int32{
|
||||||
66, // 35: server.DB_Game_IntroductionArray.Arr:type_name -> server.DB_Game_Introduction
|
66, // 35: server.DB_Game_IntroductionArray.Arr:type_name -> server.DB_Game_Introduction
|
||||||
68, // 36: server.DB_Game_PetArray.Arr:type_name -> server.DB_Game_Pet
|
68, // 36: server.DB_Game_PetArray.Arr:type_name -> server.DB_Game_Pet
|
||||||
70, // 37: server.DB_Game_RoleArray.Arr:type_name -> server.DB_Game_Role
|
70, // 37: server.DB_Game_RoleArray.Arr:type_name -> server.DB_Game_Role
|
||||||
140, // 38: server.DB_GiftBox.ItemID:type_name -> server.DB_GiftBox.ItemIDEntry
|
142, // 38: server.DB_GiftBox.ItemID:type_name -> server.DB_GiftBox.ItemIDEntry
|
||||||
72, // 39: server.DB_GiftBoxArray.Arr:type_name -> server.DB_GiftBox
|
72, // 39: server.DB_GiftBoxArray.Arr:type_name -> server.DB_GiftBox
|
||||||
141, // 40: server.DB_GiftCard.Rewards:type_name -> server.DB_GiftCard.RewardsEntry
|
143, // 40: server.DB_GiftCard.Rewards:type_name -> server.DB_GiftCard.RewardsEntry
|
||||||
142, // 41: server.DB_GiftCard.DayRewards:type_name -> server.DB_GiftCard.DayRewardsEntry
|
144, // 41: server.DB_GiftCard.DayRewards:type_name -> server.DB_GiftCard.DayRewardsEntry
|
||||||
74, // 42: server.DB_GiftCardArray.Arr:type_name -> server.DB_GiftCard
|
74, // 42: server.DB_GiftCardArray.Arr:type_name -> server.DB_GiftCard
|
||||||
76, // 43: server.DB_IceAgeElementRateArray.Arr:type_name -> server.DB_IceAgeElementRate
|
76, // 43: server.DB_IceAgeElementRateArray.Arr:type_name -> server.DB_IceAgeElementRate
|
||||||
78, // 44: server.DB_Legend_OddsArray.Arr:type_name -> server.DB_Legend_Odds
|
78, // 44: server.DB_Legend_OddsArray.Arr:type_name -> server.DB_Legend_Odds
|
||||||
|
|
@ -12378,7 +12519,7 @@ var file_pbdata_proto_depIdxs = []int32{
|
||||||
92, // 51: server.DB_NameGirlArray.Arr:type_name -> server.DB_NameGirl
|
92, // 51: server.DB_NameGirlArray.Arr:type_name -> server.DB_NameGirl
|
||||||
94, // 52: server.DB_NewPlayerArray.Arr:type_name -> server.DB_NewPlayer
|
94, // 52: server.DB_NewPlayerArray.Arr:type_name -> server.DB_NewPlayer
|
||||||
96, // 53: server.DB_PassShowArray.Arr:type_name -> server.DB_PassShow
|
96, // 53: server.DB_PassShowArray.Arr:type_name -> server.DB_PassShow
|
||||||
143, // 54: server.DB_PetSkill.ItemConsum:type_name -> server.DB_PetSkill.ItemConsumEntry
|
145, // 54: server.DB_PetSkill.ItemConsum:type_name -> server.DB_PetSkill.ItemConsumEntry
|
||||||
98, // 55: server.DB_PetSkillArray.Arr:type_name -> server.DB_PetSkill
|
98, // 55: server.DB_PetSkillArray.Arr:type_name -> server.DB_PetSkill
|
||||||
100, // 56: server.DB_PhoneLotteryArray.Arr:type_name -> server.DB_PhoneLottery
|
100, // 56: server.DB_PhoneLotteryArray.Arr:type_name -> server.DB_PhoneLottery
|
||||||
102, // 57: server.DB_PigBank_DiamondArray.Arr:type_name -> server.DB_PigBank_Diamond
|
102, // 57: server.DB_PigBank_DiamondArray.Arr:type_name -> server.DB_PigBank_Diamond
|
||||||
|
|
@ -12386,31 +12527,32 @@ var file_pbdata_proto_depIdxs = []int32{
|
||||||
106, // 59: server.DB_PlayerExpArray.Arr:type_name -> server.DB_PlayerExp
|
106, // 59: server.DB_PlayerExpArray.Arr:type_name -> server.DB_PlayerExp
|
||||||
108, // 60: server.DB_PlayerTypeArray.Arr:type_name -> server.DB_PlayerType
|
108, // 60: server.DB_PlayerTypeArray.Arr:type_name -> server.DB_PlayerType
|
||||||
110, // 61: server.DB_PotOddArray.Arr:type_name -> server.DB_PotOdd
|
110, // 61: server.DB_PotOddArray.Arr:type_name -> server.DB_PotOdd
|
||||||
144, // 62: server.DB_PropExchange.Cost:type_name -> server.DB_PropExchange.CostEntry
|
146, // 62: server.DB_PropExchange.Cost:type_name -> server.DB_PropExchange.CostEntry
|
||||||
145, // 63: server.DB_PropExchange.Gain:type_name -> server.DB_PropExchange.GainEntry
|
147, // 63: server.DB_PropExchange.Gain:type_name -> server.DB_PropExchange.GainEntry
|
||||||
112, // 64: server.DB_PropExchangeArray.Arr:type_name -> server.DB_PropExchange
|
112, // 64: server.DB_PropExchangeArray.Arr:type_name -> server.DB_PropExchange
|
||||||
114, // 65: server.DB_RankCycleArray.Arr:type_name -> server.DB_RankCycle
|
114, // 65: server.DB_RankCycleArray.Arr:type_name -> server.DB_RankCycle
|
||||||
116, // 66: server.DB_RankLevelArray.Arr:type_name -> server.DB_RankLevel
|
116, // 66: server.DB_RankLevelArray.Arr:type_name -> server.DB_RankLevel
|
||||||
118, // 67: server.DB_RankRewardArray.Arr:type_name -> server.DB_RankReward
|
118, // 67: server.DB_RankRewardArray.Arr:type_name -> server.DB_RankReward
|
||||||
120, // 68: server.DB_Sensitive_WordsArray.Arr:type_name -> server.DB_Sensitive_Words
|
120, // 68: server.DB_Sensitive_WordsArray.Arr:type_name -> server.DB_Sensitive_Words
|
||||||
146, // 69: server.DB_Skin.UnlockItem:type_name -> server.DB_Skin.UnlockItemEntry
|
148, // 69: server.DB_Skin.UnlockItem:type_name -> server.DB_Skin.UnlockItemEntry
|
||||||
122, // 70: server.DB_SkinArray.Arr:type_name -> server.DB_Skin
|
122, // 70: server.DB_SkinArray.Arr:type_name -> server.DB_Skin
|
||||||
147, // 71: server.DB_SkinLevel.UpItem:type_name -> server.DB_SkinLevel.UpItemEntry
|
149, // 71: server.DB_SkinLevel.UpItem:type_name -> server.DB_SkinLevel.UpItemEntry
|
||||||
124, // 72: server.DB_SkinLevelArray.Arr:type_name -> server.DB_SkinLevel
|
124, // 72: server.DB_SkinLevelArray.Arr:type_name -> server.DB_SkinLevel
|
||||||
126, // 73: server.DB_SlotRateWeightArray.Arr:type_name -> server.DB_SlotRateWeight
|
126, // 73: server.DB_SlotRateWeightArray.Arr:type_name -> server.DB_SlotRateWeight
|
||||||
128, // 74: server.DB_SystemChanceArray.Arr:type_name -> server.DB_SystemChance
|
128, // 74: server.DB_SystemChanceArray.Arr:type_name -> server.DB_SystemChance
|
||||||
148, // 75: server.DB_Task.Award:type_name -> server.DB_Task.AwardEntry
|
150, // 75: server.DB_Task.Award:type_name -> server.DB_Task.AwardEntry
|
||||||
130, // 76: server.DB_TaskArray.Arr:type_name -> server.DB_Task
|
130, // 76: server.DB_TaskArray.Arr:type_name -> server.DB_Task
|
||||||
132, // 77: server.DB_ThirdPlatformGameMappingArray.Arr:type_name -> server.DB_ThirdPlatformGameMapping
|
132, // 77: server.DB_ThirdPlatformGameMappingArray.Arr:type_name -> server.DB_ThirdPlatformGameMapping
|
||||||
134, // 78: server.DB_TipsArray.Arr:type_name -> server.DB_Tips
|
134, // 78: server.DB_TipsArray.Arr:type_name -> server.DB_Tips
|
||||||
149, // 79: server.DB_VIP.Privilege7:type_name -> server.DB_VIP.Privilege7Entry
|
151, // 79: server.DB_VIP.Privilege7:type_name -> server.DB_VIP.Privilege7Entry
|
||||||
150, // 80: server.DB_VIP.Award:type_name -> server.DB_VIP.AwardEntry
|
152, // 80: server.DB_VIP.Award:type_name -> server.DB_VIP.AwardEntry
|
||||||
136, // 81: server.DB_VIPArray.Arr:type_name -> server.DB_VIP
|
136, // 81: server.DB_VIPArray.Arr:type_name -> server.DB_VIP
|
||||||
82, // [82:82] is the sub-list for method output_type
|
138, // 82: server.DB_VIPShowArray.Arr:type_name -> server.DB_VIPShow
|
||||||
82, // [82:82] is the sub-list for method input_type
|
83, // [83:83] is the sub-list for method output_type
|
||||||
82, // [82:82] is the sub-list for extension type_name
|
83, // [83:83] is the sub-list for method input_type
|
||||||
82, // [82:82] is the sub-list for extension extendee
|
83, // [83:83] is the sub-list for extension type_name
|
||||||
0, // [0:82] is the sub-list for field type_name
|
83, // [83:83] is the sub-list for extension extendee
|
||||||
|
0, // [0:83] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_pbdata_proto_init() }
|
func init() { file_pbdata_proto_init() }
|
||||||
|
|
@ -14075,6 +14217,30 @@ func file_pbdata_proto_init() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_pbdata_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DB_VIPShow); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pbdata_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DB_VIPShowArray); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
|
|
@ -14082,7 +14248,7 @@ func file_pbdata_proto_init() {
|
||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_pbdata_proto_rawDesc,
|
RawDescriptor: file_pbdata_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 151,
|
NumMessages: 153,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1741,9 +1741,27 @@ message DB_VIP {
|
||||||
|
|
||||||
int32 MatchFreeTimes = 20;
|
int32 MatchFreeTimes = 20;
|
||||||
|
|
||||||
|
repeated int32 Privilege9 = 21;
|
||||||
|
|
||||||
|
int32 PrivilegeShow = 22;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message DB_VIPArray {
|
message DB_VIPArray {
|
||||||
repeated DB_VIP Arr = 1;
|
repeated DB_VIP Arr = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message DB_VIPShow {
|
||||||
|
|
||||||
|
int32 Id = 1;
|
||||||
|
|
||||||
|
int32 SkinId = 2;
|
||||||
|
|
||||||
|
int32 VIPLevel = 3;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message DB_VIPShowArray {
|
||||||
|
repeated DB_VIPShow Arr = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1262,6 +1262,7 @@ type SCShopExchange struct {
|
||||||
RetCode OpResultCode `protobuf:"varint,1,opt,name=RetCode,proto3,enum=shop.OpResultCode" json:"RetCode,omitempty"`
|
RetCode OpResultCode `protobuf:"varint,1,opt,name=RetCode,proto3,enum=shop.OpResultCode" json:"RetCode,omitempty"`
|
||||||
CreateTs int64 `protobuf:"varint,2,opt,name=CreateTs,proto3" json:"CreateTs,omitempty"` //订单创建日期
|
CreateTs int64 `protobuf:"varint,2,opt,name=CreateTs,proto3" json:"CreateTs,omitempty"` //订单创建日期
|
||||||
OrderId string `protobuf:"bytes,3,opt,name=OrderId,proto3" json:"OrderId,omitempty"` //订单号
|
OrderId string `protobuf:"bytes,3,opt,name=OrderId,proto3" json:"OrderId,omitempty"` //订单号
|
||||||
|
GoodsId int32 `protobuf:"varint,4,opt,name=GoodsId,proto3" json:"GoodsId,omitempty"` //商品Id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SCShopExchange) Reset() {
|
func (x *SCShopExchange) Reset() {
|
||||||
|
|
@ -1317,6 +1318,13 @@ func (x *SCShopExchange) GetOrderId() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *SCShopExchange) GetGoodsId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.GoodsId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
//PACKET_CS_SHOP_EXCHANGELIST
|
//PACKET_CS_SHOP_EXCHANGELIST
|
||||||
type CSShopExchangeList struct {
|
type CSShopExchangeList struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
|
|
@ -1378,6 +1386,7 @@ type ShopExchangeInfo struct {
|
||||||
NotVipShopLimit int32 `protobuf:"varint,15,opt,name=NotVipShopLimit,proto3" json:"NotVipShopLimit,omitempty"` //非VIP限购总数
|
NotVipShopLimit int32 `protobuf:"varint,15,opt,name=NotVipShopLimit,proto3" json:"NotVipShopLimit,omitempty"` //非VIP限购总数
|
||||||
ShopType int32 `protobuf:"varint,16,opt,name=ShopType,proto3" json:"ShopType,omitempty"` //商品类型
|
ShopType int32 `protobuf:"varint,16,opt,name=ShopType,proto3" json:"ShopType,omitempty"` //商品类型
|
||||||
TelData []*TelChargeData `protobuf:"bytes,17,rep,name=TelData,proto3" json:"TelData,omitempty"`
|
TelData []*TelChargeData `protobuf:"bytes,17,rep,name=TelData,proto3" json:"TelData,omitempty"`
|
||||||
|
Items []*ItemInfo `protobuf:"bytes,18,rep,name=Items,proto3" json:"Items,omitempty"` //道具
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ShopExchangeInfo) Reset() {
|
func (x *ShopExchangeInfo) Reset() {
|
||||||
|
|
@ -1517,6 +1526,13 @@ func (x *ShopExchangeInfo) GetTelData() []*TelChargeData {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *ShopExchangeInfo) GetItems() []*ItemInfo {
|
||||||
|
if x != nil {
|
||||||
|
return x.Items
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type ExchangeType struct {
|
type ExchangeType struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
|
|
@ -2585,196 +2601,200 @@ var file_shop_proto_rawDesc = []byte{
|
||||||
0x12, 0x22, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65,
|
0x12, 0x22, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65,
|
||||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
||||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x18, 0x08, 0x20,
|
0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x18, 0x08, 0x20,
|
||||||
0x01, 0x28, 0x05, 0x52, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x74, 0x0a, 0x0e, 0x53, 0x43,
|
0x01, 0x28, 0x05, 0x52, 0x05, 0x54, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x8e, 0x01, 0x0a, 0x0e, 0x53,
|
||||||
0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x07,
|
0x43, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x2c, 0x0a,
|
||||||
0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e,
|
|
||||||
0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64,
|
|
||||||
0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x72,
|
|
||||||
0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x43, 0x72,
|
|
||||||
0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
|
|
||||||
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64,
|
|
||||||
0x22, 0x14, 0x0a, 0x12, 0x43, 0x53, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
|
|
||||||
0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xf7, 0x03, 0x0a, 0x10, 0x53, 0x68, 0x6f, 0x70, 0x45,
|
|
||||||
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x54,
|
|
||||||
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12,
|
|
||||||
0x18, 0x0a, 0x07, 0x50, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
|
||||||
0x52, 0x07, 0x50, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d,
|
|
||||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a,
|
|
||||||
0x04, 0x52, 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x52, 0x75, 0x6c,
|
|
||||||
0x65, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01,
|
|
||||||
0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x44,
|
|
||||||
0x61, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
|
|
||||||
0x05, 0x52, 0x0c, 0x44, 0x61, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12,
|
|
||||||
0x2a, 0x0a, 0x06, 0x45, 0x78, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
|
||||||
0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54,
|
|
||||||
0x79, 0x70, 0x65, 0x52, 0x06, 0x45, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54,
|
|
||||||
0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09,
|
|
||||||
0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65,
|
|
||||||
0x6d, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49,
|
|
||||||
0x64, 0x12, 0x26, 0x0a, 0x0e, 0x56, 0x49, 0x50, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69,
|
|
||||||
0x6d, 0x69, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x56, 0x49, 0x50, 0x44, 0x61,
|
|
||||||
0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x4e, 0x6f, 0x74,
|
|
||||||
0x56, 0x69, 0x70, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d,
|
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x11, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x44, 0x61, 0x79, 0x4d,
|
|
||||||
0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x56, 0x69, 0x70, 0x53, 0x68,
|
|
||||||
0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x56,
|
|
||||||
0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4e,
|
|
||||||
0x6f, 0x74, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f,
|
|
||||||
0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70,
|
|
||||||
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70,
|
|
||||||
0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70,
|
|
||||||
0x65, 0x12, 0x2d, 0x0a, 0x07, 0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x18, 0x11, 0x20, 0x03,
|
|
||||||
0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61,
|
|
||||||
0x72, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61,
|
|
||||||
0x22, 0x60, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65,
|
|
||||||
0x12, 0x14, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
|
||||||
0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63, 0x65,
|
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x12,
|
|
||||||
0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x61,
|
|
||||||
0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
|
|
||||||
0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x44,
|
|
||||||
0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
|
||||||
0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
|
||||||
0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18, 0x03,
|
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x68, 0x6f,
|
|
||||||
0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54,
|
|
||||||
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54,
|
|
||||||
0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20,
|
|
||||||
0x01, 0x28, 0x05, 0x52, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x4e,
|
|
||||||
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12,
|
|
||||||
0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
|
||||||
0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x53, 0x68,
|
|
||||||
0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c,
|
|
||||||
0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
|
||||||
0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43,
|
|
||||||
0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x05,
|
|
||||||
0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x68,
|
|
||||||
0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49,
|
|
||||||
0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x57, 0x65,
|
|
||||||
0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x68, 0x6f,
|
|
||||||
0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x06, 0x57, 0x65,
|
|
||||||
0x69, 0x67, 0x68, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x09, 0x43, 0x53, 0x50, 0x61, 0x79, 0x49, 0x6e,
|
|
||||||
0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01, 0x20,
|
|
||||||
0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b,
|
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
|
||||||
0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x12, 0x14,
|
|
||||||
0x0a, 0x05, 0x42, 0x75, 0x79, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x42,
|
|
||||||
0x75, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
|
||||||
0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
|
|
||||||
0x67, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
|
||||||
0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x45,
|
|
||||||
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20,
|
|
||||||
0x0a, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x06, 0x20,
|
|
||||||
0x01, 0x28, 0x05, 0x52, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d,
|
|
||||||
0x22, 0x4b, 0x0a, 0x09, 0x53, 0x43, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c, 0x0a,
|
|
||||||
0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12,
|
0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12,
|
||||||
0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
|
0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f,
|
||||||
0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55,
|
0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x43,
|
||||||
0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x2a, 0x0a,
|
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x43,
|
||||||
0x10, 0x43, 0x53, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73,
|
0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
|
||||||
0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
|
||||||
0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0x3c, 0x0a, 0x08, 0x49, 0x74, 0x65,
|
0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18,
|
0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x43,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
0x53, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73,
|
||||||
0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07,
|
0x74, 0x22, 0x9d, 0x04, 0x0a, 0x10, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e,
|
||||||
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0xd3, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x49,
|
0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01,
|
||||||
0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x69,
|
||||||
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
|
0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x50, 0x69, 0x63,
|
||||||
0x64, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65,
|
0x74, 0x75, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x54,
|
0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65,
|
||||||
0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x4e, 0x75,
|
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07,
|
||||||
0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65,
|
0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x47,
|
||||||
0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20,
|
0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x44, 0x61, 0x79, 0x50, 0x6c, 0x61,
|
||||||
0x03, 0x28, 0x05, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x08, 0x49,
|
0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x44, 0x61,
|
||||||
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e,
|
0x79, 0x50, 0x6c, 0x61, 0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2a, 0x0a, 0x06, 0x45, 0x78,
|
||||||
0x73, 0x68, 0x6f, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x49,
|
0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x68, 0x6f,
|
||||||
0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65,
|
0x70, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06,
|
||||||
0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a,
|
0x45, 0x78, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61,
|
||||||
0x02, 0x54, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x54, 0x73, 0x22, 0x39, 0x0a,
|
0x72, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x54, 0x65, 0x6c, 0x43, 0x68,
|
||||||
0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73,
|
0x61, 0x72, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x0b,
|
||||||
0x74, 0x12, 0x25, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0e,
|
||||||
0x11, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
|
0x56, 0x49, 0x50, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0c,
|
||||||
0x73, 0x74, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x4a, 0x0a, 0x0c, 0x43, 0x53, 0x50, 0x6c,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x56, 0x49, 0x50, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c,
|
||||||
0x61, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79,
|
0x69, 0x6d, 0x69, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x44, 0x61,
|
||||||
0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65,
|
0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x12, 0x12, 0x0a, 0x04, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
|
0x11, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x44, 0x61, 0x79, 0x4d, 0x61, 0x78, 0x4c, 0x69, 0x6d,
|
||||||
0x41, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
0x69, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d,
|
||||||
0x52, 0x02, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x61,
|
0x69, 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f,
|
||||||
0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x41, 0x64, 0x64, 0x72,
|
0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70,
|
||||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x41,
|
0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x41, 0x64, 0x64, 0x72, 0x73, 0x22, 0x2e,
|
0x0f, 0x4e, 0x6f, 0x74, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74,
|
||||||
0x0a, 0x08, 0x41, 0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64,
|
0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x64,
|
0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2d, 0x0a, 0x07,
|
||||||
0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x64, 0x64, 0x72, 0x22, 0x11,
|
0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e,
|
||||||
0x0a, 0x0f, 0x43, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70, 0x53, 0x68, 0x6f,
|
0x73, 0x68, 0x6f, 0x70, 0x2e, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x44, 0x61,
|
||||||
0x70, 0x22, 0x59, 0x0a, 0x0f, 0x53, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70,
|
0x74, 0x61, 0x52, 0x07, 0x54, 0x65, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x24, 0x0a, 0x05, 0x49,
|
||||||
0x53, 0x68, 0x6f, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03,
|
0x74, 0x65, 0x6d, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f,
|
||||||
0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x49, 0x6e,
|
0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d,
|
||||||
0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72,
|
0x73, 0x22, 0x60, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70,
|
||||||
0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c,
|
0x65, 0x12, 0x14, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x95, 0x02, 0x0a,
|
0x52, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63,
|
||||||
0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4a, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12,
|
||||||
0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e,
|
0x12, 0x0a, 0x04, 0x43, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43,
|
||||||
0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x17,
|
0x61, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
0x0a, 0x13, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45,
|
0x02, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x0d, 0x54, 0x65, 0x6c, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65,
|
||||||
0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43, 0x5f,
|
0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x03, 0x12,
|
0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x72, 0x6c, 0x18,
|
||||||
0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14, 0x4f,
|
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x6c, 0x0a, 0x0a, 0x53, 0x68,
|
||||||
0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61,
|
0x6f, 0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x70,
|
||||||
0x52, 0x74, 0x74, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78,
|
0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x68, 0x6f, 0x70,
|
||||||
0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0x06, 0x12,
|
0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02,
|
||||||
0x19, 0x0a, 0x15, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||||
0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x63, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4f, 0x50,
|
0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65,
|
||||||
0x52, 0x43, 0x5f, 0x4a, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67,
|
0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05,
|
||||||
0x68, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x69, 0x70, 0x4c,
|
0x52, 0x06, 0x49, 0x73, 0x53, 0x68, 0x6f, 0x77, 0x22, 0x9a, 0x01, 0x0a, 0x12, 0x53, 0x43, 0x53,
|
||||||
0x65, 0x76, 0x65, 0x6c, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x09, 0x12,
|
0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12,
|
||||||
0x13, 0x0a, 0x0f, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x74, 0x53, 0x49, 0x4d, 0x43, 0x6f,
|
0x2c, 0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
||||||
0x64, 0x65, 0x10, 0x0a, 0x2a, 0x91, 0x05, 0x0a, 0x09, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74,
|
0x32, 0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74,
|
||||||
0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x48, 0x4f,
|
0x43, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a,
|
||||||
0x50, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b,
|
0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73,
|
||||||
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10,
|
0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
|
||||||
0xc4, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f,
|
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x06, 0x57,
|
||||||
0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xc5, 0x13, 0x12, 0x1c, 0x0a, 0x17,
|
0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x73, 0x68,
|
||||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x41,
|
0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x06, 0x57,
|
||||||
0x44, 0x4c, 0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc6, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41,
|
0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x09, 0x43, 0x53, 0x50, 0x61, 0x79, 0x49,
|
||||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x44, 0x4c,
|
0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x18, 0x01,
|
||||||
0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc7, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x64, 0x12, 0x20, 0x0a,
|
||||||
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41, 0x59,
|
0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x53, 0x48, 0x4f, 0x50, 0x10, 0xc8, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x79, 0x49, 0x64, 0x12,
|
||||||
0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41, 0x59, 0x53,
|
0x14, 0x0a, 0x05, 0x42, 0x75, 0x79, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
||||||
0x48, 0x4f, 0x50, 0x10, 0xc9, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x42, 0x75, 0x79, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
|
||||||
0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47,
|
0x65, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x45, 0x78, 0x63, 0x68, 0x61,
|
||||||
0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xca, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41,
|
0x6e, 0x67, 0x65, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
|
||||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43,
|
0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f,
|
||||||
0x48, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xcb, 0x13, 0x12, 0x1c,
|
0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12,
|
||||||
0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50,
|
0x20, 0x0a, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x06,
|
||||||
0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcc, 0x13, 0x12, 0x1c, 0x0a, 0x17,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75,
|
||||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45,
|
0x6d, 0x22, 0x4b, 0x0a, 0x09, 0x53, 0x43, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2c,
|
||||||
0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcd, 0x13, 0x12, 0x20, 0x0a, 0x1b, 0x50, 0x41,
|
0x0a, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
||||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43,
|
0x12, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43,
|
||||||
0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xce, 0x13, 0x12, 0x20, 0x0a, 0x1b,
|
0x6f, 0x64, 0x65, 0x52, 0x07, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03,
|
||||||
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45,
|
0x55, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x72, 0x6c, 0x22, 0x2a,
|
||||||
0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xcf, 0x13, 0x12, 0x1a,
|
0x0a, 0x10, 0x43, 0x53, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
|
||||||
0x0a, 0x15, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x49, 0x56, 0x45, 0x43, 0x4f,
|
0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01,
|
||||||
0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd2, 0x13, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x41,
|
0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70, 0x65, 0x22, 0x3c, 0x0a, 0x08, 0x49, 0x74,
|
||||||
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd3,
|
0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64,
|
||||||
0x13, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x41,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18,
|
||||||
0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd4, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b,
|
0x0a, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||||
0x45, 0x54, 0x5f, 0x43, 0x53, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x4c,
|
0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0xd3, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x79,
|
||||||
0x49, 0x53, 0x54, 0x10, 0xd5, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
|
0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65,
|
||||||
0x5f, 0x53, 0x43, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x4c, 0x49, 0x53,
|
0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
|
||||||
0x54, 0x10, 0xd6, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43,
|
0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x54, 0x79, 0x70,
|
||||||
0x53, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd7, 0x13, 0x12, 0x18,
|
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65,
|
||||||
0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x4c, 0x41, 0x59, 0x45,
|
0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x4e,
|
||||||
0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd8, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
|
0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d,
|
||||||
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49, 0x50,
|
0x65, 0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04,
|
||||||
0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xd9, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b,
|
0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x08,
|
||||||
0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49, 0x50,
|
0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e,
|
||||||
0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xda, 0x13, 0x42, 0x24, 0x5a, 0x22, 0x6d, 0x6f, 0x6e, 0x67,
|
0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08,
|
||||||
0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65,
|
0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74,
|
||||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x73, 0x68, 0x6f, 0x70, 0x62, 0x06,
|
0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0e,
|
||||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x0a, 0x02, 0x54, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x54, 0x73, 0x22, 0x39,
|
||||||
|
0x0a, 0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
|
||||||
|
0x32, 0x11, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x50, 0x61, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x4c,
|
||||||
|
0x69, 0x73, 0x74, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x4a, 0x0a, 0x0c, 0x43, 0x53, 0x50,
|
||||||
|
0x6c, 0x61, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x54,
|
||||||
|
0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x54, 0x79, 0x70,
|
||||||
|
0x65, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
0x04, 0x41, 0x64, 0x64, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
|
0x05, 0x52, 0x02, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x10, 0x53, 0x43, 0x47, 0x65, 0x74, 0x50, 0x6c,
|
||||||
|
0x61, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x41, 0x64, 0x64,
|
||||||
|
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e,
|
||||||
|
0x41, 0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x41, 0x64, 0x64, 0x72, 0x73, 0x22,
|
||||||
|
0x2e, 0x0a, 0x08, 0x41, 0x64, 0x64, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x49,
|
||||||
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x41,
|
||||||
|
0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x64, 0x64, 0x72, 0x22,
|
||||||
|
0x11, 0x0a, 0x0f, 0x43, 0x53, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69, 0x70, 0x53, 0x68,
|
||||||
|
0x6f, 0x70, 0x22, 0x59, 0x0a, 0x0f, 0x53, 0x43, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x56, 0x69,
|
||||||
|
0x70, 0x53, 0x68, 0x6f, 0x70, 0x12, 0x22, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20,
|
||||||
|
0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x73, 0x68, 0x6f, 0x70, 0x2e, 0x53, 0x68, 0x6f, 0x70, 0x49,
|
||||||
|
0x6e, 0x66, 0x6f, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66,
|
||||||
|
0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
|
0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x95, 0x02,
|
||||||
|
0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f,
|
||||||
|
0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12,
|
||||||
|
0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12,
|
||||||
|
0x17, 0x0a, 0x13, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74,
|
||||||
|
0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43,
|
||||||
|
0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x10, 0x03,
|
||||||
|
0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
|
||||||
|
0x65, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x04, 0x12, 0x18, 0x0a, 0x14,
|
||||||
|
0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74,
|
||||||
|
0x61, 0x52, 0x74, 0x74, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45,
|
||||||
|
0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0x06,
|
||||||
|
0x12, 0x19, 0x0a, 0x15, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,
|
||||||
|
0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x41, 0x63, 0x63, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x4f,
|
||||||
|
0x50, 0x52, 0x43, 0x5f, 0x4a, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75,
|
||||||
|
0x67, 0x68, 0x10, 0x08, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x56, 0x69, 0x70,
|
||||||
|
0x4c, 0x65, 0x76, 0x65, 0x6c, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x09,
|
||||||
|
0x12, 0x13, 0x0a, 0x0f, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x74, 0x53, 0x49, 0x4d, 0x43,
|
||||||
|
0x6f, 0x64, 0x65, 0x10, 0x0a, 0x2a, 0x91, 0x05, 0x0a, 0x09, 0x53, 0x50, 0x61, 0x63, 0x6b, 0x65,
|
||||||
|
0x74, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x48,
|
||||||
|
0x4f, 0x50, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
|
||||||
|
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f,
|
||||||
|
0x10, 0xc4, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
|
||||||
|
0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xc5, 0x13, 0x12, 0x1c, 0x0a,
|
||||||
|
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f,
|
||||||
|
0x41, 0x44, 0x4c, 0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc6, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50,
|
||||||
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x41, 0x44,
|
||||||
|
0x4c, 0x4f, 0x4f, 0x4b, 0x45, 0x44, 0x10, 0xc7, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43,
|
||||||
|
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41,
|
||||||
|
0x59, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xc8, 0x13, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b,
|
||||||
|
0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x56, 0x43, 0x50, 0x41, 0x59,
|
||||||
|
0x53, 0x48, 0x4f, 0x50, 0x10, 0xc9, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e,
|
||||||
|
0x47, 0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xca, 0x13, 0x12, 0x22, 0x0a, 0x1d, 0x50,
|
||||||
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58,
|
||||||
|
0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x10, 0xcb, 0x13, 0x12,
|
||||||
|
0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f,
|
||||||
|
0x50, 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcc, 0x13, 0x12, 0x1c, 0x0a,
|
||||||
|
0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f,
|
||||||
|
0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0xcd, 0x13, 0x12, 0x20, 0x0a, 0x1b, 0x50,
|
||||||
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x45, 0x58,
|
||||||
|
0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xce, 0x13, 0x12, 0x20, 0x0a,
|
||||||
|
0x1b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x5f,
|
||||||
|
0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0xcf, 0x13, 0x12,
|
||||||
|
0x1a, 0x0a, 0x15, 0x53, 0x48, 0x4f, 0x50, 0x5f, 0x53, 0x43, 0x5f, 0x47, 0x49, 0x56, 0x45, 0x43,
|
||||||
|
0x4f, 0x49, 0x4e, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd2, 0x13, 0x12, 0x15, 0x0a, 0x10, 0x50,
|
||||||
|
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10,
|
||||||
|
0xd3, 0x13, 0x12, 0x15, 0x0a, 0x10, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50,
|
||||||
|
0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xd4, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43,
|
||||||
|
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f,
|
||||||
|
0x4c, 0x49, 0x53, 0x54, 0x10, 0xd5, 0x13, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45,
|
||||||
|
0x54, 0x5f, 0x53, 0x43, 0x47, 0x45, 0x54, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x46, 0x4f, 0x4c, 0x49,
|
||||||
|
0x53, 0x54, 0x10, 0xd6, 0x13, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
|
||||||
|
0x43, 0x53, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd7, 0x13, 0x12,
|
||||||
|
0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x4c, 0x41, 0x59,
|
||||||
|
0x45, 0x52, 0x41, 0x44, 0x44, 0x52, 0x10, 0xd8, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
|
||||||
|
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49,
|
||||||
|
0x50, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xd9, 0x13, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43,
|
||||||
|
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x56, 0x49,
|
||||||
|
0x50, 0x5f, 0x53, 0x48, 0x4f, 0x50, 0x10, 0xda, 0x13, 0x42, 0x24, 0x5a, 0x22, 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, 0x73, 0x68, 0x6f, 0x70, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
@ -2836,19 +2856,20 @@ var file_shop_proto_depIdxs = []int32{
|
||||||
0, // 7: shop.SCShopExchange.RetCode:type_name -> shop.OpResultCode
|
0, // 7: shop.SCShopExchange.RetCode:type_name -> shop.OpResultCode
|
||||||
17, // 8: shop.ShopExchangeInfo.ExType:type_name -> shop.ExchangeType
|
17, // 8: shop.ShopExchangeInfo.ExType:type_name -> shop.ExchangeType
|
||||||
18, // 9: shop.ShopExchangeInfo.TelData:type_name -> shop.TelChargeData
|
18, // 9: shop.ShopExchangeInfo.TelData:type_name -> shop.TelChargeData
|
||||||
0, // 10: shop.SCShopExchangeList.RetCode:type_name -> shop.OpResultCode
|
24, // 10: shop.ShopExchangeInfo.Items:type_name -> shop.ItemInfo
|
||||||
16, // 11: shop.SCShopExchangeList.Infos:type_name -> shop.ShopExchangeInfo
|
0, // 11: shop.SCShopExchangeList.RetCode:type_name -> shop.OpResultCode
|
||||||
19, // 12: shop.SCShopExchangeList.Weight:type_name -> shop.ShopWeight
|
16, // 12: shop.SCShopExchangeList.Infos:type_name -> shop.ShopExchangeInfo
|
||||||
0, // 13: shop.SCPayInfo.RetCode:type_name -> shop.OpResultCode
|
19, // 13: shop.SCShopExchangeList.Weight:type_name -> shop.ShopWeight
|
||||||
24, // 14: shop.PayInfoList.ItemInfo:type_name -> shop.ItemInfo
|
0, // 14: shop.SCPayInfo.RetCode:type_name -> shop.OpResultCode
|
||||||
25, // 15: shop.SCGetPayInfoList.Info:type_name -> shop.PayInfoList
|
24, // 15: shop.PayInfoList.ItemInfo:type_name -> shop.ItemInfo
|
||||||
29, // 16: shop.SCGetPlayerAddrs.Addrs:type_name -> shop.AddrData
|
25, // 16: shop.SCGetPayInfoList.Info:type_name -> shop.PayInfoList
|
||||||
2, // 17: shop.SCUpdateVipShop.info:type_name -> shop.ShopInfo
|
29, // 17: shop.SCGetPlayerAddrs.Addrs:type_name -> shop.AddrData
|
||||||
18, // [18:18] is the sub-list for method output_type
|
2, // 18: shop.SCUpdateVipShop.info:type_name -> shop.ShopInfo
|
||||||
18, // [18:18] is the sub-list for method input_type
|
19, // [19:19] is the sub-list for method output_type
|
||||||
18, // [18:18] is the sub-list for extension type_name
|
19, // [19:19] is the sub-list for method input_type
|
||||||
18, // [18:18] is the sub-list for extension extendee
|
19, // [19:19] is the sub-list for extension type_name
|
||||||
0, // [0:18] is the sub-list for field type_name
|
19, // [19:19] is the sub-list for extension extendee
|
||||||
|
0, // [0:19] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_shop_proto_init() }
|
func init() { file_shop_proto_init() }
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ message SCShopExchange{
|
||||||
OpResultCode RetCode = 1;
|
OpResultCode RetCode = 1;
|
||||||
int64 CreateTs = 2;//订单创建日期
|
int64 CreateTs = 2;//订单创建日期
|
||||||
string OrderId = 3;//订单号
|
string OrderId = 3;//订单号
|
||||||
|
int32 GoodsId = 4;//商品Id
|
||||||
}
|
}
|
||||||
|
|
||||||
//PACKET_CS_SHOP_EXCHANGELIST
|
//PACKET_CS_SHOP_EXCHANGELIST
|
||||||
|
|
@ -183,6 +184,7 @@ message ShopExchangeInfo{
|
||||||
int32 NotVipShopLimit = 15;//非VIP限购总数
|
int32 NotVipShopLimit = 15;//非VIP限购总数
|
||||||
int32 ShopType = 16; //商品类型
|
int32 ShopType = 16; //商品类型
|
||||||
repeated TelChargeData TelData = 17;
|
repeated TelChargeData TelData = 17;
|
||||||
|
repeated ItemInfo Items = 18; //道具
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -20,6 +20,10 @@ enum TOURNAMENTID{
|
||||||
PACKET_TM_SCTMSeasonRank = 2754;//赛季排行榜
|
PACKET_TM_SCTMSeasonRank = 2754;//赛季排行榜
|
||||||
PACKET_TM_CSTMSeasonAward = 2755;//领取赛季奖励
|
PACKET_TM_CSTMSeasonAward = 2755;//领取赛季奖励
|
||||||
PACKET_TM_SCTMSeasonAward = 2756;//领取赛季奖励
|
PACKET_TM_SCTMSeasonAward = 2756;//领取赛季奖励
|
||||||
|
PACKET_TM_CSMatchList = 2757;// 比赛列表
|
||||||
|
PACKET_TM_SCMatchList = 2758;// 比赛列表
|
||||||
|
PACKET_TM_CSRoomList = 2759; // 比赛房间列表
|
||||||
|
PACKET_TM_SCRoomList = 2760; // 比赛房间列表
|
||||||
}
|
}
|
||||||
//比赛场场次
|
//比赛场场次
|
||||||
//PACKET_TM_CSTMInfo
|
//PACKET_TM_CSTMInfo
|
||||||
|
|
@ -65,6 +69,7 @@ message TMInfo{
|
||||||
repeated string OnChannelName = 21;//在哪个渠道开启
|
repeated string OnChannelName = 21;//在哪个渠道开启
|
||||||
int32 ShowId = 22; // 比赛区分
|
int32 ShowId = 22; // 比赛区分
|
||||||
int32 AwardNum = 23; //比赛奖励剩余数量
|
int32 AwardNum = 23; //比赛奖励剩余数量
|
||||||
|
int32 AudienceSwitch = 27; // 观战开关 1开启 2关闭
|
||||||
}
|
}
|
||||||
|
|
||||||
message MatchTypeInfo{
|
message MatchTypeInfo{
|
||||||
|
|
@ -188,3 +193,56 @@ message SCTMSeasonAward {
|
||||||
int32 Lv = 1;//段位
|
int32 Lv = 1;//段位
|
||||||
int32 Code = 2;//0成功 1失败
|
int32 Code = 2;//0成功 1失败
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//PACKET_TM_CSMatchList
|
||||||
|
message CSMatchList{
|
||||||
|
int64 MatchId = 1; // 比赛id 0表示所有比赛场
|
||||||
|
int32 Tp = 2; // 房间类型 0所有房间 1可观战房间
|
||||||
|
}
|
||||||
|
|
||||||
|
message MatchPlayer{
|
||||||
|
int32 SnId = 1; // 玩家id
|
||||||
|
string Name = 2; // 玩家名字
|
||||||
|
string HeadUrl = 3;//头像地址
|
||||||
|
int32 UseRoleId = 4;//使用的人物模型id
|
||||||
|
int32 UseSkinId = 5; // 皮肤id
|
||||||
|
int32 Rank = 6;//排名
|
||||||
|
int32 Score = 7;//分数
|
||||||
|
}
|
||||||
|
|
||||||
|
message MatchInfo{
|
||||||
|
int64 MatchId = 1; // 比赛id
|
||||||
|
int64 InstanceId = 2; // 本场比赛id
|
||||||
|
string Name = 3; // 比赛名字
|
||||||
|
int32 Round = 4; // 当前第几轮
|
||||||
|
int32 TotalRound = 5; // 总轮数
|
||||||
|
int32 RemainNum = 6; // 剩余人数
|
||||||
|
repeated MatchPlayer Players = 7; // 玩家列表
|
||||||
|
}
|
||||||
|
|
||||||
|
message SCTMMatchList{
|
||||||
|
repeated MatchInfo List = 1;
|
||||||
|
int64 MatchId = 2;
|
||||||
|
int32 Tp = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
//PACKET_TM_CSRoomList
|
||||||
|
message CSRoomList{
|
||||||
|
int64 Id = 1; // 本场比赛id 0表示所有房间
|
||||||
|
int32 Tp = 2; // 房间类型 0所有房间 1可观战房间
|
||||||
|
}
|
||||||
|
|
||||||
|
message MatchRoom{
|
||||||
|
int64 RoomId = 1; // 房间id
|
||||||
|
int64 MatchId = 2; // 比赛id
|
||||||
|
int64 InstanceId = 3; // 本场比赛id
|
||||||
|
int32 Round = 4; // 当前第几轮
|
||||||
|
int32 TotalRound = 5; // 总轮数
|
||||||
|
repeated MatchPlayer Players = 7; // 玩家列表
|
||||||
|
}
|
||||||
|
|
||||||
|
message SCRoomList{
|
||||||
|
repeated MatchRoom List = 1;
|
||||||
|
int64 Id = 2;
|
||||||
|
int32 Tp = 3;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -384,6 +384,7 @@ message ExchangeShop {
|
||||||
int32 NotVipShopLimit = 15;//非VIP限购总数
|
int32 NotVipShopLimit = 15;//非VIP限购总数
|
||||||
int32 ShopType = 16; //商品类型
|
int32 ShopType = 16; //商品类型
|
||||||
repeated TelChargeData TelData = 17;
|
repeated TelChargeData TelData = 17;
|
||||||
|
repeated ItemInfo Items = 18;
|
||||||
}
|
}
|
||||||
|
|
||||||
message TelChargeData{
|
message TelChargeData{
|
||||||
|
|
@ -489,6 +490,7 @@ message GameMatchDate {
|
||||||
int32 CardType = 24; // 手机卡类型
|
int32 CardType = 24; // 手机卡类型
|
||||||
int32 ShowId = 25; // 比赛区分
|
int32 ShowId = 25; // 比赛区分
|
||||||
int32 AwardNum = 26; //比赛奖励剩余数量
|
int32 AwardNum = 26; //比赛奖励剩余数量
|
||||||
|
int32 AudienceSwitch = 27; // 观战开关 1开启 2关闭
|
||||||
}
|
}
|
||||||
|
|
||||||
// etcd /game/game_match
|
// etcd /game/game_match
|
||||||
|
|
@ -615,7 +617,7 @@ message VIPcfg {
|
||||||
map<int64,int64> Award = 2; // 道具
|
map<int64,int64> Award = 2; // 道具
|
||||||
int32 VipEx = 3; // VIP经验
|
int32 VipEx = 3; // VIP经验
|
||||||
int64 Price = 4; // 金额
|
int64 Price = 4; // 金额
|
||||||
repeated int32 Privilege1 = 5; //特权1 VIP比赛场免费次数
|
map<int64,int64> Privilege1 = 5; //特权1 VIP比赛场免费次数
|
||||||
repeated int32 Privilege2 = 6; //每日金币 0金币值 1充值金额
|
repeated int32 Privilege2 = 6; //每日金币 0金币值 1充值金额
|
||||||
repeated int32 Privilege3 = 7;
|
repeated int32 Privilege3 = 7;
|
||||||
int32 Privilege4 = 8;
|
int32 Privilege4 = 8;
|
||||||
|
|
@ -628,6 +630,7 @@ message VIPcfg {
|
||||||
int32 ShopId2 = 15;
|
int32 ShopId2 = 15;
|
||||||
int32 ShopId7 = 16;
|
int32 ShopId7 = 16;
|
||||||
int32 MatchFreeTimes = 17; // vip比赛场免费次数
|
int32 MatchFreeTimes = 17; // vip比赛场免费次数
|
||||||
|
map<int64,int64> Privilege9 = 18; // vip免费礼包,每个vip等级领取一次
|
||||||
}
|
}
|
||||||
|
|
||||||
// etcd /game/VIPcfg VIP配置
|
// etcd /game/VIPcfg VIP配置
|
||||||
|
|
@ -881,3 +884,24 @@ message AnnouncerLogInfo{
|
||||||
int32 ItemId = 4; //获得物品ID
|
int32 ItemId = 4; //获得物品ID
|
||||||
int32 TypeId = 5; //1-话费 2-实物
|
int32 TypeId = 5; //1-话费 2-实物
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// etcd /game/guide_config
|
||||||
|
message GuideConfig {
|
||||||
|
string Platform = 1; // 平台
|
||||||
|
int32 On = 2; // 引导开关 1开启 2关闭
|
||||||
|
int32 Skip = 3; // 引导跳过开关 1开启 2关闭
|
||||||
|
}
|
||||||
|
|
||||||
|
// etcd /game/match_audience
|
||||||
|
message MatchAudience {
|
||||||
|
string Platform = 1; // 平台
|
||||||
|
int32 SnId = 2; // 玩家ID
|
||||||
|
int64 Ts = 3; // 时间戳
|
||||||
|
}
|
||||||
|
|
||||||
|
// etcd /game/spirit
|
||||||
|
message SpiritConfig {
|
||||||
|
string Platform = 1; // 平台
|
||||||
|
int32 On = 2; // 精灵开关 1开启 2关闭
|
||||||
|
string Url = 3;
|
||||||
|
}
|
||||||
2
public
2
public
|
|
@ -1 +1 @@
|
||||||
Subproject commit 13589ad17018a4a9d50fdc9d8223e3ccf492a0ce
|
Subproject commit 07c189d652b84910258fa33eb3214d39c53edec4
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
|
||||||
|
// Code generated by xlsx2proto.
|
||||||
|
// DO NOT EDIT!
|
||||||
|
|
||||||
|
package srvdata
|
||||||
|
|
||||||
|
import (
|
||||||
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
|
"mongo.games.com/game/protocol/server"
|
||||||
|
)
|
||||||
|
|
||||||
|
var PBDB_VIPShowMgr = &DB_VIPShowMgr{
|
||||||
|
Datas: &server.DB_VIPShowArray{},
|
||||||
|
pool: make(map[int32]*server.DB_VIPShow),
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
type DB_VIPShowMgr struct {
|
||||||
|
Datas *server.DB_VIPShowArray
|
||||||
|
pool map[int32]*server.DB_VIPShow
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *DB_VIPShowMgr) unmarshal(data []byte) error {
|
||||||
|
err := proto.Unmarshal(data, this.Datas)
|
||||||
|
if err == nil {
|
||||||
|
this.arrangeData()
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *DB_VIPShowMgr) reunmarshal(data []byte) error {
|
||||||
|
newDatas := &server.DB_VIPShowArray{}
|
||||||
|
err := proto.Unmarshal(data, newDatas)
|
||||||
|
if err == nil {
|
||||||
|
for _, item := range newDatas.Arr {
|
||||||
|
existItem := this.GetData(item.GetId())
|
||||||
|
if existItem == nil {
|
||||||
|
this.pool[item.GetId()] = item
|
||||||
|
this.Datas.Arr = append(this.Datas.Arr, item)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
*existItem = *item
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *DB_VIPShowMgr) arrangeData() {
|
||||||
|
if this.Datas == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
dataArr := this.Datas.GetArr()
|
||||||
|
if dataArr == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, data := range dataArr {
|
||||||
|
this.pool[data.GetId()] = data
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *DB_VIPShowMgr) GetData(id int32) *server.DB_VIPShow {
|
||||||
|
if data, ok := this.pool[id]; ok {
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
DataMgr.register("DB_VIPShow.dat", &ProtobufDataLoader{dh: PBDB_VIPShowMgr})
|
||||||
|
}
|
||||||
31
worldsrv/aaa
31
worldsrv/aaa
|
|
@ -1,31 +0,0 @@
|
||||||
71001,71002,71003,72001,72002,72003,72004,72005,73001,73002,73003,73004,74001,74002,74003,74004,74005,74006,75001,75002,75003,75004,75005,75006,76001,76002,76003,76004,76005,76006,77001,77002,77003,77004,77005,78001,78002,78003,79001,79002,79003,79004,79005,77006
|
|
||||||
|
|
||||||
5001,5002,5003,5004,5005,5006
|
|
||||||
|
|
||||||
"79003":NumberLong(1),
|
|
||||||
"73001":NumberLong(24),
|
|
||||||
"74006":NumberLong(1),
|
|
||||||
"79005":NumberLong(1),
|
|
||||||
"76006":NumberLong(16),
|
|
||||||
"74003":NumberLong(1),
|
|
||||||
"72004":NumberLong(1),
|
|
||||||
"73004":NumberLong(1)
|
|
||||||
|
|
||||||
|
|
||||||
"30008":NumberLong(712),
|
|
||||||
"30009":NumberLong(97),
|
|
||||||
"30010":NumberLong(20),
|
|
||||||
"30011":NumberLong(3)
|
|
||||||
|
|
||||||
|
|
||||||
"5001":NumberLong(2),
|
|
||||||
"5002":NumberLong(18),
|
|
||||||
"5003":NumberLong(6),
|
|
||||||
"5004":NumberLong(13),
|
|
||||||
"5005":NumberLong(13),
|
|
||||||
"5006":NumberLong(4)
|
|
||||||
|
|
||||||
30008 712
|
|
||||||
30009 97
|
|
||||||
30010 20
|
|
||||||
30011 3
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -2,12 +2,15 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
"mongo.games.com/game/protocol/gamehall"
|
"mongo.games.com/game/protocol/gamehall"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
"mongo.games.com/goserver/core/logger"
|
|
||||||
"mongo.games.com/goserver/core/netlib"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type CSHundredSceneGetPlayerNumPacketFactory struct {
|
type CSHundredSceneGetPlayerNumPacketFactory struct {
|
||||||
|
|
@ -25,7 +28,7 @@ func (this *CSHundredSceneGetPlayerNumHandler) Process(s *netlib.Session, packet
|
||||||
if msg, ok := data.(*gamehall.CSHundredSceneGetPlayerNum); ok {
|
if msg, ok := data.(*gamehall.CSHundredSceneGetPlayerNum); ok {
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
if p != nil {
|
if p != nil {
|
||||||
nums := HundredSceneMgrSington.GetPlayerNums(p, msg.GetGameId(), msg.GetGameModel())
|
nums := HundredSceneMgrSingleton.GetPlayerNums(p, msg.GetGameId(), msg.GetGameModel())
|
||||||
pack := &gamehall.SCHundredSceneGetPlayerNum{
|
pack := &gamehall.SCHundredSceneGetPlayerNum{
|
||||||
Nums: nums,
|
Nums: nums,
|
||||||
}
|
}
|
||||||
|
|
@ -60,7 +63,7 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
|
||||||
}
|
}
|
||||||
oldPlatform := p.Platform
|
oldPlatform := p.Platform
|
||||||
switch msg.GetOpType() {
|
switch msg.GetOpType() {
|
||||||
case HundredSceneOp_Enter:
|
case HundredSceneOPEnter:
|
||||||
//pt := PlatformMgrSingleton.GetPackageTag(p.PackageID)
|
//pt := PlatformMgrSingleton.GetPackageTag(p.PackageID)
|
||||||
//if pt != nil && pt.IsForceBind == 1 {
|
//if pt != nil && pt.IsForceBind == 1 {
|
||||||
// if p.BeUnderAgentCode == "" || p.BeUnderAgentCode == "0" {
|
// if p.BeUnderAgentCode == "" || p.BeUnderAgentCode == "0" {
|
||||||
|
|
@ -79,13 +82,13 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
|
||||||
params := msg.GetOpParams()
|
params := msg.GetOpParams()
|
||||||
if len(params) != 0 {
|
if len(params) != 0 {
|
||||||
roomId = params[0]
|
roomId = params[0]
|
||||||
name, ok := HundredSceneMgrSington.GetPlatformNameBySceneId(roomId)
|
platform := SceneMgrSingleton.GetPlatformBySceneId(int(roomId))
|
||||||
if p.IsRob {
|
if p.IsRob {
|
||||||
//机器人先伪装成对应平台的用户
|
//机器人先伪装成对应平台的用户
|
||||||
if ok {
|
if platform != "" {
|
||||||
p.Platform = name
|
p.Platform = platform
|
||||||
}
|
}
|
||||||
} else if p.GMLevel > 0 && p.Platform == name { //允许GM直接按房间ID进场
|
} else if p.GMLevel > 0 && p.Platform == platform { //允许GM直接按房间ID进场
|
||||||
roomId = params[0]
|
roomId = params[0]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +155,7 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = HundredSceneMgrSington.PlayerEnter(p, msg.GetId())
|
ret = HundredSceneMgrSingleton.PlayerEnter(p, msg.GetId())
|
||||||
if p.scene != nil {
|
if p.scene != nil {
|
||||||
pack.OpParams = append(pack.OpParams, msg.GetId())
|
pack.OpParams = append(pack.OpParams, msg.GetId())
|
||||||
//TODO 有房间还进入失败,尝试returnroom
|
//TODO 有房间还进入失败,尝试returnroom
|
||||||
|
|
@ -161,9 +164,9 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case HundredSceneOp_Leave:
|
case HundredSceneOPLeave:
|
||||||
ret = HundredSceneMgrSington.PlayerTryLeave(p)
|
ret = HundredSceneMgrSingleton.PlayerTryLeave(p)
|
||||||
case HundredSceneOp_Change:
|
case HundredSceneOPChange:
|
||||||
/*var exclude int32
|
/*var exclude int32
|
||||||
if p.scene != nil {
|
if p.scene != nil {
|
||||||
exclude = int32(p.scene.sceneId)
|
exclude = int32(p.scene.sceneId)
|
||||||
|
|
@ -172,10 +175,10 @@ func (this *CSHundredSceneOpHandler) Process(s *netlib.Session, packetid int, da
|
||||||
if len(params) != 0 {
|
if len(params) != 0 {
|
||||||
exclude = params[0]
|
exclude = params[0]
|
||||||
}
|
}
|
||||||
if HundredSceneMgrSington.PlayerInChanging(p) { //换桌中
|
if HundredSceneMgrSingleton.PlayerInChanging(p) { //换桌中
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
ret = HundredSceneMgrSington.PlayerTryChange(p, msg.GetId(), exclude)*/
|
ret = HundredSceneMgrSingleton.PlayerTryChange(p, msg.GetId(), exclude)*/
|
||||||
}
|
}
|
||||||
done:
|
done:
|
||||||
//机器人要避免身上的平台标记被污染
|
//机器人要避免身上的平台标记被污染
|
||||||
|
|
@ -210,38 +213,38 @@ func (this *CSGameObservePacketFactory) CreatePacket() interface{} {
|
||||||
|
|
||||||
func (this *CSGameObserveHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
func (this *CSGameObserveHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
logger.Logger.Trace("CSGameObserveHandler Process recv ", data)
|
logger.Logger.Trace("CSGameObserveHandler Process recv ", data)
|
||||||
if _, ok := data.(*gamehall.CSGameObserve); ok {
|
if msg, ok := data.(*gamehall.CSGameObserve); ok {
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
if p != nil {
|
if p != nil {
|
||||||
//if msg.GetStartOrEnd() {
|
if msg.GetStartOrEnd() {
|
||||||
// gameStateMgr.PlayerRegiste(p, msg.GetGameId(), msg.GetStartOrEnd())
|
gameStateMgr.PlayerRegiste(p, msg.GetGameId(), msg.GetStartOrEnd())
|
||||||
// pack := &gamehall.SCGameSubList{}
|
pack := &gamehall.SCGameSubList{}
|
||||||
// statePack := &gamehall.SCGameState{}
|
statePack := &gamehall.SCGameState{}
|
||||||
// scenes := HundredSceneMgrSington.GetPlatformScene(p.Platform, msg.GetGameId())
|
scenes := HundredSceneMgrSingleton.GetPlatformScene(p.Platform, msg.GetGameId())
|
||||||
// for _, value := range scenes {
|
for _, value := range scenes {
|
||||||
// pack.List = append(pack.List, &gamehall.GameSubRecord{
|
pack.List = append(pack.List, &gamehall.GameSubRecord{
|
||||||
// GameFreeId: proto.Int32(value.dbGameFree.GetId()),
|
GameFreeId: proto.Int32(value.dbGameFree.GetId()),
|
||||||
// NewLog: proto.Int32(-1),
|
NewLog: proto.Int32(-1),
|
||||||
// LogCnt: proto.Int(len(value.GameLog)),
|
LogCnt: proto.Int(len(value.GameLog)),
|
||||||
// TotleLog: value.GameLog,
|
TotleLog: value.GameLog,
|
||||||
// })
|
})
|
||||||
// leftTime := int64(value.StateSec) - (time.Now().Unix() - value.StateTs)
|
leftTime := int64(value.StateSec) - (time.Now().Unix() - value.StateTs)
|
||||||
// if leftTime < 0 {
|
if leftTime < 0 {
|
||||||
// leftTime = 0
|
leftTime = 0
|
||||||
// }
|
}
|
||||||
// statePack.List = append(statePack.List, &gamehall.GameState{
|
statePack.List = append(statePack.List, &gamehall.GameState{
|
||||||
// GameFreeId: proto.Int32(value.dbGameFree.GetId()),
|
GameFreeId: proto.Int32(value.dbGameFree.GetId()),
|
||||||
// Ts: proto.Int64(leftTime),
|
Ts: proto.Int64(leftTime),
|
||||||
// Sec: proto.Int32(value.StateSec),
|
Sec: proto.Int32(value.StateSec),
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
// p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESUBLIST), pack)
|
p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESUBLIST), pack)
|
||||||
// logger.Logger.Trace("SCGameSubList:", pack)
|
logger.Logger.Trace("SCGameSubList:", pack)
|
||||||
// p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESTATE), statePack)
|
p.SendToClient(int(gamehall.GameHallPacketID_PACKET_SC_GAMESTATE), statePack)
|
||||||
// logger.Logger.Trace("SCGameState:", statePack)
|
logger.Logger.Trace("SCGameState:", statePack)
|
||||||
//} else {
|
} else {
|
||||||
// gameStateMgr.PlayerClear(p)
|
gameStateMgr.PlayerClear(p)
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -268,7 +271,7 @@ func (this *CSGameObserveHandler) Process(s *netlib.Session, packetid int, data
|
||||||
// // gameid == common.GameId_Avengers || gameid == common.GameId_EasterIsland {
|
// // gameid == common.GameId_Avengers || gameid == common.GameId_EasterIsland {
|
||||||
// // gameStateMgr.PlayerRegiste(p, msg.GetGameId(), true)
|
// // gameStateMgr.PlayerRegiste(p, msg.GetGameId(), true)
|
||||||
// // pack := &gamehall.SCHundredSceneGetGameJackpot{}
|
// // pack := &gamehall.SCHundredSceneGetGameJackpot{}
|
||||||
// // scenes := HundredSceneMgrSington.GetPlatformScene(p.Platform, msg.GetGameId())
|
// // scenes := HundredSceneMgrSingleton.GetPlatformScene(p.Platform, msg.GetGameId())
|
||||||
// // for _, v := range scenes {
|
// // for _, v := range scenes {
|
||||||
// // jpfi := &gamehall.GameJackpotFundInfo{
|
// // jpfi := &gamehall.GameJackpotFundInfo{
|
||||||
// // GameFreeId: proto.Int32(v.dbGameFree.GetId()),
|
// // GameFreeId: proto.Int32(v.dbGameFree.GetId()),
|
||||||
|
|
|
||||||
|
|
@ -1748,7 +1748,7 @@ func (this *CSPlayerVIPDrawHandler) Process(s *netlib.Session, packetid int, dat
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
p.VIPDraw(msg.GetId())
|
p.VIPDraw(msg.GetId(), msg.GetVip())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -3027,6 +3027,119 @@ func CSPopUpWindowsConfig(s *netlib.Session, packetId int, data interface{}, sid
|
||||||
}), "Api_PopupWindowsConfig").Start()
|
}), "Api_PopupWindowsConfig").Start()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid int64) error {
|
||||||
|
logger.Logger.Tracef("CSUpdateAttribute %v", data)
|
||||||
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
|
if p == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
msg, ok := data.(*player_proto.CSUpdateAttribute)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
stepId := p.GuideStep + 1
|
||||||
|
pack := &player_proto.SCUpdateAttribute{
|
||||||
|
OpRetCode: player_proto.OpResultCode_OPRC_Error,
|
||||||
|
Tp: msg.GetTp(),
|
||||||
|
Param: msg.GetParam(),
|
||||||
|
}
|
||||||
|
|
||||||
|
send := func() {
|
||||||
|
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCUpdateAttribute), pack)
|
||||||
|
logger.Logger.Tracef("SCUpdateAttribute %v", pack)
|
||||||
|
// 日志
|
||||||
|
if pack.OpRetCode == player_proto.OpResultCode_OPRC_Sucess {
|
||||||
|
switch msg.GetTp() {
|
||||||
|
case common.AttributeGuideStep, common.AttributeGuideSkip:
|
||||||
|
d := model.CustomData{
|
||||||
|
Event: "guide",
|
||||||
|
Platform: p.Platform,
|
||||||
|
GuideTp: msg.GetTp(),
|
||||||
|
N: int64(stepId),
|
||||||
|
}
|
||||||
|
b, _ := json.Marshal(d)
|
||||||
|
LogChannelSingleton.WriteLog(&model.ClientLogMysql{
|
||||||
|
Data: string(b),
|
||||||
|
Platform: p.Platform,
|
||||||
|
Snid: p.SnId,
|
||||||
|
Ts: time.Now().Unix(),
|
||||||
|
CreateTs: p.CreateTime.Unix(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch msg.GetTp() {
|
||||||
|
case common.AttributeGuideStep:
|
||||||
|
if len(msg.GetParam()) == 0 || msg.GetParam()[0] == 0 || p.GuideStep < 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.GetOn() != common.On {
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_Guide_Close
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if p.GuideStep >= model.GameParamData.GuideStepMaxNum {
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_End
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if int64(p.GuideStep) >= msg.GetParam()[0] {
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_Finish
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if int64(p.GuideStep)+1 < msg.GetParam()[0] {
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_GuideStep_Front
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
p.GuideStep = int32(msg.GetParam()[0])
|
||||||
|
stepId = p.GuideStep
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
|
||||||
|
send()
|
||||||
|
// 获得10v卡
|
||||||
|
if p.GuideStep == 2 {
|
||||||
|
BagMgrSingleton.AddItemsV2(&ItemParam{
|
||||||
|
P: p,
|
||||||
|
Change: []*Item{
|
||||||
|
{
|
||||||
|
ItemId: common.ItemIDVCard,
|
||||||
|
ItemNum: 10,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
GainWay: common.GainWayGuide,
|
||||||
|
Operator: "system",
|
||||||
|
Remark: "新手引导奖励",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
case common.AttributeGuideSkip:
|
||||||
|
if PlatformMgrSingleton.GetConfig(p.Platform).GuideConfig.GetSkip() != common.On {
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_Guide_SkipClose
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if p.GuideStep >= 0 && p.GuideStep < model.GameParamData.GuideStepMaxNum {
|
||||||
|
p.GuideStep = -1 // 跳过引导为 -1
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
case common.AttributeGuideTest:
|
||||||
|
if !common.Config.IsDevMode {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
p.GuideStep = int32(msg.GetParam()[0])
|
||||||
|
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
|
||||||
|
send()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// 用户信息
|
// 用户信息
|
||||||
common.Register(int(player_proto.PlayerPacketID_PACKET_CS_PLAYERDATA), player_proto.CSPlayerData{}, CSPlayerData)
|
common.Register(int(player_proto.PlayerPacketID_PACKET_CS_PLAYERDATA), player_proto.CSPlayerData{}, CSPlayerData)
|
||||||
|
|
@ -3058,4 +3171,6 @@ func init() {
|
||||||
common.Register(int(player_proto.PlayerPacketID_PACKET_CSAwardLog), player_proto.CS_AwardLog{}, CSAwardLog)
|
common.Register(int(player_proto.PlayerPacketID_PACKET_CSAwardLog), player_proto.CS_AwardLog{}, CSAwardLog)
|
||||||
//弹窗配置
|
//弹窗配置
|
||||||
common.Register(int(player_proto.PlayerPacketID_PACKET_CSPopUpWindowsConfig), player_proto.CSPopUpWindowsConfig{}, CSPopUpWindowsConfig)
|
common.Register(int(player_proto.PlayerPacketID_PACKET_CSPopUpWindowsConfig), player_proto.CSPopUpWindowsConfig{}, CSPopUpWindowsConfig)
|
||||||
|
// 更新属性;新手引导阶段
|
||||||
|
common.Register(int(player_proto.PlayerPacketID_PACKET_CSUpdateAttribute), player_proto.CSUpdateAttribute{}, CSUpdateAttribute)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,32 +13,32 @@ import (
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
gamehall_proto "mongo.games.com/game/protocol/gamehall"
|
gamehallproto "mongo.games.com/game/protocol/gamehall"
|
||||||
login_proto "mongo.games.com/game/protocol/login"
|
loginproto "mongo.games.com/game/protocol/login"
|
||||||
player_proto "mongo.games.com/game/protocol/player"
|
playerproto "mongo.games.com/game/protocol/player"
|
||||||
server_proto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// 销毁房间
|
// 销毁房间
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWDestroyScene{}
|
return &serverproto.GWDestroyScene{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_DESTROYSCENE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive GWDestroyScene:", pack)
|
logger.Logger.Trace("receive GWDestroyScene:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWDestroyScene); ok {
|
if msg, ok := pack.(*serverproto.GWDestroyScene); ok {
|
||||||
SceneMgrSingleton.DestroyScene(int(msg.GetSceneId()), msg.GetIsCompleted())
|
SceneMgrSingleton.DestroyScene(int(msg.GetSceneId()), msg.GetIsCompleted())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 离开房间
|
// 离开房间
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWPlayerLeave{}
|
return &serverproto.GWPlayerLeave{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERLEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
if msg, ok := pack.(*server_proto.GWPlayerLeave); ok {
|
if msg, ok := pack.(*serverproto.GWPlayerLeave); ok {
|
||||||
logger.Logger.Trace("receive GWPlayerLeave:", msg.GetPlayerId())
|
logger.Logger.Trace("receive GWPlayerLeave:", msg.GetPlayerId())
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
|
|
@ -68,7 +68,7 @@ func init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case scene.IsHundredScene():
|
case scene.IsHundredScene():
|
||||||
if !HundredSceneMgrSington.PlayerLeave(p, int(msg.GetReason())) {
|
if !HundredSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||||
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]",
|
logger.Logger.Warnf("GWPlayerLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]",
|
||||||
p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
||||||
}
|
}
|
||||||
|
|
@ -228,12 +228,12 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 观众离开房间
|
// 观众离开房间
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWPlayerLeave{}
|
return &serverproto.GWPlayerLeave{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_AUDIENCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive PACKET_GW_AUDIENCELEAVE GWPlayerLeave:", pack)
|
logger.Logger.Trace("receive PACKET_GW_AUDIENCELEAVE GWPlayerLeave:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWPlayerLeave); ok {
|
if msg, ok := pack.(*serverproto.GWPlayerLeave); ok {
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
p := PlayerMgrSington.GetPlayerBySnId(msg.GetPlayerId())
|
p := PlayerMgrSington.GetPlayerBySnId(msg.GetPlayerId())
|
||||||
|
|
@ -270,12 +270,12 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 房间游戏开始
|
// 房间游戏开始
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_SCENESTART), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_SCENESTART), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWSceneStart{}
|
return &serverproto.GWSceneStart{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_SCENESTART), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_SCENESTART), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GW_SCENESTART GWSceneStart:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GW_SCENESTART GWSceneStart:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWSceneStart); ok {
|
if msg, ok := pack.(*serverproto.GWSceneStart); ok {
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
scene.starting = msg.GetStart()
|
scene.starting = msg.GetStart()
|
||||||
|
|
@ -299,12 +299,12 @@ func init() {
|
||||||
|
|
||||||
// 房间游戏状态
|
// 房间游戏状态
|
||||||
// 捕鱼
|
// 捕鱼
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_SCENESTATE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_SCENESTATE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWSceneState{}
|
return &serverproto.GWSceneState{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_SCENESTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_SCENESTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GW_SCENESTATE GWSceneState:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GW_SCENESTATE GWSceneState:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWSceneState); ok {
|
if msg, ok := pack.(*serverproto.GWSceneState); ok {
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
scene.state = msg.GetCurrState()
|
scene.state = msg.GetCurrState()
|
||||||
|
|
@ -315,12 +315,12 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 用户状态同步 flag
|
// 用户状态同步 flag
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWPlayerFlag{}
|
return &serverproto.GWPlayerFlag{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERSTATE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive GWPlayerFlag:", pack)
|
logger.Logger.Trace("receive GWPlayerFlag:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWPlayerFlag); ok {
|
if msg, ok := pack.(*serverproto.GWPlayerFlag); ok {
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
|
player := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
|
||||||
if player != nil {
|
if player != nil {
|
||||||
player.flag = msg.GetFlag()
|
player.flag = msg.GetFlag()
|
||||||
|
|
@ -330,12 +330,12 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 房间服务器状态切换
|
// 房间服务器状态切换
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.ServerStateSwitch{}
|
return &serverproto.ServerStateSwitch{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GB_STATE_SWITCH), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GB_STATE_SWITCH ServerStateSwitch:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GB_STATE_SWITCH ServerStateSwitch:", pack)
|
||||||
if sr, ok := pack.(*server_proto.ServerStateSwitch); ok {
|
if sr, ok := pack.(*serverproto.ServerStateSwitch); ok {
|
||||||
srvid := int(sr.GetSrvId())
|
srvid := int(sr.GetSrvId())
|
||||||
gameSess := GameSessMgrSington.GetGameSess(srvid)
|
gameSess := GameSessMgrSington.GetGameSess(srvid)
|
||||||
if gameSess != nil {
|
if gameSess != nil {
|
||||||
|
|
@ -360,13 +360,13 @@ func init() {
|
||||||
|
|
||||||
// 游戏服务器的系统广播
|
// 游戏服务器的系统广播
|
||||||
// 捕鱼
|
// 捕鱼
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWNewNotice{}
|
return &serverproto.GWNewNotice{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.HandlerWrapper(func(s *netlib.Session,
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.HandlerWrapper(func(s *netlib.Session,
|
||||||
packetid int, pack interface{}) error {
|
packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive GWNewNotice:", pack)
|
logger.Logger.Trace("receive GWNewNotice:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWNewNotice); ok {
|
if msg, ok := pack.(*serverproto.GWNewNotice); ok {
|
||||||
//立即发送改为定期发送,控制下广播包的频度
|
//立即发送改为定期发送,控制下广播包的频度
|
||||||
HorseRaceLampMgrSington.PushGameHorseRaceLamp(msg.GetCh(), msg.GetPlatform(), msg.GetContent(), int32(msg.GetMsgtype()), msg.GetIsrob(), msg.GetPriority())
|
HorseRaceLampMgrSington.PushGameHorseRaceLamp(msg.GetCh(), msg.GetPlatform(), msg.GetContent(), int32(msg.GetMsgtype()), msg.GetIsrob(), msg.GetPriority())
|
||||||
}
|
}
|
||||||
|
|
@ -374,13 +374,13 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 同步每局游戏那些玩家一起玩的
|
// 同步每局游戏那些玩家一起玩的
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWScenePlayerLog{}
|
return &serverproto.GWScenePlayerLog{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.HandlerWrapper(func(s *netlib.Session,
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_SCENEPLAYERLOG), netlib.HandlerWrapper(func(s *netlib.Session,
|
||||||
packetid int, pack interface{}) error {
|
packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive GWScenePlayerLog:", pack)
|
logger.Logger.Trace("receive GWScenePlayerLog:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWScenePlayerLog); ok {
|
if msg, ok := pack.(*serverproto.GWScenePlayerLog); ok {
|
||||||
sceneLimitMgr.ReceiveData(msg.GetGameId(), msg.GetSnids())
|
sceneLimitMgr.ReceiveData(msg.GetGameId(), msg.GetSnids())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -388,11 +388,11 @@ func init() {
|
||||||
|
|
||||||
// 强制离开房间
|
// 强制离开房间
|
||||||
// 返回房间失败
|
// 返回房间失败
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWPlayerForceLeave{}
|
return &serverproto.GWPlayerForceLeave{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERFORCELEAVE), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
if msg, ok := pack.(*server_proto.GWPlayerForceLeave); ok {
|
if msg, ok := pack.(*serverproto.GWPlayerForceLeave); ok {
|
||||||
logger.Logger.Warn("receive GWPlayerForceLeave:", msg)
|
logger.Logger.Warn("receive GWPlayerForceLeave:", msg)
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetRoomId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
|
|
@ -406,7 +406,7 @@ func init() {
|
||||||
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [coinscene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [coinscene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
||||||
}
|
}
|
||||||
case scene.IsHundredScene():
|
case scene.IsHundredScene():
|
||||||
if !HundredSceneMgrSington.PlayerLeave(p, int(msg.GetReason())) {
|
if !HundredSceneMgrSingleton.PlayerLeave(p, int(msg.GetReason())) {
|
||||||
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
logger.Logger.Warnf("GWPlayerForceLeave snid:%v sceneid:%v gameid:%v modeid:%v [hundredcene]", p.SnId, scene.sceneId, scene.gameId, scene.gameMode)
|
||||||
}
|
}
|
||||||
case scene.IsMatchScene():
|
case scene.IsMatchScene():
|
||||||
|
|
@ -438,12 +438,12 @@ func init() {
|
||||||
//1.同步玩家游戏场内的实时金币
|
//1.同步玩家游戏场内的实时金币
|
||||||
//2.触发相关任务:统计有效下注金币数,赢取金币数,牌局次数等
|
//2.触发相关任务:统计有效下注金币数,赢取金币数,牌局次数等
|
||||||
//3.黑名单处理
|
//3.黑名单处理
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWPlayerData{}
|
return &serverproto.GWPlayerData{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_PLAYERDATA), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive GWPlayerBet:", pack)
|
logger.Logger.Trace("receive GWPlayerBet:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWPlayerData); ok {
|
if msg, ok := pack.(*serverproto.GWPlayerData); ok {
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
|
||||||
if scene == nil {
|
if scene == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -573,13 +573,13 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
//推送游戏的状态
|
//推送游戏的状态
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_GAMESTATE), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_GAMESTATE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWGameState{}
|
return &serverproto.GWGameState{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_GAMESTATE), netlib.HandlerWrapper(func(s *netlib.Session,
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_GAMESTATE), netlib.HandlerWrapper(func(s *netlib.Session,
|
||||||
packetid int, pack interface{}) error {
|
packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GW_GAMESTATE GWGameState:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GW_GAMESTATE GWGameState:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWGameState); ok {
|
if msg, ok := pack.(*serverproto.GWGameState); ok {
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
scene.State = msg.GetState()
|
scene.State = msg.GetState()
|
||||||
|
|
@ -591,38 +591,38 @@ func init() {
|
||||||
if leftTime < 0 {
|
if leftTime < 0 {
|
||||||
leftTime = 0
|
leftTime = 0
|
||||||
}
|
}
|
||||||
pack := &gamehall_proto.SCGameState{}
|
pack := &gamehallproto.SCGameState{}
|
||||||
pack.List = append(pack.List, &gamehall_proto.GameState{
|
pack.List = append(pack.List, &gamehallproto.GameState{
|
||||||
GameFreeId: proto.Int32(scene.dbGameFree.GetId()),
|
GameFreeId: proto.Int32(scene.dbGameFree.GetId()),
|
||||||
Ts: proto.Int64(leftTime),
|
Ts: proto.Int64(leftTime),
|
||||||
Sec: proto.Int32(scene.StateSec),
|
Sec: proto.Int32(scene.StateSec),
|
||||||
})
|
})
|
||||||
gameStateMgr.BrodcastGameState(int32(scene.gameId), scene.limitPlatform.IdStr,
|
gameStateMgr.BrodcastGameState(int32(scene.gameId), scene.limitPlatform.IdStr,
|
||||||
int(gamehall_proto.GameHallPacketID_PACKET_SC_GAMESTATE), pack)
|
int(gamehallproto.GameHallPacketID_PACKET_SC_GAMESTATE), pack)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWGameJackList{}
|
return &serverproto.GWGameJackList{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_JACKPOTLIST), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GW_JACKPOTLIST GWGameJackList:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GW_JACKPOTLIST GWGameJackList:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWGameJackList); ok {
|
if msg, ok := pack.(*serverproto.GWGameJackList); ok {
|
||||||
FishJackListMgr.Insert(msg.GetCoin(), msg.GetSnId(), msg.GetRoomId(), msg.GetJackType(), msg.GetGameId(),
|
FishJackListMgr.Insert(msg.GetCoin(), msg.GetSnId(), msg.GetRoomId(), msg.GetJackType(), msg.GetGameId(),
|
||||||
msg.GetPlatform(), msg.GetChannel(), msg.GetName())
|
msg.GetPlatform(), msg.GetChannel(), msg.GetName())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWGameJackCoin{}
|
return &serverproto.GWGameJackCoin{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_JACKPOTCOIN), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GW_JACKPOTCOIN GWGameJackCoin:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GW_JACKPOTCOIN GWGameJackCoin:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWGameJackCoin); ok {
|
if msg, ok := pack.(*serverproto.GWGameJackCoin); ok {
|
||||||
for i, pl := range msg.Platform {
|
for i, pl := range msg.Platform {
|
||||||
FishJackpotCoinMgr.Jackpot[pl] = msg.Coin[i]
|
FishJackpotCoinMgr.Jackpot[pl] = msg.Coin[i]
|
||||||
}
|
}
|
||||||
|
|
@ -631,12 +631,12 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
//强制换桌
|
//强制换桌
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.GWChangeSceneEvent{}
|
return &serverproto.GWChangeSceneEvent{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_CHANGESCENEEVENT), netlib.HandlerWrapper(func(s *netlib.Session, packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("receive SSPacketID_PACKET_GW_CHANGESCENEEVENT GWChangeSceneEvent:", pack)
|
logger.Logger.Trace("receive SSPacketID_PACKET_GW_CHANGESCENEEVENT GWChangeSceneEvent:", pack)
|
||||||
if msg, ok := pack.(*server_proto.GWChangeSceneEvent); ok {
|
if msg, ok := pack.(*serverproto.GWChangeSceneEvent); ok {
|
||||||
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
|
scene := SceneMgrSingleton.GetScene(int(msg.GetSceneId()))
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
scene.PlayerTryChange()
|
scene.PlayerTryChange()
|
||||||
|
|
@ -646,13 +646,13 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
//玩家中转消息
|
//玩家中转消息
|
||||||
netlib.RegisterFactory(int(server_proto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.PacketFactoryWrapper(func() interface{} {
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
return &server_proto.SSRedirectToPlayer{}
|
return &serverproto.SSRedirectToPlayer{}
|
||||||
}))
|
}))
|
||||||
netlib.RegisterHandler(int(server_proto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.HandlerWrapper(func(s *netlib.Session,
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), netlib.HandlerWrapper(func(s *netlib.Session,
|
||||||
packetid int, pack interface{}) error {
|
packetid int, pack interface{}) error {
|
||||||
logger.Logger.Trace("SSRedirectToPlayer Process recv ", pack)
|
logger.Logger.Trace("SSRedirectToPlayer Process recv ", pack)
|
||||||
if msg, ok := pack.(*server_proto.SSRedirectToPlayer); ok {
|
if msg, ok := pack.(*serverproto.SSRedirectToPlayer); ok {
|
||||||
p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
|
p := PlayerMgrSington.GetPlayerBySnId(msg.GetSnId())
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -670,13 +670,13 @@ type CSPMCmdHandler struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CSPMCmdPacketFactory) CreatePacket() interface{} {
|
func (this *CSPMCmdPacketFactory) CreatePacket() interface{} {
|
||||||
pack := &player_proto.CSPMCmd{}
|
pack := &playerproto.CSPMCmd{}
|
||||||
return pack
|
return pack
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CSPMCmdHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
func (this *CSPMCmdHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
logger.Logger.Trace("CSPMCmdHandler Process recv ", data)
|
logger.Logger.Trace("CSPMCmdHandler Process recv ", data)
|
||||||
if msg, ok := data.(*player_proto.CSPMCmd); ok {
|
if msg, ok := data.(*playerproto.CSPMCmd); ok {
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
if p == nil {
|
if p == nil {
|
||||||
logger.Logger.Trace("CSPMCmdHandler p == nil")
|
logger.Logger.Trace("CSPMCmdHandler p == nil")
|
||||||
|
|
@ -729,13 +729,13 @@ type CSRobotChgDataHandler struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CSRobotChgDataPacketFactory) CreatePacket() interface{} {
|
func (this *CSRobotChgDataPacketFactory) CreatePacket() interface{} {
|
||||||
pack := &player_proto.CSRobotChgData{}
|
pack := &playerproto.CSRobotChgData{}
|
||||||
return pack
|
return pack
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CSRobotChgDataHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
func (this *CSRobotChgDataHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
logger.Logger.Trace("CSRobotChgDataHandler Process recv ", data)
|
logger.Logger.Trace("CSRobotChgDataHandler Process recv ", data)
|
||||||
if _, ok := data.(*player_proto.CSRobotChgData); ok {
|
if _, ok := data.(*playerproto.CSRobotChgData); ok {
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
if p == nil {
|
if p == nil {
|
||||||
logger.Logger.Trace("CSRobotChgDataHandler p == nil")
|
logger.Logger.Trace("CSRobotChgDataHandler p == nil")
|
||||||
|
|
@ -756,13 +756,13 @@ type CSAccountInvalidHandler struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CSAccountInvalidPacketFactory) CreatePacket() interface{} {
|
func (this *CSAccountInvalidPacketFactory) CreatePacket() interface{} {
|
||||||
pack := &login_proto.CSAccountInvalid{}
|
pack := &loginproto.CSAccountInvalid{}
|
||||||
return pack
|
return pack
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CSAccountInvalidHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
func (this *CSAccountInvalidHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
logger.Logger.Trace("CSAccountInvalidHandler Process recv ", data)
|
logger.Logger.Trace("CSAccountInvalidHandler Process recv ", data)
|
||||||
if _, ok := data.(*login_proto.CSAccountInvalid); ok {
|
if _, ok := data.(*loginproto.CSAccountInvalid); ok {
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
if p != nil && p.IsRobot() {
|
if p != nil && p.IsRobot() {
|
||||||
snid := p.SnId
|
snid := p.SnId
|
||||||
|
|
@ -789,12 +789,12 @@ func (this *CSAccountInvalidHandler) Process(s *netlib.Session, packetid int, da
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdHandler{})
|
common.RegisterHandler(int(playerproto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdHandler{})
|
||||||
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdPacketFactory{})
|
netlib.RegisterFactory(int(playerproto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdPacketFactory{})
|
||||||
|
|
||||||
common.RegisterHandler(int(player_proto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataHandler{})
|
common.RegisterHandler(int(playerproto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataHandler{})
|
||||||
netlib.RegisterFactory(int(player_proto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataPacketFactory{})
|
netlib.RegisterFactory(int(playerproto.PlayerPacketID_PACKET_CS_ROBOTCHGDATA), &CSRobotChgDataPacketFactory{})
|
||||||
|
|
||||||
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidHandler{})
|
common.RegisterHandler(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidHandler{})
|
||||||
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidPacketFactory{})
|
netlib.RegisterFactory(int(loginproto.LoginPacketID_PACKET_CS_ACCOUNTINVALID), &CSAccountInvalidPacketFactory{})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,6 +311,7 @@ func (this *CSShopExchangeHandler) Process(s *netlib.Session, packetid int, data
|
||||||
if !f {
|
if !f {
|
||||||
pack := &shop.SCShopExchange{
|
pack := &shop.SCShopExchange{
|
||||||
RetCode: shop.OpResultCode_OPRC_ExchangeLimitAcc,
|
RetCode: shop.OpResultCode_OPRC_ExchangeLimitAcc,
|
||||||
|
GoodsId: msg.GetGoodsId(),
|
||||||
}
|
}
|
||||||
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)
|
p.SendToClient(int(shop.SPacketID_PACKET_SC_SHOP_EXCHANGE), pack)
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"mongo.games.com/goserver/core/logger"
|
|
||||||
"mongo.games.com/goserver/core/netlib"
|
|
||||||
|
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/protocol/tournament"
|
"mongo.games.com/game/protocol/tournament"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CSTMInfo(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
func CSTMInfo(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
|
|
@ -94,9 +94,135 @@ func CSSignRace(s *netlib.Session, packetid int, data interface{}, sid int64) er
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func CSMatchList(s *netlib.Session, packetId int, data interface{}, sid int64) error {
|
||||||
|
logger.Logger.Trace("CSMatchList ", data)
|
||||||
|
msg, ok := data.(*tournament.CSMatchList)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
|
if p == nil {
|
||||||
|
logger.Logger.Warnf("CSMatchList p == nil.")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
pack := &tournament.SCTMMatchList{
|
||||||
|
MatchId: msg.GetMatchId(),
|
||||||
|
Tp: msg.GetTp(),
|
||||||
|
}
|
||||||
|
|
||||||
|
audience := msg.GetTp() == 1
|
||||||
|
list := TournamentMgr.GetTmMatch(p.Platform, int32(msg.GetMatchId()), p.LastChannel, audience, 0)
|
||||||
|
|
||||||
|
// 开始时间排序
|
||||||
|
sort.Slice(list, func(i, j int) bool {
|
||||||
|
return list[i].StartTime < list[j].StartTime
|
||||||
|
})
|
||||||
|
|
||||||
|
for _, v := range list {
|
||||||
|
round := TournamentMgr.GetRound(v.SortId)
|
||||||
|
d := &tournament.MatchInfo{
|
||||||
|
MatchId: int64(v.TMId),
|
||||||
|
InstanceId: v.SortId,
|
||||||
|
Name: v.gmd.MatchName,
|
||||||
|
Round: round,
|
||||||
|
TotalRound: v.GetTotalRound(),
|
||||||
|
RemainNum: TournamentMgr.GetRemainNum(v.SortId),
|
||||||
|
}
|
||||||
|
for _, v := range TournamentMgr.GetRemainPlayer(v.SortId) {
|
||||||
|
var name, headUrl string
|
||||||
|
p := PlayerMgrSington.GetPlayerBySnId(v.SnId)
|
||||||
|
if p != nil {
|
||||||
|
name = p.Name
|
||||||
|
headUrl = p.HeadUrl
|
||||||
|
}
|
||||||
|
d.Players = append(d.Players, &tournament.MatchPlayer{
|
||||||
|
SnId: v.SnId,
|
||||||
|
Name: name,
|
||||||
|
HeadUrl: headUrl,
|
||||||
|
UseRoleId: v.RoleId,
|
||||||
|
UseSkinId: v.SkinId,
|
||||||
|
Rank: v.Rank,
|
||||||
|
Score: v.Grade,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
sort.Slice(d.Players, func(i, j int) bool {
|
||||||
|
if d.Players[i].Score > d.Players[j].Score {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if d.Players[i].Score < d.Players[j].Score {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return d.Players[i].SnId < d.Players[j].SnId
|
||||||
|
})
|
||||||
|
|
||||||
|
pack.List = append(pack.List, d)
|
||||||
|
}
|
||||||
|
|
||||||
|
p.SendToClient(int(tournament.TOURNAMENTID_PACKET_TM_SCMatchList), pack)
|
||||||
|
logger.Logger.Tracef("SCMatchList %v", pack)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func CSRoomList(s *netlib.Session, packetId int, data interface{}, sid int64) error {
|
||||||
|
logger.Logger.Trace("CSRoomList ", data)
|
||||||
|
msg, ok := data.(*tournament.CSRoomList)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
p := PlayerMgrSington.GetPlayer(sid)
|
||||||
|
if p == nil {
|
||||||
|
logger.Logger.Warnf("CSRoomList p == nil.")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
pack := &tournament.SCRoomList{
|
||||||
|
Id: msg.GetId(),
|
||||||
|
Tp: msg.GetTp(),
|
||||||
|
}
|
||||||
|
|
||||||
|
audience := msg.GetTp() == 1
|
||||||
|
scenes := TournamentMgr.GetTmRoom(p.Platform, 0, p.LastChannel, audience, msg.GetId())
|
||||||
|
for _, v := range scenes {
|
||||||
|
tm := TournamentMgr.GetTm(v.matchId)
|
||||||
|
if tm == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
room := &tournament.MatchRoom{
|
||||||
|
RoomId: int64(v.sceneId),
|
||||||
|
MatchId: int64(tm.TMId),
|
||||||
|
InstanceId: tm.SortId,
|
||||||
|
Round: TournamentMgr.GetRound(tm.SortId),
|
||||||
|
TotalRound: tm.GetTotalRound(),
|
||||||
|
}
|
||||||
|
for _, v := range v.players {
|
||||||
|
if v.matchCtx == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
d := &tournament.MatchPlayer{
|
||||||
|
SnId: v.matchCtx.copySnid,
|
||||||
|
Name: v.Name,
|
||||||
|
HeadUrl: v.HeadUrl,
|
||||||
|
UseRoleId: v.matchCtx.copyRoleId,
|
||||||
|
UseSkinId: v.matchCtx.copySkinId,
|
||||||
|
Rank: v.matchCtx.rank,
|
||||||
|
Score: v.matchCtx.grade,
|
||||||
|
}
|
||||||
|
room.Players = append(room.Players, d)
|
||||||
|
}
|
||||||
|
pack.List = append(pack.List, room)
|
||||||
|
}
|
||||||
|
p.SendToClient(int(tournament.TOURNAMENTID_PACKET_TM_SCRoomList), pack)
|
||||||
|
logger.Logger.Tracef("SCRoomList %v", pack)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// 比赛信息列表
|
// 比赛配置列表
|
||||||
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSTMInfo), tournament.CSTMInfo{}, CSTMInfo)
|
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSTMInfo), tournament.CSTMInfo{}, CSTMInfo)
|
||||||
// 比赛报名
|
// 比赛报名
|
||||||
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSSignRace), tournament.CSSignRace{}, CSSignRace)
|
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSSignRace), tournament.CSSignRace{}, CSSignRace)
|
||||||
|
// 比赛中比赛列表
|
||||||
|
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSMatchList), tournament.CSMatchList{}, CSMatchList)
|
||||||
|
// 比赛中房间列表
|
||||||
|
common.Register(int(tournament.TOURNAMENTID_PACKET_TM_CSRoomList), tournament.CSRoomList{}, CSRoomList)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ func (this *AwardLogManager) Update() {
|
||||||
|
|
||||||
func (this *AwardLogManager) Shutdown() {
|
func (this *AwardLogManager) Shutdown() {
|
||||||
this.Save()
|
this.Save()
|
||||||
|
module.UnregisteModule(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *AwardLogManager) OnHourTimer() {
|
func (this *AwardLogManager) OnHourTimer() {
|
||||||
|
|
|
||||||
|
|
@ -592,25 +592,47 @@ func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
jybLog := &model.JybLog{
|
||||||
|
Platform: p.Platform,
|
||||||
|
Id: jyb.JybId.Hex(),
|
||||||
|
Ts: time.Now().Unix(),
|
||||||
|
SnId: p.SnId,
|
||||||
|
Tp: jyb.CodeType,
|
||||||
|
Name: jyb.Name,
|
||||||
|
}
|
||||||
for _, v := range jyb.Award.Item {
|
for _, v := range jyb.Award.Item {
|
||||||
//if _, code := BagMgrSingleton.UpBagInfo(p.SnId, p.Platform, v.ItemId, v.ItemNum); code == bag.OpResultCode_OPRC_Sucess { // 需修改
|
//if _, code := BagMgrSingleton.UpBagInfo(p.SnId, p.Platform, v.ItemId, v.ItemNum); code == bag.OpResultCode_OPRC_Sucess { // 需修改
|
||||||
pack.GainItem.ItemId = append(pack.GainItem.ItemId, &playerproto.ItemInfo{
|
pack.GainItem.ItemId = append(pack.GainItem.ItemId, &playerproto.ItemInfo{
|
||||||
ItemId: v.ItemId,
|
ItemId: v.ItemId,
|
||||||
ItemNum: v.ItemNum,
|
ItemNum: v.ItemNum,
|
||||||
})
|
})
|
||||||
|
jybLog.Award = append(jybLog.Award, &model.JybItem{
|
||||||
|
Id: v.ItemId,
|
||||||
|
Num: int32(v.ItemNum),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if jyb.Award.Coin > 0 {
|
if jyb.Award.Coin > 0 {
|
||||||
p.AddCoin(jyb.Award.Coin, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
|
p.AddCoin(jyb.Award.Coin, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
|
||||||
if !p.IsRob {
|
if !p.IsRob {
|
||||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Coin, int64(jyb.Award.Coin)))
|
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Coin, int64(jyb.Award.Coin)))
|
||||||
}
|
}
|
||||||
|
jybLog.Award = append(jybLog.Award, &model.JybItem{
|
||||||
|
Id: common.ItemIDCoin,
|
||||||
|
Num: int32(jyb.Award.Coin),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if jyb.Award.Diamond > 0 {
|
if jyb.Award.Diamond > 0 {
|
||||||
p.AddDiamond(jyb.Award.Diamond, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
|
p.AddDiamond(jyb.Award.Diamond, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
|
||||||
if !p.IsRob {
|
if !p.IsRob {
|
||||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Diamond, int64(jyb.Award.Diamond)))
|
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Diamond, int64(jyb.Award.Diamond)))
|
||||||
}
|
}
|
||||||
|
jybLog.Award = append(jybLog.Award, &model.JybItem{
|
||||||
|
Id: common.ItemIDDiamond,
|
||||||
|
Num: int32(jyb.Award.Coin),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
// 领取日志
|
||||||
|
LogChannelSingleton.WriteLog(jybLog)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
pack.GainItem.Coin = jyb.Award.Coin
|
pack.GainItem.Coin = jyb.Award.Coin
|
||||||
pack.GainItem.Diamond = jyb.Award.Diamond
|
pack.GainItem.Diamond = jyb.Award.Diamond
|
||||||
|
|
|
||||||
|
|
@ -10,21 +10,17 @@ import (
|
||||||
"mongo.games.com/goserver/core/transact"
|
"mongo.games.com/goserver/core/transact"
|
||||||
|
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
hall_proto "mongo.games.com/game/protocol/gamehall"
|
hallproto "mongo.games.com/game/protocol/gamehall"
|
||||||
"mongo.games.com/game/protocol/server"
|
"mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/game/protocol/webapi"
|
"mongo.games.com/game/protocol/webapi"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
var CoinSceneMgrSingleton = &CoinSceneMgr{
|
var CoinSceneMgrSingleton = &CoinSceneMgr{
|
||||||
playerChanging: make(map[int32]int32),
|
playerChanging: make(map[int32]int32),
|
||||||
//按平台管理
|
|
||||||
scenesOfPlatform: make(map[string]map[int32]*CoinScenePool),
|
scenesOfPlatform: make(map[string]map[int32]*CoinScenePool),
|
||||||
platformOfScene: make(map[int]string),
|
|
||||||
//按组管理
|
|
||||||
scenesOfGroup: make(map[int32]map[int32]*CoinScenePool),
|
|
||||||
groupOfScene: make(map[int]int32),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateRoomCache struct {
|
type CreateRoomCache struct {
|
||||||
|
|
@ -33,16 +29,8 @@ type CreateRoomCache struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CoinSceneMgr struct {
|
type CoinSceneMgr struct {
|
||||||
playerChanging map[int32]int32 // snid:gamefreeid 换桌中的玩家
|
scenesOfPlatform map[string]map[int32]*CoinScenePool // 场次房间池 platform:gamefreeid
|
||||||
|
playerChanging map[int32]int32 // 换桌中的玩家 snid:gamefreeid
|
||||||
//按平台管理
|
|
||||||
scenesOfPlatform map[string]map[int32]*CoinScenePool // platform:gamefreeid
|
|
||||||
platformOfScene map[int]string // sceneid:platform; 创建房间后记录房间所在平台
|
|
||||||
|
|
||||||
//按组管理
|
|
||||||
scenesOfGroup map[int32]map[int32]*CoinScenePool // groupid:gamefreeid
|
|
||||||
groupOfScene map[int]int32 // sceneid:groupid;
|
|
||||||
|
|
||||||
//延迟创建房间列表
|
//延迟创建房间列表
|
||||||
delayCache []*CreateRoomCache // 待预创建房间
|
delayCache []*CreateRoomCache // 待预创建房间
|
||||||
}
|
}
|
||||||
|
|
@ -50,215 +38,126 @@ type CoinSceneMgr struct {
|
||||||
// GetCoinScenePool 获取一个场景池
|
// GetCoinScenePool 获取一个场景池
|
||||||
// plt 平台id
|
// plt 平台id
|
||||||
// id 场次id
|
// id 场次id
|
||||||
func (csm *CoinSceneMgr) GetCoinScenePool(plt string, id int32) *CoinScenePool {
|
func (m *CoinSceneMgr) GetCoinScenePool(plt string, id int32) *CoinScenePool {
|
||||||
gf := PlatformMgrSingleton.GetGameFree(plt, id)
|
gf := PlatformMgrSingleton.GetGameFree(plt, id)
|
||||||
if gf == nil {
|
if gf == nil || gf.DbGameFree == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
groupId := gf.GetGroupId()
|
|
||||||
if groupId != 0 {
|
|
||||||
if _, ok := csm.scenesOfGroup[groupId]; ok {
|
|
||||||
if csp, ok := csm.scenesOfGroup[groupId][id]; ok {
|
|
||||||
return csp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ss, ok := csm.scenesOfPlatform[plt]; ok {
|
|
||||||
if csp, ok := ss[id]; ok && csp != nil {
|
|
||||||
return csp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if gf.GetDbGameFree() == nil {
|
if ss, ok := m.scenesOfPlatform[plt]; ok {
|
||||||
return nil
|
if csp, ok := ss[id]; ok && csp != nil {
|
||||||
|
return csp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建了一个新的
|
// 创建了一个新的
|
||||||
// 应该是走不到这里,因为模块启动时所有场次都创建了房间池
|
// 模块启动时所有场次都创建了房间池
|
||||||
pool := newCoinScenePool(plt, groupId, gf.GetDbGameFree())
|
pool := newCoinScenePool(plt, gf.GetDbGameFree())
|
||||||
if groupId != 0 {
|
v, ok := m.scenesOfPlatform[plt]
|
||||||
v, ok := csm.scenesOfGroup[groupId]
|
if !ok || v == nil {
|
||||||
if !ok || v == nil {
|
m.scenesOfPlatform[plt] = make(map[int32]*CoinScenePool)
|
||||||
csm.scenesOfGroup[groupId] = make(map[int32]*CoinScenePool)
|
|
||||||
}
|
|
||||||
csm.scenesOfGroup[groupId][id] = pool
|
|
||||||
} else {
|
|
||||||
v, ok := csm.scenesOfPlatform[plt]
|
|
||||||
if !ok || v == nil {
|
|
||||||
csm.scenesOfPlatform[plt] = make(map[int32]*CoinScenePool)
|
|
||||||
}
|
|
||||||
csm.scenesOfPlatform[plt][id] = pool
|
|
||||||
}
|
}
|
||||||
|
m.scenesOfPlatform[plt][id] = pool
|
||||||
return pool
|
return pool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[int32]*CoinScenePool, groupID int32,
|
func (m *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[int32]*CoinScenePool, dbGameFree *server.DB_GameFree) {
|
||||||
dbGameFree *server.DB_GameFree) {
|
|
||||||
gf := PlatformMgrSingleton.GetGameFree(platform, id)
|
gf := PlatformMgrSingleton.GetGameFree(platform, id)
|
||||||
if gf == nil || gf.GetDbGameFree() == nil {
|
if gf == nil || gf.GetDbGameFree() == nil {
|
||||||
return nil, 0, nil
|
return nil, nil
|
||||||
}
|
|
||||||
groupId := gf.GetGroupId()
|
|
||||||
|
|
||||||
var ss map[int32]*CoinScenePool
|
|
||||||
var ok bool
|
|
||||||
if groupId != 0 {
|
|
||||||
ss, ok = csm.scenesOfGroup[groupId]
|
|
||||||
if !ok {
|
|
||||||
ss = make(map[int32]*CoinScenePool)
|
|
||||||
csm.scenesOfGroup[groupId] = ss
|
|
||||||
}
|
|
||||||
return ss, groupId, gf.GetDbGameFree()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ss, ok = csm.scenesOfPlatform[platform]
|
ss, ok := m.scenesOfPlatform[platform]
|
||||||
if !ok {
|
if !ok || ss == nil {
|
||||||
ss = make(map[int32]*CoinScenePool)
|
ss = make(map[int32]*CoinScenePool)
|
||||||
csm.scenesOfPlatform[platform] = ss
|
m.scenesOfPlatform[platform] = ss
|
||||||
}
|
}
|
||||||
return ss, 0, gf.GetDbGameFree()
|
return ss, gf.GetDbGameFree()
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerEnter 玩家进入房间池
|
// PlayerEnter 玩家进入房间池
|
||||||
func (csm *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []int32, isChangeRoom bool) hall_proto.OpResultCode {
|
func (m *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []int32, isChangeRoom bool) hallproto.OpResultCode {
|
||||||
logger.Logger.Tracef("(csm *CoinSceneMgr) PlayerEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
logger.Logger.Tracef("CoinSceneMgr PlayerEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
||||||
if p.isDelete { //删档用户不让进游戏
|
if p.isDelete { //删档用户不让进游戏
|
||||||
return hall_proto.OpResultCode_OPRC_RoomHadClosed
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
|
}
|
||||||
|
// 玩家已经在房间里了
|
||||||
|
if m.InCoinScene(p) {
|
||||||
|
logger.Logger.Warnf("CoinSceneMgr PlayerEnter snid:%v find in gamefreeid:%v roomId:%v", p.SnId, p.scene.dbGameFree.Id, p.scene.sceneId)
|
||||||
|
return hallproto.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
|
||||||
//多平台支持
|
//多平台支持
|
||||||
platform := p.GetPlatform()
|
platform := p.GetPlatform()
|
||||||
if platform == nil {
|
if platform == nil {
|
||||||
return hall_proto.OpResultCode_OPRC_RoomHadClosed
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
|
csp := m.GetCoinScenePool(platform.IdStr, id)
|
||||||
// 玩家已经在房间里了
|
ret := csp.playerEnter(p, roomId, exclude, isChangeRoom)
|
||||||
if p.scene != nil {
|
logger.Logger.Tracef("CoinSceneMgr PlayerEnter snid:%v id:%v ret:%v", p.SnId, id, ret)
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) PlayerEnter snid:%v find in gameId:%v gamefreeid:%v", p.SnId, p.scene.gameId, id)
|
|
||||||
return hall_proto.OpResultCode_OPRC_Error
|
|
||||||
}
|
|
||||||
|
|
||||||
csp := csm.GetCoinScenePool(platform.IdStr, id)
|
|
||||||
|
|
||||||
ret := csp.PlayerEnter(p, roomId, exclude, isChangeRoom)
|
|
||||||
|
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) PlayerEnter snid:%v find in id:%v exclude:%v return false", p.SnId, id, exclude)
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// AudienceEnter 观众进入房间
|
// AudienceEnter 观众进入房间
|
||||||
func (csm *CoinSceneMgr) AudienceEnter(p *Player, id int32, roomId int32, exclude []int32, ischangeroom bool) hall_proto.OpResultCode {
|
func (m *CoinSceneMgr) AudienceEnter(p *Player, id int32, roomId int32, exclude []int32, ischangeroom bool) hallproto.OpResultCode {
|
||||||
|
logger.Logger.Tracef("CoinSceneMgr AudienceEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
||||||
|
if p.isDelete { //删档用户不让进游戏
|
||||||
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
|
}
|
||||||
|
if m.InCoinScene(p) {
|
||||||
|
logger.Logger.Warnf("CoinSceneMgr AudienceEnter snid:%v find in gamefreeid:%v roomId:%v", p.SnId, p.scene.dbGameFree.Id, p.scene.sceneId)
|
||||||
|
return hallproto.OpResultCode_OPRC_Error
|
||||||
|
}
|
||||||
//多平台支持
|
//多平台支持
|
||||||
platform := p.GetPlatform()
|
platform := p.GetPlatform()
|
||||||
if platform == nil {
|
if platform == nil {
|
||||||
return hall_proto.OpResultCode_OPRC_RoomHadClosed
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
pools, _, _ := csm.findCoinScenePool(platform.IdStr, id)
|
pools, _ := m.findCoinScenePool(platform.IdStr, id)
|
||||||
if pools == nil {
|
if pools == nil {
|
||||||
return hall_proto.OpResultCode_OPRC_RoomHadClosed
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(pools) == 0 {
|
if len(pools) == 0 {
|
||||||
return hall_proto.OpResultCode_OPRC_NoFindDownTiceRoom
|
return hallproto.OpResultCode_OPRC_NoFindDownTiceRoom
|
||||||
}
|
}
|
||||||
|
|
||||||
if csp, ok := pools[id]; ok && csp != nil {
|
csp, ok := pools[id]
|
||||||
ret := csp.AudienceEnter(p, roomId, exclude, ischangeroom)
|
if !ok || csp == nil {
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) AudienceEnter snid:%v find in id:%v exclude:%v return false", p.SnId, id, exclude)
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
return ret
|
|
||||||
}
|
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) AudienceEnter snid:%v find in id:%v exclude:%v csp.AudienceEnter return false", p.SnId, id, exclude)
|
|
||||||
return hall_proto.OpResultCode_OPRC_Error
|
|
||||||
}
|
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) playerLeave(p *Player, reason int) bool {
|
|
||||||
if p == nil || p.scene == nil {
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
s := p.scene
|
ret := csp.audienceEnter(p, roomId, exclude, ischangeroom)
|
||||||
if s.groupId != 0 {
|
logger.Logger.Tracef("CoinSceneMgr AudienceEnter snid:%v id:%v ret:%v", p.SnId, id, ret)
|
||||||
if ss, ok := csm.scenesOfGroup[s.groupId]; ok && ss != nil {
|
return ret
|
||||||
if csp, ok := ss[s.dbGameFree.GetId()]; ok && csp != nil {
|
|
||||||
if !csp.PlayerLeave(p, reason) {
|
|
||||||
csp.AudienceLeave(p, reason)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 玩家身上平台
|
|
||||||
if platform := p.GetPlatform(); platform != nil {
|
|
||||||
if ss, ok := csm.scenesOfPlatform[platform.IdStr]; ok && ss != nil {
|
|
||||||
if csp, ok := ss[s.dbGameFree.GetId()]; ok && csp != nil {
|
|
||||||
if !csp.PlayerLeave(p, reason) {
|
|
||||||
csp.AudienceLeave(p, reason)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 房间所在平台
|
|
||||||
if s.limitPlatform != nil {
|
|
||||||
if ss, ok := csm.scenesOfPlatform[s.limitPlatform.IdStr]; ok && ss != nil {
|
|
||||||
if csp, ok := ss[s.dbGameFree.GetId()]; ok && csp != nil {
|
|
||||||
if !csp.PlayerLeave(p, reason) {
|
|
||||||
csp.AudienceLeave(p, reason)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerLeave 玩家离开
|
// PlayerLeave 玩家离开
|
||||||
func (csm *CoinSceneMgr) PlayerLeave(p *Player, reason int) bool {
|
// 游戏服玩家离开房间消息触发
|
||||||
logger.Logger.Tracef("玩家离开: snid %v, reason %v isAudience %v", p.SnId, reason)
|
func (m *CoinSceneMgr) PlayerLeave(p *Player, reason int) bool {
|
||||||
return csm.playerLeave(p, reason)
|
logger.Logger.Tracef("玩家离开: snid %v, reason %v", p.SnId, reason)
|
||||||
|
if p.scene == nil || p.scene.csp == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if p.scene.csp.playerLeave(p, reason) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if p.scene.csp.audienceLeave(p, reason) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnDestroyScene 解散房间
|
// OnDestroyScene 解散房间
|
||||||
|
// 游戏服解散房间消息触发
|
||||||
// sceneId 房间id
|
// sceneId 房间id
|
||||||
func (csm *CoinSceneMgr) OnDestroyScene(sceneId int) {
|
func (m *CoinSceneMgr) OnDestroyScene(sceneId int) {
|
||||||
if platformName, ok := csm.platformOfScene[sceneId]; ok {
|
if s := SceneMgrSingleton.GetScene(sceneId); s != nil && s.csp != nil {
|
||||||
if ss, ok := csm.scenesOfPlatform[platformName]; ok {
|
s.csp.onDestroyScene(sceneId)
|
||||||
for _, csp := range ss {
|
|
||||||
csp.OnDestroyScene(sceneId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete(csm.platformOfScene, sceneId)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if groupId, ok := csm.groupOfScene[sceneId]; ok {
|
|
||||||
if ss, ok := csm.scenesOfGroup[groupId]; ok {
|
|
||||||
for _, csp := range ss {
|
|
||||||
csp.OnDestroyScene(sceneId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete(csm.groupOfScene, sceneId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPlatformBySceneId 获取房间所在平台
|
|
||||||
func (csm *CoinSceneMgr) GetPlatformBySceneId(sceneId int) string {
|
|
||||||
if platformName, ok := csm.platformOfScene[sceneId]; ok {
|
|
||||||
return platformName
|
|
||||||
}
|
|
||||||
s := SceneMgrSingleton.GetScene(sceneId)
|
|
||||||
if s != nil && s.limitPlatform != nil {
|
|
||||||
return s.limitPlatform.IdStr
|
|
||||||
}
|
|
||||||
return DefaultPlatform
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPlayerNums 获取场次人数
|
// GetPlayerNums 获取场次人数
|
||||||
func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
|
func (m *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
|
||||||
//多平台支持
|
//多平台支持
|
||||||
platform := p.GetPlatform()
|
platform := p.GetPlatform()
|
||||||
var nums [10]int32
|
var nums [10]int32
|
||||||
|
|
@ -275,22 +174,11 @@ func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int3
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
|
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
|
||||||
if gps != nil {
|
if gps != nil {
|
||||||
if gps.GroupId != 0 {
|
if ss, ok := m.scenesOfPlatform[platform.IdStr]; ok {
|
||||||
if ss, exist := csm.scenesOfGroup[gps.GroupId]; exist {
|
if csp, exist := ss[id]; exist {
|
||||||
if csp, exist := ss[id]; exist {
|
sceneType := csp.GetSceneType() - 1
|
||||||
sceneType := csp.GetSceneType() - 1
|
if sceneType >= 0 && sceneType < len(nums) {
|
||||||
if sceneType >= 0 && sceneType < len(nums) {
|
nums[sceneType] += csp.GetPlayerNum() + csp.GetFakePlayerNum()
|
||||||
nums[sceneType] += csp.GetPlayerNum() + csp.GetFakePlayerNum()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ss, ok := csm.scenesOfPlatform[platform.IdStr]; ok {
|
|
||||||
if csp, exist := ss[id]; exist {
|
|
||||||
sceneType := csp.GetSceneType() - 1
|
|
||||||
if sceneType >= 0 && sceneType < len(nums) {
|
|
||||||
nums[sceneType] += csp.GetPlayerNum() + csp.GetFakePlayerNum()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -304,9 +192,9 @@ func (csm *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int3
|
||||||
}
|
}
|
||||||
|
|
||||||
// InCoinScene 是否在场次中
|
// InCoinScene 是否在场次中
|
||||||
func (csm *CoinSceneMgr) InCoinScene(p *Player) bool {
|
func (m *CoinSceneMgr) InCoinScene(p *Player) bool {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
logger.Logger.Tracef("(csm *CoinSceneMgr) InCoinScene p == nil snid:%v ", p.SnId)
|
logger.Logger.Tracef("(m *CoinSceneMgr) InCoinScene p == nil")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -321,10 +209,10 @@ func (csm *CoinSceneMgr) InCoinScene(p *Player) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerTryLeave 通知游戏服务玩家要离开房间
|
// PlayerTryLeave 通知游戏服务玩家要离开房间
|
||||||
func (csm *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hall_proto.OpResultCode {
|
func (m *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hallproto.OpResultCode {
|
||||||
if !csm.InCoinScene(p) {
|
if !m.InCoinScene(p) {
|
||||||
logger.Logger.Tracef("(csm *CoinSceneMgr) PlayerTryLeave !csm.InCoinScene(p) snid:%v ", p.SnId)
|
logger.Logger.Tracef("(m *CoinSceneMgr) PlayerTryLeave !m.InCoinScene(p) snid:%v ", p.SnId)
|
||||||
return hall_proto.OpResultCode_OPRC_Sucess
|
return hallproto.OpResultCode_OPRC_Sucess
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通知gamesrv
|
// 通知gamesrv
|
||||||
|
|
@ -332,46 +220,54 @@ func (csm *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hall_proto.O
|
||||||
if isAudience {
|
if isAudience {
|
||||||
op = common.CoinSceneOp_AudienceLeave
|
op = common.CoinSceneOp_AudienceLeave
|
||||||
}
|
}
|
||||||
pack := &hall_proto.CSCoinSceneOp{
|
pack := &hallproto.CSCoinSceneOp{
|
||||||
Id: proto.Int32(p.scene.csp.id),
|
Id: proto.Int32(p.scene.csp.ID()),
|
||||||
OpType: proto.Int32(op),
|
OpType: proto.Int32(op),
|
||||||
}
|
}
|
||||||
proto.SetDefaults(pack)
|
common.TransmitToServer(p.sid, int(hallproto.CoinSceneGamePacketID_PACKET_CS_COINSCENE_OP), pack, p.scene.gameSess.Session)
|
||||||
common.TransmitToServer(p.sid, int(hall_proto.CoinSceneGamePacketID_PACKET_CS_COINSCENE_OP), pack, p.scene.gameSess.Session)
|
logger.Logger.Tracef("(m *CoinSceneMgr) PlayerTryLeave snid:%v id:%v", p.SnId, pack.GetId())
|
||||||
logger.Logger.Tracef("(csm *CoinSceneMgr) PlayerTryLeave snid:%v id:%v", p.SnId, pack.GetId())
|
|
||||||
return hall_proto.OpResultCode_OPRC_OpYield
|
return hallproto.OpResultCode_OPRC_OpYield
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) PlayerInChanging(p *Player) bool {
|
// PlayerInChanging 换房中
|
||||||
_, exist := csm.playerChanging[p.SnId]
|
func (m *CoinSceneMgr) PlayerInChanging(p *Player) bool {
|
||||||
|
_, exist := m.playerChanging[p.SnId]
|
||||||
return exist
|
return exist
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) ClearPlayerChanging(p *Player) {
|
// ClearPlayerChanging 换房结束
|
||||||
delete(csm.playerChanging, p.SnId)
|
func (m *CoinSceneMgr) ClearPlayerChanging(p *Player) {
|
||||||
|
delete(m.playerChanging, p.SnId)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) PlayerTryChange(p *Player, id int32, exclude []int32, isAudience bool) hall_proto.OpResultCode {
|
// PlayerTryChange 换房
|
||||||
if csm.InCoinScene(p) {
|
// id 场次id
|
||||||
return csm.StartChangeCoinSceneTransact(p, id, exclude, isAudience)
|
// excludeRoomId 排除的房间id
|
||||||
|
// isAudience 是否是观众
|
||||||
|
func (m *CoinSceneMgr) PlayerTryChange(p *Player, id int32, excludeRoomId []int32, isAudience bool) hallproto.OpResultCode {
|
||||||
|
if m.InCoinScene(p) {
|
||||||
|
return m.StartChangeCoinSceneTransact(p, id, excludeRoomId, isAudience)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 不在场次中,进入房间观战
|
||||||
if isAudience {
|
if isAudience {
|
||||||
return csm.AudienceEnter(p, id, 0, exclude, true)
|
return m.AudienceEnter(p, id, 0, excludeRoomId, true)
|
||||||
}
|
}
|
||||||
return csm.PlayerEnter(p, id, 0, exclude, true)
|
// 不在场次中,进入房间
|
||||||
|
return m.PlayerEnter(p, id, 0, excludeRoomId, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclude []int32, isAudience bool) hall_proto.OpResultCode {
|
func (m *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclude []int32, isAudience bool) hallproto.OpResultCode {
|
||||||
if p == nil || p.scene == nil {
|
if p == nil || p.scene == nil {
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) StartChangeCoinSceneTransact p == nil || p.scene == nil snid:%v id:%v", p.SnId, id)
|
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact p == nil || p.scene == nil snid:%v id:%v", p.SnId, id)
|
||||||
return hall_proto.OpResultCode_OPRC_Error
|
return hallproto.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
|
||||||
tNow := time.Now()
|
tNow := time.Now()
|
||||||
if !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second {
|
if !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second {
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) StartChangeCoinSceneTransact !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second snid:%v id:%v", p.SnId, id)
|
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact !p.lastChangeScene.IsZero() && tNow.Sub(p.lastChangeScene) < time.Second snid:%v id:%v", p.SnId, id)
|
||||||
return hall_proto.OpResultCode_OPRC_ChangeRoomTooOften
|
return hallproto.OpResultCode_OPRC_ChangeRoomTooOften
|
||||||
}
|
}
|
||||||
|
|
||||||
tnp := &transact.TransNodeParam{
|
tnp := &transact.TransNodeParam{
|
||||||
|
|
@ -391,12 +287,12 @@ func (csm *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclu
|
||||||
tNode := transact.DTCModule.StartTrans(tnp, ctx, CoinSceneChangeTimeOut)
|
tNode := transact.DTCModule.StartTrans(tnp, ctx, CoinSceneChangeTimeOut)
|
||||||
if tNode != nil {
|
if tNode != nil {
|
||||||
tNode.Go(core.CoreObject())
|
tNode.Go(core.CoreObject())
|
||||||
csm.playerChanging[p.SnId] = id
|
m.playerChanging[p.SnId] = id
|
||||||
p.lastChangeScene = tNow
|
p.lastChangeScene = tNow
|
||||||
return hall_proto.OpResultCode_OPRC_Sucess
|
return hallproto.OpResultCode_OPRC_Sucess
|
||||||
}
|
}
|
||||||
logger.Logger.Warnf("(csm *CoinSceneMgr) StartChangeCoinSceneTransact tNode == nil snid:%v id:%v", p.SnId, id)
|
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact tNode == nil snid:%v id:%v", p.SnId, id)
|
||||||
return hall_proto.OpResultCode_OPRC_Error
|
return hallproto.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// TouchCreateRoom 触发预创建房间
|
// TouchCreateRoom 触发预创建房间
|
||||||
|
|
@ -404,44 +300,47 @@ func (csm *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclu
|
||||||
// 2.游戏服建立连接后触发
|
// 2.游戏服建立连接后触发
|
||||||
// 3.房间解散后触发
|
// 3.房间解散后触发
|
||||||
// 4.场次配置更新后
|
// 4.场次配置更新后
|
||||||
func (csm *CoinSceneMgr) TouchCreateRoom(platform string, gameFreeId int32) {
|
func (m *CoinSceneMgr) TouchCreateRoom(platform string, gameFreeId int32) {
|
||||||
|
if model.GameParamData.ClosePreCreateRoom {
|
||||||
|
return
|
||||||
|
}
|
||||||
gf := PlatformMgrSingleton.GetGameFree(platform, gameFreeId)
|
gf := PlatformMgrSingleton.GetGameFree(platform, gameFreeId)
|
||||||
if gf.Status && gf.DbGameFree.GetCreateRoomNum() > 0 {
|
if gf.Status && gf.DbGameFree.GetCreateRoomNum() > 0 {
|
||||||
logger.Logger.Tracef("TouchCreateRoom platform:%v gameFreeId:%v", platform, gameFreeId)
|
logger.Logger.Tracef("TouchCreateRoom platform:%v gameFreeId:%v", platform, gameFreeId)
|
||||||
csm.delayCache = append(csm.delayCache, &CreateRoomCache{
|
m.delayCache = append(m.delayCache, &CreateRoomCache{
|
||||||
platformName: platform,
|
platformName: platform,
|
||||||
gameFreeId: gameFreeId,
|
gameFreeId: gameFreeId,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) ModuleName() string {
|
func (m *CoinSceneMgr) ModuleName() string {
|
||||||
return "CoinSceneMgr"
|
return "CoinSceneMgr"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) Init() {
|
func (m *CoinSceneMgr) Init() {
|
||||||
// 房间池初始化
|
// 房间池初始化
|
||||||
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
|
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
|
||||||
if platform.Isolated || platform.IdStr == "" {
|
if platform.Isolated || platform.IdStr == "" {
|
||||||
for _, v := range srvdata.PBDB_GameFreeMgr.Datas.GetArr() {
|
for _, v := range srvdata.PBDB_GameFreeMgr.Datas.GetArr() {
|
||||||
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, v.GetId())
|
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, v.GetId())
|
||||||
if gps != nil {
|
if gps != nil {
|
||||||
csm.GetCoinScenePool(platform.IdStr, v.GetId())
|
m.GetCoinScenePool(platform.IdStr, v.GetId())
|
||||||
csm.TouchCreateRoom(platform.IdStr, v.GetId())
|
m.TouchCreateRoom(platform.IdStr, v.GetId())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) Update() {
|
func (m *CoinSceneMgr) Update() {
|
||||||
cnt := len(csm.delayCache)
|
cnt := len(m.delayCache)
|
||||||
if cnt > 0 {
|
if cnt > 0 {
|
||||||
data := csm.delayCache[cnt-1]
|
data := m.delayCache[cnt-1]
|
||||||
csm.delayCache = csm.delayCache[:cnt-1]
|
m.delayCache = m.delayCache[:cnt-1]
|
||||||
gf := PlatformMgrSingleton.GetGameFree(data.platformName, data.gameFreeId)
|
gf := PlatformMgrSingleton.GetGameFree(data.platformName, data.gameFreeId)
|
||||||
if gf != nil && gf.DbGameFree != nil {
|
if gf != nil && gf.DbGameFree != nil {
|
||||||
csp := csm.GetCoinScenePool(data.platformName, data.gameFreeId)
|
csp := m.GetCoinScenePool(data.platformName, data.gameFreeId)
|
||||||
if csp != nil {
|
if csp != nil {
|
||||||
csp.PreCreateRoom()
|
csp.PreCreateRoom()
|
||||||
}
|
}
|
||||||
|
|
@ -449,22 +348,22 @@ func (csm *CoinSceneMgr) Update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) Shutdown() {
|
func (m *CoinSceneMgr) Shutdown() {
|
||||||
module.UnregisteModule(csm)
|
module.UnregisteModule(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
//=====================PlatformObserver======================
|
//=====================PlatformObserver======================
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnPlatformCreate(p *Platform) {
|
func (m *CoinSceneMgr) OnPlatformCreate(p *Platform) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
|
func (m *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var ids []int
|
var ids []int
|
||||||
if v, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
if v, ok := m.scenesOfPlatform[p.IdStr]; ok {
|
||||||
for _, csp := range v {
|
for _, csp := range v {
|
||||||
for _, scene := range csp.scenes {
|
for _, scene := range csp.scenes {
|
||||||
ids = append(ids, scene.sceneId)
|
ids = append(ids, scene.sceneId)
|
||||||
|
|
@ -474,24 +373,18 @@ func (this *CoinSceneMgr) OnPlatformDestroy(p *Platform) {
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
SceneMgrSingleton.DoDelete(ids, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
|
func (m *CoinSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
|
||||||
if disabled {
|
if disabled {
|
||||||
this.OnPlatformDestroy(p)
|
m.OnPlatformDestroy(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *webapi.GameFree) {
|
func (m *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *webapi.GameFree) {
|
||||||
if p == nil || newCfg == nil {
|
if p == nil || newCfg == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var ss map[int32]*CoinScenePool
|
ss, ok := m.scenesOfPlatform[p.IdStr]
|
||||||
var ok bool
|
|
||||||
if oldCfg.GroupId != newCfg.GroupId || oldCfg.GroupId != 0 {
|
|
||||||
ss, ok = this.scenesOfGroup[oldCfg.GroupId]
|
|
||||||
} else {
|
|
||||||
ss, ok = this.scenesOfPlatform[p.IdStr]
|
|
||||||
}
|
|
||||||
if !ok || ss == nil {
|
if !ok || ss == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -503,62 +396,36 @@ func (this *CoinSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCfg *
|
||||||
ids = append(ids, scene.sceneId)
|
ids = append(ids, scene.sceneId)
|
||||||
}
|
}
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
SceneMgrSingleton.DoDelete(ids, true)
|
||||||
this.TouchCreateRoom(p.IdStr, newCfg.DbGameFree.Id)
|
m.TouchCreateRoom(p.IdStr, newCfg.DbGameFree.Id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
|
func (m *CoinSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if csps, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
var ids []int
|
||||||
var ids []int
|
if v, ok := m.scenesOfPlatform[p.IdStr]; ok {
|
||||||
for _, csp := range csps {
|
for _, csp := range v {
|
||||||
for _, scene := range csp.scenes {
|
for _, scene := range csp.scenes {
|
||||||
if scene.dbGameFree.Id == gameFreeId {
|
if scene.dbGameFree.Id == gameFreeId {
|
||||||
ids = append(ids, scene.sceneId)
|
ids = append(ids, scene.sceneId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
|
||||||
}
|
}
|
||||||
|
SceneMgrSingleton.DoDelete(ids, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========================PlatformGameGroupObserver==============================
|
//=========================PlatformGameGroupObserver==============================
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
|
func (m *CoinSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
|
||||||
if newCfg == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if scenes, exist := this.scenesOfGroup[newCfg.Id]; exist {
|
|
||||||
if cps, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
|
||||||
needDestroy := false
|
|
||||||
if cps.dbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
|
|
||||||
cps.dbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
|
|
||||||
cps.dbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||
|
|
||||||
cps.dbGameFree.GetMaxCoinLimit() != newCfg.DbGameFree.GetMaxCoinLimit() ||
|
|
||||||
cps.dbGameFree.GetTaxRate() != newCfg.DbGameFree.GetTaxRate() ||
|
|
||||||
!common.SliceInt64Equal(cps.dbGameFree.GetOtherIntParams(), newCfg.DbGameFree.GetOtherIntParams()) ||
|
|
||||||
!common.SliceInt64Equal(cps.dbGameFree.GetRobotTakeCoin(), newCfg.DbGameFree.GetRobotTakeCoin()) ||
|
|
||||||
!common.SliceInt64Equal(cps.dbGameFree.GetRobotLimitCoin(), newCfg.DbGameFree.GetRobotLimitCoin()) {
|
|
||||||
needDestroy = true
|
|
||||||
}
|
|
||||||
//TODO 预创建房间配置更新,unsupport group model
|
|
||||||
cps.dbGameFree = newCfg.DbGameFree
|
|
||||||
if needDestroy {
|
|
||||||
var ids []int
|
|
||||||
for _, scene := range cps.scenes {
|
|
||||||
ids = append(ids, scene.sceneId)
|
|
||||||
}
|
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========================GameSessionListener======================================
|
//=========================GameSessionListener======================================
|
||||||
|
|
||||||
func (csm *CoinSceneMgr) OnGameSessionRegiste(gs *GameSession) {
|
func (m *CoinSceneMgr) OnGameSessionRegiste(gs *GameSession) {
|
||||||
wildGs := len(gs.gameIds) == 0 || common.InSliceInt32(gs.gameIds, 0) // 是否所有游戏都支持
|
wildGs := len(gs.gameIds) == 0 || common.InSliceInt32(gs.gameIds, 0) // 是否所有游戏都支持
|
||||||
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
|
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
|
||||||
if platform.IdStr == DefaultPlatform {
|
if platform.IdStr == DefaultPlatform {
|
||||||
|
|
@ -568,13 +435,13 @@ func (csm *CoinSceneMgr) OnGameSessionRegiste(gs *GameSession) {
|
||||||
gps := PlatformMgrSingleton.GetGameFrees(platform.IdStr)
|
gps := PlatformMgrSingleton.GetGameFrees(platform.IdStr)
|
||||||
for _, v := range gps {
|
for _, v := range gps {
|
||||||
if v != nil && (wildGs || common.InSliceInt32(gs.gameIds, v.DbGameFree.GetGameId())) {
|
if v != nil && (wildGs || common.InSliceInt32(gs.gameIds, v.DbGameFree.GetGameId())) {
|
||||||
csm.TouchCreateRoom(platform.IdStr, v.DbGameFree.Id)
|
m.TouchCreateRoom(platform.IdStr, v.DbGameFree.Id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *CoinSceneMgr) OnGameSessionUnregiste(gs *GameSession) {
|
func (m *CoinSceneMgr) OnGameSessionUnregiste(gs *GameSession) {
|
||||||
//todo 游戏服务断开,是否解散房间?
|
//todo 游戏服务断开,是否解散房间?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"mongo.games.com/game/common"
|
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
gamehallproto "mongo.games.com/game/protocol/gamehall"
|
gamehallproto "mongo.games.com/game/protocol/gamehall"
|
||||||
serverproto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
|
|
@ -13,8 +13,6 @@ import (
|
||||||
// CoinScenePool 房间池
|
// CoinScenePool 房间池
|
||||||
type CoinScenePool struct {
|
type CoinScenePool struct {
|
||||||
platform string // 平台id
|
platform string // 平台id
|
||||||
groupId int32 // 组id
|
|
||||||
id int32 // 场次id
|
|
||||||
dbGameFree *serverproto.DB_GameFree // 场次配置
|
dbGameFree *serverproto.DB_GameFree // 场次配置
|
||||||
dbGameRule *serverproto.DB_GameRule // 场次配置
|
dbGameRule *serverproto.DB_GameRule // 场次配置
|
||||||
scenes map[int]*Scene // 所有房间,房间id
|
scenes map[int]*Scene // 所有房间,房间id
|
||||||
|
|
@ -26,7 +24,7 @@ type CoinScenePool struct {
|
||||||
policy ICoinScenePool
|
policy ICoinScenePool
|
||||||
}
|
}
|
||||||
|
|
||||||
func newCoinScenePool(platform string, groupId int32, dbGameFree *serverproto.DB_GameFree) *CoinScenePool {
|
func newCoinScenePool(platform string, dbGameFree *serverproto.DB_GameFree) *CoinScenePool {
|
||||||
if dbGameFree == nil {
|
if dbGameFree == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -42,8 +40,6 @@ func newCoinScenePool(platform string, groupId int32, dbGameFree *serverproto.DB
|
||||||
|
|
||||||
csp := &CoinScenePool{
|
csp := &CoinScenePool{
|
||||||
platform: platform,
|
platform: platform,
|
||||||
groupId: groupId,
|
|
||||||
id: dbGameFree.GetId(),
|
|
||||||
dbGameFree: dbGameFree,
|
dbGameFree: dbGameFree,
|
||||||
dbGameRule: dbGameRule,
|
dbGameRule: dbGameRule,
|
||||||
scenes: make(map[int]*Scene),
|
scenes: make(map[int]*Scene),
|
||||||
|
|
@ -59,6 +55,10 @@ func newCoinScenePool(platform string, groupId int32, dbGameFree *serverproto.DB
|
||||||
return csp
|
return csp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (csp *CoinScenePool) ID() int32 {
|
||||||
|
return csp.dbGameFree.Id
|
||||||
|
}
|
||||||
|
|
||||||
func (csp *CoinScenePool) GetPlayerNum() int32 {
|
func (csp *CoinScenePool) GetPlayerNum() int32 {
|
||||||
return int32(len(csp.players))
|
return int32(len(csp.players))
|
||||||
}
|
}
|
||||||
|
|
@ -73,7 +73,8 @@ func (csp *CoinScenePool) GetFakePlayerNum() int32 {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSceneType 获取场次id
|
// GetSceneType 获取场次类型
|
||||||
|
// 新手场,中级场 ...
|
||||||
func (csp *CoinScenePool) GetSceneType() int {
|
func (csp *CoinScenePool) GetSceneType() int {
|
||||||
if csp.dbGameFree != nil {
|
if csp.dbGameFree != nil {
|
||||||
return int(csp.dbGameFree.GetSceneType())
|
return int(csp.dbGameFree.GetSceneType())
|
||||||
|
|
@ -89,14 +90,79 @@ func (csp *CoinScenePool) CanInviteRob() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanEnter 检查入场条件
|
// PreCreateRoom 预创建房间
|
||||||
func (csp *CoinScenePool) CanEnter(p *Player) gamehallproto.OpResultCode {
|
func (csp *CoinScenePool) PreCreateRoom() {
|
||||||
|
if csp.platform == DefaultPlatform || model.GameParamData.ClosePreCreateRoom {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if p := PlatformMgrSingleton.GetPlatform(csp.platform); p == nil || p.Disable {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
preCreateNum := int(csp.dbGameFree.GetCreateRoomNum())
|
||||||
|
if preCreateNum <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
num := preCreateNum - csp.GetRoomNum(common.SceneMode_Public)
|
||||||
|
if num > 0 {
|
||||||
|
logger.Logger.Tracef("预创建房间 [inc:%v] platform:%v gameFreeId:%v", num, csp.platform, csp.dbGameFree.Id)
|
||||||
|
for i := 0; i < num; i++ {
|
||||||
|
scene := csp.policy.NewPreCreateScene(csp)
|
||||||
|
if scene != nil {
|
||||||
|
csp.AddScene(scene)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (csp *CoinScenePool) GetRoomNum(mode ...int) int {
|
||||||
|
tp := 0
|
||||||
|
if len(mode) > 0 {
|
||||||
|
tp = mode[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
var num int
|
||||||
|
for _, scene := range csp.scenes {
|
||||||
|
if tp > 0 {
|
||||||
|
if scene.IsSceneMode(tp) {
|
||||||
|
num++
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
num++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return num
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHasTruePlayerSceneCnt 有真人的房间数量
|
||||||
|
func (csp *CoinScenePool) GetHasTruePlayerSceneCnt() int {
|
||||||
|
cnt := 0
|
||||||
|
for _, s := range csp.scenes {
|
||||||
|
if s.GetTruePlayerCnt() != 0 {
|
||||||
|
cnt++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cnt
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddScene 添加房间
|
||||||
|
// 自定义房间参数的时候创建房间后添加到房间池
|
||||||
|
// 创建房间后,调用AddScene添加到房间池,在玩家进入房间之前调用
|
||||||
|
func (csp *CoinScenePool) AddScene(s *Scene) {
|
||||||
|
if s == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
csp.scenes[s.sceneId] = s
|
||||||
|
s.csp = csp
|
||||||
|
}
|
||||||
|
|
||||||
|
// canEnter 检查入场条件
|
||||||
|
func (csp *CoinScenePool) canEnter(p *Player) gamehallproto.OpResultCode {
|
||||||
if csp.dbGameFree == nil || p == nil {
|
if csp.dbGameFree == nil || p == nil {
|
||||||
return gamehallproto.OpResultCode_OPRC_Error
|
return gamehallproto.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
|
||||||
//检测房间状态是否开启
|
//检测房间状态是否开启
|
||||||
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.id)
|
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.ID())
|
||||||
if gps == nil || !gps.Status {
|
if gps == nil || !gps.Status {
|
||||||
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
|
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +172,7 @@ func (csp *CoinScenePool) CanEnter(p *Player) gamehallproto.OpResultCode {
|
||||||
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
|
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
|
|
||||||
//检查游戏次数限制
|
// 检查游戏次数限制
|
||||||
if !p.IsRob {
|
if !p.IsRob {
|
||||||
todayData, _ := p.GetDaliyGameData(int(dbGameFree.GetId()))
|
todayData, _ := p.GetDaliyGameData(int(dbGameFree.GetId()))
|
||||||
if dbGameFree.GetPlayNumLimit() != 0 &&
|
if dbGameFree.GetPlayNumLimit() != 0 &&
|
||||||
|
|
@ -119,14 +185,14 @@ func (csp *CoinScenePool) CanEnter(p *Player) gamehallproto.OpResultCode {
|
||||||
return csp.policy.CanEnter(csp, p)
|
return csp.policy.CanEnter(csp, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CanAudienceEnter 检查观众入场条件
|
// canAudienceEnter 检查观众入场条件
|
||||||
func (csp *CoinScenePool) CanAudienceEnter(p *Player) gamehallproto.OpResultCode {
|
func (csp *CoinScenePool) canAudienceEnter(p *Player) gamehallproto.OpResultCode {
|
||||||
if csp.dbGameFree == nil || p == nil {
|
if csp.dbGameFree == nil || p == nil {
|
||||||
return gamehallproto.OpResultCode_OPRC_Error
|
return gamehallproto.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
|
||||||
//检测房间状态是否开启
|
//检测房间状态是否开启
|
||||||
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.id)
|
gps := PlatformMgrSingleton.GetGameFree(p.Platform, csp.ID())
|
||||||
if gps == nil {
|
if gps == nil {
|
||||||
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
|
return gamehallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
|
|
@ -139,35 +205,16 @@ func (csp *CoinScenePool) CanAudienceEnter(p *Player) gamehallproto.OpResultCode
|
||||||
return csp.policy.CanAudienceEnter(csp, p)
|
return csp.policy.CanAudienceEnter(csp, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddScene 添加房间
|
// playerEnter 玩家进入房间池
|
||||||
func (csp *CoinScenePool) AddScene(s *Scene) {
|
|
||||||
if s == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
csp.scenes[s.sceneId] = s
|
|
||||||
s.csp = csp
|
|
||||||
if csp.groupId != 0 {
|
|
||||||
CoinSceneMgrSingleton.groupOfScene[s.sceneId] = csp.groupId
|
|
||||||
} else {
|
|
||||||
CoinSceneMgrSingleton.platformOfScene[s.sceneId] = csp.platform
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PlayerEnter 玩家进入房间池
|
|
||||||
// exclude 排除的房间id
|
// exclude 排除的房间id
|
||||||
// isChangeRoom 是否换房
|
// isChangeRoom 是否换房
|
||||||
func (csp *CoinScenePool) PlayerEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
|
func (csp *CoinScenePool) playerEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
|
||||||
if ret := csp.CanEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
|
if ret := csp.canEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
|
||||||
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter find snid:%v csp.CanEnter coin:%v ret:%v id:%v", p.SnId,
|
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter find snid:%v csp.canEnter coin:%v ret:%v id:%v", p.SnId,
|
||||||
p.Coin, ret, csp.dbGameFree.GetId())
|
p.Coin, ret, csp.dbGameFree.GetId())
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.scene != nil {
|
|
||||||
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter[p.scene != nil] find snid:%v in scene:%v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
|
|
||||||
return gamehallproto.OpResultCode_OPRC_Error
|
|
||||||
}
|
|
||||||
|
|
||||||
var scene *Scene
|
var scene *Scene
|
||||||
// 进入房间
|
// 进入房间
|
||||||
// 指定房间id进入,忽略排除exclude,只有机器人和进入预创建房间才允许
|
// 指定房间id进入,忽略排除exclude,只有机器人和进入预创建房间才允许
|
||||||
|
|
@ -204,15 +251,17 @@ func (csp *CoinScenePool) PlayerEnter(p *Player, roomId int32, exclude []int32,
|
||||||
if scene == nil {
|
if scene == nil {
|
||||||
scene = csp.policy.NewScene(csp, p)
|
scene = csp.policy.NewScene(csp, p)
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
|
logger.Logger.Infof("(csp *CoinScenePool) PlayerEnter create new scene:%v snid:%v gamefreeid:%v", scene.sceneId, p.SnId, csp.ID())
|
||||||
csp.AddScene(scene)
|
csp.AddScene(scene)
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Errorf("Create %v scene failed.", csp.id)
|
logger.Logger.Errorf("Create %v scene failed.", csp.ID())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
if scene.PlayerEnter(p, -1, isChangeRoom) {
|
if scene.PlayerEnter(p, -1, isChangeRoom) {
|
||||||
csp.OnPlayerEnter(p, scene)
|
logger.Logger.Infof("(csp *CoinScenePool) PlayerEnter snid:%v sceneid:%v gamefreeid:%v success", p.SnId, scene.sceneId, csp.ID())
|
||||||
|
csp.onPlayerEnter(p, scene)
|
||||||
return gamehallproto.OpResultCode_OPRC_Sucess
|
return gamehallproto.OpResultCode_OPRC_Sucess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -220,18 +269,13 @@ func (csp *CoinScenePool) PlayerEnter(p *Player, roomId int32, exclude []int32,
|
||||||
return gamehallproto.OpResultCode_OPRC_SceneServerMaintain
|
return gamehallproto.OpResultCode_OPRC_SceneServerMaintain
|
||||||
}
|
}
|
||||||
|
|
||||||
// AudienceEnter 观众入场
|
// audienceEnter 观众入场
|
||||||
func (csp *CoinScenePool) AudienceEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
|
func (csp *CoinScenePool) audienceEnter(p *Player, roomId int32, exclude []int32, isChangeRoom bool) gamehallproto.OpResultCode {
|
||||||
if ret := csp.CanAudienceEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
|
if ret := csp.canAudienceEnter(p); ret != gamehallproto.OpResultCode_OPRC_Sucess {
|
||||||
logger.Logger.Warnf("(csp *CoinScenePool) AudienceEnter find snid:%v csp.CanEnter coin:%v ret:%v id:%v", p.SnId, p.Coin, ret, csp.dbGameFree.GetId())
|
logger.Logger.Warnf("(csp *CoinScenePool) AudienceEnter find snid:%v csp.canEnter coin:%v ret:%v id:%v", p.SnId, p.Coin, ret, csp.dbGameFree.GetId())
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.scene != nil {
|
|
||||||
logger.Logger.Warnf("(csp *CoinScenePool) AudienceEnter[p.scene != nil] find snid:%v in scene:%v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
|
|
||||||
return gamehallproto.OpResultCode_OPRC_Error
|
|
||||||
}
|
|
||||||
|
|
||||||
var scene *Scene
|
var scene *Scene
|
||||||
if roomId != 0 {
|
if roomId != 0 {
|
||||||
if s, ok := csp.scenes[int(roomId)]; ok {
|
if s, ok := csp.scenes[int(roomId)]; ok {
|
||||||
|
|
@ -261,7 +305,8 @@ func (csp *CoinScenePool) AudienceEnter(p *Player, roomId int32, exclude []int32
|
||||||
}
|
}
|
||||||
|
|
||||||
if scene.AudienceEnter(p, isChangeRoom) {
|
if scene.AudienceEnter(p, isChangeRoom) {
|
||||||
csp.OnPlayerEnter(p, scene)
|
logger.Logger.Infof("(csp *CoinScenePool) AudienceEnter snid:%v sceneid:%v gamefreeid:%v success", p.SnId, scene.sceneId, csp.ID())
|
||||||
|
csp.onPlayerEnter(p, scene)
|
||||||
return gamehallproto.OpResultCode_OPRC_Sucess
|
return gamehallproto.OpResultCode_OPRC_Sucess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -269,78 +314,14 @@ func (csp *CoinScenePool) AudienceEnter(p *Player, roomId int32, exclude []int32
|
||||||
return gamehallproto.OpResultCode_OPRC_NoFindDownTiceRoom
|
return gamehallproto.OpResultCode_OPRC_NoFindDownTiceRoom
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnPlayerEnter 玩家进入房间完成
|
// onPlayerEnter 玩家进入房间完成
|
||||||
func (csp *CoinScenePool) OnPlayerEnter(p *Player, scene *Scene) {
|
func (csp *CoinScenePool) onPlayerEnter(p *Player, scene *Scene) {
|
||||||
csp.players[p.SnId] = struct{}{}
|
csp.players[p.SnId] = struct{}{}
|
||||||
csp.policy.OnPlayerEnter(csp, p, scene)
|
csp.policy.OnPlayerEnter(csp, p, scene)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerLeave 玩家离开房间
|
|
||||||
func (csp *CoinScenePool) PlayerLeave(p *Player, reason int) bool {
|
|
||||||
if p.scene == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if p.scene.csp != csp && p.scene == csp.scenes[p.scene.sceneId] {
|
|
||||||
logger.Logger.Error("bug")
|
|
||||||
}
|
|
||||||
if p.scene.csp != csp {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if p.scene != csp.scenes[p.scene.sceneId] {
|
|
||||||
logger.Logger.Error("bug")
|
|
||||||
}
|
|
||||||
s, ok := csp.scenes[p.scene.sceneId]
|
|
||||||
if !ok || s == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if !s.HasPlayer(p) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if !csp.policy.PlayerLeave(csp, p, reason) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
s.PlayerLeave(p, reason)
|
|
||||||
logger.Logger.Tracef("(csp *CoinScenePool) PlayerLeave snid:%v in scene:%v", p.SnId, s.sceneId)
|
|
||||||
|
|
||||||
csp.policy.OnPlayerLeave(csp, s, p)
|
|
||||||
|
|
||||||
csp.OnPlayerLeave(s, p)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// AudienceLeave 观众离开房间
|
|
||||||
func (csp *CoinScenePool) AudienceLeave(p *Player, reason int) bool {
|
|
||||||
if p.scene == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if p.scene.csp != csp {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
s, ok := csp.scenes[p.scene.sceneId]
|
|
||||||
if !ok || s == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if !s.HasAudience(p) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
if !csp.policy.AudienceLeave(csp, p, reason) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
s.AudienceLeave(p, reason)
|
|
||||||
logger.Logger.Tracef("(csp *CoinScenePool) AudienceLeave snid:%v in scene:%v", p.SnId, s.sceneId)
|
|
||||||
|
|
||||||
csp.policy.OnPlayerLeave(csp, s, p)
|
|
||||||
|
|
||||||
csp.OnPlayerLeave(s, p)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// OnPlayerLeave 离开房间完成
|
// OnPlayerLeave 离开房间完成
|
||||||
func (csp *CoinScenePool) OnPlayerLeave(s *Scene, p *Player) {
|
func (csp *CoinScenePool) onPlayerLeave(s *Scene, p *Player) {
|
||||||
if s == nil || p == nil {
|
if s == nil || p == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -370,17 +351,68 @@ func (csp *CoinScenePool) OnPlayerLeave(s *Scene, p *Player) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnDestroyScene 解散房间
|
// playerLeave 玩家离开房间
|
||||||
// 房间解散一定是游戏服确认的,worldsrv收到游戏房间解散消息后解散房间
|
func (csp *CoinScenePool) playerLeave(p *Player, reason int) bool {
|
||||||
func (csp *CoinScenePool) OnDestroyScene(sceneId int) {
|
if p.scene != csp.scenes[p.scene.sceneId] {
|
||||||
|
logger.Logger.Error("bug")
|
||||||
|
}
|
||||||
|
s, ok := csp.scenes[p.scene.sceneId]
|
||||||
|
if !ok || s == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if !s.HasPlayer(p) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if !csp.policy.PlayerLeave(csp, p, reason) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
s.PlayerLeave(p, reason)
|
||||||
|
logger.Logger.Tracef("(csp *CoinScenePool) PlayerLeave snid:%v in scene:%v", p.SnId, s.sceneId)
|
||||||
|
|
||||||
|
csp.policy.OnPlayerLeave(csp, s, p)
|
||||||
|
|
||||||
|
csp.onPlayerLeave(s, p)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// audienceLeave 观众离开房间
|
||||||
|
func (csp *CoinScenePool) audienceLeave(p *Player, reason int) bool {
|
||||||
|
s, ok := csp.scenes[p.scene.sceneId]
|
||||||
|
if !ok || s == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if !s.HasAudience(p) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if !csp.policy.AudienceLeave(csp, p, reason) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
s.AudienceLeave(p, reason)
|
||||||
|
logger.Logger.Tracef("(csp *CoinScenePool) AudienceLeave snid:%v in scene:%v", p.SnId, s.sceneId)
|
||||||
|
|
||||||
|
csp.policy.OnPlayerLeave(csp, s, p)
|
||||||
|
|
||||||
|
csp.onPlayerLeave(s, p)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// onDestroyScene 解散房间
|
||||||
|
// 房间解散一定是游戏服确认的,worldsrv收到游戏房间解散消息后解散房间,此时房间内玩家应该都离开了
|
||||||
|
// 或者游戏服异常断开触发房间解散,此时房间中还有人
|
||||||
|
func (csp *CoinScenePool) onDestroyScene(sceneId int) {
|
||||||
scene, ok := csp.scenes[sceneId]
|
scene, ok := csp.scenes[sceneId]
|
||||||
if !ok {
|
if !ok || scene == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Logger.Tracef("(csp *CoinScenePool) OnDestroyScene scene:%v", sceneId)
|
logger.Logger.Tracef("(csp *CoinScenePool) OnDestroyScene scene:%v", sceneId)
|
||||||
|
|
||||||
// todo 是否需要优化
|
// todo 是否需要优化
|
||||||
|
// 游戏服异常断开,同步一次金币
|
||||||
for id := range scene.players {
|
for id := range scene.players {
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(id)
|
player := PlayerMgrSington.GetPlayerBySnId(id)
|
||||||
if player != nil {
|
if player != nil {
|
||||||
|
|
@ -407,96 +439,13 @@ func (csp *CoinScenePool) OnDestroyScene(sceneId int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
csp.policy.OnDestroyScene(csp, sceneId)
|
csp.policy.OnDestroyScene(csp, sceneId)
|
||||||
|
for k := range scene.players {
|
||||||
|
delete(csp.players, k)
|
||||||
|
}
|
||||||
|
for k := range scene.audiences {
|
||||||
|
delete(csp.players, k)
|
||||||
|
}
|
||||||
scene.csp = nil // 解除关联
|
scene.csp = nil // 解除关联
|
||||||
delete(csp.scenes, sceneId)
|
delete(csp.scenes, sceneId)
|
||||||
CoinSceneMgrSingleton.TouchCreateRoom(csp.platform, csp.dbGameFree.Id)
|
CoinSceneMgrSingleton.TouchCreateRoom(csp.platform, csp.dbGameFree.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PreCreateRoom 预创建房间
|
|
||||||
func (csp *CoinScenePool) PreCreateRoom() {
|
|
||||||
if csp.platform == DefaultPlatform {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if p := PlatformMgrSingleton.GetPlatform(csp.platform); p == nil || p.Disable {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
preCreateNum := int(csp.dbGameFree.GetCreateRoomNum())
|
|
||||||
if preCreateNum <= 0 || model.GameParamData.ClosePreCreateRoom {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
num := preCreateNum - csp.GetRoomNum(common.SceneMode_Public)
|
|
||||||
if num > 0 {
|
|
||||||
logger.Logger.Tracef("预创建房间 [inc:%v] platform:%v gameFreeId:%v", num, csp.platform, csp.dbGameFree.Id)
|
|
||||||
for i := 0; i < num; i++ {
|
|
||||||
scene := csp.policy.NewPreCreateScene(csp)
|
|
||||||
if scene != nil {
|
|
||||||
csp.AddScene(scene)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (csp *CoinScenePool) GetRoomNum(mode ...int) int {
|
|
||||||
tp := 0
|
|
||||||
if len(mode) > 0 {
|
|
||||||
tp = mode[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
var num int
|
|
||||||
for _, scene := range csp.scenes {
|
|
||||||
if tp > 0 {
|
|
||||||
if scene.IsSceneMode(tp) {
|
|
||||||
num++
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
num++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return num
|
|
||||||
}
|
|
||||||
|
|
||||||
// ListRoom 房间列表
|
|
||||||
//func (csp *CoinScenePool) ListRoom(p *Player) bool {
|
|
||||||
// if p.scene != nil {
|
|
||||||
// logger.Logger.Warnf("(csp *CoinScenePool) PlayerListRoom[p.scene != nil] find snid:%v in scene:%v gameId:%v", p.SnId, p.scene.sceneId, p.scene.gameId)
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if len(csp.scenes) == 0 {
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// pack := &gamehallproto.SCCoinSceneListRoom{
|
|
||||||
// Id: csp.dbGameFree.Id,
|
|
||||||
// LimitCoin: csp.dbGameFree.LimitCoin,
|
|
||||||
// MaxCoinLimit: csp.dbGameFree.MaxCoinLimit,
|
|
||||||
// BaseScore: csp.dbGameFree.BaseScore,
|
|
||||||
// MaxScore: csp.dbGameFree.MaxChip,
|
|
||||||
// OtherIntParams: csp.dbGameFree.OtherIntParams,
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// maxPlayerNum := 0
|
|
||||||
// for sceneId, s := range csp.scenes {
|
|
||||||
// data := &gamehallproto.CoinSceneInfo{
|
|
||||||
// SceneId: proto.Int(sceneId),
|
|
||||||
// PlayerNum: proto.Int(len(s.players)),
|
|
||||||
// }
|
|
||||||
// pack.Datas = append(pack.Datas, data)
|
|
||||||
// maxPlayerNum = s.playerNum
|
|
||||||
// }
|
|
||||||
// pack.MaxPlayerNum = proto.Int(maxPlayerNum)
|
|
||||||
// proto.SetDefaults(pack)
|
|
||||||
// p.SendToClient(int(gamehallproto.CoinSceneGamePacketID_PACKET_SC_COINSCENE_LISTROOM), pack)
|
|
||||||
// return true
|
|
||||||
//}
|
|
||||||
|
|
||||||
// GetHasTruePlayerSceneCnt 有真人的房间数量
|
|
||||||
func (csp *CoinScenePool) GetHasTruePlayerSceneCnt() int {
|
|
||||||
cnt := 0
|
|
||||||
for _, s := range csp.scenes {
|
|
||||||
if s.GetTruePlayerCnt() != 0 {
|
|
||||||
cnt++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cnt
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ func (this *BaseCoinScenePool) PlayerEnter(pool *CoinScenePool, p *Player, exclu
|
||||||
}
|
}
|
||||||
} else { //按类型匹配
|
} else { //按类型匹配
|
||||||
//优先真人
|
//优先真人
|
||||||
if scene == nil && len(scenes) != 0 && matchTrueManRule == MatchTrueManPriority {
|
if len(scenes) != 0 && matchTrueManRule == MatchTrueManPriority {
|
||||||
var selScene []*Scene
|
var selScene []*Scene
|
||||||
for _, value := range scenes {
|
for _, value := range scenes {
|
||||||
if value != nil {
|
if value != nil {
|
||||||
|
|
@ -211,14 +211,14 @@ func (this *BaseCoinScenePool) AudienceLeave(pool *CoinScenePool, p *Player, rea
|
||||||
func (this *BaseCoinScenePool) OnPlayerLeave(pool *CoinScenePool, s *Scene, p *Player) {}
|
func (this *BaseCoinScenePool) OnPlayerLeave(pool *CoinScenePool, s *Scene, p *Player) {}
|
||||||
|
|
||||||
func (this *BaseCoinScenePool) NewScene(pool *CoinScenePool, p *Player) *Scene {
|
func (this *BaseCoinScenePool) NewScene(pool *CoinScenePool, p *Player) *Scene {
|
||||||
gameId := int(pool.dbGameRule.GetGameId())
|
gameId := int(pool.dbGameFree.GetGameId())
|
||||||
gs := GameSessMgrSington.GetMinLoadSess(gameId)
|
gs := GameSessMgrSington.GetMinLoadSess(gameId)
|
||||||
if gs == nil {
|
if gs == nil {
|
||||||
logger.Logger.Warnf("Get %v game min session failed.", gameId)
|
logger.Logger.Warnf("Get %v game min session failed.", gameId)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
gameMode := pool.dbGameRule.GetGameMode()
|
gameMode := pool.dbGameFree.GetGameMode()
|
||||||
params := common.CopySliceInt32ToInt64(pool.dbGameRule.GetParams())
|
params := common.CopySliceInt32ToInt64(pool.dbGameRule.GetParams())
|
||||||
limitPlatform := PlatformMgrSingleton.GetPlatform(pool.platform)
|
limitPlatform := PlatformMgrSingleton.GetPlatform(pool.platform)
|
||||||
if limitPlatform == nil || !limitPlatform.Isolated {
|
if limitPlatform == nil || !limitPlatform.Isolated {
|
||||||
|
|
@ -228,7 +228,7 @@ func (this *BaseCoinScenePool) NewScene(pool *CoinScenePool, p *Player) *Scene {
|
||||||
sceneId := SceneMgrSingleton.GenOneCoinSceneId()
|
sceneId := SceneMgrSingleton.GenOneCoinSceneId()
|
||||||
|
|
||||||
scene := SceneMgrSingleton.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public,
|
scene := SceneMgrSingleton.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public,
|
||||||
1, -1, params, gs, limitPlatform, pool.groupId, pool.dbGameFree, pool.id)
|
1, -1, params, gs, limitPlatform, 0, pool.dbGameFree, pool.ID())
|
||||||
return scene
|
return scene
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ func (l *CoinScenePoolLocal) NewScene(pool *CoinScenePool, p *Player) *Scene {
|
||||||
}
|
}
|
||||||
|
|
||||||
scene := SceneMgrSingleton.CreateLocalGameScene(p.SnId, sceneId, gameId, gameSite, common.SceneMode_Public, 1, common.CopySliceInt32ToInt64(params),
|
scene := SceneMgrSingleton.CreateLocalGameScene(p.SnId, sceneId, gameId, gameSite, common.SceneMode_Public, 1, common.CopySliceInt32ToInt64(params),
|
||||||
gs, limitPlatform, 0, pool.dbGameFree, baseScore, pool.groupId, pool.id)
|
gs, limitPlatform, 0, pool.dbGameFree, baseScore, 0, pool.ID())
|
||||||
return scene
|
return scene
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -285,7 +285,7 @@ func (l *CoinScenePoolLocal) NewPreCreateScene(pool *CoinScenePool) *Scene {
|
||||||
}
|
}
|
||||||
if baseScore != 0 {
|
if baseScore != 0 {
|
||||||
scene = SceneMgrSingleton.CreateLocalGameScene(0, sceneId, gameId, gameSite, common.SceneMode_Public, 1, common.CopySliceInt32ToInt64(params),
|
scene = SceneMgrSingleton.CreateLocalGameScene(0, sceneId, gameId, gameSite, common.SceneMode_Public, 1, common.CopySliceInt32ToInt64(params),
|
||||||
gs, limitPlatform, playerNum, pool.dbGameFree, baseScore, pool.groupId, pool.id)
|
gs, limitPlatform, playerNum, pool.dbGameFree, baseScore, 0, pool.ID())
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
logger.Logger.Tracef("CreateLocalGameScene success.gameId:%v gameSite:%v baseScore:%v randIdx:%v", scene.gameId, scene.gameSite, baseScore, randIdx)
|
logger.Logger.Tracef("CreateLocalGameScene success.gameId:%v gameSite:%v baseScore:%v randIdx:%v", scene.gameId, scene.gameSite, baseScore, randIdx)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
116
worldsrv/etcd.go
116
worldsrv/etcd.go
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.etcd.io/etcd/client/v3"
|
"go.etcd.io/etcd/client/v3"
|
||||||
"mongo.games.com/goserver/core/basic"
|
"mongo.games.com/goserver/core/basic"
|
||||||
|
|
@ -88,6 +87,12 @@ func init() {
|
||||||
etcd.Register(etcd.ETCDKEY_RANK_TYPE, webapi.RankTypeConfig{}, platformConfigEvent)
|
etcd.Register(etcd.ETCDKEY_RANK_TYPE, webapi.RankTypeConfig{}, platformConfigEvent)
|
||||||
//获奖记录配置
|
//获奖记录配置
|
||||||
etcd.Register(etcd.ETCDKEY_AWARD_CONFIG, webapi.AwardLogConfig{}, platformConfigEvent)
|
etcd.Register(etcd.ETCDKEY_AWARD_CONFIG, webapi.AwardLogConfig{}, platformConfigEvent)
|
||||||
|
// 新手引导
|
||||||
|
etcd.Register(etcd.ETCDKEY_GUIDE, webapi.GuideConfig{}, platformConfigEvent)
|
||||||
|
// 比赛观众
|
||||||
|
etcd.Register(etcd.ETCDKEY_MatchAudience, webapi.MatchAudience{}, handlerEvent)
|
||||||
|
// 小精灵配置
|
||||||
|
etcd.Register(etcd.ETCDKEY_Spirit, webapi.SpiritConfig{}, platformConfigEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||||
|
|
@ -115,11 +120,7 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
||||||
PlatformMgrSingleton.GetConfig(config.Platform).CommonNotices = config
|
PlatformMgrSingleton.GetConfig(config.Platform).CommonNotices = config
|
||||||
if !isInit {
|
if !isInit {
|
||||||
// 通知公共变更
|
// 通知公共变更
|
||||||
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
|
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(hallproto.GameHallPacketID_PACKET_SC_NoticeChange), &hallproto.SCNoticeChange{})
|
||||||
if v != nil && v.IsOnLine() {
|
|
||||||
v.SendToClient(int(hallproto.GameHallPacketID_PACKET_SC_NoticeChange), &hallproto.SCNoticeChange{})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case *webapi.GameConfigGlobal:
|
case *webapi.GameConfigGlobal:
|
||||||
if isInit {
|
if isInit {
|
||||||
|
|
@ -188,16 +189,12 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
||||||
PlatformMgrSingleton.GetConfig(config.Platform).ChannelSwitch[config.GetTp()] = config
|
PlatformMgrSingleton.GetConfig(config.Platform).ChannelSwitch[config.GetTp()] = config
|
||||||
if !isInit {
|
if !isInit {
|
||||||
// 通知变更
|
// 通知变更
|
||||||
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
|
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(playerproto.PlayerPacketID_PACKET_SCExchangeChannel), &playerproto.SCExchangeChannel{
|
||||||
if v != nil && v.IsOnLine() {
|
Datas: []*playerproto.ChannelSwitch{{
|
||||||
v.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCExchangeChannel), &playerproto.SCExchangeChannel{
|
Tp: config.Tp,
|
||||||
Datas: []*playerproto.ChannelSwitch{{
|
OnChannelName: config.OnChannelName,
|
||||||
Tp: config.Tp,
|
}},
|
||||||
OnChannelName: config.OnChannelName,
|
})
|
||||||
}},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case *webapi.GameConfigGroup:
|
case *webapi.GameConfigGroup:
|
||||||
PlatformGameGroupMgrSington.UpsertGameGroup(config)
|
PlatformGameGroupMgrSington.UpsertGameGroup(config)
|
||||||
|
|
@ -245,36 +242,40 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
||||||
PlatformMgrSingleton.GetConfig(config.Platform).PermitStartTs = startTs
|
PlatformMgrSingleton.GetConfig(config.Platform).PermitStartTs = startTs
|
||||||
PlatformMgrSingleton.GetConfig(config.Platform).PermitEndTs = endTs
|
PlatformMgrSingleton.GetConfig(config.Platform).PermitEndTs = endTs
|
||||||
}
|
}
|
||||||
f := func() {
|
f1 := func() {
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
if st.StartTs <= 0 || st.EndTs <= 0 {
|
||||||
if st.StartTs <= 0 || st.EndTs <= 0 {
|
return
|
||||||
return nil
|
}
|
||||||
}
|
b, err := json.Marshal(st)
|
||||||
b, err := json.Marshal(st)
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("permit startts save error: %v", err)
|
||||||
|
} else {
|
||||||
|
logger.Logger.Infof("update permit startts: %v %v", st.StartTs, st.EndTs)
|
||||||
|
err := model.UptStrKVGameData(common.PermitStartTsKey+config.Platform, string(b))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Logger.Errorf("permit startts save error: %v", err)
|
logger.Logger.Errorf("permit startts update error:%v", err)
|
||||||
} else {
|
|
||||||
logger.Logger.Infof("update permit startts: %v %v", st.StartTs, st.EndTs)
|
|
||||||
err := model.UptStrKVGameData(common.PermitStartTsKey+config.Platform, string(b))
|
|
||||||
if err != nil {
|
|
||||||
logger.Logger.Errorf("permit startts update error:%v", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil
|
}
|
||||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
}
|
||||||
if st.StartTs > 0 {
|
f2 := func() {
|
||||||
LogChannelSingleton.WriteLog(&model.BackendPermitCycle{
|
if st.StartTs > 0 {
|
||||||
Platform: config.Platform,
|
LogChannelSingleton.WriteLog(&model.BackendPermitCycle{
|
||||||
StartTs: st.StartTs,
|
Platform: config.Platform,
|
||||||
EndTs: st.EndTs - 1,
|
StartTs: st.StartTs,
|
||||||
})
|
EndTs: st.EndTs - 1,
|
||||||
}
|
})
|
||||||
})).StartByExecutor("permit_start_ts")
|
}
|
||||||
}
|
}
|
||||||
if isInit {
|
if isInit {
|
||||||
time.AfterFunc(time.Second*5, f) //todo 优化
|
f1()
|
||||||
|
f2()
|
||||||
} else {
|
} else {
|
||||||
f()
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
f1()
|
||||||
|
return nil
|
||||||
|
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||||
|
f2()
|
||||||
|
})).StartByExecutor("permit_start_ts")
|
||||||
}
|
}
|
||||||
|
|
||||||
case *webapi.ItemConfig:
|
case *webapi.ItemConfig:
|
||||||
|
|
@ -305,13 +306,9 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if len(items) > 0 {
|
if len(items) > 0 {
|
||||||
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
|
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(playerproto.PlayerPacketID_PACKET_SCItem), &playerproto.SCItem{
|
||||||
if v != nil && v.IsOnLine() {
|
Items: items,
|
||||||
v.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCItem), &playerproto.SCItem{
|
})
|
||||||
Items: items,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -321,10 +318,24 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
||||||
PlatformMgrSingleton.GetConfig(config.Platform).RankTypeConfig = config
|
PlatformMgrSingleton.GetConfig(config.Platform).RankTypeConfig = config
|
||||||
case *webapi.AwardLogConfig:
|
case *webapi.AwardLogConfig:
|
||||||
PlatformMgrSingleton.GetConfig(config.Platform).AwardLogConfig = config
|
PlatformMgrSingleton.GetConfig(config.Platform).AwardLogConfig = config
|
||||||
|
case *webapi.GuideConfig:
|
||||||
|
PlatformMgrSingleton.GetConfig(config.Platform).GuideConfig = config
|
||||||
|
case *webapi.SpiritConfig:
|
||||||
|
PlatformMgrSingleton.GetConfig(config.Platform).SpiritConfig = config
|
||||||
|
if !isInit {
|
||||||
|
PlayerMgrSington.BroadcastMessageToPlatform(config.Platform, int(playerproto.PlayerPacketID_PACKET_SCDataConfig), &playerproto.SCDataConfig{
|
||||||
|
Cfg: []*playerproto.Config{
|
||||||
|
{
|
||||||
|
Tp: 1,
|
||||||
|
On: config.GetOn() == 1,
|
||||||
|
Value: config.GetUrl(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||||
|
|
@ -389,6 +400,13 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
|
||||||
if isInit || event.Type == clientv3.EventTypePut {
|
if isInit || event.Type == clientv3.EventTypePut {
|
||||||
ActMgrSington.AddGiveConfig(config, config.Platform)
|
ActMgrSington.AddGiveConfig(config, config.Platform)
|
||||||
}
|
}
|
||||||
|
case *webapi.MatchAudience:
|
||||||
|
switch event.Type {
|
||||||
|
case clientv3.EventTypePut:
|
||||||
|
PlatformMgrSingleton.AddMatchAudience(config)
|
||||||
|
case clientv3.EventTypeDelete:
|
||||||
|
PlatformMgrSingleton.DelMatchAudience(config)
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ func (this *GameSessMgr) OnRegiste(s *netlib.Session) {
|
||||||
}
|
}
|
||||||
gs.OnRegiste()
|
gs.OnRegiste()
|
||||||
//尝试创建百人场
|
//尝试创建百人场
|
||||||
HundredSceneMgrSington.TryCreateRoom()
|
HundredSceneMgrSingleton.TryCreateRoom()
|
||||||
}
|
}
|
||||||
} else if srvInfo.GetType() == srvlib.GateServiceType {
|
} else if srvInfo.GetType() == srvlib.GateServiceType {
|
||||||
logger.Logger.Warn("(this *GameSessMgr) OnRegiste (GateSrv):", s)
|
logger.Logger.Warn("(this *GameSessMgr) OnRegiste (GateSrv):", s)
|
||||||
|
|
|
||||||
|
|
@ -10,383 +10,193 @@ import (
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
gamehall_proto "mongo.games.com/game/protocol/gamehall"
|
gamehallproto "mongo.games.com/game/protocol/gamehall"
|
||||||
server_proto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/game/protocol/webapi"
|
"mongo.games.com/game/protocol/webapi"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
HundredSceneType_Primary int = iota //初级
|
HundredSceneOPEnter int32 = iota //进入
|
||||||
HundredSceneType_Mid //中级
|
HundredSceneOPLeave //离开
|
||||||
HundredSceneType_Senior //高级
|
HundredSceneOPChange //换桌
|
||||||
HundredSceneType_Professor //专家
|
|
||||||
HundredSceneType_Experience //体验场
|
|
||||||
HundredSceneType_Max
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
var HundredSceneMgrSingleton = &HundredSceneMgr{
|
||||||
HundredSceneOp_Enter int32 = iota //进入
|
|
||||||
HundredSceneOp_Leave //离开
|
|
||||||
HundredSceneOp_Change //换桌
|
|
||||||
HundredSceneOp_Audience //观战
|
|
||||||
)
|
|
||||||
|
|
||||||
var HundredSceneMgrSington = &HundredSceneMgr{
|
|
||||||
//分平台管理
|
|
||||||
scenesOfPlatform: make(map[string]map[int32]*Scene),
|
scenesOfPlatform: make(map[string]map[int32]*Scene),
|
||||||
platformOfScene: make(map[int32]string),
|
|
||||||
//分组管理
|
|
||||||
scenesOfGroup: make(map[int32]map[int32]*Scene),
|
|
||||||
groupOfScene: make(map[int32]int32),
|
|
||||||
playerIning: make(map[int32]int32),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type HundredSceneMgr struct {
|
type HundredSceneMgr struct {
|
||||||
//分平台管理
|
|
||||||
scenesOfPlatform map[string]map[int32]*Scene // platform:gamefreeid:房间
|
scenesOfPlatform map[string]map[int32]*Scene // platform:gamefreeid:房间
|
||||||
platformOfScene map[int32]string // sceneid:platform
|
|
||||||
//分组管理
|
|
||||||
scenesOfGroup map[int32]map[int32]*Scene // groupid:gamefreeid:房间
|
|
||||||
groupOfScene map[int32]int32 // sceneid:groupid
|
|
||||||
playerIning map[int32]int32 // snid:sceneid
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) GetPlatformNameBySceneId(sceneid int32) (string, bool) {
|
// PlayerEnter 玩家进入场次
|
||||||
if name, exist := this.platformOfScene[sceneid]; exist {
|
// id 场次id
|
||||||
return name, exist
|
func (this *HundredSceneMgr) PlayerEnter(p *Player, id int32) gamehallproto.OpResultCode_Hundred {
|
||||||
}
|
logger.Logger.Tracef("HundredSceneMgr PlayerEnter snid:%v gamefreeid:%v", p.SnId, id)
|
||||||
if _, exist := this.groupOfScene[sceneid]; exist {
|
if p.isDelete {
|
||||||
s := SceneMgrSingleton.GetScene(int(sceneid))
|
return gamehallproto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
|
||||||
if s != nil && s.limitPlatform != nil {
|
|
||||||
return s.limitPlatform.IdStr, true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return DefaultPlatform, false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HundredSceneMgr) RebindPlayerSnId(oldSnId, newSnId int32) {
|
|
||||||
if id, exist := this.playerIning[oldSnId]; exist {
|
|
||||||
delete(this.playerIning, oldSnId)
|
|
||||||
this.playerIning[newSnId] = id
|
|
||||||
}
|
|
||||||
for _, ss := range this.scenesOfPlatform {
|
|
||||||
for _, s := range ss {
|
|
||||||
s.RebindPlayerSnId(oldSnId, newSnId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for _, ss := range this.scenesOfGroup {
|
|
||||||
for _, s := range ss {
|
|
||||||
s.RebindPlayerSnId(oldSnId, newSnId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HundredSceneMgr) PlayerEnter(p *Player, id int32) gamehall_proto.OpResultCode_Hundred {
|
|
||||||
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter snid:%v id:%v", p.SnId, id)
|
|
||||||
if oid, exist := this.playerIning[p.SnId]; exist {
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter:%v snid:%v find in id:%v PlayerEnter return false", id, p.SnId, oid)
|
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_Error_Hundred
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.scene != nil {
|
if this.InHundredScene(p) {
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter:%v snid:%v find in id:%v PlayerEnter return false", id, p.SnId, p.scene.sceneId)
|
logger.Logger.Warnf("HundredSceneMgr PlayerEnter snid:%v find in gamefreeid:%v roomId:%v", p.SnId, p.scene.dbGameFree.Id, p.scene.sceneId)
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_Error_Hundred
|
return gamehallproto.OpResultCode_Hundred_OPRC_Error_Hundred
|
||||||
}
|
|
||||||
|
|
||||||
if p.isDelete { //删档用户不让进游戏
|
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//多平台支持
|
//多平台支持
|
||||||
var limitPlatform *Platform
|
platform := p.GetPlatform()
|
||||||
platformName := DefaultPlatform
|
if platform == nil {
|
||||||
platform := PlatformMgrSingleton.GetPlatform(p.Platform)
|
return gamehallproto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
|
||||||
if platform != nil && platform.Isolated {
|
|
||||||
platformName = platform.IdStr
|
|
||||||
limitPlatform = platform
|
|
||||||
} else {
|
|
||||||
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gps := PlatformMgrSingleton.GetGameFree(limitPlatform.IdStr, id)
|
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
|
||||||
if gps == nil {
|
if gps == nil {
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
|
return gamehallproto.OpResultCode_Hundred_OPRC_RoomHadClosed_Hundred
|
||||||
}
|
}
|
||||||
|
|
||||||
if gps.GroupId != 0 { //按分组进入场景游戏
|
|
||||||
pgg := PlatformGameGroupMgrSington.GetGameGroup(gps.GroupId)
|
|
||||||
if pgg != nil {
|
|
||||||
if _, ok := this.scenesOfGroup[gps.GroupId]; !ok {
|
|
||||||
this.scenesOfGroup[gps.GroupId] = make(map[int32]*Scene)
|
|
||||||
|
|
||||||
}
|
|
||||||
if ss, ok := this.scenesOfGroup[gps.GroupId]; ok {
|
|
||||||
if s, ok := ss[id]; !ok {
|
|
||||||
s = this.CreateNewScene(id, gps.GroupId, limitPlatform, pgg.DbGameFree)
|
|
||||||
if s != nil {
|
|
||||||
ss[id] = s
|
|
||||||
this.groupOfScene[int32(s.sceneId)] = gps.GroupId
|
|
||||||
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(groupid=%v) Create %v scene success.", gps.GroupId, id)
|
|
||||||
} else {
|
|
||||||
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(groupid=%v) Create %v scene failed.", gps.GroupId, id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//尝试进入
|
|
||||||
if s, ok := ss[id]; ok && s != nil {
|
|
||||||
if s.PlayerEnter(p, -1, true) {
|
|
||||||
this.OnPlayerEnter(p, id)
|
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_Sucess_Hundred
|
|
||||||
} else {
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(groupid=%v) enter %v scene failed.", gps.GroupId, id)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(groupid=%v) get %v scene failed.", gps.GroupId, id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(groupid=%v) snid:%v find in id:%v csp.PlayerEnter return false", gps.GroupId, p.SnId, id)
|
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_Error_Hundred
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//没有场景,尝试创建
|
//没有场景,尝试创建
|
||||||
if _, ok := this.scenesOfPlatform[platformName]; !ok {
|
if _, ok := this.scenesOfPlatform[platform.IdStr]; !ok {
|
||||||
this.scenesOfPlatform[platformName] = make(map[int32]*Scene)
|
this.scenesOfPlatform[platform.IdStr] = make(map[int32]*Scene)
|
||||||
}
|
}
|
||||||
if ss, ok := this.scenesOfPlatform[platformName]; ok {
|
ss := this.scenesOfPlatform[platform.IdStr]
|
||||||
if s, ok := ss[id]; !ok {
|
if s, ok := ss[id]; !ok || s == nil {
|
||||||
s = this.CreateNewScene(id, gps.GroupId, limitPlatform, gps.DbGameFree)
|
s = this.CreateNewScene(id, gps.GroupId, platform, gps.DbGameFree)
|
||||||
if s != nil {
|
if s != nil {
|
||||||
ss[id] = s
|
ss[id] = s
|
||||||
this.platformOfScene[int32(s.sceneId)] = platformName
|
s.hp = this
|
||||||
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(platform=%v) Create %v scene success.", platformName, id)
|
logger.Logger.Infof("HundredSceneMgr PlayerEnter(platform=%v snid=%v) Create %v scene success.", platform.IdStr, p.SnId, id)
|
||||||
} else {
|
|
||||||
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerEnter(platform=%v) Create %v scene failed.", platformName, id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//尝试进入
|
|
||||||
if s, ok := ss[id]; ok && s != nil {
|
|
||||||
if s.PlayerEnter(p, -1, true) {
|
|
||||||
this.OnPlayerEnter(p, id)
|
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_Sucess_Hundred
|
|
||||||
} else {
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(platform=%v) enter %v scene failed.", platformName, id)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(platform=%v) get %v scene failed.", platformName, id)
|
logger.Logger.Errorf("HundredSceneMgr PlayerEnter(platform=%v snid=%v) Create %v scene failed.", platform.IdStr, p.SnId, id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerEnter(platform=%v) snid:%v find in id:%v csp.PlayerEnter return false", platformName, p.SnId, id)
|
//尝试进入
|
||||||
return gamehall_proto.OpResultCode_Hundred_OPRC_SceneServerMaintain_Hundred
|
if s, ok := ss[id]; ok && s != nil {
|
||||||
}
|
if s.PlayerEnter(p, -1, true) {
|
||||||
|
logger.Logger.Infof("HundredSceneMgr PlayerEnter(platform=%v snid=%v) enter %v scene success.", platform.IdStr, p.SnId, id)
|
||||||
func (this *HundredSceneMgr) OnPlayerEnter(p *Player, id int32) {
|
return gamehallproto.OpResultCode_Hundred_OPRC_Sucess_Hundred
|
||||||
this.playerIning[p.SnId] = id
|
} else {
|
||||||
|
logger.Logger.Errorf("HundredSceneMgr PlayerEnter(platform=%v snid=%v) enter %v scene failed.", platform.IdStr, p.SnId, id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.Logger.Errorf("HundredSceneMgr PlayerEnter(platform=%v) get %v scene failed.", platform.IdStr, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
return gamehallproto.OpResultCode_Hundred_OPRC_SceneServerMaintain_Hundred
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PlayerLeave 离开房间
|
||||||
|
// 游戏服通知玩家离开房间
|
||||||
func (this *HundredSceneMgr) PlayerLeave(p *Player, reason int) bool {
|
func (this *HundredSceneMgr) PlayerLeave(p *Player, reason int) bool {
|
||||||
if p == nil {
|
if p == nil || p.scene == nil || p.scene.hp == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if _, ok := this.playerIning[p.SnId]; ok {
|
|
||||||
if p.scene != nil {
|
p.scene.PlayerLeave(p, reason)
|
||||||
p.scene.PlayerLeave(p, reason)
|
|
||||||
} else {
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerLeave(%v) found scene=nil", p.SnId)
|
|
||||||
delete(this.playerIning, p.SnId)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} else {
|
|
||||||
if p.scene != nil && p.scene.IsHundredScene() {
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerLeave(%v) exception scene=%v gameid=%v", p.SnId, p.scene.sceneId, p.scene.gameId)
|
|
||||||
p.scene.PlayerLeave(p, reason)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) PlayerLeave(%v) not found in hundred scene", p.SnId)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) PlayerTryLeave(p *Player) gamehall_proto.OpResultCode_Hundred {
|
// PlayerTryLeave 玩家尝试离开房间
|
||||||
if p.scene == nil || p.scene.gameSess == nil {
|
// 给游戏服发离开消息
|
||||||
logger.Logger.Tracef("(csm *HundredSceneMgr) PlayerTryLeave p.scene == nil || p.scene.gameSess == nil snid:%v ", p.SnId)
|
func (this *HundredSceneMgr) PlayerTryLeave(p *Player) gamehallproto.OpResultCode_Hundred {
|
||||||
return 1
|
if !this.InHundredScene(p) {
|
||||||
|
logger.Logger.Tracef("(this *HundredSceneMgr) PlayerTryLeave !csm.InCoinScene(p) snid:%v ", p.SnId)
|
||||||
|
return gamehallproto.OpResultCode_Hundred_OPRC_Sucess_Hundred
|
||||||
}
|
}
|
||||||
//通知gamesrv托管
|
|
||||||
if _, ok := this.playerIning[p.SnId]; ok {
|
pack := &gamehallproto.CSLeaveRoom{Mode: proto.Int(0)}
|
||||||
pack := &gamehall_proto.CSLeaveRoom{Mode: proto.Int(0)}
|
common.TransmitToServer(p.sid, int(gamehallproto.GameHallPacketID_PACKET_CS_LEAVEROOM), pack, p.scene.gameSess.Session)
|
||||||
proto.SetDefaults(pack)
|
return gamehallproto.OpResultCode_Hundred_OPRC_Sucess_Hundred // ???
|
||||||
common.TransmitToServer(p.sid, int(gamehall_proto.GameHallPacketID_PACKET_CS_LEAVEROOM), pack, p.scene.gameSess.Session)
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnPlayerLeave(p *Player) {
|
// OnDestroyScene 房间销毁
|
||||||
delete(this.playerIning, p.SnId)
|
func (this *HundredSceneMgr) OnDestroyScene(sceneId int) {
|
||||||
}
|
s := SceneMgrSingleton.GetScene(sceneId)
|
||||||
|
if s == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
plt := SceneMgrSingleton.GetPlatformBySceneId(sceneId)
|
||||||
|
if plt == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ss, ok := this.scenesOfPlatform[plt]; ok {
|
||||||
|
for id, scene := range ss {
|
||||||
|
if scene.sceneId == sceneId {
|
||||||
|
if scene != s {
|
||||||
|
logger.Logger.Errorf("bug")
|
||||||
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnDestroyScene(sceneid int) {
|
//删除玩家
|
||||||
var s *Scene
|
for _, v := range scene.players {
|
||||||
if platformName, ok := this.platformOfScene[int32(sceneid)]; ok {
|
if v != nil {
|
||||||
if ss, ok := this.scenesOfPlatform[platformName]; ok {
|
if !v.IsRob {
|
||||||
for id, scene := range ss {
|
ctx := scene.GetPlayerGameCtx(v.SnId)
|
||||||
if scene.sceneId == sceneid {
|
if ctx != nil {
|
||||||
s = scene
|
//发送一个探针,等待ack后同步金币
|
||||||
//删除玩家
|
v.TryRetrieveLostGameCoin(sceneId)
|
||||||
for pid, hid := range this.playerIning {
|
logger.Logger.Warnf("(this *HundredSceneMgr) OnDestroyScene(sceneid:%v) snid:%v SyncGameCoin", sceneId, v.SnId)
|
||||||
if hid == id {
|
|
||||||
delete(this.playerIning, pid)
|
|
||||||
//TODO 非正常删除房间时,尝试同步金币
|
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(pid)
|
|
||||||
if player != nil {
|
|
||||||
if !player.IsRob {
|
|
||||||
ctx := scene.GetPlayerGameCtx(player.SnId)
|
|
||||||
if ctx != nil {
|
|
||||||
//发送一个探针,等待ack后同步金币
|
|
||||||
player.TryRetrieveLostGameCoin(sceneid)
|
|
||||||
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) OnDestroyScene(sceneid:%v) snid:%v SyncGameCoin", sceneid, player.SnId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete(ss, id)
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scene.hp = nil
|
||||||
|
delete(ss, id)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if groupId, ok := this.groupOfScene[int32(sceneid)]; ok {
|
this.tryCreateRoom(plt, s.dbGameFree.Id)
|
||||||
if ss, ok := this.scenesOfGroup[groupId]; ok {
|
|
||||||
for id, scene := range ss {
|
|
||||||
if scene.sceneId == sceneid {
|
|
||||||
s = scene
|
|
||||||
//删除玩家
|
|
||||||
for pid, hid := range this.playerIning {
|
|
||||||
if hid == id {
|
|
||||||
delete(this.playerIning, pid)
|
|
||||||
//TODO 非正常删除房间时,尝试同步金币
|
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(pid)
|
|
||||||
if player != nil {
|
|
||||||
if !player.IsRob {
|
|
||||||
ctx := scene.GetPlayerGameCtx(player.SnId)
|
|
||||||
if ctx != nil {
|
|
||||||
//发送一个探针,等待ack后同步金币
|
|
||||||
player.TryRetrieveLostGameCoin(sceneid)
|
|
||||||
logger.Logger.Warnf("(this *HundredSceneMgr) OnDestroyScene(sceneid:%v) snid:%v SyncGameCoin", sceneid, player.SnId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete(ss, id)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.PreCreateGame(s.limitPlatform.IdStr, []int32{s.dbGameFree.Id})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
|
func (this *HundredSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32 {
|
||||||
//多平台支持
|
//多平台支持
|
||||||
platformName := DefaultPlatform
|
platform := p.GetPlatform()
|
||||||
platform := PlatformMgrSingleton.GetPlatform(p.Platform)
|
var nums [10]int32
|
||||||
if platform != nil && platform.Isolated {
|
wantNum := [10]int32{80, 50, 30, 20, 10, 10, 10, 10, 10, 10}
|
||||||
platformName = platform.IdStr
|
for i := 0; i < 10; i++ {
|
||||||
} else if p.Platform != DefaultPlatform {
|
|
||||||
platform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
|
||||||
}
|
|
||||||
|
|
||||||
var nums [HundredSceneType_Max]int32
|
|
||||||
wantNum := []int32{80, 50, 30, 20, 0}
|
|
||||||
for i := 0; i < HundredSceneType_Max; i++ {
|
|
||||||
if wantNum[i]/2 > 0 {
|
if wantNum[i]/2 > 0 {
|
||||||
nums[i] = rand.Int31n(wantNum[i]/2) + wantNum[i]
|
nums[i] = rand.Int31n(wantNum[i]/2) + wantNum[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if platform == nil {
|
if platform == nil {
|
||||||
return nums[:]
|
return nums[:]
|
||||||
}
|
}
|
||||||
|
|
||||||
ids, _ := srvdata.GameFreeMgr.GetGameFreeIds(gameId, gameMode)
|
ids, _ := srvdata.GameFreeMgr.GetGameFreeIds(gameId, gameMode)
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
|
gps := PlatformMgrSingleton.GetGameFree(platform.IdStr, id)
|
||||||
if gps != nil {
|
if gps != nil {
|
||||||
if gps.GroupId != 0 {
|
if ss, ok := this.scenesOfPlatform[platform.IdStr]; ok {
|
||||||
if ss, exist := this.scenesOfGroup[gps.GroupId]; exist {
|
if s, exist := ss[id]; exist && s.dbGameFree != nil {
|
||||||
for _, s := range ss {
|
sceneType := s.dbGameFree.GetSceneType() - 1
|
||||||
if s.paramsEx[0] == id {
|
if sceneType >= 0 && int(sceneType) < len(nums) {
|
||||||
dbGame := srvdata.PBDB_GameFreeMgr.GetData(s.paramsEx[0])
|
nums[sceneType] += int32(s.GetPlayerCnt())
|
||||||
sceneType := int(dbGame.GetSceneType()) - 1
|
|
||||||
if sceneType == -2 {
|
|
||||||
//体验场
|
|
||||||
sceneType = HundredSceneType_Experience
|
|
||||||
}
|
|
||||||
truePlayerCount := int32(s.GetPlayerCnt())
|
|
||||||
|
|
||||||
//获取fake用户数量
|
|
||||||
var fakePlayerCount int32
|
|
||||||
//if truePlayerCount >= 21 {
|
|
||||||
// correctNum := dbGame.GetCorrectNum()
|
|
||||||
// correctRate := dbGame.GetCorrectRate()
|
|
||||||
// fakePlayerCount = correctNum + truePlayerCount*correctRate/100 + dbGame.GetDeviation()
|
|
||||||
//}
|
|
||||||
if sceneType >= 0 && sceneType < HundredSceneType_Max {
|
|
||||||
nums[sceneType] += int32(truePlayerCount + fakePlayerCount)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ss, ok := this.scenesOfPlatform[platformName]; ok {
|
|
||||||
for _, s := range ss {
|
|
||||||
if s.paramsEx[0] == id {
|
|
||||||
dbGame := srvdata.PBDB_GameFreeMgr.GetData(s.paramsEx[0])
|
|
||||||
sceneType := int(dbGame.GetSceneType()) - 1
|
|
||||||
if sceneType == -2 {
|
|
||||||
//体验场
|
|
||||||
sceneType = HundredSceneType_Experience
|
|
||||||
}
|
|
||||||
truePlayerCount := int32(s.GetPlayerCnt())
|
|
||||||
|
|
||||||
//获取fake用户数量
|
|
||||||
var fakePlayerCount int32
|
|
||||||
//if truePlayerCount >= 21 {
|
|
||||||
// correctNum := dbGame.GetCorrectNum()
|
|
||||||
// correctRate := dbGame.GetCorrectRate()
|
|
||||||
// fakePlayerCount = correctNum + truePlayerCount*correctRate/100 + dbGame.GetDeviation()
|
|
||||||
//}
|
|
||||||
if sceneType >= 0 && sceneType < HundredSceneType_Max {
|
|
||||||
nums[sceneType] += int32(truePlayerCount + fakePlayerCount)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(ids) <= 10 {
|
||||||
|
return nums[:len(ids)]
|
||||||
|
}
|
||||||
return nums[:]
|
return nums[:]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) InHundredScene(p *Player) bool {
|
func (this *HundredSceneMgr) InHundredScene(p *Player) bool {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
logger.Logger.Tracef("(this *HundredSceneMgr) InHundredScene p == nil snid:%v ", p.SnId)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if _, ok := this.playerIning[p.SnId]; ok {
|
if p.scene == nil {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
logger.Logger.Tracef("(csm *HundredSceneMgr) InHundredScene false snid:%v ", p.SnId)
|
if p.scene.hp == nil {
|
||||||
return false
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Platform, dbGameFree *server_proto.DB_GameFree) *Scene {
|
func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Platform, dbGameFree *serverproto.DB_GameFree) *Scene {
|
||||||
if dbGameFree != nil {
|
if dbGameFree != nil {
|
||||||
dbGameRule := srvdata.PBDB_GameRuleMgr.GetData(dbGameFree.GetGameRule())
|
dbGameRule := srvdata.PBDB_GameRuleMgr.GetData(dbGameFree.GetGameRule())
|
||||||
if dbGameRule != nil {
|
if dbGameRule != nil {
|
||||||
|
|
@ -396,16 +206,11 @@ func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Pl
|
||||||
sceneId := SceneMgrSingleton.GenOneHundredSceneId()
|
sceneId := SceneMgrSingleton.GenOneHundredSceneId()
|
||||||
gameMode := dbGameRule.GetGameMode()
|
gameMode := dbGameRule.GetGameMode()
|
||||||
params := common.CopySliceInt32ToInt64(dbGameRule.GetParams())
|
params := common.CopySliceInt32ToInt64(dbGameRule.GetParams())
|
||||||
//SceneType := dbGameFree.GetSceneType()
|
|
||||||
|
|
||||||
scene := SceneMgrSingleton.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public, 1, -1, params, gs, limitPlatform, groupId, dbGameFree, id)
|
scene := SceneMgrSingleton.CreateScene(0, 0, sceneId, gameId, int(gameMode), common.SceneMode_Public, 1, -1, params, gs, limitPlatform, groupId, dbGameFree, id)
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
|
logger.Logger.Infof("Create hundred scene %v-%v success.", gameId, sceneId)
|
||||||
scene.hallId = id
|
scene.hallId = id
|
||||||
//移动到SceneMgr中集中处理
|
scene.hp = this
|
||||||
//if !scene.IsMatchScene() {
|
|
||||||
// //平台水池设置
|
|
||||||
// gs.DetectCoinPoolSetting(limitPlatform.Name, scene.hallId, scene.groupId)
|
|
||||||
//}
|
|
||||||
return scene
|
return scene
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Errorf("Create hundred scene %v-%v failed.", gameId, sceneId)
|
logger.Logger.Errorf("Create hundred scene %v-%v failed.", gameId, sceneId)
|
||||||
|
|
@ -419,135 +224,144 @@ func (this *HundredSceneMgr) CreateNewScene(id, groupId int32, limitPlatform *Pl
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Errorf("Game free data %v no found.", id)
|
logger.Logger.Errorf("Game free data %v no found.", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) TryCreateRoom() {
|
func (this *HundredSceneMgr) tryCreateRoom(plt string, id ...int32) {
|
||||||
if model.GameParamData.HundredScenePreCreate {
|
limitPlatform := PlatformMgrSingleton.GetPlatform(plt)
|
||||||
arr := srvdata.PBDB_GameFreeMgr.Datas.GetArr()
|
|
||||||
for _, dbGame := range arr {
|
|
||||||
if dbGame.GetGameId() <= 0 {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if common.IsHundredType(dbGame.GetGameType()) { //百人场
|
|
||||||
id := dbGame.GetId()
|
|
||||||
for k, ss := range this.scenesOfPlatform {
|
|
||||||
if _, exist := ss[id]; !exist {
|
|
||||||
limitPlatform := PlatformMgrSingleton.GetPlatform(k)
|
|
||||||
if limitPlatform == nil || !limitPlatform.Isolated {
|
|
||||||
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
|
||||||
k = DefaultPlatform
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
gps := PlatformMgrSingleton.GetGameFree(limitPlatform.IdStr, id)
|
|
||||||
if gps != nil && gps.GroupId == 0 && gps.Status {
|
|
||||||
scene := this.CreateNewScene(id, gps.GroupId, limitPlatform, gps.DbGameFree)
|
|
||||||
logger.Logger.Trace("(this *HundredSceneMgr) TryCreateRoom(platform) ", id, k, scene)
|
|
||||||
if scene != nil {
|
|
||||||
this.platformOfScene[int32(scene.sceneId)] = k
|
|
||||||
ss[id] = scene
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (this *HundredSceneMgr) PreCreateGame(platform string, createIds []int32) {
|
|
||||||
limitPlatform := PlatformMgrSingleton.GetPlatform(platform)
|
|
||||||
if limitPlatform == nil || !limitPlatform.Isolated {
|
if limitPlatform == nil || !limitPlatform.Isolated {
|
||||||
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
limitPlatform = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
||||||
}
|
}
|
||||||
if this.scenesOfPlatform[platform] == nil {
|
if this.scenesOfPlatform[plt] == nil {
|
||||||
this.scenesOfPlatform[platform] = make(map[int32]*Scene)
|
this.scenesOfPlatform[plt] = make(map[int32]*Scene)
|
||||||
}
|
}
|
||||||
//var platformName string
|
if limitPlatform.IdStr == DefaultPlatform {
|
||||||
platformData := PlatformMgrSingleton.GetPlatform(platform)
|
|
||||||
if platformData != nil && platformData.Isolated {
|
|
||||||
//platformName = platformData.Name
|
|
||||||
} else if platform != DefaultPlatform {
|
|
||||||
platformData = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
|
||||||
}
|
|
||||||
if platformData.IdStr == DefaultPlatform {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if model.GameParamData.HundredScenePreCreate {
|
|
||||||
//不创建已经存在的场景
|
|
||||||
for _, id := range createIds {
|
|
||||||
dbGame := srvdata.PBDB_GameFreeMgr.GetData(id)
|
|
||||||
if common.IsHundredType(dbGame.GetGameType()) {
|
|
||||||
gps := PlatformMgrSingleton.GetGameFree(platformData.IdStr, id)
|
|
||||||
if gps != nil && gps.Status {
|
|
||||||
if gps.GroupId != 0 {
|
|
||||||
if this.scenesOfGroup[gps.GroupId] != nil && this.scenesOfGroup[gps.GroupId][id] != nil {
|
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
scene := this.CreateNewScene(dbGame.GetId(), gps.GroupId, limitPlatform, gps.DbGameFree)
|
|
||||||
if scene != nil {
|
|
||||||
this.scenesOfGroup[gps.GroupId][id] = scene
|
|
||||||
this.groupOfScene[int32(scene.sceneId)] = gps.GroupId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
f := func(i int32) {
|
||||||
if this.scenesOfPlatform[platform] != nil && this.scenesOfPlatform[platform][dbGame.GetId()] != nil {
|
if this.scenesOfPlatform[plt][i] != nil {
|
||||||
continue
|
return
|
||||||
} else {
|
}
|
||||||
scene := this.CreateNewScene(dbGame.GetId(), gps.GroupId, limitPlatform, gps.DbGameFree)
|
gps := PlatformMgrSingleton.GetGameFree(plt, i)
|
||||||
if scene != nil {
|
if !common.IsHundredType(gps.GetDbGameFree().GetGameType()) {
|
||||||
this.platformOfScene[int32(scene.sceneId)] = platform
|
return
|
||||||
this.scenesOfPlatform[platform][dbGame.GetId()] = scene
|
}
|
||||||
}
|
scene := this.CreateNewScene(i, gps.GroupId, limitPlatform, gps.DbGameFree)
|
||||||
}
|
if scene != nil {
|
||||||
}
|
this.scenesOfPlatform[plt][i] = scene
|
||||||
}
|
scene.hp = this
|
||||||
}
|
logger.Logger.Infof("HundredSceneMgr PreCreateRoom Platform:%v Id:%v", plt, i)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(id) == 0 {
|
||||||
|
// 所有百人场
|
||||||
|
for _, vv := range srvdata.PBDB_GameFreeMgr.Datas.GetArr() {
|
||||||
|
f(vv.GetId())
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for _, v := range id {
|
||||||
|
f(v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (this *HundredSceneMgr) OnPlatformCreate(p *Platform) {
|
|
||||||
if p != nil && p.Isolated && p.IdStr != DefaultPlatform {
|
// TryCreateRoom 预创建房间
|
||||||
if _, exist := this.scenesOfPlatform[p.IdStr]; !exist {
|
func (this *HundredSceneMgr) TryCreateRoom() {
|
||||||
this.scenesOfPlatform[p.IdStr] = make(map[int32]*Scene)
|
if !model.GameParamData.HundredScenePreCreate {
|
||||||
if model.GameParamData.HundredScenePreCreate {
|
return
|
||||||
arr := srvdata.PBDB_GameFreeMgr.Datas.GetArr()
|
}
|
||||||
for _, dbGame := range arr {
|
|
||||||
if common.IsHundredType(dbGame.GetGameType()) { //百人场
|
for _, v := range PlatformMgrSingleton.GetPlatforms() {
|
||||||
id := dbGame.GetId()
|
this.tryCreateRoom(v.IdStr)
|
||||||
gps := PlatformMgrSingleton.GetGameFree(p.IdStr, id)
|
}
|
||||||
if gps != nil {
|
}
|
||||||
if gps.GroupId != 0 {
|
|
||||||
if ss, ok := this.scenesOfGroup[gps.GroupId]; ok {
|
func (this *HundredSceneMgr) OnPlatformChangeIsolated(p *Platform, isolated bool) {
|
||||||
if _, exist := ss[id]; !exist {
|
if p == nil {
|
||||||
pgg := PlatformGameGroupMgrSington.GetGameGroup(gps.GroupId)
|
return
|
||||||
if pgg != nil {
|
}
|
||||||
scene := this.CreateNewScene(id, gps.GroupId, p, pgg.DbGameFree)
|
if isolated { //孤立
|
||||||
logger.Logger.Trace("(this *HundredSceneMgr) TryCreateRoom(group) ", id, gps.GroupId, scene)
|
this.OnPlatformCreate(p) //预创建场景
|
||||||
if scene != nil {
|
} else {
|
||||||
ss[id] = scene
|
this.OnPlatformDestroy(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
func (this *HundredSceneMgr) GetPlatformSceneByGameFreeId(platform string, gameFreeIds []int32) []*Scene {
|
||||||
} else {
|
platformName := DefaultPlatform
|
||||||
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
platformData := PlatformMgrSingleton.GetPlatform(platform)
|
||||||
if _, exist := ss[id]; !exist {
|
if platformData != nil && platformData.Isolated {
|
||||||
scene := this.CreateNewScene(id, gps.GroupId, p, gps.DbGameFree)
|
platformName = platformData.IdStr
|
||||||
logger.Logger.Trace("(this *HundredSceneMgr) TryCreateRoom(platform) ", id, p.Name, scene)
|
} else if platform != DefaultPlatform {
|
||||||
if scene != nil {
|
platformData = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
||||||
ss[id] = scene
|
}
|
||||||
}
|
|
||||||
}
|
if platformData == nil {
|
||||||
}
|
return nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
var scenes []*Scene
|
||||||
|
for _, id := range gameFreeIds {
|
||||||
|
gps := PlatformMgrSingleton.GetGameFree(platformData.IdStr, id)
|
||||||
|
if gps != nil {
|
||||||
|
if ss, ok := this.scenesOfPlatform[platformName]; ok {
|
||||||
|
if s, exist := ss[id]; exist && s != nil {
|
||||||
|
scenes = append(scenes, s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return scenes
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *HundredSceneMgr) GetPlatformScene(platform string, gameId int32) []*Scene {
|
||||||
|
gameFreeIds := gameStateMgr.gameIds[gameId]
|
||||||
|
gameScenes := this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
|
||||||
|
if len(gameScenes) != len(gameFreeIds) {
|
||||||
|
var createIds []int32
|
||||||
|
for _, gfi := range gameFreeIds {
|
||||||
|
bFind := false
|
||||||
|
for _, s := range gameScenes {
|
||||||
|
if s.dbGameFree.GetId() == gfi {
|
||||||
|
bFind = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !bFind {
|
||||||
|
createIds = append(createIds, gfi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(createIds) > 0 {
|
||||||
|
this.tryCreateRoom(platform, createIds...)
|
||||||
|
gameScenes = this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return gameScenes
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *HundredSceneMgr) ModuleName() string {
|
||||||
|
return "HundredSceneMgr"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *HundredSceneMgr) Init() {
|
||||||
|
this.TryCreateRoom()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *HundredSceneMgr) Update() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *HundredSceneMgr) Shutdown() {
|
||||||
|
module.UnregisteModule(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *HundredSceneMgr) OnPlatformCreate(p *Platform) {
|
||||||
|
if model.GameParamData.HundredScenePreCreate {
|
||||||
|
this.tryCreateRoom(p.IdStr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnPlatformDestroy(p *Platform) {
|
func (this *HundredSceneMgr) OnPlatformDestroy(p *Platform) {
|
||||||
|
|
@ -563,34 +377,12 @@ func (this *HundredSceneMgr) OnPlatformDestroy(p *Platform) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnPlatformChangeIsolated(p *Platform, isolated bool) {
|
|
||||||
if p != nil {
|
|
||||||
if isolated { //孤立
|
|
||||||
this.OnPlatformCreate(p) //预创建场景
|
|
||||||
} else {
|
|
||||||
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
|
||||||
var ids []int
|
|
||||||
for _, scene := range ss {
|
|
||||||
ids = append(ids, scene.sceneId)
|
|
||||||
}
|
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
|
func (this *HundredSceneMgr) OnPlatformChangeDisabled(p *Platform, disabled bool) {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if disabled {
|
if disabled {
|
||||||
if ss, ok := this.scenesOfPlatform[p.IdStr]; ok {
|
this.OnPlatformDestroy(p)
|
||||||
var ids []int
|
|
||||||
for _, scene := range ss {
|
|
||||||
ids = append(ids, scene.sceneId)
|
|
||||||
}
|
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -598,14 +390,6 @@ func (this *HundredSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCf
|
||||||
if p == nil || newCfg == nil {
|
if p == nil || newCfg == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if oldCfg.GroupId != newCfg.GroupId || oldCfg.GroupId != 0 {
|
|
||||||
if scenes, exist := this.scenesOfGroup[oldCfg.GroupId]; exist {
|
|
||||||
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
|
||||||
s.DoDelete(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if scenes, exist := this.scenesOfPlatform[p.IdStr]; exist {
|
if scenes, exist := this.scenesOfPlatform[p.IdStr]; exist {
|
||||||
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
||||||
s.DoDelete(false)
|
s.DoDelete(false)
|
||||||
|
|
@ -614,99 +398,7 @@ func (this *HundredSceneMgr) OnPlatformGameFreeUpdate(p *Platform, oldCfg, newCf
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
|
func (this *HundredSceneMgr) OnGameGroupUpdate(oldCfg, newCfg *webapi.GameConfigGroup) {
|
||||||
if newCfg == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if scenes, exist := this.scenesOfGroup[newCfg.Id]; exist {
|
|
||||||
if s, ok := scenes[newCfg.DbGameFree.Id]; ok {
|
|
||||||
needDestroy := false
|
|
||||||
if s.dbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
|
|
||||||
s.dbGameFree.GetBaseScore() != newCfg.DbGameFree.GetBaseScore() ||
|
|
||||||
s.dbGameFree.GetLimitCoin() != newCfg.DbGameFree.GetLimitCoin() ||
|
|
||||||
s.dbGameFree.GetMaxCoinLimit() != newCfg.DbGameFree.GetMaxCoinLimit() ||
|
|
||||||
!common.SliceInt64Equal(s.dbGameFree.GetRobotTakeCoin(), newCfg.DbGameFree.GetRobotTakeCoin()) ||
|
|
||||||
!common.SliceInt64Equal(s.dbGameFree.GetRobotLimitCoin(), newCfg.DbGameFree.GetRobotLimitCoin()) {
|
|
||||||
needDestroy = true
|
|
||||||
}
|
|
||||||
if needDestroy {
|
|
||||||
SceneMgrSingleton.DoDelete([]int{s.sceneId}, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (this *HundredSceneMgr) GetPlatformSceneByGameFreeId(platform string, gameFreeIds []int32) []*Scene {
|
|
||||||
platformName := DefaultPlatform
|
|
||||||
platformData := PlatformMgrSingleton.GetPlatform(platform)
|
|
||||||
if platformData != nil && platformData.Isolated {
|
|
||||||
platformName = platformData.IdStr
|
|
||||||
} else if platform != DefaultPlatform {
|
|
||||||
platformData = PlatformMgrSingleton.GetPlatform(DefaultPlatform)
|
|
||||||
}
|
|
||||||
gameScenes := []*Scene{}
|
|
||||||
for _, id := range gameFreeIds {
|
|
||||||
gps := PlatformMgrSingleton.GetGameFree(platformData.IdStr, id)
|
|
||||||
if gps != nil {
|
|
||||||
if gps.GroupId != 0 {
|
|
||||||
if ss, exist := this.scenesOfGroup[gps.GroupId]; exist {
|
|
||||||
if s, exist := ss[id]; exist && s != nil {
|
|
||||||
gameScenes = append(gameScenes, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ss, ok := this.scenesOfPlatform[platformName]; ok {
|
|
||||||
if s, exist := ss[id]; exist && s != nil {
|
|
||||||
gameScenes = append(gameScenes, s)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return gameScenes
|
|
||||||
}
|
|
||||||
func (this *HundredSceneMgr) GetPlatformScene(platform string, gameid int32) []*Scene {
|
|
||||||
gameFreeIds := gameStateMgr.gameIds[gameid]
|
|
||||||
gameScenes := this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
|
|
||||||
if len(gameScenes) != len(gameFreeIds) {
|
|
||||||
createIds := []int32{}
|
|
||||||
for _, gfi := range gameFreeIds {
|
|
||||||
bFind := false
|
|
||||||
for _, s := range gameScenes {
|
|
||||||
if s.dbGameFree.GetId() == gfi {
|
|
||||||
bFind = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !bFind {
|
|
||||||
createIds = append(createIds, gfi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(createIds) > 0 {
|
|
||||||
this.PreCreateGame(platform, createIds)
|
|
||||||
gameScenes = this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return gameScenes
|
|
||||||
}
|
|
||||||
func (this *HundredSceneMgr) ModuleName() string {
|
|
||||||
return "HundredSceneMgr"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HundredSceneMgr) Init() {
|
|
||||||
for _, platform := range PlatformMgrSingleton.GetPlatforms() {
|
|
||||||
if platform.Isolated || platform.IdStr == DefaultPlatform {
|
|
||||||
this.scenesOfPlatform[platform.IdStr] = make(map[int32]*Scene)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 撮合
|
|
||||||
func (this *HundredSceneMgr) Update() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HundredSceneMgr) Shutdown() {
|
|
||||||
module.UnregisteModule(this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
|
func (this *HundredSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFreeId int32) {
|
||||||
|
|
@ -723,8 +415,9 @@ func (this *HundredSceneMgr) OnPlatformDestroyByGameFreeId(p *Platform, gameFree
|
||||||
SceneMgrSingleton.DoDelete(ids, true)
|
SceneMgrSingleton.DoDelete(ids, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
module.RegisteModule(HundredSceneMgrSington, time.Second*5, 0)
|
module.RegisteModule(HundredSceneMgrSingleton, time.Second*5, 0)
|
||||||
PlatformMgrSingleton.RegisterObserver(HundredSceneMgrSington)
|
PlatformMgrSingleton.RegisterObserver(HundredSceneMgrSingleton)
|
||||||
PlatformGameGroupMgrSington.RegisteObserver(HundredSceneMgrSington)
|
PlatformGameGroupMgrSington.RegisteObserver(HundredSceneMgrSingleton)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,4 +69,7 @@ func init() {
|
||||||
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitExchange, &model.BackendPermitExchange{})
|
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitExchange, &model.BackendPermitExchange{})
|
||||||
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitJoin, &model.BackendPermitJoin{})
|
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitJoin, &model.BackendPermitJoin{})
|
||||||
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitTask, &model.BackendPermitTask{})
|
LogChannelSingleton.RegisterLogCName(mq.BackSystemPermitTask, &model.BackendPermitTask{})
|
||||||
|
LogChannelSingleton.RegisterLogCName(mq.BackClientLog, &model.ClientLogMysql{})
|
||||||
|
LogChannelSingleton.RegisterLogCName(mq.BackSystemJyb, &model.JybLog{})
|
||||||
|
LogChannelSingleton.RegisterLogCName(mq.DBVipGiftLog, &model.DbVip{})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ type PlayerMatchContext struct {
|
||||||
copySnid int32
|
copySnid int32
|
||||||
copyLv int32
|
copyLv int32
|
||||||
copyRoleId int32
|
copyRoleId int32
|
||||||
|
copySkinId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
type MatchContextSlice []*PlayerMatchContext
|
type MatchContextSlice []*PlayerMatchContext
|
||||||
|
|
@ -39,22 +40,22 @@ func (p MatchContextSlice) Sort(isFinals bool) {
|
||||||
for i, mc := range p {
|
for i, mc := range p {
|
||||||
mc.rank = int32(i + 1)
|
mc.rank = int32(i + 1)
|
||||||
}
|
}
|
||||||
if isFinals {
|
//if isFinals {
|
||||||
// 积分相同名次相同
|
// // 积分相同名次相同
|
||||||
lastRank := int32(0)
|
// lastRank := int32(0)
|
||||||
lastGrade := int32(0)
|
// lastGrade := int32(0)
|
||||||
for i := 0; i < len(p); i++ {
|
// for i := 0; i < len(p); i++ {
|
||||||
mc := p[i]
|
// mc := p[i]
|
||||||
if i > 0 && mc.grade == lastGrade {
|
// if i > 0 && mc.grade == lastGrade {
|
||||||
mc.rank = lastRank
|
// mc.rank = lastRank
|
||||||
}
|
// }
|
||||||
lastRank = mc.rank
|
// lastRank = mc.rank
|
||||||
lastGrade = mc.grade
|
// lastGrade = mc.grade
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMatchContext(p *Player, tm *TmMatch, grade, snid, lv, roleId int32, seq int) *PlayerMatchContext {
|
func NewMatchContext(p *Player, tm *TmMatch, grade, snid, lv, roleId, skinId int32, seq int) *PlayerMatchContext {
|
||||||
if !p.IsRob {
|
if !p.IsRob {
|
||||||
snid = p.SnId
|
snid = p.SnId
|
||||||
}
|
}
|
||||||
|
|
@ -67,5 +68,6 @@ func NewMatchContext(p *Player, tm *TmMatch, grade, snid, lv, roleId int32, seq
|
||||||
copySnid: snid,
|
copySnid: snid,
|
||||||
copyLv: lv,
|
copyLv: lv,
|
||||||
copyRoleId: roleId,
|
copyRoleId: roleId,
|
||||||
|
copySkinId: skinId,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@ func (ms *MatchSceneMgr) MatchStart(tm *TmMatch) {
|
||||||
}
|
}
|
||||||
// 填充机器人
|
// 填充机器人
|
||||||
if scene != nil && !scene.IsFull() {
|
if scene != nil && !scene.IsFull() {
|
||||||
tm.RobotGradesDecline(1)
|
|
||||||
needRobotNum := scene.playerNum - len(scene.players)
|
needRobotNum := scene.playerNum - len(scene.players)
|
||||||
logger.Logger.Trace("MatchStart 填充机器人", needRobotNum)
|
logger.Logger.Trace("MatchStart 填充机器人", needRobotNum)
|
||||||
pack := &server.WGInviteMatchRob{
|
pack := &server.WGInviteMatchRob{
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ func (cfg *GameList) GetGameConfig(gameFreeId int32) *webapiproto.GameFree {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func CompareGameFreeConfigChged(oldCfg, newCfg *webapiproto.GameFree) bool {
|
func CompareGameFreeConfigChanged(oldCfg, newCfg *webapiproto.GameFree) bool {
|
||||||
if oldCfg.Status != newCfg.Status ||
|
if oldCfg.Status != newCfg.Status ||
|
||||||
oldCfg.GroupId != newCfg.GroupId ||
|
oldCfg.GroupId != newCfg.GroupId ||
|
||||||
oldCfg.DbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
|
oldCfg.DbGameFree.GetBot() != newCfg.DbGameFree.GetBot() ||
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ func (pm *PlatformMgr) UpsertGameFree(platform string, data *webapiproto.GameFre
|
||||||
pgc.gameId[data.DbGameFree.Id] = append(pgc.gameId[data.DbGameFree.Id], data)
|
pgc.gameId[data.DbGameFree.Id] = append(pgc.gameId[data.DbGameFree.Id], data)
|
||||||
}
|
}
|
||||||
// 新增的场次不会通知
|
// 新增的场次不会通知
|
||||||
if ok && old != nil && !CompareGameFreeConfigChged(old, data) {
|
if ok && old != nil && !CompareGameFreeConfigChanged(old, data) {
|
||||||
pm.OnPlatformGameFreeUpdate(p, old, data)
|
pm.OnPlatformGameFreeUpdate(p, old, data)
|
||||||
pm.SyncGameFree(p.IdStr, data)
|
pm.SyncGameFree(p.IdStr, data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -340,6 +340,13 @@ func (this *Player) OnLogined() {
|
||||||
this.RandRobotExData()
|
this.RandRobotExData()
|
||||||
|
|
||||||
if !this.IsRob {
|
if !this.IsRob {
|
||||||
|
if isFirstLogin {
|
||||||
|
cfg := PlatformMgrSingleton.GetConfig(this.Platform).GuideConfig
|
||||||
|
if cfg == nil || cfg.GetOn() != common.On {
|
||||||
|
this.GuideStep = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.SendJackPotInit()
|
this.SendJackPotInit()
|
||||||
|
|
||||||
this.GetPayGoodsInfo()
|
this.GetPayGoodsInfo()
|
||||||
|
|
@ -1594,7 +1601,7 @@ func (this *Player) DgGameLogout() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) ThirdGameLogout() {
|
func (this *Player) ThirdGameLogout() {
|
||||||
_LeaveTransferThird2SystemTask(this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) IsOnLine() bool {
|
func (this *Player) IsOnLine() bool {
|
||||||
|
|
@ -3022,6 +3029,7 @@ func (this *Player) SendPlayerInfo() {
|
||||||
VipShopRefreshCount: proto.Int32(this.VipShopRefreshCount),
|
VipShopRefreshCount: proto.Int32(this.VipShopRefreshCount),
|
||||||
Signature: this.Signature,
|
Signature: this.Signature,
|
||||||
Age: this.Age,
|
Age: this.Age,
|
||||||
|
GuideStep: this.GuideStep,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if this.Roles != nil {
|
if this.Roles != nil {
|
||||||
|
|
@ -3088,8 +3096,13 @@ func (this *Player) SendPlayerInfo() {
|
||||||
if this.scene != nil && this.thrscene == 0 {
|
if this.scene != nil && this.thrscene == 0 {
|
||||||
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
|
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
|
||||||
}
|
}
|
||||||
this.SCItems()
|
|
||||||
//this.SendJackpotInfo()
|
//this.SendJackpotInfo()
|
||||||
|
// 后台道具配置
|
||||||
|
this.SCItems()
|
||||||
|
// 引导配置
|
||||||
|
this.SCGuide()
|
||||||
|
// 小精灵配置
|
||||||
|
this.SCSpirit()
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (this *Player) SendJackpotInfo() {
|
//func (this *Player) SendJackpotInfo() {
|
||||||
|
|
@ -3680,8 +3693,6 @@ func (this *Player) TryRetrieveLostGameCoin(sceneid int) {
|
||||||
logProbe.SeqNo = this.GameCoinTs
|
logProbe.SeqNo = this.GameCoinTs
|
||||||
logProbe.RoomId = int32(sceneid)
|
logProbe.RoomId = int32(sceneid)
|
||||||
LogChannelSingleton.WriteLog(logProbe)
|
LogChannelSingleton.WriteLog(logProbe)
|
||||||
//先把玩家身上的钱清掉
|
|
||||||
//this.Coin = 0
|
|
||||||
this.SendDiffData()
|
this.SendDiffData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3766,17 +3777,24 @@ func (this *Player) SCVIPInfo() {
|
||||||
LineId: cfg.RewardOutlineID,
|
LineId: cfg.RewardOutlineID,
|
||||||
ShopId2: cfg.ShopId2,
|
ShopId2: cfg.ShopId2,
|
||||||
ShopId7: cfg.ShopId7,
|
ShopId7: cfg.ShopId7,
|
||||||
MatchFreeTimes: cfg.MatchFreeTimes + this.GetSkillAdd(common.SkillIdVipTimes),
|
MatchFreeTimes: cfg.MatchFreeTimes,
|
||||||
|
Privilege9: cfg.Privilege9,
|
||||||
}
|
}
|
||||||
money := cfg.Privilege1[0]
|
d := srvdata.PBDB_VIPMgr.GetData(cfg.VipId)
|
||||||
// 皮肤技能加成
|
if d != nil {
|
||||||
add := this.GetSkillAdd(common.SkillIdVipGift)
|
data.PrivilegeShow = d.GetPrivilegeShow()
|
||||||
if add > 0 {
|
}
|
||||||
money += int32((float64(money) * float64(add)) / 100.00)
|
data.Privilege1 = make(map[int64]int64)
|
||||||
|
for k, v := range cfg.Privilege1 {
|
||||||
|
if k == common.ItemIDCoin {
|
||||||
|
// 皮肤技能加成
|
||||||
|
add := this.GetSkillAdd(common.SkillIdVipGift)
|
||||||
|
if add > 0 {
|
||||||
|
//v += int64((float64(v) * float64(add)) / 100.00)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.Privilege1[k] = v
|
||||||
}
|
}
|
||||||
data.Privilege1 = make([]int32, len(cfg.Privilege1))
|
|
||||||
copy(data.Privilege1, cfg.Privilege1)
|
|
||||||
data.Privilege1[0] = money
|
|
||||||
for itemId, itemNum := range cfg.Award {
|
for itemId, itemNum := range cfg.Award {
|
||||||
data.Item = append(data.Item, &playerproto.ItemInfo{
|
data.Item = append(data.Item, &playerproto.ItemInfo{
|
||||||
ItemId: int32(itemId),
|
ItemId: int32(itemId),
|
||||||
|
|
@ -3789,10 +3807,11 @@ func (this *Player) SCVIPInfo() {
|
||||||
ItemNum: itemNum,
|
ItemNum: itemNum,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
data.BagStatus = make([]int32, 3)
|
data.BagStatus = make([]int32, 4)
|
||||||
data.BagStatus[0] = 0 //每日礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
data.BagStatus[0] = 0 //每日礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
||||||
data.BagStatus[1] = 0 //每日金币礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
data.BagStatus[1] = 0 //每日金币礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
||||||
data.BagStatus[2] = this.GetPlayerVipBagStatus(cfg.ShopId7, cfg.VipId) //固定VIP礼包 0可领取 1不可领取 可以领取所有VIP等级的奖励
|
data.BagStatus[2] = this.GetPlayerVipBagStatus(cfg.ShopId7, cfg.VipId) //固定VIP礼包 0可领取 1不可领取 可以领取所有VIP等级的奖励
|
||||||
|
data.BagStatus[3] = this.GetPlayerVipBagStatus(1, cfg.VipId) // 等级礼包 0可领取 1不可领取
|
||||||
if cfg.VipId != this.VIP {
|
if cfg.VipId != this.VIP {
|
||||||
data.BagStatus[0] = 1 //每日礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
data.BagStatus[0] = 1 //每日礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
||||||
data.BagStatus[1] = 1 //每日金币礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
data.BagStatus[1] = 1 //每日金币礼包 0可领取 1不可领取 只能领取当前VIP等级的
|
||||||
|
|
@ -3812,70 +3831,124 @@ func (this *Player) SCVIPInfo() {
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPINFO), pack)
|
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPINFO), pack)
|
||||||
logger.Logger.Tracef("send vipinfo to client:%v", pack)
|
logger.Logger.Tracef("send vipinfo to client:%v", pack)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) GetVIPExpByPay(payTotal int32) int32 {
|
func (this *Player) GetVIPExpByPay(payTotal int32) int32 {
|
||||||
vips := VipMgrSington.GetVIPcfg(this.Platform)
|
vips := VipMgrSington.GetVIPcfg(this.Platform)
|
||||||
return int32(math.Floor(float64(payTotal) * vips.MoneyRatio / 100))
|
return int32(math.Floor(float64(payTotal) * vips.MoneyRatio / 100))
|
||||||
}
|
}
|
||||||
func (this *Player) VIPDraw(id int32) {
|
|
||||||
//WelfareMgrSington.MonitorWelfData(this)
|
func (this *Player) VIPDraw(id, vip int32) {
|
||||||
pack := &playerproto.SCVIPDraw{
|
pack := &playerproto.SCVIPDraw{
|
||||||
Id: id,
|
Id: id,
|
||||||
OpRetCode: playerproto.OpResultCode_OPRC_Error,
|
OpRetCode: playerproto.OpResultCode_OPRC_Error,
|
||||||
|
Award: make(map[int64]int64),
|
||||||
}
|
}
|
||||||
if id != 0 {
|
send := func() {
|
||||||
|
pack.Vip = vip
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
|
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
|
||||||
|
logger.Logger.Tracef("send vipdraw to client:%v", pack)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.WelfData.VIPBag == nil {
|
if this.WelfData.VIPBag == nil {
|
||||||
this.WelfData.VIPBag = make(map[int32]map[int32]int32)
|
this.WelfData.VIPBag = make(map[int32]map[int32]int32)
|
||||||
}
|
}
|
||||||
if innerMap, ok := this.WelfData.VIPBag[this.VIP]; ok {
|
|
||||||
if _, ok := innerMap[0]; ok {
|
|
||||||
logger.Logger.Trace("VIPDraw VIP is repeat id%v ", id)
|
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.WelfData.VIPBag[this.VIP] = make(map[int32]int32)
|
|
||||||
}
|
|
||||||
|
|
||||||
vips := VipMgrSington.GetVIPcfg(this.Platform)
|
switch id {
|
||||||
if vips != nil {
|
case 0: // 每日礼包只能领当前VIP等级的
|
||||||
for _, data := range vips.List {
|
vip = this.VIP
|
||||||
if data.VipId == this.VIP {
|
if innerMap, ok := this.WelfData.VIPBag[vip]; ok {
|
||||||
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
|
if _, ok := innerMap[id]; ok {
|
||||||
this.WelfData.VIPBag[this.VIP][0] = 1
|
logger.Logger.Trace("VIPDraw VIP is repeat id%v ", id)
|
||||||
//金币数量
|
send()
|
||||||
money := data.Privilege1[0]
|
return
|
||||||
// 皮肤技能加成
|
|
||||||
add := this.GetSkillAdd(common.SkillIdVipGift)
|
|
||||||
if add > 0 {
|
|
||||||
money += int32((float64(money) * float64(add)) / 100.00)
|
|
||||||
}
|
|
||||||
//vip经验
|
|
||||||
addVipExp := int64(float64(data.Privilege1[1]) / vips.MoneyRatio)
|
|
||||||
this.AddCoin(int64(money), 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
|
|
||||||
this.AddMoneyPayTotal(addVipExp)
|
|
||||||
pack.Vip = this.VIP
|
|
||||||
logger.Logger.Tracef("玩家领取VIP每日礼包成功!snid = %v,Vip = %v,金币数量 = %v,addVipEx = %v", this.SnId, this.VIP, money, addVipExp)
|
|
||||||
//VIP礼包统计数据
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
var item []model.ItemInfo
|
|
||||||
item = append(item, model.ItemInfo{ItemId: 1, ItemNum: int64(money)})
|
|
||||||
log := model.NewDbVip(this.Platform, this.SnId, this.VIP, 0, 0, 0, item, 0, "Vip每日礼包")
|
|
||||||
return model.InsertDbVipLog(log)
|
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
|
||||||
if data != nil {
|
|
||||||
logger.Logger.Errorf("err:", data.(error))
|
|
||||||
}
|
|
||||||
}), "VIPDraw").Start()
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case 1: // VIP等级礼包
|
||||||
|
if this.GetPlayerVipBagStatus(1, vip) == 1 {
|
||||||
|
send()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
send()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
|
if this.WelfData.VIPBag[vip] == nil {
|
||||||
|
this.WelfData.VIPBag[vip] = make(map[int32]int32)
|
||||||
|
}
|
||||||
|
|
||||||
|
data := VipMgrSington.GetVipCfg(this.Platform, vip)
|
||||||
|
if data != nil {
|
||||||
|
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
|
||||||
|
this.WelfData.VIPBag[vip][id] = 1
|
||||||
|
switch id {
|
||||||
|
case 0:
|
||||||
|
var money, addVipExp int64
|
||||||
|
for k, v := range data.Privilege1 {
|
||||||
|
switch k {
|
||||||
|
case common.ItemIDCoin:
|
||||||
|
money = v
|
||||||
|
// 皮肤技能加成
|
||||||
|
add := this.GetSkillAdd(common.SkillIdVipGift)
|
||||||
|
if add > 0 {
|
||||||
|
money += int64((float64(money) * float64(add)) / 100.00)
|
||||||
|
}
|
||||||
|
this.AddCoin(money, 0, common.GainWay_VIPGift, "sys", "VIP每日礼包")
|
||||||
|
pack.Award[common.ItemIDCoin] = money
|
||||||
|
case common.ItemIDVipExp:
|
||||||
|
vips := VipMgrSington.GetVIPcfg(this.Platform)
|
||||||
|
addVipExp = int64(float64(v) / vips.MoneyRatio)
|
||||||
|
this.AddMoneyPayTotal(addVipExp)
|
||||||
|
pack.Award[common.ItemIDVipExp] = addVipExp
|
||||||
|
default:
|
||||||
|
BagMgrSingleton.AddItemsV2(&ItemParam{
|
||||||
|
P: this,
|
||||||
|
Change: []*Item{
|
||||||
|
{
|
||||||
|
ItemId: int32(k),
|
||||||
|
ItemNum: v,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
GainWay: common.GainWay_VIPGift,
|
||||||
|
Operator: "system",
|
||||||
|
Remark: "VIP每日礼包",
|
||||||
|
})
|
||||||
|
pack.Award[k] += v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.Logger.Tracef("玩家领取VIP每日礼包成功!snid = %v,Vip = %v,金币数量 = %v,addVipEx = %v", this.SnId, this.VIP, money, addVipExp)
|
||||||
|
//VIP礼包统计数据
|
||||||
|
var item []model.ItemInfo
|
||||||
|
item = append(item, model.ItemInfo{ItemId: 1, ItemNum: money})
|
||||||
|
log := model.NewDbVip(this.Platform, this.SnId, this.VIP, 0, 0, 0, item, 0, "Vip每日礼包")
|
||||||
|
LogChannelSingleton.WriteLog(log)
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
var items []*Item
|
||||||
|
var itemInfo []model.ItemInfo
|
||||||
|
for k, v := range data.Privilege9 {
|
||||||
|
items = append(items, &Item{
|
||||||
|
ItemId: int32(k),
|
||||||
|
ItemNum: v,
|
||||||
|
})
|
||||||
|
itemInfo = append(itemInfo, model.ItemInfo{ItemId: int32(k), ItemNum: v})
|
||||||
|
pack.Award[k] = v
|
||||||
|
}
|
||||||
|
BagMgrSingleton.AddItemsV2(&ItemParam{
|
||||||
|
P: this,
|
||||||
|
Change: items,
|
||||||
|
GainWay: common.GainWayVipGift9,
|
||||||
|
Operator: "system",
|
||||||
|
Remark: "VIP等级礼包",
|
||||||
|
})
|
||||||
|
logger.Logger.Tracef("玩家领取VIP等级礼包成功!snid = %v,Vip = %v,items %#v", this.SnId, this.VIP, items)
|
||||||
|
//VIP礼包统计数据
|
||||||
|
log := model.NewDbVip(this.Platform, this.SnId, this.VIP, 9, 0, 0, itemInfo, 0, "Vip等级礼包")
|
||||||
|
LogChannelSingleton.WriteLog(log)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
send()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp int64, money int64) {
|
func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp int64, money int64) {
|
||||||
|
|
@ -4058,8 +4131,11 @@ func (this *Player) GetPayGoodsInfo() {
|
||||||
BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false)
|
BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false)
|
||||||
|
|
||||||
PayGoodsInfo := &playerproto.SCPayGoodsInfo{
|
PayGoodsInfo := &playerproto.SCPayGoodsInfo{
|
||||||
Gold: info.Amount,
|
Gold: info.Amount,
|
||||||
Item: itemInfo,
|
Item: itemInfo,
|
||||||
|
ShopId: info.ShopId,
|
||||||
|
Money: int64(info.ConsumeTypeNum),
|
||||||
|
Name: info.Remark,
|
||||||
}
|
}
|
||||||
proto.SetDefaults(PayGoodsInfo)
|
proto.SetDefaults(PayGoodsInfo)
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo)
|
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo)
|
||||||
|
|
@ -4303,16 +4379,11 @@ func (this *Player) UpdatePlayerVipBag(shopId int32) {
|
||||||
}
|
}
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
|
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
|
||||||
//VIP金币礼包&VIP固定礼包统计数据
|
//VIP金币礼包&VIP固定礼包统计数据
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
var item []model.ItemInfo
|
||||||
var item []model.ItemInfo
|
item = append(item, model.ItemInfo{ItemId: shopInfo.Type, ItemNum: shopInfo.Amount})
|
||||||
item = append(item, model.ItemInfo{ItemId: shopInfo.Type, ItemNum: shopInfo.Amount})
|
log := model.NewDbVip(this.Platform, this.SnId, shopInfo.VipLevel, shopInfo.Type, shopInfo.ConstType,
|
||||||
log := model.NewDbVip(this.Platform, this.SnId, shopInfo.VipLevel, shopInfo.Type, shopInfo.ConstType, int64(shopInfo.CostArea[0]), item, shopInfo.Id, shopInfo.Name)
|
int64(shopInfo.CostArea[0]), item, shopInfo.Id, shopInfo.Name)
|
||||||
return model.InsertDbVipLog(log)
|
LogChannelSingleton.WriteLog(log)
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
|
||||||
if data != nil {
|
|
||||||
logger.Logger.Errorf("err:", data.(error))
|
|
||||||
}
|
|
||||||
}), "UpdatePlayerVipBag").Start()
|
|
||||||
}
|
}
|
||||||
//判断是否是礼包周卡
|
//判断是否是礼包周卡
|
||||||
if shopInfo.Page == ShopPageGift {
|
if shopInfo.Page == ShopPageGift {
|
||||||
|
|
@ -4323,7 +4394,7 @@ func (this *Player) UpdatePlayerVipBag(shopId int32) {
|
||||||
|
|
||||||
// 判断vip特权某个礼包是否领取过 返回值:0可领取 1 不可领取
|
// 判断vip特权某个礼包是否领取过 返回值:0可领取 1 不可领取
|
||||||
func (this *Player) GetPlayerVipBagStatus(shopId, vipLevel int32) int32 {
|
func (this *Player) GetPlayerVipBagStatus(shopId, vipLevel int32) int32 {
|
||||||
if vipLevel > this.VIP {
|
if vipLevel > this.VIP || vipLevel < 0 {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
if this.WelfData == nil || this.WelfData.VIPBag == nil {
|
if this.WelfData == nil || this.WelfData.VIPBag == nil {
|
||||||
|
|
@ -4343,14 +4414,16 @@ func (this *Player) UpdateVipShopData() {
|
||||||
this.VipShopRefreshCount = 0
|
this.VipShopRefreshCount = 0
|
||||||
//每日礼包 和每日金币礼包需要初始化
|
//每日礼包 和每日金币礼包需要初始化
|
||||||
if this.WelfData != nil && this.WelfData.VIPBag != nil {
|
if this.WelfData != nil && this.WelfData.VIPBag != nil {
|
||||||
delKeyList := []int32{}
|
var delKeyList []int32
|
||||||
for _, data := range this.WelfData.VIPBag {
|
for _, data := range this.WelfData.VIPBag {
|
||||||
for shopId, shopType := range data {
|
for shopId, shopType := range data {
|
||||||
if shopId == 0 {
|
switch shopId {
|
||||||
//初始化每日礼包
|
case 0: // 每日礼包
|
||||||
delKeyList = append(delKeyList, shopId)
|
delKeyList = append(delKeyList, shopId)
|
||||||
logger.Logger.Trace("初始化VIP每日礼包!!!!!!!")
|
logger.Logger.Trace("初始化VIP每日礼包!!!!!!!")
|
||||||
} else {
|
case 1: // 等级礼包,不需要重置
|
||||||
|
|
||||||
|
default:
|
||||||
if shopType == 1 {
|
if shopType == 1 {
|
||||||
delKeyList = append(delKeyList, shopId)
|
delKeyList = append(delKeyList, shopId)
|
||||||
logger.Logger.Trace("初始化VIP每日固定礼包!!!!!!!!!!")
|
logger.Logger.Trace("初始化VIP每日固定礼包!!!!!!!!!!")
|
||||||
|
|
@ -4867,3 +4940,31 @@ func (this *Player) AutoSkinUnlock() {
|
||||||
func (this *Player) GetSkillAdd(id int32) int32 {
|
func (this *Player) GetSkillAdd(id int32) int32 {
|
||||||
return this.GetSkillAdd2(id, PlatformMgrSingleton.ConfigMgr)
|
return this.GetSkillAdd2(id, PlatformMgrSingleton.ConfigMgr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Player) SCGuide() {
|
||||||
|
cfg := PlatformMgrSingleton.GetConfig(this.Platform).GuideConfig
|
||||||
|
pack := &playerproto.SCGuideConfig{
|
||||||
|
On: cfg.GetOn(),
|
||||||
|
Skip: cfg.GetSkip(),
|
||||||
|
}
|
||||||
|
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCGuideConfig), pack)
|
||||||
|
logger.Logger.Tracef("SCGuideConfig: %v", pack)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Player) SCSpirit() {
|
||||||
|
cfg := PlatformMgrSingleton.GetConfig(this.Platform).SpiritConfig
|
||||||
|
if cfg == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pack := &playerproto.SCDataConfig{
|
||||||
|
Cfg: []*playerproto.Config{
|
||||||
|
{
|
||||||
|
Tp: 1,
|
||||||
|
On: cfg.On == 1,
|
||||||
|
Value: cfg.Url,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCDataConfig), pack)
|
||||||
|
logger.Logger.Tracef("SCDataConfig: %v", pack)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,8 @@ type Scene struct {
|
||||||
BaseScore int32 //tienlen游戏底分
|
BaseScore int32 //tienlen游戏底分
|
||||||
matchId int64 //比赛场id
|
matchId int64 //比赛场id
|
||||||
|
|
||||||
csp *CoinScenePool // 所在场景池
|
csp *CoinScenePool // 所在场景池
|
||||||
|
hp *HundredSceneMgr // 百人场房间池
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewScene 创建房间
|
// NewScene 创建房间
|
||||||
|
|
@ -276,8 +277,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
||||||
case this.IsCoinScene():
|
case this.IsCoinScene():
|
||||||
|
|
||||||
case this.IsHundredScene():
|
case this.IsHundredScene():
|
||||||
// todo 删除这个标记
|
|
||||||
HundredSceneMgrSington.OnPlayerEnter(p, this.paramsEx[0])
|
|
||||||
case this.IsMatchScene():
|
case this.IsMatchScene():
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -293,7 +293,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
||||||
takeCoin := p.Coin
|
takeCoin := p.Coin
|
||||||
leaveCoin := int64(0)
|
leaveCoin := int64(0)
|
||||||
gameTimes := rand.Int31n(100)
|
gameTimes := rand.Int31n(100)
|
||||||
matchParams := []int32{} //排名、段位、假snid、假角色
|
matchParams := []int32{} //排名、段位、假snid、假角色、假皮肤
|
||||||
|
|
||||||
if this.IsMatchScene() && p.matchCtx != nil {
|
if this.IsMatchScene() && p.matchCtx != nil {
|
||||||
takeCoin = int64(p.matchCtx.grade)
|
takeCoin = int64(p.matchCtx.grade)
|
||||||
|
|
@ -304,7 +304,8 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
||||||
matchParams = append(matchParams, 1) //段位默认值
|
matchParams = append(matchParams, 1) //段位默认值
|
||||||
}
|
}
|
||||||
matchParams = append(matchParams, p.matchCtx.copySnid) //假snid
|
matchParams = append(matchParams, p.matchCtx.copySnid) //假snid
|
||||||
matchParams = append(matchParams, p.matchCtx.copyRoleId) //假snid
|
matchParams = append(matchParams, p.matchCtx.copyRoleId) //假RoleId
|
||||||
|
matchParams = append(matchParams, p.matchCtx.copySkinId) //假SkinId
|
||||||
} else {
|
} else {
|
||||||
if p.IsRob {
|
if p.IsRob {
|
||||||
if len(this.paramsEx) > 0 { //机器人携带金币动态调整
|
if len(this.paramsEx) > 0 { //机器人携带金币动态调整
|
||||||
|
|
@ -629,7 +630,6 @@ func (this *Scene) DelPlayer(p *Player) bool {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case this.IsHundredScene():
|
case this.IsHundredScene():
|
||||||
HundredSceneMgrSington.OnPlayerLeave(p)
|
|
||||||
//case this.IsHallScene():
|
//case this.IsHallScene():
|
||||||
// PlatformMgrSingleton.OnPlayerLeaveScene(this, p)
|
// PlatformMgrSingleton.OnPlayerLeaveScene(this, p)
|
||||||
// for i := 0; i < this.playerNum; i++ {
|
// for i := 0; i < this.playerNum; i++ {
|
||||||
|
|
@ -663,9 +663,7 @@ func (this *Scene) AudienceEnter(p *Player, ischangeroom bool) bool {
|
||||||
p.scene = this
|
p.scene = this
|
||||||
this.audiences[p.SnId] = p
|
this.audiences[p.SnId] = p
|
||||||
this.gameSess.AddPlayer(p)
|
this.gameSess.AddPlayer(p)
|
||||||
if this.IsHundredScene() {
|
|
||||||
HundredSceneMgrSington.OnPlayerEnter(p, this.paramsEx[0])
|
|
||||||
}
|
|
||||||
//todo:send add msg to gamesrv
|
//todo:send add msg to gamesrv
|
||||||
data, err := p.MarshalData(this.gameId)
|
data, err := p.MarshalData(this.gameId)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
@ -748,9 +746,6 @@ func (this *Scene) DelAudience(p *Player) bool {
|
||||||
}
|
}
|
||||||
p.scene = nil
|
p.scene = nil
|
||||||
SceneMgrSingleton.OnPlayerLeaveScene(this, p)
|
SceneMgrSingleton.OnPlayerLeaveScene(this, p)
|
||||||
if this.IsHundredScene() {
|
|
||||||
HundredSceneMgrSington.OnPlayerLeave(p)
|
|
||||||
}
|
|
||||||
//from gameserver, so don't need send msg
|
//from gameserver, so don't need send msg
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
@ -1023,6 +1018,7 @@ func (this *Scene) GetSceneName() string {
|
||||||
}
|
}
|
||||||
return "[unknow scene name]"
|
return "[unknow scene name]"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Scene) RandRobotCnt() {
|
func (this *Scene) RandRobotCnt() {
|
||||||
if len(this.paramsEx) > 0 {
|
if len(this.paramsEx) > 0 {
|
||||||
gps := PlatformMgrSingleton.GetGameFree(this.limitPlatform.IdStr, this.paramsEx[0])
|
gps := PlatformMgrSingleton.GetGameFree(this.limitPlatform.IdStr, this.paramsEx[0])
|
||||||
|
|
@ -1262,3 +1258,17 @@ func (this *Scene) TryForceDelectMatchInfo() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CanAudience 是否允许观战
|
||||||
|
func (this *Scene) CanAudience() bool {
|
||||||
|
switch {
|
||||||
|
case this.matchId > 0: // 比赛场
|
||||||
|
tm := TournamentMgr.GetTm(this.matchId)
|
||||||
|
if tm != nil {
|
||||||
|
return tm.gmd.GetAudienceSwitch() == 1
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
default:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,14 @@ type SceneMgr struct {
|
||||||
hundredSceneAutoId int // 百人场房间号
|
hundredSceneAutoId int // 百人场房间号
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *SceneMgr) GetPlatformBySceneId(sceneId int) string {
|
||||||
|
s := m.GetScene(sceneId)
|
||||||
|
if s != nil && s.limitPlatform != nil {
|
||||||
|
return s.limitPlatform.IdStr
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
// AllocReplayCode 获取回访码
|
// AllocReplayCode 获取回访码
|
||||||
func (m *SceneMgr) AllocReplayCode() string {
|
func (m *SceneMgr) AllocReplayCode() string {
|
||||||
code, _ := model.GetOneReplayId()
|
code, _ := model.GetOneReplayId()
|
||||||
|
|
@ -115,6 +123,19 @@ func (m *SceneMgr) GetScenesByGameFreeId(gameFreeId int32) []*Scene {
|
||||||
return scenes
|
return scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *SceneMgr) GetMatchRoom(sortId int64) []*Scene {
|
||||||
|
var scenes []*Scene
|
||||||
|
for _, value := range m.scenes {
|
||||||
|
if value.matchId == sortId {
|
||||||
|
s := m.GetScene(value.sceneId)
|
||||||
|
if s != nil {
|
||||||
|
scenes = append(scenes, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return scenes
|
||||||
|
}
|
||||||
|
|
||||||
// MarshalAllRoom 获取房间列表
|
// MarshalAllRoom 获取房间列表
|
||||||
func (m *SceneMgr) MarshalAllRoom(platform string, groupId, gameId int, gameMode, clubId, sceneMode, sceneId int,
|
func (m *SceneMgr) MarshalAllRoom(platform string, groupId, gameId int, gameMode, clubId, sceneMode, sceneId int,
|
||||||
gameFreeId, snId int32, start, end, pageSize int32) ([]*webapi2.RoomInfo, int32, int32) {
|
gameFreeId, snId int32, start, end, pageSize int32) ([]*webapi2.RoomInfo, int32, int32) {
|
||||||
|
|
@ -303,7 +324,7 @@ func (m *SceneMgr) DestroyScene(sceneId int, isCompleted bool) {
|
||||||
CoinSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
CoinSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
||||||
|
|
||||||
case s.IsHundredScene():
|
case s.IsHundredScene():
|
||||||
HundredSceneMgrSington.OnDestroyScene(s.sceneId)
|
HundredSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
||||||
|
|
||||||
case s.IsMatchScene():
|
case s.IsMatchScene():
|
||||||
MatchSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
MatchSceneMgrSingleton.OnDestroyScene(s.sceneId)
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ type ExchangeShopInfo struct {
|
||||||
TelCharge int32 //话费
|
TelCharge int32 //话费
|
||||||
ShopType int32 //商品类型
|
ShopType int32 //商品类型
|
||||||
TelData []*shop.TelChargeData //运营商配置
|
TelData []*shop.TelChargeData //运营商配置
|
||||||
|
Items []*shop.ItemInfo //道具
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ShopMgr) ModuleName() string {
|
func (this *ShopMgr) ModuleName() string {
|
||||||
|
|
@ -777,6 +778,13 @@ func (this *ShopMgr) GetExchangeData(platform string, id int32) *ExchangeShopInf
|
||||||
Url: info.Url,
|
Url: info.Url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
var items []*shop.ItemInfo
|
||||||
|
for _, v := range data.GetItems() {
|
||||||
|
items = append(items, &shop.ItemInfo{
|
||||||
|
ItemId: v.GetItemId(),
|
||||||
|
ItemNum: v.GetItemNum(),
|
||||||
|
})
|
||||||
|
}
|
||||||
return &ExchangeShopInfo{
|
return &ExchangeShopInfo{
|
||||||
Id: data.Id,
|
Id: data.Id,
|
||||||
Picture: data.Picture,
|
Picture: data.Picture,
|
||||||
|
|
@ -788,6 +796,7 @@ func (this *ShopMgr) GetExchangeData(platform string, id int32) *ExchangeShopInf
|
||||||
TelCharge: data.TelCharge,
|
TelCharge: data.TelCharge,
|
||||||
ShopType: data.ShopType,
|
ShopType: data.ShopType,
|
||||||
TelData: telData,
|
TelData: telData,
|
||||||
|
Items: items,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -802,6 +811,7 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
|
||||||
cdata := this.GetExchangeData(p.Platform, goodsId)
|
cdata := this.GetExchangeData(p.Platform, goodsId)
|
||||||
pack := &shop.SCShopExchange{
|
pack := &shop.SCShopExchange{
|
||||||
RetCode: shop.OpResultCode_OPRC_VCoinNotEnough,
|
RetCode: shop.OpResultCode_OPRC_VCoinNotEnough,
|
||||||
|
GoodsId: goodsId,
|
||||||
}
|
}
|
||||||
if cdata == nil {
|
if cdata == nil {
|
||||||
pack.RetCode = shop.OpResultCode_OPRC_ExchangeSoldOut
|
pack.RetCode = shop.OpResultCode_OPRC_ExchangeSoldOut
|
||||||
|
|
@ -904,6 +914,7 @@ func (this *ShopMgr) Exchange(p *Player, goodsId int32, username, mobile, commen
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
|
||||||
pack := &shop.SCShopExchange{
|
pack := &shop.SCShopExchange{
|
||||||
RetCode: shop.OpResultCode_OPRC_Error,
|
RetCode: shop.OpResultCode_OPRC_Error,
|
||||||
|
GoodsId: goodsId,
|
||||||
}
|
}
|
||||||
|
|
||||||
as := data.(*webapi_proto.SACreateExchangeOrder) // 必不为空
|
as := data.(*webapi_proto.SACreateExchangeOrder) // 必不为空
|
||||||
|
|
@ -1036,6 +1047,13 @@ func (this *ShopMgr) ExchangeList(p *Player) (ret bool) {
|
||||||
Url: info.Url,
|
Url: info.Url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
var items []*shop.ItemInfo
|
||||||
|
for _, v := range v.GetItems() {
|
||||||
|
items = append(items, &shop.ItemInfo{
|
||||||
|
ItemId: v.GetItemId(),
|
||||||
|
ItemNum: v.GetItemNum(),
|
||||||
|
})
|
||||||
|
}
|
||||||
pack.Infos = append(pack.Infos, &shop.ShopExchangeInfo{
|
pack.Infos = append(pack.Infos, &shop.ShopExchangeInfo{
|
||||||
Type: v.Type,
|
Type: v.Type,
|
||||||
Picture: v.Picture,
|
Picture: v.Picture,
|
||||||
|
|
@ -1052,6 +1070,7 @@ func (this *ShopMgr) ExchangeList(p *Player) (ret bool) {
|
||||||
NotVipShopLimit: v.NotVipShopLimit,
|
NotVipShopLimit: v.NotVipShopLimit,
|
||||||
ShopType: v.ShopType,
|
ShopType: v.ShopType,
|
||||||
TelData: telData,
|
TelData: telData,
|
||||||
|
Items: items,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ type TmGradeInfo struct {
|
||||||
copySnid int32
|
copySnid int32
|
||||||
copyLv int32
|
copyLv int32
|
||||||
copyRoleId int32
|
copyRoleId int32
|
||||||
|
CopySkinId int32
|
||||||
}
|
}
|
||||||
|
|
||||||
type TmMatch struct {
|
type TmMatch struct {
|
||||||
|
|
@ -73,6 +74,8 @@ func (tm *TmMatch) Start() {
|
||||||
tm.BroadcastMessage(int(tournament.TOURNAMENTID_PACKET_TM_SCTMStart), pack)
|
tm.BroadcastMessage(int(tournament.TOURNAMENTID_PACKET_TM_SCTMStart), pack)
|
||||||
logger.Logger.Trace("SCTMStart ", pack)
|
logger.Logger.Trace("SCTMStart ", pack)
|
||||||
|
|
||||||
|
tm.RobotGradesDecline(1)
|
||||||
|
|
||||||
//创建房间
|
//创建房间
|
||||||
timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
|
timer.StartTimer(timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
|
||||||
MatchSceneMgrSingleton.MatchStart(tm)
|
MatchSceneMgrSingleton.MatchStart(tm)
|
||||||
|
|
@ -86,6 +89,10 @@ func (tm *TmMatch) Stop() {
|
||||||
logger.Logger.Trace("(this *TmMatch) Stop()")
|
logger.Logger.Trace("(this *TmMatch) Stop()")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (tm *TmMatch) GetTotalRound() int32 {
|
||||||
|
return int32(len(tm.gmd.GetMatchPromotion()) - 1)
|
||||||
|
}
|
||||||
|
|
||||||
func (tm *TmMatch) BroadcastMessage(packetId int, rawPack interface{}) {
|
func (tm *TmMatch) BroadcastMessage(packetId int, rawPack interface{}) {
|
||||||
mgs := make(map[*netlib.Session][]*srvproto.MCSessionUnion)
|
mgs := make(map[*netlib.Session][]*srvproto.MCSessionUnion)
|
||||||
for _, tmp := range tm.TmPlayer {
|
for _, tmp := range tm.TmPlayer {
|
||||||
|
|
@ -135,7 +142,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
|
||||||
tm.robotGrades[round-1] = []*TmGradeInfo{}
|
tm.robotGrades[round-1] = []*TmGradeInfo{}
|
||||||
var snids []int32
|
var snids []int32
|
||||||
var lvs []int32
|
var lvs []int32
|
||||||
var roleIds []int32
|
var roleIds, skinIds []int32
|
||||||
for _, player := range PlayerMgrSington.snidMap {
|
for _, player := range PlayerMgrSington.snidMap {
|
||||||
if len(snids) > int(lastPromotionNum) {
|
if len(snids) > int(lastPromotionNum) {
|
||||||
break
|
break
|
||||||
|
|
@ -148,6 +155,9 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
|
||||||
roleId = player.Roles.ModId
|
roleId = player.Roles.ModId
|
||||||
}
|
}
|
||||||
roleIds = append(roleIds, roleId)
|
roleIds = append(roleIds, roleId)
|
||||||
|
if player.Skin != nil && player.Skin.ModId != 0 {
|
||||||
|
skinIds = append(skinIds, player.Skin.ModId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(snids) <= int(lastPromotionNum) {
|
if len(snids) <= int(lastPromotionNum) {
|
||||||
|
|
@ -164,6 +174,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
|
||||||
snids = append(snids, tmpSnid)
|
snids = append(snids, tmpSnid)
|
||||||
lvs = append(lvs, 1)
|
lvs = append(lvs, 1)
|
||||||
roleIds = append(roleIds, int32(2000001))
|
roleIds = append(roleIds, int32(2000001))
|
||||||
|
skinIds = append(skinIds, 300001)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i := 0; i < int(lastPromotionNum); i++ {
|
for i := 0; i < int(lastPromotionNum); i++ {
|
||||||
|
|
@ -172,12 +183,22 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
|
||||||
copySnid: snids[i],
|
copySnid: snids[i],
|
||||||
copyLv: lvs[i],
|
copyLv: lvs[i],
|
||||||
copyRoleId: roleIds[i],
|
copyRoleId: roleIds[i],
|
||||||
|
CopySkinId: skinIds[i],
|
||||||
}
|
}
|
||||||
tm.robotGrades[round-1] = append(tm.robotGrades[round-1], gradeInfo)
|
tm.robotGrades[round-1] = append(tm.robotGrades[round-1], gradeInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort.Slice(tm.robotGrades[round-1], func(i, j int) bool {
|
sort.Slice(tm.robotGrades[round-1], func(i, j int) bool {
|
||||||
return tm.robotGrades[round-1][i].grade > tm.robotGrades[round-1][j].grade
|
if tm.robotGrades[round-1][i].copySnid > 0 && tm.robotGrades[round-1][j].copySnid == 0 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if tm.robotGrades[round-1][i].copySnid > 0 && tm.robotGrades[round-1][j].copySnid > 0 {
|
||||||
|
return tm.robotGrades[round-1][i].grade > tm.robotGrades[round-1][j].grade
|
||||||
|
}
|
||||||
|
if tm.robotGrades[round-1][i].copySnid == 0 && tm.robotGrades[round-1][j].copySnid > 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 当前轮数据
|
// 当前轮数据
|
||||||
|
|
@ -209,6 +230,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
|
||||||
copySnid: tm.robotGrades[round-1][index].copySnid,
|
copySnid: tm.robotGrades[round-1][index].copySnid,
|
||||||
copyLv: tm.robotGrades[round-1][index].copyLv,
|
copyLv: tm.robotGrades[round-1][index].copyLv,
|
||||||
copyRoleId: tm.robotGrades[round-1][index].copyRoleId,
|
copyRoleId: tm.robotGrades[round-1][index].copyRoleId,
|
||||||
|
CopySkinId: tm.robotGrades[round-1][index].CopySkinId,
|
||||||
}
|
}
|
||||||
tm.robotGrades[round] = append(tm.robotGrades[round], gradeInfo)
|
tm.robotGrades[round] = append(tm.robotGrades[round], gradeInfo)
|
||||||
}
|
}
|
||||||
|
|
@ -235,6 +257,7 @@ func (tm *TmMatch) CreateRobotGrades(round int) {
|
||||||
copySnid: tm.robotGrades[round-1][index].copySnid,
|
copySnid: tm.robotGrades[round-1][index].copySnid,
|
||||||
copyLv: tm.robotGrades[round-1][index].copyLv,
|
copyLv: tm.robotGrades[round-1][index].copyLv,
|
||||||
copyRoleId: tm.robotGrades[round-1][index].copyRoleId,
|
copyRoleId: tm.robotGrades[round-1][index].copyRoleId,
|
||||||
|
CopySkinId: tm.robotGrades[round-1][index].CopySkinId,
|
||||||
}
|
}
|
||||||
tm.robotGrades[round] = append(tm.robotGrades[round], gradeInfo)
|
tm.robotGrades[round] = append(tm.robotGrades[round], gradeInfo)
|
||||||
}
|
}
|
||||||
|
|
@ -283,6 +306,7 @@ func (tm *TmMatch) RobotGradesDecline(round int) {
|
||||||
copySnid: info.copySnid,
|
copySnid: info.copySnid,
|
||||||
copyLv: info.copyLv,
|
copyLv: info.copyLv,
|
||||||
copyRoleId: info.copyRoleId,
|
copyRoleId: info.copyRoleId,
|
||||||
|
CopySkinId: info.CopySkinId,
|
||||||
}
|
}
|
||||||
tm.robotGrades[lastRound][i] = gradeInfo
|
tm.robotGrades[lastRound][i] = gradeInfo
|
||||||
if info.copySnid != 0 {
|
if info.copySnid != 0 {
|
||||||
|
|
@ -291,11 +315,11 @@ func (tm *TmMatch) RobotGradesDecline(round int) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.Logger.Tracef("======积分衰减======当前第 %v 轮============", round)
|
//logger.Logger.Tracef("======积分衰减======当前第 %v 轮============", round)
|
||||||
for i, infos := range tm.robotGrades {
|
//for i, infos := range tm.robotGrades {
|
||||||
logger.Logger.Tracef(">>>积分历史>>> 第 %v 轮", i)
|
// logger.Logger.Tracef(">>>积分历史>>> 第 %v 轮", i)
|
||||||
for _, info := range infos {
|
// for _, info := range infos {
|
||||||
logger.Logger.Trace("Snid: ", info.copySnid, " grade: ", info.grade, " copyLv: ", info.copyLv, " copyRoleId: ", info.copyRoleId)
|
// logger.Logger.Trace("Snid: ", info.copySnid, " grade: ", info.grade, " copyLv: ", info.copyLv, " copyRoleId: ", info.copyRoleId)
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,8 @@ import (
|
||||||
"mongo.games.com/game/webapi"
|
"mongo.games.com/game/webapi"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
// 如果这里比赛类型没有,默认是锦标赛
|
||||||
module.RegisteModule(TournamentMgr, time.Second, 0)
|
|
||||||
ClockMgrSington.RegisteSinker(TournamentMgr)
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// 如果这里比赛类型没有,默认是锦标赛
|
|
||||||
MatchTypeNormal = iota + 1 // 锦标赛
|
MatchTypeNormal = iota + 1 // 锦标赛
|
||||||
MatchTypeChampion // 冠军赛/实物赛
|
MatchTypeChampion // 冠军赛/实物赛
|
||||||
MatchTypeVIP // vip比赛
|
MatchTypeVIP // vip比赛
|
||||||
|
|
@ -54,6 +49,11 @@ const (
|
||||||
DaiDing = 2 // 待定
|
DaiDing = 2 // 待定
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
module.RegisteModule(TournamentMgr, time.Second, 0)
|
||||||
|
ClockMgrSington.RegisteSinker(TournamentMgr)
|
||||||
|
}
|
||||||
|
|
||||||
var TournamentMgr = NewTournament()
|
var TournamentMgr = NewTournament()
|
||||||
|
|
||||||
type PerRankInfo struct {
|
type PerRankInfo struct {
|
||||||
|
|
@ -78,8 +78,8 @@ type SignupInfo struct {
|
||||||
|
|
||||||
type PlayerRoundInfo struct {
|
type PlayerRoundInfo struct {
|
||||||
players []*PlayerMatchContext // 本轮结算信息
|
players []*PlayerMatchContext // 本轮结算信息
|
||||||
ranks []*PlayerMatchContext // 本来排名
|
ranks []*PlayerMatchContext // 本轮排名
|
||||||
num int // 本来完成人数
|
num int // 本轮完成人数
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tournament struct {
|
type Tournament struct {
|
||||||
|
|
@ -91,7 +91,7 @@ type Tournament struct {
|
||||||
playerWaitStart map[int32]int64 // 等待时间 玩家Id:等待时长秒
|
playerWaitStart map[int32]int64 // 等待时间 玩家Id:等待时长秒
|
||||||
matches map[int32]map[int64]*TmMatch // 开始比赛的数据,比赛配置Id:比赛顺序序号:一场开始的比赛数据
|
matches map[int32]map[int64]*TmMatch // 开始比赛的数据,比赛配置Id:比赛顺序序号:一场开始的比赛数据
|
||||||
players map[int64]map[int32]*PlayerMatchContext // 比赛中玩家 比赛顺序序号:玩家id:玩家信息
|
players map[int64]map[int32]*PlayerMatchContext // 比赛中玩家 比赛顺序序号:玩家id:玩家信息
|
||||||
roundPlayers map[int64]map[int32]*PlayerRoundInfo // 每轮比赛数据 比赛顺序序号:第几轮
|
roundPlayers map[int64]map[int32]*PlayerRoundInfo // 每轮比赛数据备份 比赛顺序序号:第几轮
|
||||||
finalPerRank map[int64][]*PerRankInfo // 本场比赛排名,每淘汰一位记录一位,最后记录决赛玩家 比赛顺序序号
|
finalPerRank map[int64][]*PerRankInfo // 本场比赛排名,每淘汰一位记录一位,最后记录决赛玩家 比赛顺序序号
|
||||||
MatchAwardNum map[string]map[int32]int32 // 比赛配置Id:比赛奖励次數
|
MatchAwardNum map[string]map[int32]int32 // 比赛配置Id:比赛奖励次數
|
||||||
}
|
}
|
||||||
|
|
@ -137,15 +137,16 @@ func (this *Tournament) checkData(cfg *webapiproto.GameMatchDate) bool {
|
||||||
if num%4 != 0 { //必须是4的整倍数
|
if num%4 != 0 { //必须是4的整倍数
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if num <= cfg.MatchPromotion[i+1] { //必须递减
|
//if num <= cfg.MatchPromotion[i+1] { //必须递减
|
||||||
return false
|
// return false
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录淘汰人员
|
||||||
func (this *Tournament) addFinalPlayer(sortId int64, p *PerRankInfo) {
|
func (this *Tournament) addFinalPlayer(sortId int64, p *PerRankInfo) {
|
||||||
if this.finalPerRank[sortId] == nil {
|
if this.finalPerRank[sortId] == nil {
|
||||||
this.finalPerRank[sortId] = []*PerRankInfo{}
|
this.finalPerRank[sortId] = []*PerRankInfo{}
|
||||||
|
|
@ -153,6 +154,7 @@ func (this *Tournament) addFinalPlayer(sortId int64, p *PerRankInfo) {
|
||||||
this.finalPerRank[sortId] = append(this.finalPerRank[sortId], p)
|
this.finalPerRank[sortId] = append(this.finalPerRank[sortId], p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询一场比赛某轮的历史数据
|
||||||
func (this *Tournament) getRoundPlayer(sortId int64, round int32) *PlayerRoundInfo {
|
func (this *Tournament) getRoundPlayer(sortId int64, round int32) *PlayerRoundInfo {
|
||||||
_, ok := this.roundPlayers[sortId]
|
_, ok := this.roundPlayers[sortId]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
@ -168,6 +170,96 @@ func (this *Tournament) getRoundPlayer(sortId int64, round int32) *PlayerRoundIn
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetRemainNum 剩余比赛人数
|
||||||
|
func (this *Tournament) GetRemainNum(sortId int64) int32 {
|
||||||
|
tm := this.GetTm(sortId)
|
||||||
|
if tm == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
round := this.GetRound(sortId)
|
||||||
|
l := tm.gmd.GetMatchPromotion()
|
||||||
|
if round <= int32(len(l)) {
|
||||||
|
return l[round-1]
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type MatchPlayerInfo struct {
|
||||||
|
SnId int32
|
||||||
|
RoleId int32
|
||||||
|
SkinId int32
|
||||||
|
Rank int32
|
||||||
|
Grade int32
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRemainPlayer 未淘汰的人
|
||||||
|
func (this *Tournament) GetRemainPlayer(sortId int64) []*MatchPlayerInfo {
|
||||||
|
tm := this.GetTm(sortId)
|
||||||
|
if tm == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
round := this.GetRound(sortId)
|
||||||
|
useRobot := this.IsRobotOn(tm.gmd)
|
||||||
|
|
||||||
|
var ret []*MatchPlayerInfo
|
||||||
|
|
||||||
|
realPlayer := func() {
|
||||||
|
for _, v := range tm.TmPlayer {
|
||||||
|
p := PlayerMgrSington.GetPlayerBySnId(v.SnId)
|
||||||
|
if p != nil {
|
||||||
|
ret = append(ret, &MatchPlayerInfo{
|
||||||
|
SnId: v.SnId,
|
||||||
|
RoleId: p.GetRoleId(),
|
||||||
|
SkinId: p.Skin.ModId,
|
||||||
|
Grade: 1000,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
robotPlayer := func(n int) {
|
||||||
|
for _, v := range tm.robotGrades[n] {
|
||||||
|
ret = append(ret, &MatchPlayerInfo{
|
||||||
|
SnId: v.copySnid,
|
||||||
|
RoleId: v.copyRoleId,
|
||||||
|
SkinId: v.CopySkinId,
|
||||||
|
Grade: v.grade,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if round <= 1 {
|
||||||
|
if useRobot {
|
||||||
|
robotPlayer(0)
|
||||||
|
realPlayer()
|
||||||
|
} else {
|
||||||
|
realPlayer()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if useRobot {
|
||||||
|
robotPlayer(int(round - 1))
|
||||||
|
} else {
|
||||||
|
if this.roundPlayers[sortId] != nil {
|
||||||
|
d := this.roundPlayers[sortId][round-1]
|
||||||
|
if d != nil {
|
||||||
|
for _, v := range d.ranks {
|
||||||
|
ret = append(ret, &MatchPlayerInfo{
|
||||||
|
SnId: v.copySnid,
|
||||||
|
RoleId: v.copyRoleId,
|
||||||
|
SkinId: v.copySkinId,
|
||||||
|
Grade: v.grade,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSignUpPlayers 获取报名人员
|
||||||
|
// id 比赛配置id
|
||||||
func (this *Tournament) GetSignUpPlayers(platform string, id int32) map[int32]*TmPlayer {
|
func (this *Tournament) GetSignUpPlayers(platform string, id int32) map[int32]*TmPlayer {
|
||||||
v, ok := this.signupPlayers[platform]
|
v, ok := this.signupPlayers[platform]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
@ -194,7 +286,7 @@ func (this *Tournament) UpdateData(init bool, data *webapiproto.GameMatchDateLis
|
||||||
this.FixMatchTimeStamp(v)
|
this.FixMatchTimeStamp(v)
|
||||||
configs[v.Id] = v
|
configs[v.Id] = v
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Error("GameMatchDate error: ", v)
|
logger.Logger.Errorf("GameMatchDate check error: %v", v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -239,14 +331,6 @@ func (this *Tournament) UpdateData(init bool, data *webapiproto.GameMatchDateLis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.GameMatchDateList[data.Platform] = configs
|
this.GameMatchDateList[data.Platform] = configs
|
||||||
//拉取数据
|
|
||||||
if this.MatchAwardNum == nil {
|
|
||||||
ret, err := model.GetMatchAwardLog(data.Platform)
|
|
||||||
logger.Logger.Tracef("ret = %v,err = %v", ret, err)
|
|
||||||
if err == nil {
|
|
||||||
this.MatchAwardNum = ret.AwardNum
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 通知平台玩家数据更新
|
// 通知平台玩家数据更新
|
||||||
if !init {
|
if !init {
|
||||||
//todo 优化
|
//todo 优化
|
||||||
|
|
@ -784,7 +868,7 @@ func (this *Tournament) CreatePlayerMatchContext(p *Player, m *TmMatch, seq int)
|
||||||
roleId = p.Roles.ModId
|
roleId = p.Roles.ModId
|
||||||
}
|
}
|
||||||
|
|
||||||
mc := NewMatchContext(p, m, 1000, p.SnId, 1, roleId, seq)
|
mc := NewMatchContext(p, m, 1000, p.SnId, 1, roleId, p.Skin.ModId, seq)
|
||||||
if mc != nil {
|
if mc != nil {
|
||||||
if this.players[m.SortId] == nil {
|
if this.players[m.SortId] == nil {
|
||||||
this.players[m.SortId] = make(map[int32]*PlayerMatchContext)
|
this.players[m.SortId] = make(map[int32]*PlayerMatchContext)
|
||||||
|
|
@ -796,6 +880,7 @@ func (this *Tournament) CreatePlayerMatchContext(p *Player, m *TmMatch, seq int)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 是否淘汰
|
||||||
func (this *Tournament) isOut(sortId int64, snid int32) bool {
|
func (this *Tournament) isOut(sortId int64, snid int32) bool {
|
||||||
if this.finalPerRank[sortId] != nil {
|
if this.finalPerRank[sortId] != nil {
|
||||||
for _, info := range this.finalPerRank[sortId] {
|
for _, info := range this.finalPerRank[sortId] {
|
||||||
|
|
@ -959,7 +1044,9 @@ func (this *Tournament) NextRoundStartSingle(sortId int64, playerCtx *PlayerMatc
|
||||||
}
|
}
|
||||||
|
|
||||||
if promotionNum != 1 {
|
if promotionNum != 1 {
|
||||||
arr = append(arr[:promotionNum])
|
if int(promotionNum) < len(arr) {
|
||||||
|
arr = arr[:promotionNum]
|
||||||
|
}
|
||||||
playerCtx.tm.robotGrades[int(round)] = arr
|
playerCtx.tm.robotGrades[int(round)] = arr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1514,6 +1601,72 @@ func (this *Tournament) GetSCTMInfosPack(platform, channelName string) *tourname
|
||||||
return pack
|
return pack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetTmMatch 查询比赛中的比赛
|
||||||
|
func (this *Tournament) GetTmMatch(plt string, matchId int32, channelName string, audience bool, sortId int64) []*TmMatch {
|
||||||
|
matches := this.GetAllMatchInfo(plt)
|
||||||
|
if matches == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var ids []int32
|
||||||
|
for id, info := range matches {
|
||||||
|
if info == nil || info.MatchSwitch != 1 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if matchId > 0 && id != matchId {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if channelName != "" && !common.InMatchChannel(info.OnChannelName, channelName) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if info.GetAudienceSwitch() == 1 != audience {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ids = append(ids, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
var ret []*TmMatch
|
||||||
|
if sortId > 0 {
|
||||||
|
for _, v := range ids {
|
||||||
|
d := this.matches[v]
|
||||||
|
if d != nil {
|
||||||
|
r, ok := d[sortId]
|
||||||
|
if ok && r != nil {
|
||||||
|
return []*TmMatch{r}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range ids {
|
||||||
|
for _, vv := range this.matches[v] {
|
||||||
|
ret = append(ret, vv)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Tournament) GetTmRoom(plt string, matchId int32, channelName string, audience bool, sortId int64) []*Scene {
|
||||||
|
tm := this.GetTmMatch(plt, matchId, channelName, audience, sortId)
|
||||||
|
|
||||||
|
sort.Slice(tm, func(i, j int) bool {
|
||||||
|
return tm[i].SortId < tm[j].SortId
|
||||||
|
})
|
||||||
|
|
||||||
|
var ret []*Scene
|
||||||
|
for _, v := range tm {
|
||||||
|
d := SceneMgrSingleton.GetMatchRoom(v.SortId)
|
||||||
|
sort.Slice(d, func(i, j int) bool {
|
||||||
|
return d[i].createTime.Before(d[j].createTime)
|
||||||
|
})
|
||||||
|
ret = append(ret, d...)
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
func (this *Tournament) MakeMatchLog(platform string, tmId int32, sortId int64) *model.MatchLog {
|
func (this *Tournament) MakeMatchLog(platform string, tmId int32, sortId int64) *model.MatchLog {
|
||||||
gameMatchDate := this.GetMatchInfo(platform, tmId, sortId)
|
gameMatchDate := this.GetMatchInfo(platform, tmId, sortId)
|
||||||
if gameMatchDate == nil {
|
if gameMatchDate == nil {
|
||||||
|
|
@ -1606,6 +1759,20 @@ func (this *Tournament) ModuleName() string {
|
||||||
|
|
||||||
func (this *Tournament) Init() {
|
func (this *Tournament) Init() {
|
||||||
logger.Logger.Trace("Tournament Init")
|
logger.Logger.Trace("Tournament Init")
|
||||||
|
for _, v := range PlatformMgrSingleton.GetPlatforms() {
|
||||||
|
if v == nil || v.IdStr == "0" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ret, err := model.GetMatchAward(v.IdStr)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Warnf("GetMatchAward error %v", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if this.MatchAwardNum == nil {
|
||||||
|
this.MatchAwardNum = make(map[string]map[int32]int32)
|
||||||
|
}
|
||||||
|
this.MatchAwardNum[v.IdStr] = ret.Award
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Tournament) Update() {
|
func (this *Tournament) Update() {
|
||||||
|
|
@ -1648,35 +1815,42 @@ func (this *Tournament) Update() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Tournament) OnDayTimer() {
|
func (this *Tournament) OnDayTimer() {
|
||||||
this.MatchAwardNum = make(map[string]map[int32]int32)
|
for k := range this.MatchAwardNum {
|
||||||
this.Save()
|
this.MatchAwardNum[k] = make(map[int32]int32)
|
||||||
logger.Logger.Trace("比赛场每日库存清理!!!")
|
}
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
this.SaveMatchAward()
|
||||||
|
return nil
|
||||||
|
}), nil, "save_match_award_times").Start()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Tournament) Shutdown() {
|
func (this *Tournament) Shutdown() {
|
||||||
// 保存数据
|
this.SaveMatchAward()
|
||||||
this.Save()
|
module.UnregisteModule(this)
|
||||||
}
|
}
|
||||||
func (this *Tournament) Save() {
|
|
||||||
logger.Logger.Info("保存比赛场每日奖励数据!!!!", this.MatchAwardNum)
|
func (this *Tournament) SaveMatchAward() {
|
||||||
if this.MatchAwardNum == nil {
|
if this.MatchAwardNum == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for platform, _ := range this.MatchAwardNum {
|
logger.Logger.Tracef("保存比赛场奖励领取次数")
|
||||||
matchAwardLog := model.NewMatchAwardLog()
|
for platform, v := range this.MatchAwardNum {
|
||||||
matchAwardLog.AwardNum = this.MatchAwardNum
|
d := &model.MatchAward{
|
||||||
matchAwardLog.Platform = platform
|
Platform: platform,
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
Award: make(map[int32]int32),
|
||||||
err := model.InsertOrUpdateMatchAwardLog(matchAwardLog)
|
}
|
||||||
if err != nil {
|
for k, vv := range v {
|
||||||
logger.Logger.Error("saveMatchAwardLog error %v", err)
|
d.Award[k] = vv
|
||||||
return err
|
}
|
||||||
}
|
err := model.UpsertMatchAward(d)
|
||||||
return nil
|
if err != nil {
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
|
logger.Logger.Errorf("SaveMatchAward error %v", err)
|
||||||
})).StartByFixExecutor("saveMatchAwardLogTask")
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Tournament) getWeekDay() int {
|
func (this *Tournament) getWeekDay() int {
|
||||||
getWeekNum := func(t time.Time) int {
|
getWeekNum := func(t time.Time) int {
|
||||||
strWeek := []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
|
strWeek := []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
|
||||||
|
|
@ -1709,7 +1883,7 @@ func (this *Tournament) FixMatchTimeStamp(d *webapiproto.GameMatchDate) {
|
||||||
week := this.getWeekDay()
|
week := this.getWeekDay()
|
||||||
st := time.Unix(d.MatchTimeStamp[0], 0).In(l)
|
st := time.Unix(d.MatchTimeStamp[0], 0).In(l)
|
||||||
et := time.Unix(d.MatchTimeStamp[1], 0).In(l)
|
et := time.Unix(d.MatchTimeStamp[1], 0).In(l)
|
||||||
logger.Logger.Tracef("FixMatchTimeStamp 1 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
|
//logger.Logger.Tracef("FixMatchTimeStamp 1 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
|
||||||
// 重复时间段比赛时间
|
// 重复时间段比赛时间
|
||||||
for _, v := range d.MatchTimeWeek {
|
for _, v := range d.MatchTimeWeek {
|
||||||
if v == int32(week) {
|
if v == int32(week) {
|
||||||
|
|
@ -1721,8 +1895,7 @@ func (this *Tournament) FixMatchTimeStamp(d *webapiproto.GameMatchDate) {
|
||||||
|
|
||||||
st = time.Unix(d.MatchTimeStamp[0], 0).In(l)
|
st = time.Unix(d.MatchTimeStamp[0], 0).In(l)
|
||||||
et = time.Unix(d.MatchTimeStamp[1], 0).In(l)
|
et = time.Unix(d.MatchTimeStamp[1], 0).In(l)
|
||||||
logger.Logger.Tracef("FixMatchTimeStamp 2 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
|
//logger.Logger.Tracef("FixMatchTimeStamp 2 id:%v now:%v week:%v start:%v end:%v", d.Id, bTs, bTs.Weekday(), st, et)
|
||||||
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1736,6 +1909,8 @@ func (this *Tournament) OnHourTimer() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMatchAwardNum 剩余奖励数量
|
||||||
|
// id 比赛配置id
|
||||||
func (this *Tournament) GetMatchAwardNum(platform string, id int32) int32 {
|
func (this *Tournament) GetMatchAwardNum(platform string, id int32) int32 {
|
||||||
var num int32
|
var num int32
|
||||||
if this.MatchAwardNum != nil && this.MatchAwardNum[platform] != nil {
|
if this.MatchAwardNum != nil && this.MatchAwardNum[platform] != nil {
|
||||||
|
|
@ -1759,3 +1934,11 @@ func (this *Tournament) GetMatchAwardNum(platform string, id int32) int32 {
|
||||||
}
|
}
|
||||||
return num
|
return num
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *Tournament) GetRound(sortId int64) int32 {
|
||||||
|
d, ok := this.roundPlayers[sortId]
|
||||||
|
if !ok || d == nil {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return int32(len(d))
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1964,6 +1964,65 @@ func init() {
|
||||||
pack.Msg = "no any data"
|
pack.Msg = "no any data"
|
||||||
return common.ResponseTag_Ok, pack
|
return common.ResponseTag_Ok, pack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
f := func(plt string, snid int32) {
|
||||||
|
var alipayAcc, alipayAccName, bankAccount, bankAccName, channelId string
|
||||||
|
if val, ok := playerMap["AlipayAccount"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
alipayAcc = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["AlipayAccName"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
alipayAccName = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["BankAccount"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
bankAccount = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["BankAccName"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
bankAccName = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if val, ok := playerMap["ChannelId"]; ok {
|
||||||
|
if str, ok := val.(string); ok {
|
||||||
|
channelId = str
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if alipayAcc != "" || alipayAccName != "" {
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
|
||||||
|
alipayAccName, alipayAcc, 2)
|
||||||
|
return nil
|
||||||
|
}), nil, "NewBankBindLog").Start()
|
||||||
|
}
|
||||||
|
if bankAccount != "" || bankAccName != "" {
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
|
||||||
|
bankAccName, bankAccount, 2)
|
||||||
|
return nil
|
||||||
|
}), nil, "NewBankBindLog").Start()
|
||||||
|
}
|
||||||
|
if channelId != "" {
|
||||||
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
|
a, err := model.GetAccountBySnid(plt, snid)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("GetAccountBySnid error: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
a.ChannelId = channelId
|
||||||
|
if err = model.UpdateAccount(a); err != nil {
|
||||||
|
logger.Logger.Errorf("UpdateAccount error: %v", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}), nil).StartByExecutor("UpdateChannelId")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pack.Tag = webapiproto.TagCode_SUCCESS
|
pack.Tag = webapiproto.TagCode_SUCCESS
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(msg.SnId)
|
player := PlayerMgrSington.GetPlayerBySnId(msg.SnId)
|
||||||
if player != nil {
|
if player != nil {
|
||||||
|
|
@ -1985,7 +2044,7 @@ func init() {
|
||||||
if v.FieldByName(k).CanInterface() {
|
if v.FieldByName(k).CanInterface() {
|
||||||
switch f.Type.Kind() {
|
switch f.Type.Kind() {
|
||||||
case reflect.Int64, reflect.Int32:
|
case reflect.Int64, reflect.Int32:
|
||||||
a, _ := strconv.ParseInt((fmt.Sprintf("%v", n)), 10, 64)
|
a, _ := strconv.ParseInt(fmt.Sprintf("%v", n), 10, 64)
|
||||||
s.FieldByName(k).SetInt(a)
|
s.FieldByName(k).SetInt(a)
|
||||||
case reflect.Bool:
|
case reflect.Bool:
|
||||||
s.FieldByName(k).SetBool(n.(bool))
|
s.FieldByName(k).SetBool(n.(bool))
|
||||||
|
|
@ -2002,42 +2061,8 @@ func init() {
|
||||||
pd = SetInfo(pd, *pd, playerMap)
|
pd = SetInfo(pd, *pd, playerMap)
|
||||||
player.dirty = true
|
player.dirty = true
|
||||||
player.SendDiffData()
|
player.SendDiffData()
|
||||||
var alipayAcc, alipayAccName, bankAccount, bankAccName string
|
|
||||||
if val, ok := playerMap["AlipayAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAcc = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["AlipayAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccount = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if alipayAcc != "" || alipayAccName != "" {
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
|
|
||||||
alipayAccName, alipayAcc, 2)
|
|
||||||
return nil
|
|
||||||
}), nil, "NewBankBindLog").Start()
|
|
||||||
}
|
|
||||||
if bankAccount != "" || bankAccName != "" {
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
|
|
||||||
bankAccName, bankAccount, 2)
|
|
||||||
return nil
|
|
||||||
}), nil, "NewBankBindLog").Start()
|
|
||||||
}
|
|
||||||
pack.Msg = "success"
|
pack.Msg = "success"
|
||||||
|
f(pd.Platform, pd.SnId)
|
||||||
return common.ResponseTag_Ok, pack
|
return common.ResponseTag_Ok, pack
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2053,35 +2078,7 @@ func init() {
|
||||||
//直接操作数据库
|
//直接操作数据库
|
||||||
err := model.UpdatePlayerElement(msg.Platform, msg.SnId, playerMap)
|
err := model.UpdatePlayerElement(msg.Platform, msg.SnId, playerMap)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var alipayAcc, alipayAccName, bankAccount, bankAccName string
|
f(msg.Platform, msg.SnId)
|
||||||
if val, ok := playerMap["AlipayAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAcc = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["AlipayAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
alipayAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccount"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccount = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if val, ok := playerMap["BankAccName"]; ok {
|
|
||||||
if str, ok := val.(string); ok {
|
|
||||||
bankAccName = str
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if alipayAcc != "" || alipayAccName != "" {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Ali,
|
|
||||||
alipayAccName, alipayAcc, 2)
|
|
||||||
}
|
|
||||||
if bankAccount != "" || bankAccName != "" {
|
|
||||||
model.NewBankBindLog(msg.SnId, msg.Platform, model.BankBindLogType_Bank,
|
|
||||||
bankAccName, bankAccount, 2)
|
|
||||||
}
|
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
logger.Logger.Error("UpdatePlayerElement task marshal data error:", err)
|
logger.Logger.Error("UpdatePlayerElement task marshal data error:", err)
|
||||||
}
|
}
|
||||||
|
|
@ -3730,6 +3727,7 @@ func init() {
|
||||||
})).StartByExecutor(fmt.Sprint(msg.GetSnid()))
|
})).StartByExecutor(fmt.Sprint(msg.GetSnid()))
|
||||||
return common.ResponseTag_TransactYield, pack
|
return common.ResponseTag_TransactYield, pack
|
||||||
}))
|
}))
|
||||||
|
|
||||||
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/player/AddItem", WebAPIHandlerWrapper(
|
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/player/AddItem", WebAPIHandlerWrapper(
|
||||||
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
||||||
pack := &webapiproto.SAAddItemById{}
|
pack := &webapiproto.SAAddItemById{}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
BIN
xlsx/DB_VIP.xlsx
BIN
xlsx/DB_VIP.xlsx
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue