diff --git a/common/config.go b/common/config.go index 3347b65..a15c366 100644 --- a/common/config.go +++ b/common/config.go @@ -2,6 +2,7 @@ package common import ( "encoding/json" + "strings" "mongo.games.com/goserver/core" ) @@ -53,6 +54,13 @@ func (this *CustomConfiguration) GetString(key string) string { return str } } + + if v, exist := (*this)[strings.ToLower(key)]; exist { + if str, ok := v.(string); ok { + return str + } + } + return "" } @@ -67,6 +75,18 @@ func (this *CustomConfiguration) GetStrings(key string) (strs []string) { return } } + + if v, exist := (*this)[strings.ToLower(key)]; exist { + if vals, ok := v.([]interface{}); ok { + for _, s := range vals { + if str, ok := s.(string); ok { + strs = append(strs, str) + } + } + return + } + } + return } @@ -86,6 +106,23 @@ func (this *CustomConfiguration) GetCustomCfgs(key string) (strs []*CustomConfig return } } + + if v, exist := (*this)[strings.ToLower(key)]; exist { + if vals, ok := v.([]interface{}); ok { + for _, s := range vals { + if data, ok := s.(map[string]interface{}); ok { + var pkg *CustomConfiguration + modelBuff, _ := json.Marshal(data) + err := json.Unmarshal(modelBuff, &pkg) + if err == nil { + strs = append(strs, pkg) + } + } + } + return + } + } + return } @@ -100,6 +137,18 @@ func (this *CustomConfiguration) GetInts(key string) (strs []int) { return } } + + if v, exist := (*this)[strings.ToLower(key)]; exist { + if vals, ok := v.([]interface{}); ok { + for _, s := range vals { + if str, ok := s.(float64); ok { + strs = append(strs, int(str)) + } + } + return + } + } + return } func (this *CustomConfiguration) GetInt(key string) int { @@ -108,6 +157,12 @@ func (this *CustomConfiguration) GetInt(key string) int { return int(val) } } + + if v, exist := (*this)[strings.ToLower(key)]; exist { + if val, ok := v.(float64); ok { + return int(val) + } + } return 0 } @@ -117,5 +172,10 @@ func (this *CustomConfiguration) GetBool(key string) bool { return val } } + if v, exist := (*this)[strings.ToLower(key)]; exist { + if val, ok := v.(bool); ok { + return val + } + } return false } diff --git a/common/constant.go b/common/constant.go index acc9646..4d6d278 100644 --- a/common/constant.go +++ b/common/constant.go @@ -84,6 +84,8 @@ const ( GameId_FortuneRabbit = 310 // FortuneRabbit GameId_FortuneOx = 311 // FortuneOx GameId_FortuneMouse = 312 // FortuneMouse + GameId_CashMania = 313 // CashMania + GameId_GatesOfOlympus = 314 // GatesOfOlympus __GameId_Fishing_Min__ = 400 //################捕鱼类################ GameId_HFishing = 401 //欢乐捕鱼 GameId_TFishing = 402 //天天捕鱼 diff --git a/common/time.go b/common/time.go index e54bfaa..907796b 100644 --- a/common/time.go +++ b/common/time.go @@ -204,3 +204,8 @@ func StrTimeToTime(s string) time.Time { t, _ := time.ParseInLocation("2006-01-02 15:04:05", s, time.Local) return t } + +func StrRFC3339TimeToTime(s string) time.Time { + t, _ := time.Parse(time.RFC3339, s) + return t +} diff --git a/data/DB_GameFree.dat b/data/DB_GameFree.dat index 9ed5700..4b9a383 100644 Binary files a/data/DB_GameFree.dat and b/data/DB_GameFree.dat differ diff --git a/data/DB_GameFree.json b/data/DB_GameFree.json index 1ecae87..cdb6134 100644 --- a/data/DB_GameFree.json +++ b/data/DB_GameFree.json @@ -6661,6 +6661,74 @@ "PlayerWaterRate": 100, "BetWaterRate": 100 }, + { + "Id": 3130001, + "Name": "CashMania", + "Title": "1", + "GameId": 313, + "GameRule": 31300, + "GameType": 3, + "SceneType": 1, + "Desc": "0", + "ShowType": 2, + "ShowId": 31300, + "LimitCoin": 10000, + "BaseScore": 1000, + "Turn": 31300, + "BetDec": "1000", + "Ai": [ + 0 + ], + "OtherIntParams": [ + 0 + ], + "RobotNumRng": [ + 0 + ], + "SameIpLimit": 1, + "GameDif": "313", + "GameClass": 2, + "PlatformName": "越南棋牌", + "MaxBetCoin": [ + 0 + ], + "PlayerWaterRate": 100, + "BetWaterRate": 100 + }, + { + "Id": 3140001, + "Name": "GatesOfOlympus", + "Title": "1", + "GameId": 314, + "GameRule": 31400, + "GameType": 3, + "SceneType": 1, + "Desc": "0", + "ShowType": 2, + "ShowId": 31400, + "LimitCoin": 10000, + "BaseScore": 1000, + "Turn": 31400, + "BetDec": "1000", + "Ai": [ + 0 + ], + "OtherIntParams": [ + 0 + ], + "RobotNumRng": [ + 0 + ], + "SameIpLimit": 1, + "GameDif": "314", + "GameClass": 2, + "PlatformName": "越南棋牌", + "MaxBetCoin": [ + 0 + ], + "PlayerWaterRate": 100, + "BetWaterRate": 100 + }, { "Id": 6080001, "Name": "娃娃机", diff --git a/data/DB_GameRule.dat b/data/DB_GameRule.dat index c2dfcc4..5377feb 100644 Binary files a/data/DB_GameRule.dat and b/data/DB_GameRule.dat differ diff --git a/data/DB_GameRule.json b/data/DB_GameRule.json index 3975258..4860e87 100644 --- a/data/DB_GameRule.json +++ b/data/DB_GameRule.json @@ -71,7 +71,7 @@ "Name": "十三张(四人场)", "GameId": 211, "Params": [ - 0, + 4, 0, 30, 50, @@ -84,7 +84,7 @@ "Name": "十三张(八人场)", "GameId": 212, "Params": [ - 1, + 8, 0, 30, 50, @@ -97,7 +97,7 @@ "Name": "十三张(自由场经典场)", "GameId": 213, "Params": [ - 1, + 8, 0, 30, 50, @@ -110,7 +110,7 @@ "Name": "十三张(自由场癞子场)", "GameId": 214, "Params": [ - 1, + 8, 0, 30, 50, @@ -250,6 +250,18 @@ "GameId": 312, "GameDif": "312" }, + { + "Id": 31300, + "Name": "CashMania", + "GameId": 313, + "GameDif": "313" + }, + { + "Id": 31400, + "Name": "GatesOfOlympus", + "GameId": 314, + "GameDif": "314" + }, { "Id": 60800, "Name": "娃娃机", diff --git a/data/DB_GiftCard.dat b/data/DB_GiftCard.dat index 96640b0..1560036 100644 Binary files a/data/DB_GiftCard.dat and b/data/DB_GiftCard.dat differ diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index 804f106..7ad9b2f 100644 Binary files a/data/DB_PropExchange.dat and b/data/DB_PropExchange.dat differ diff --git a/data/DB_Task.dat b/data/DB_Task.dat index adeaa2c..9cf86c3 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ diff --git a/data/activity/activity_51game.json b/data/activity/activity_51game.json deleted file mode 100644 index 270de94..0000000 --- a/data/activity/activity_51game.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Id":5, - "Name":"51活动", - "Desc":"对局领福袋", - "StartTime":"2018-04-20 00:00:00", - "EndTime":"2018-05-02 23:59:59", - "TaskIds":[], - "IsDelTaskWhenEnd":true, - "IsDelActIdWhenEnd":true, - "Data":[ - {"Name":"PerDayLimit", "IntVal":3 }, - {"Name":"CostTimes", "IntArr":[5,3] }, - {"Name":"Prize1", "IntArr":[1,1500,60,1,2000,20,1,3000,10,4,100,6,4,200,3,4,500,1] }, - {"Name":"Prize2", "IntArr":[1,200,40,1,300,25,1,500,15,1,800,10,1,1000,5,4,100,5] } - ] -} \ No newline at end of file diff --git a/data/activity/activity_guess.json b/data/activity/activity_guess.json deleted file mode 100644 index bede4ae..0000000 --- a/data/activity/activity_guess.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "Id":3, - "Name":"元宵猜灯谜", - "Desc":"元宵猜灯谜", - "StartTime":"2018-03-02 00:00:00", - "EndTime":"2018-03-02 23:59:59", - "TaskIds":[], - "IsDelTaskWhenEnd":true, - "IsDelActIdWhenEnd":true, - "Data":[ - {"Name":"Count", "IntVal":6 }, - {"Name":"Prize", "IntArr":[1,2000,50,1,3000,30,3,20,15,3,50,5] }, - {"Name":"1", "StrArr":["2018-03-02 00:00:00","1","弟兄五六个,围着圆柱坐,大家一分手,衣服都扯破。","A:花生","B:大蒜","C:向日葵","D:糖葫芦"] }, - {"Name":"2", "StrArr":["2018-03-02 04:00:00","2","红公鸡,绿尾巴,身体钻到地底下,又甜又脆营养大。","A:番茄","B:红薯","C:红萝卜","D:花生"] }, - {"Name":"3", "StrArr":["2018-03-02 08:00:00","3","纸老虎(打一成语)","A:狐假虎威","B:狗仗人势","C:仗势欺人","D:外强中干"] }, - {"Name":"4", "StrArr":["2018-03-02 12:00:00","0","笑死人(打一成语)","A:乐极生悲","B:笑里藏刀","C:哭笑不得","D:强颜欢笑"] }, - {"Name":"5", "StrArr":["2018-03-02 16:00:00","3","兔子请老虎(打一成语)","A:狐假虎威","B:为虎作伥","C:与虎谋皮","D:寅吃卯粮"] }, - {"Name":"6", "StrArr":["2018-03-02 20:00:00","1", "白又方,嫩又香,能做菜,能煮汤,豆子是它爹和妈,它和爹妈不一样。","A:土豆","B:豆腐","C:大米","D:萝卜"] } - ] -} \ No newline at end of file diff --git a/data/activity/activity_invite.json b/data/activity/activity_invite.json deleted file mode 100644 index e60e5aa..0000000 --- a/data/activity/activity_invite.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Id":4, - "Name":"邀请新人", - "Desc":"邀请新人", - "StartTime":"2018-03-23 00:00:00", - "EndTime":"2018-05-31 23:59:59", - "TaskIds":[], - "IsDelTaskWhenEnd":true, - "IsDelActIdWhenEnd":true, - "Data":[] -} \ No newline at end of file diff --git a/data/activity/activity_new_reg.json b/data/activity/activity_new_reg.json deleted file mode 100644 index 15c40a0..0000000 --- a/data/activity/activity_new_reg.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Id":1, - "Name":"新人注册领红包", - "Desc":"新人注册领红包", - "StartTime":"2018-02-05 12:00:00", - "EndTime":"2020-05-30 12:00:00", - "TaskIds":[1,2,3,4,5,6,7,8,9,10], - "IsDelTaskWhenEnd":false, - "IsDelActIdWhenEnd":false, - "Data":[ - {"Name":"MaxNum", "IntVal":2000 }, - {"Name":"AcceptRate", "IntArr":[1001,100,2001,20] } - ] -} \ No newline at end of file diff --git a/data/activity/activity_rebate.json b/data/activity/activity_rebate.json deleted file mode 100644 index eb82bfc..0000000 --- a/data/activity/activity_rebate.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "Id":6, - "Name":"投资返利", - "Desc":"投资返利", - "StartTime":"2018-04-20 00:00:00", - "EndTime":"2025-05-02 23:59:59", - "TaskIds":[], - "IsDelTaskWhenEnd":true, - "IsDelActIdWhenEnd":true, - "Data":[] -} \ No newline at end of file diff --git a/data/activity/activity_reply_word.json b/data/activity/activity_reply_word.json deleted file mode 100644 index 6abd634..0000000 --- a/data/activity/activity_reply_word.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "Id":2, - "Name":"对暗号拿红包", - "Desc":"对暗号拿红包", - "StartTime":"2018-02-16 00:00:00", - "EndTime":"2018-02-23 00:00:00", - "TaskIds":[], - "IsDelTaskWhenEnd":false, - "IsDelActIdWhenEnd":false, - "Data":[ - {"Name":"Count", "IntVal":7 }, - {"Name":"UnOpenTip", "StrVal":"0" }, - {"Name":"1", "StrVal":"2018-02-16 19:00:00|1" }, - {"Name":"2", "StrVal":"2018-02-17 19:00:00|2" }, - {"Name":"3", "StrVal":"2018-02-18 19:00:00|3" }, - {"Name":"4", "StrVal":"2018-02-19 19:00:00|4" }, - {"Name":"5", "StrVal":"2018-02-20 19:00:00|5" }, - {"Name":"6", "StrVal":"2018-02-21 19:00:00|6" }, - {"Name":"7", "StrVal":"2018-02-22 19:00:00|7" } - ] -} \ No newline at end of file diff --git a/data/botai/dvtfollowwin.json b/data/botai/dvtfollowwin.json deleted file mode 100644 index a75f1df..0000000 --- a/data/botai/dvtfollowwin.json +++ /dev/null @@ -1,1173 +0,0 @@ -{ - "version": "0.3.0", - "scope": "tree", - "id": "37bd2b7b-fa98-4e95-9574-d1f14a8c3422", - "title": "DVTFollowWinBot", - "description": "龙虎跟注", - "root": "e1363bca-78ca-4923-995e-074cdcb803cf", - "properties": {}, - "nodes": { - "d1b6d256-4b76-441b-a455-bdf592c0a722": { - "id": "d1b6d256-4b76-441b-a455-bdf592c0a722", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 324, - "y": -108 - }, - "children": [ - "3cecf744-3e4b-4ca1-85b0-323aaa576314", - "2a567791-009a-43ac-842b-3ebf763ecd20", - "2a8386b7-8dfe-4057-84cc-d55f7b027611", - "910076bb-4d07-471e-8280-a55a802ba13f", - "09d39c93-a081-4fe1-8ec3-389a1c5f9617", - "273444a5-6648-42c2-868b-a6a5d869fc9e" - ] - }, - "8ad1b951-ff76-4a7d-81f5-e934737d3842": { - "id": "8ad1b951-ff76-4a7d-81f5-e934737d3842", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betSrcCoin", - "min": 2, - "max": 6 - }, - "display": { - "x": 324, - "y": -480 - } - }, - "da6163be-5079-428a-aa43-2c5e53d840a7": { - "id": "da6163be-5079-428a-aa43-2c5e53d840a7", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 600, - "maxTime": 1200 - }, - "display": { - "x": 1044, - "y": 204 - } - }, - "df0cd7eb-848f-49e0-87b6-d0ba50c282f1": { - "id": "df0cd7eb-848f-49e0-87b6-d0ba50c282f1", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 24, - "y": 1044 - }, - "children": [ - "094558c6-747d-48d0-8846-3e648f1b58b6", - "c19613b3-0961-4c38-8680-c1e4a88df0b8", - "feac41f1-9450-431c-8bea-30fee992e269", - "7083a59f-1953-421e-9356-6b636a4ddc57" - ] - }, - "95dc5d8f-69a4-4b0d-b22e-0bab989c82f8": { - "id": "95dc5d8f-69a4-4b0d-b22e-0bab989c82f8", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "saveLimit", - "cmp": 0 - }, - "display": { - "x": 912, - "y": 948 - } - }, - "ec1cdd41-d944-4d3f-8918-c5971e8dc21c": { - "id": "ec1cdd41-d944-4d3f-8918-c5971e8dc21c", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "saveLimit" - }, - "display": { - "x": 900, - "y": 876 - } - }, - "feac41f1-9450-431c-8bea-30fee992e269": { - "id": "feac41f1-9450-431c-8bea-30fee992e269", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 500, - "maxTime": 3500 - }, - "display": { - "x": 252, - "y": 1200 - } - }, - "7083a59f-1953-421e-9356-6b636a4ddc57": { - "id": "7083a59f-1953-421e-9356-6b636a4ddc57", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {}, - "display": { - "x": 216, - "y": 1344 - } - }, - "593b4c1a-5cd1-4782-8cbb-faedf41e4464": { - "id": "593b4c1a-5cd1-4782-8cbb-faedf41e4464", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "maxGameNum", - "cmp": 4 - }, - "display": { - "x": 960, - "y": 1128 - } - }, - "4c83ed6e-f99f-4be7-953e-f5ff06a2f9f5": { - "id": "4c83ed6e-f99f-4be7-953e-f5ff06a2f9f5", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "maxGameNum", - "min": 5, - "max": 30 - }, - "display": { - "x": 936, - "y": 1044 - } - }, - "521239f8-2829-471e-ab43-e0a98d77aab7": { - "id": "521239f8-2829-471e-ab43-e0a98d77aab7", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "生成初始押注额度", - "properties": {}, - "display": { - "x": 12, - "y": -456 - }, - "children": [ - "c764dcd1-7d5e-4e39-a068-8c309dff1484", - "7a8a52d3-1a69-4df7-8de2-a4d71afae499", - "ece5c421-9448-453e-99b6-460323cbed9b", - "8ad1b951-ff76-4a7d-81f5-e934737d3842", - "b3ffd6fa-1fd7-4640-812d-d1c6d55f6224", - "b9b8737c-ece2-4e1a-8af6-542dc08d5b59", - "6bc3ed88-f412-49c3-8b32-70641b703747", - "9d30f3ac-f772-48fb-852e-1acdec9d474f" - ] - }, - "7a8a52d3-1a69-4df7-8de2-a4d71afae499": { - "id": "7a8a52d3-1a69-4df7-8de2-a4d71afae499", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "needStartBet", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 300, - "y": -576 - } - }, - "ece5c421-9448-453e-99b6-460323cbed9b": { - "id": "ece5c421-9448-453e-99b6-460323cbed9b", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@1" - }, - "display": { - "x": 324, - "y": -528 - } - }, - "09d39c93-a081-4fe1-8ec3-389a1c5f9617": { - "id": "09d39c93-a081-4fe1-8ec3-389a1c5f9617", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "needStartBet" - }, - "display": { - "x": 816, - "y": -36 - } - }, - "273444a5-6648-42c2-868b-a6a5d869fc9e": { - "id": "273444a5-6648-42c2-868b-a6a5d869fc9e", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue1": "needStartBet", - "gIPValue2": "@2" - }, - "display": { - "x": 804, - "y": 12 - } - }, - "6e65f94a-05f4-410f-be23-01ee2da43240": { - "id": "6e65f94a-05f4-410f-be23-01ee2da43240", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 192, - "y": 684 - }, - "children": [ - "5bfdcdcf-57e3-4a15-8f02-5403d8447550", - "8d131988-67e9-4d44-99d8-7d838f5a7410", - "83b27986-aa7b-40e1-87b6-46067b5fa504" - ] - }, - "8d131988-67e9-4d44-99d8-7d838f5a7410": { - "id": "8d131988-67e9-4d44-99d8-7d838f5a7410", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "@1", - "cmp": 2 - }, - "display": { - "x": 480, - "y": 684 - } - }, - "83b27986-aa7b-40e1-87b6-46067b5fa504": { - "id": "83b27986-aa7b-40e1-87b6-46067b5fa504", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@0" - }, - "display": { - "x": 468, - "y": 756 - } - }, - "b3ffd6fa-1fd7-4640-812d-d1c6d55f6224": { - "id": "b3ffd6fa-1fd7-4640-812d-d1c6d55f6224", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "playerCoin" - }, - "display": { - "x": 312, - "y": -432 - } - }, - "b9b8737c-ece2-4e1a-8af6-542dc08d5b59": { - "id": "b9b8737c-ece2-4e1a-8af6-542dc08d5b59", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "playerCoin" - }, - "display": { - "x": 384, - "y": -384 - } - }, - "6bc3ed88-f412-49c3-8b32-70641b703747": { - "id": "6bc3ed88-f412-49c3-8b32-70641b703747", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 360, - "y": -336 - } - }, - "c19613b3-0961-4c38-8680-c1e4a88df0b8": { - "id": "c19613b3-0961-4c38-8680-c1e4a88df0b8", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 336, - "y": 1056 - }, - "children": [ - "9986d0ac-48cd-4707-b24a-fdcb96f02a58", - "c95924ef-c6b1-480c-ab7b-aefbc84bd635", - "406d653d-e148-4722-aecf-ef77500ac21b", - "f08511cc-fa3c-4729-a434-69986d8db842" - ] - }, - "9986d0ac-48cd-4707-b24a-fdcb96f02a58": { - "id": "9986d0ac-48cd-4707-b24a-fdcb96f02a58", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 576, - "y": 972 - }, - "children": [ - "ec1cdd41-d944-4d3f-8918-c5971e8dc21c", - "95dc5d8f-69a4-4b0d-b22e-0bab989c82f8" - ] - }, - "c95924ef-c6b1-480c-ab7b-aefbc84bd635": { - "id": "c95924ef-c6b1-480c-ab7b-aefbc84bd635", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 576, - "y": 1128 - }, - "children": [ - "4c83ed6e-f99f-4be7-953e-f5ff06a2f9f5", - "593b4c1a-5cd1-4782-8cbb-faedf41e4464" - ] - }, - "2a567791-009a-43ac-842b-3ebf763ecd20": { - "id": "2a567791-009a-43ac-842b-3ebf763ecd20", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "sameNum", - "min": 2, - "max": 4 - }, - "display": { - "x": 768, - "y": -180 - } - }, - "455ac069-63e9-4f5c-97ff-a0800e3e813d": { - "id": "455ac069-63e9-4f5c-97ff-a0800e3e813d", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 768, - "y": 144 - }, - "children": [ - "ac131866-e93e-4df5-8b18-646af0ffa070", - "7bf79e28-4232-43f6-8002-4cedb5b72cd7", - "da6163be-5079-428a-aa43-2c5e53d840a7", - "ad2737f1-015c-42c1-88af-d34099656ad5" - ] - }, - "ad2737f1-015c-42c1-88af-d34099656ad5": { - "id": "ad2737f1-015c-42c1-88af-d34099656ad5", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 852, - "y": 288 - }, - "children": [ - "2710b442-af43-4350-baf9-eee1e00c2c67", - "3ef5c0b6-9106-42b8-99a2-30b4b16afeed" - ] - }, - "3ef5c0b6-9106-42b8-99a2-30b4b16afeed": { - "id": "3ef5c0b6-9106-42b8-99a2-30b4b16afeed", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@1" - }, - "display": { - "x": 1056, - "y": 348 - } - }, - "7bf79e28-4232-43f6-8002-4cedb5b72cd7": { - "id": "7bf79e28-4232-43f6-8002-4cedb5b72cd7", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betIsOk", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 1032, - "y": 144 - } - }, - "c3807aad-a77d-4a6e-8941-aceb75e75f26": { - "id": "c3807aad-a77d-4a6e-8941-aceb75e75f26", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@0" - }, - "display": { - "x": 372, - "y": 360 - } - }, - "f08511cc-fa3c-4729-a434-69986d8db842": { - "id": "f08511cc-fa3c-4729-a434-69986d8db842", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "betCoin", - "cmp": 0 - }, - "display": { - "x": 648, - "y": 1536 - } - }, - "cfb3bfdf-67e8-4bb9-9731-be379743e042": { - "id": "cfb3bfdf-67e8-4bb9-9731-be379743e042", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 132, - "y": 396 - }, - "children": [ - "c3807aad-a77d-4a6e-8941-aceb75e75f26", - "6d6f636d-a02a-42b5-9b4c-255c11352a68", - "43ad54ad-0bdc-4b6d-8ff5-f838f87d3bce" - ] - }, - "43ad54ad-0bdc-4b6d-8ff5-f838f87d3bce": { - "id": "43ad54ad-0bdc-4b6d-8ff5-f838f87d3bce", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 348, - "y": 504 - } - }, - "6728318e-fb51-4f59-8c60-72d0f3b8c8b1": { - "id": "6728318e-fb51-4f59-8c60-72d0f3b8c8b1", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 996, - "y": 420 - } - }, - "e1363bca-78ca-4923-995e-074cdcb803cf": { - "id": "e1363bca-78ca-4923-995e-074cdcb803cf", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": -312, - "y": 192 - }, - "children": [ - "521239f8-2829-471e-ab43-e0a98d77aab7", - "07529410-ecf9-4d54-ac6e-16982e4b0b25", - "6e65f94a-05f4-410f-be23-01ee2da43240", - "df0cd7eb-848f-49e0-87b6-d0ba50c282f1" - ] - }, - "07529410-ecf9-4d54-ac6e-16982e4b0b25": { - "id": "07529410-ecf9-4d54-ac6e-16982e4b0b25", - "name": "MemSequence", - "category": "composite", - "title": "MemSequence", - "description": "", - "properties": {}, - "display": { - "x": 0, - "y": 108 - }, - "children": [ - "d1b6d256-4b76-441b-a455-bdf592c0a722", - "752d8fae-ade7-4c2f-9d4e-ad066773b1bb", - "cfb3bfdf-67e8-4bb9-9731-be379743e042" - ] - }, - "752d8fae-ade7-4c2f-9d4e-ad066773b1bb": { - "id": "752d8fae-ade7-4c2f-9d4e-ad066773b1bb", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 516, - "y": 240 - }, - "children": [ - "6ffd1efe-4d56-44f8-87a4-e88201b51b48", - "6728318e-fb51-4f59-8c60-72d0f3b8c8b1" - ] - }, - "6ffd1efe-4d56-44f8-87a4-e88201b51b48": { - "id": "6ffd1efe-4d56-44f8-87a4-e88201b51b48", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 636, - "y": 120 - }, - "child": "455ac069-63e9-4f5c-97ff-a0800e3e813d" - }, - "272ca19a-1e93-4de4-915f-f7142312b4bd": { - "id": "272ca19a-1e93-4de4-915f-f7142312b4bd", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "takeCoinDiv", - "min": 10, - "max": 30 - }, - "display": { - "x": 984, - "y": 1236 - } - }, - "406d653d-e148-4722-aecf-ef77500ac21b": { - "id": "406d653d-e148-4722-aecf-ef77500ac21b", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 576, - "y": 1272 - }, - "children": [ - "96e4f37b-302f-4fb9-809f-ef0e6d80f3b1", - "272ca19a-1e93-4de4-915f-f7142312b4bd", - "7156278f-75b4-45aa-89aa-e436899fe51b", - "4df6815d-1ff7-4395-8666-aca24a7213b4", - "02997ae9-a706-4e08-8947-e550200db1ca" - ] - }, - "7156278f-75b4-45aa-89aa-e436899fe51b": { - "id": "7156278f-75b4-45aa-89aa-e436899fe51b", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "takeCoin" - }, - "display": { - "x": 972, - "y": 1284 - } - }, - "02997ae9-a706-4e08-8947-e550200db1ca": { - "id": "02997ae9-a706-4e08-8947-e550200db1ca", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "takeCoin", - "cmp": 0 - }, - "display": { - "x": 960, - "y": 1476 - } - }, - "96e4f37b-302f-4fb9-809f-ef0e6d80f3b1": { - "id": "96e4f37b-302f-4fb9-809f-ef0e6d80f3b1", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "takeCoinDiv" - }, - "display": { - "x": 1020, - "y": 1188 - } - }, - "4df6815d-1ff7-4395-8666-aca24a7213b4": { - "id": "4df6815d-1ff7-4395-8666-aca24a7213b4", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 984, - "y": 1392 - } - }, - "c764dcd1-7d5e-4e39-a068-8c309dff1484": { - "id": "c764dcd1-7d5e-4e39-a068-8c309dff1484", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 276, - "y": -636 - } - }, - "9d30f3ac-f772-48fb-852e-1acdec9d474f": { - "id": "9d30f3ac-f772-48fb-852e-1acdec9d474f", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betSrcCoin" - }, - "display": { - "x": 372, - "y": -276 - } - }, - "3cecf744-3e4b-4ca1-85b0-323aaa576314": { - "id": "3cecf744-3e4b-4ca1-85b0-323aaa576314", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 744, - "y": -240 - } - }, - "2a8386b7-8dfe-4057-84cc-d55f7b027611": { - "id": "2a8386b7-8dfe-4057-84cc-d55f7b027611", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "sameNum" - }, - "display": { - "x": 768, - "y": -132 - } - }, - "910076bb-4d07-471e-8280-a55a802ba13f": { - "id": "910076bb-4d07-471e-8280-a55a802ba13f", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "betArea" - }, - "display": { - "x": 756, - "y": -84 - } - }, - "ac131866-e93e-4df5-8b18-646af0ffa070": { - "id": "ac131866-e93e-4df5-8b18-646af0ffa070", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 1020, - "y": 84 - } - }, - "6d6f636d-a02a-42b5-9b4c-255c11352a68": { - "id": "6d6f636d-a02a-42b5-9b4c-255c11352a68", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 360, - "y": 432 - } - }, - "2710b442-af43-4350-baf9-eee1e00c2c67": { - "id": "2710b442-af43-4350-baf9-eee1e00c2c67", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "betArea" - }, - "display": { - "x": 1068, - "y": 276 - } - }, - "5bfdcdcf-57e3-4a15-8f02-5403d8447550": { - "id": "5bfdcdcf-57e3-4a15-8f02-5403d8447550", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 420, - "y": 612 - } - }, - "094558c6-747d-48d0-8846-3e648f1b58b6": { - "id": "094558c6-747d-48d0-8846-3e648f1b58b6", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 240, - "y": 936 - } - } - }, - "display": { - "camera_x": 575.9850000012666, - "camera_y": -21.6749999972526, - "camera_z": 0.75, - "x": -456, - "y": 192 - }, - "custom_nodes": [ - { - "version": "0.3.0", - "scope": "node", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "key", - "min": 0, - "max": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 0, - "maxTime": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "\"\"" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckBool", - "category": "condition", - "title": "CheckBool()", - "description": "检查一个黑板的key值", - "properties": { - "keyName": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "key", - "value": 0, - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LogAction", - "category": "action", - "title": "LogAction(,)", - "description": "输出日志", - "properties": { - "info": "info", - "level": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetPct", - "category": "action", - "title": "RVBBetPct(,)", - "description": "红黑下注\ngIPpct 下注百分比,黑板key 支持@\ngIPArea 下注区域,黑板key 支持@", - "properties": { - "gIPpct": "key", - "gIPArea": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {} - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "key", - "gIPValue": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "key", - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "key", - "num": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": 0, - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - } - ] -} \ No newline at end of file diff --git a/data/botai/dvtinvertwin.json b/data/botai/dvtinvertwin.json deleted file mode 100644 index a0dbd91..0000000 --- a/data/botai/dvtinvertwin.json +++ /dev/null @@ -1,1284 +0,0 @@ -{ - "version": "0.3.0", - "scope": "tree", - "id": "b5731d3a-691c-4271-b818-444f5ba03491", - "title": "DVTInvertWinBot", - "description": "龙虎 反手", - "root": "c56e902a-2191-47b2-a231-b285b27707f6", - "properties": {}, - "nodes": { - "3867ed0e-725c-48eb-894e-3aa618a6c5c9": { - "id": "3867ed0e-725c-48eb-894e-3aa618a6c5c9", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 408, - "y": -36 - }, - "children": [ - "6822b96d-08af-4d7f-8cba-9c3807b37e8e", - "774f427b-e3e6-4d3d-9521-f8b9adfcce19", - "3df61c16-0be3-4ef7-8b5a-25da08835e63", - "1e66e380-efd6-41fb-8a44-a3abf61e8ed3", - "ad07b001-3deb-4e63-80fb-dbd36cbc8c8c", - "aaccb693-07ea-487a-81e9-c5cc722f93d7", - "ff99a45d-d3ee-4d94-8339-49a315ffe90c" - ] - }, - "f9d918a1-7bde-4331-82ef-00e607dd09c2": { - "id": "f9d918a1-7bde-4331-82ef-00e607dd09c2", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betSrcCoin", - "min": 2, - "max": 6 - }, - "display": { - "x": 372, - "y": -432 - } - }, - "ec2fbcaa-a1ec-44b0-8976-6b00ea0a20b3": { - "id": "ec2fbcaa-a1ec-44b0-8976-6b00ea0a20b3", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 600, - "maxTime": 1200 - }, - "display": { - "x": 1140, - "y": 384 - } - }, - "586f564f-4237-441e-9a97-04c7a9b78043": { - "id": "586f564f-4237-441e-9a97-04c7a9b78043", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 72, - "y": 1092 - }, - "children": [ - "49df9afd-f126-4814-a45c-9b5372af2f7b", - "bd9d99c8-e75e-442e-aaa5-7aac04258a1c", - "4cf8eb59-7a37-49b7-83a2-331bf817da20", - "7312a87b-d3f7-42c5-b7fb-d0773b0051e1" - ] - }, - "7ab20fd5-902d-4839-9fca-4c52ee5f580a": { - "id": "7ab20fd5-902d-4839-9fca-4c52ee5f580a", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "saveLimit", - "cmp": 0 - }, - "display": { - "x": 960, - "y": 996 - } - }, - "330dfd90-d165-444a-9ccb-fca9888d864c": { - "id": "330dfd90-d165-444a-9ccb-fca9888d864c", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "saveLimit" - }, - "display": { - "x": 948, - "y": 924 - } - }, - "4cf8eb59-7a37-49b7-83a2-331bf817da20": { - "id": "4cf8eb59-7a37-49b7-83a2-331bf817da20", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 500, - "maxTime": 3500 - }, - "display": { - "x": 300, - "y": 1248 - } - }, - "7312a87b-d3f7-42c5-b7fb-d0773b0051e1": { - "id": "7312a87b-d3f7-42c5-b7fb-d0773b0051e1", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {}, - "display": { - "x": 264, - "y": 1392 - } - }, - "605190eb-13f1-4636-8726-8bae569b4f3a": { - "id": "605190eb-13f1-4636-8726-8bae569b4f3a", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "maxGameNum", - "cmp": 4 - }, - "display": { - "x": 1008, - "y": 1176 - } - }, - "fe24c868-4d2e-4736-8a20-6d394654e830": { - "id": "fe24c868-4d2e-4736-8a20-6d394654e830", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "maxGameNum", - "min": 5, - "max": 30 - }, - "display": { - "x": 984, - "y": 1092 - } - }, - "7cde24c8-9874-4a78-a506-171133d3e99e": { - "id": "7cde24c8-9874-4a78-a506-171133d3e99e", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "生成初始押注额度", - "properties": {}, - "display": { - "x": 132, - "y": -372 - }, - "children": [ - "f215847a-03fe-4790-81cc-e19a50a41d1c", - "d90b1fa5-51c2-4432-86c0-ac31f91fe880", - "9a6c0d30-d420-4451-b515-5c79c726703c", - "f9d918a1-7bde-4331-82ef-00e607dd09c2", - "78f3f7d0-b86b-434e-8d16-d0268571be3f", - "b7a65e1f-333f-4b4f-8c45-e1928cfabe73", - "8a859274-7f02-48f8-81b9-99f92a8a36a4", - "f98e90d0-eb06-41ac-b6af-3e9c812f5a62" - ] - }, - "d90b1fa5-51c2-4432-86c0-ac31f91fe880": { - "id": "d90b1fa5-51c2-4432-86c0-ac31f91fe880", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "needStartBet", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 348, - "y": -528 - } - }, - "9a6c0d30-d420-4451-b515-5c79c726703c": { - "id": "9a6c0d30-d420-4451-b515-5c79c726703c", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@1" - }, - "display": { - "x": 372, - "y": -480 - } - }, - "ad07b001-3deb-4e63-80fb-dbd36cbc8c8c": { - "id": "ad07b001-3deb-4e63-80fb-dbd36cbc8c8c", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "needStartBet" - }, - "display": { - "x": 864, - "y": 24 - } - }, - "aaccb693-07ea-487a-81e9-c5cc722f93d7": { - "id": "aaccb693-07ea-487a-81e9-c5cc722f93d7", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue1": "needStartBet", - "gIPValue2": "@2" - }, - "display": { - "x": 852, - "y": 72 - } - }, - "b5f58277-0cfe-4c4e-96b7-20b1d72d580c": { - "id": "b5f58277-0cfe-4c4e-96b7-20b1d72d580c", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 228, - "y": 744 - }, - "children": [ - "37c3cb74-8b30-4a5f-8df5-55b8dc8e46ac", - "aed37422-3a02-4ab7-806d-84554f73c28a", - "b3dd5c17-cca0-4dfa-8ace-1944fb37749f" - ] - }, - "aed37422-3a02-4ab7-806d-84554f73c28a": { - "id": "aed37422-3a02-4ab7-806d-84554f73c28a", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "@1", - "cmp": 2 - }, - "display": { - "x": 528, - "y": 732 - } - }, - "b3dd5c17-cca0-4dfa-8ace-1944fb37749f": { - "id": "b3dd5c17-cca0-4dfa-8ace-1944fb37749f", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@0" - }, - "display": { - "x": 516, - "y": 804 - } - }, - "78f3f7d0-b86b-434e-8d16-d0268571be3f": { - "id": "78f3f7d0-b86b-434e-8d16-d0268571be3f", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "playerCoin" - }, - "display": { - "x": 360, - "y": -384 - } - }, - "b7a65e1f-333f-4b4f-8c45-e1928cfabe73": { - "id": "b7a65e1f-333f-4b4f-8c45-e1928cfabe73", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "playerCoin" - }, - "display": { - "x": 432, - "y": -336 - } - }, - "8a859274-7f02-48f8-81b9-99f92a8a36a4": { - "id": "8a859274-7f02-48f8-81b9-99f92a8a36a4", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 408, - "y": -288 - } - }, - "bd9d99c8-e75e-442e-aaa5-7aac04258a1c": { - "id": "bd9d99c8-e75e-442e-aaa5-7aac04258a1c", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 384, - "y": 1104 - }, - "children": [ - "3ea8c5e0-83b1-44c3-94ed-022c74c81632", - "1abc8dc0-7dd3-4b58-834b-ff96a7d4f781", - "3a901eb5-8890-41fb-8b6a-598d30478429", - "51676728-ebe5-4481-8387-30b840749182" - ] - }, - "3ea8c5e0-83b1-44c3-94ed-022c74c81632": { - "id": "3ea8c5e0-83b1-44c3-94ed-022c74c81632", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 624, - "y": 1020 - }, - "children": [ - "330dfd90-d165-444a-9ccb-fca9888d864c", - "7ab20fd5-902d-4839-9fca-4c52ee5f580a" - ] - }, - "1abc8dc0-7dd3-4b58-834b-ff96a7d4f781": { - "id": "1abc8dc0-7dd3-4b58-834b-ff96a7d4f781", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 624, - "y": 1176 - }, - "children": [ - "fe24c868-4d2e-4736-8a20-6d394654e830", - "605190eb-13f1-4636-8726-8bae569b4f3a" - ] - }, - "774f427b-e3e6-4d3d-9521-f8b9adfcce19": { - "id": "774f427b-e3e6-4d3d-9521-f8b9adfcce19", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "sameNum", - "min": 3, - "max": 5 - }, - "display": { - "x": 816, - "y": -132 - } - }, - "7a10ce37-bf1b-4a54-9969-3dac615b4f3f": { - "id": "7a10ce37-bf1b-4a54-9969-3dac615b4f3f", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 864, - "y": 324 - }, - "children": [ - "bf3a8e66-e69a-4b99-98a9-c5ad44c0a72a", - "a36141c4-c760-4400-b6a1-4509723f1f50", - "ec2fbcaa-a1ec-44b0-8976-6b00ea0a20b3", - "618f7726-459b-4d7e-8b0f-77d4ee097fa5" - ] - }, - "618f7726-459b-4d7e-8b0f-77d4ee097fa5": { - "id": "618f7726-459b-4d7e-8b0f-77d4ee097fa5", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 948, - "y": 468 - }, - "children": [ - "1d79bf2a-0d2b-448b-8db5-fffc8b3be7b1", - "88f78ad3-58c7-494a-8979-b87b63ce74ea" - ] - }, - "88f78ad3-58c7-494a-8979-b87b63ce74ea": { - "id": "88f78ad3-58c7-494a-8979-b87b63ce74ea", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@1" - }, - "display": { - "x": 1152, - "y": 528 - } - }, - "a36141c4-c760-4400-b6a1-4509723f1f50": { - "id": "a36141c4-c760-4400-b6a1-4509723f1f50", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betIsOk", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 1128, - "y": 324 - } - }, - "2348b6b7-1a1d-4d43-8023-8a3b49216095": { - "id": "2348b6b7-1a1d-4d43-8023-8a3b49216095", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@0" - }, - "display": { - "x": 420, - "y": 408 - } - }, - "51676728-ebe5-4481-8387-30b840749182": { - "id": "51676728-ebe5-4481-8387-30b840749182", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "betCoin", - "cmp": 0 - }, - "display": { - "x": 708, - "y": 1572 - } - }, - "fecdf0a9-1d1a-478b-9e92-9211c580b3b9": { - "id": "fecdf0a9-1d1a-478b-9e92-9211c580b3b9", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 180, - "y": 444 - }, - "children": [ - "2348b6b7-1a1d-4d43-8023-8a3b49216095", - "f0371824-9be3-4dc0-b447-cf9b56700fbf", - "f0330c18-245c-4d33-865b-489577e03d1d" - ] - }, - "f0330c18-245c-4d33-865b-489577e03d1d": { - "id": "f0330c18-245c-4d33-865b-489577e03d1d", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 396, - "y": 552 - } - }, - "054cdb7e-e898-445a-ac1b-0b9692477a42": { - "id": "054cdb7e-e898-445a-ac1b-0b9692477a42", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 1092, - "y": 600 - } - }, - "c56e902a-2191-47b2-a231-b285b27707f6": { - "id": "c56e902a-2191-47b2-a231-b285b27707f6", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": -264, - "y": 240 - }, - "children": [ - "7cde24c8-9874-4a78-a506-171133d3e99e", - "4263203b-9944-43e9-aaf6-3590c05b5e4f", - "b5f58277-0cfe-4c4e-96b7-20b1d72d580c", - "586f564f-4237-441e-9a97-04c7a9b78043" - ] - }, - "4263203b-9944-43e9-aaf6-3590c05b5e4f": { - "id": "4263203b-9944-43e9-aaf6-3590c05b5e4f", - "name": "MemSequence", - "category": "composite", - "title": "MemSequence", - "description": "", - "properties": {}, - "display": { - "x": 48, - "y": 156 - }, - "children": [ - "3867ed0e-725c-48eb-894e-3aa618a6c5c9", - "d889262c-2397-47ad-8eee-43d7e3057ffd", - "fecdf0a9-1d1a-478b-9e92-9211c580b3b9" - ] - }, - "d889262c-2397-47ad-8eee-43d7e3057ffd": { - "id": "d889262c-2397-47ad-8eee-43d7e3057ffd", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 612, - "y": 360 - }, - "children": [ - "50c7c380-4ccc-4062-8681-e12e1b7fc9a7", - "054cdb7e-e898-445a-ac1b-0b9692477a42" - ] - }, - "50c7c380-4ccc-4062-8681-e12e1b7fc9a7": { - "id": "50c7c380-4ccc-4062-8681-e12e1b7fc9a7", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 732, - "y": 300 - }, - "child": "7a10ce37-bf1b-4a54-9969-3dac615b4f3f" - }, - "ff99a45d-d3ee-4d94-8339-49a315ffe90c": { - "id": "ff99a45d-d3ee-4d94-8339-49a315ffe90c", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 708, - "y": 144 - }, - "children": [ - "df2b9c40-653c-471d-8cdc-c222dfdcf7ec", - "fb863925-3ebf-4e50-84e4-d7748e72a54f" - ] - }, - "df2b9c40-653c-471d-8cdc-c222dfdcf7ec": { - "id": "df2b9c40-653c-471d-8cdc-c222dfdcf7ec", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 1044, - "y": 120 - }, - "children": [ - "3ebb51ae-3e7f-4746-8cc9-7f5188db0eb9", - "1dca51b7-6ed4-4a50-b07a-1d7b04d9575e" - ] - }, - "3ebb51ae-3e7f-4746-8cc9-7f5188db0eb9": { - "id": "3ebb51ae-3e7f-4746-8cc9-7f5188db0eb9", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betArea", - "value": 1, - "cmp": 2 - }, - "display": { - "x": 1308, - "y": 0 - } - }, - "1dca51b7-6ed4-4a50-b07a-1d7b04d9575e": { - "id": "1dca51b7-6ed4-4a50-b07a-1d7b04d9575e", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betArea", - "gIPValue": "@2" - }, - "display": { - "x": 1332, - "y": 60 - } - }, - "fb863925-3ebf-4e50-84e4-d7748e72a54f": { - "id": "fb863925-3ebf-4e50-84e4-d7748e72a54f", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 1044, - "y": 168 - }, - "children": [ - "e09fcf87-4ff0-4550-8364-b069fe0ffe63", - "5b1368c6-5692-4ed7-a79b-1d606a08e97d" - ] - }, - "e09fcf87-4ff0-4550-8364-b069fe0ffe63": { - "id": "e09fcf87-4ff0-4550-8364-b069fe0ffe63", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betArea", - "value": 2, - "cmp": 2 - }, - "display": { - "x": 1332, - "y": 108 - } - }, - "5b1368c6-5692-4ed7-a79b-1d606a08e97d": { - "id": "5b1368c6-5692-4ed7-a79b-1d606a08e97d", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betArea", - "gIPValue": "@1" - }, - "display": { - "x": 1356, - "y": 168 - } - }, - "279f1942-b1da-42a5-a73e-69ad9def364f": { - "id": "279f1942-b1da-42a5-a73e-69ad9def364f", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "takeCoinDiv", - "min": 10, - "max": 30 - }, - "display": { - "x": 972, - "y": 1236 - } - }, - "3a901eb5-8890-41fb-8b6a-598d30478429": { - "id": "3a901eb5-8890-41fb-8b6a-598d30478429", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 624, - "y": 1284 - }, - "children": [ - "279f1942-b1da-42a5-a73e-69ad9def364f", - "7386ae1b-1eea-4c9c-86cf-bcf4e11bebdf", - "cc25360e-6225-446d-85f6-edb4fe41d2e8", - "28b467fc-e6e0-4e9d-99f6-2765ff6abb87", - "7f241929-d17b-4693-84ae-642e22c82f87" - ] - }, - "7386ae1b-1eea-4c9c-86cf-bcf4e11bebdf": { - "id": "7386ae1b-1eea-4c9c-86cf-bcf4e11bebdf", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "takeCoin" - }, - "display": { - "x": 960, - "y": 1284 - } - }, - "7f241929-d17b-4693-84ae-642e22c82f87": { - "id": "7f241929-d17b-4693-84ae-642e22c82f87", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "takeCoin", - "cmp": 0 - }, - "display": { - "x": 948, - "y": 1476 - } - }, - "cc25360e-6225-446d-85f6-edb4fe41d2e8": { - "id": "cc25360e-6225-446d-85f6-edb4fe41d2e8", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "takeCoinDiv" - }, - "display": { - "x": 1008, - "y": 1344 - } - }, - "28b467fc-e6e0-4e9d-99f6-2765ff6abb87": { - "id": "28b467fc-e6e0-4e9d-99f6-2765ff6abb87", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 972, - "y": 1404 - } - }, - "f215847a-03fe-4790-81cc-e19a50a41d1c": { - "id": "f215847a-03fe-4790-81cc-e19a50a41d1c", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 312, - "y": -588 - } - }, - "f98e90d0-eb06-41ac-b6af-3e9c812f5a62": { - "id": "f98e90d0-eb06-41ac-b6af-3e9c812f5a62", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betSrcCoin" - }, - "display": { - "x": 420, - "y": -228 - } - }, - "6822b96d-08af-4d7f-8cba-9c3807b37e8e": { - "id": "6822b96d-08af-4d7f-8cba-9c3807b37e8e", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 768, - "y": -192 - } - }, - "3df61c16-0be3-4ef7-8b5a-25da08835e63": { - "id": "3df61c16-0be3-4ef7-8b5a-25da08835e63", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "sameNum" - }, - "display": { - "x": 804, - "y": -84 - } - }, - "1e66e380-efd6-41fb-8a44-a3abf61e8ed3": { - "id": "1e66e380-efd6-41fb-8a44-a3abf61e8ed3", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "betArea" - }, - "display": { - "x": 792, - "y": -36 - } - }, - "bf3a8e66-e69a-4b99-98a9-c5ad44c0a72a": { - "id": "bf3a8e66-e69a-4b99-98a9-c5ad44c0a72a", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 1104, - "y": 264 - } - }, - "1d79bf2a-0d2b-448b-8db5-fffc8b3be7b1": { - "id": "1d79bf2a-0d2b-448b-8db5-fffc8b3be7b1", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "betArea" - }, - "display": { - "x": 1164, - "y": 456 - } - }, - "f0371824-9be3-4dc0-b447-cf9b56700fbf": { - "id": "f0371824-9be3-4dc0-b447-cf9b56700fbf", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 396, - "y": 480 - } - }, - "37c3cb74-8b30-4a5f-8df5-55b8dc8e46ac": { - "id": "37c3cb74-8b30-4a5f-8df5-55b8dc8e46ac", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 468, - "y": 672 - } - }, - "49df9afd-f126-4814-a45c-9b5372af2f7b": { - "id": "49df9afd-f126-4814-a45c-9b5372af2f7b", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 300, - "y": 996 - } - } - }, - "display": { - "camera_x": 222.7900000035297, - "camera_y": -608.9149999988731, - "camera_z": 1, - "x": -444, - "y": 240 - }, - "custom_nodes": [ - { - "version": "0.3.0", - "scope": "node", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "key", - "min": 0, - "max": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 0, - "maxTime": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "\"\"" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckBool", - "category": "condition", - "title": "CheckBool()", - "description": "检查一个黑板的key值", - "properties": { - "keyName": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "key", - "value": 0, - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LogAction", - "category": "action", - "title": "LogAction(,)", - "description": "输出日志", - "properties": { - "info": "info", - "level": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetPct", - "category": "action", - "title": "RVBBetPct(,)", - "description": "红黑下注\ngIPpct 下注百分比,黑板key 支持@\ngIPArea 下注区域,黑板key 支持@", - "properties": { - "gIPpct": "key", - "gIPArea": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {} - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "key", - "gIPValue": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "key", - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "key", - "num": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": 0, - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - } - ] -} \ No newline at end of file diff --git a/data/botai/dvtrandom.json b/data/botai/dvtrandom.json deleted file mode 100644 index a864e9e..0000000 --- a/data/botai/dvtrandom.json +++ /dev/null @@ -1,1059 +0,0 @@ -{ - "version": "0.3.0", - "scope": "tree", - "id": "e48a3128-ccf5-40fa-825e-85a778c46954", - "title": "DVTRandomBot", - "description": "龙虎随机机器人", - "root": "17a798f7-5270-4c07-b56b-90854a8617a6", - "properties": {}, - "nodes": { - "40bb4ee0-c1e3-4399-8af9-4edba593f737": { - "id": "40bb4ee0-c1e3-4399-8af9-4edba593f737", - "name": "MemSequence", - "category": "composite", - "title": "MemSequence", - "description": "", - "properties": {}, - "display": { - "x": 360, - "y": -300 - }, - "children": [ - "2600c6ff-388f-405d-802f-857a2bc5049e", - "fdc39a2b-01cd-4544-b8fa-fd95f2425e5c", - "f0f1f6db-6623-4152-8879-d15181967caa", - "98e13cbc-ed04-4e85-8b06-4689e5432c2a" - ] - }, - "fdc39a2b-01cd-4544-b8fa-fd95f2425e5c": { - "id": "fdc39a2b-01cd-4544-b8fa-fd95f2425e5c", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 100, - "maxTime": 4000 - }, - "display": { - "x": 744, - "y": -372 - } - }, - "f0f1f6db-6623-4152-8879-d15181967caa": { - "id": "f0f1f6db-6623-4152-8879-d15181967caa", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "7|100" - }, - "display": { - "x": 732, - "y": -216 - }, - "children": [ - "8cb03d04-efbb-45c4-87ec-8bc7d56dc073", - "8fa27d60-d1bf-4180-86fa-0f7df43964aa" - ] - }, - "17a798f7-5270-4c07-b56b-90854a8617a6": { - "id": "17a798f7-5270-4c07-b56b-90854a8617a6", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 156, - "y": 372 - }, - "children": [ - "40bb4ee0-c1e3-4399-8af9-4edba593f737", - "851f539f-606e-404c-a981-32201499a7c0" - ] - }, - "851f539f-606e-404c-a981-32201499a7c0": { - "id": "851f539f-606e-404c-a981-32201499a7c0", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 408, - "y": 612 - }, - "children": [ - "c99835ea-a71f-4259-9a55-a3a47c53ce4c", - "ecfdebd2-e48d-4501-8ffd-33771ea788cd", - "4f583aa3-2fce-482b-87e9-7a23cd10790f", - "2f80c20e-c2ca-4802-9975-b0face24b105" - ] - }, - "6fb0e1c1-6464-4b40-8bfa-883377fb7778": { - "id": "6fb0e1c1-6464-4b40-8bfa-883377fb7778", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "saveLimit", - "cmp": 0 - }, - "display": { - "x": 1296, - "y": 516 - } - }, - "716444a6-5f39-44f2-80c0-2181ca3d7689": { - "id": "716444a6-5f39-44f2-80c0-2181ca3d7689", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "saveLimit" - }, - "display": { - "x": 1284, - "y": 444 - } - }, - "4f583aa3-2fce-482b-87e9-7a23cd10790f": { - "id": "4f583aa3-2fce-482b-87e9-7a23cd10790f", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 500, - "maxTime": 3000 - }, - "display": { - "x": 636, - "y": 768 - } - }, - "2f80c20e-c2ca-4802-9975-b0face24b105": { - "id": "2f80c20e-c2ca-4802-9975-b0face24b105", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {}, - "display": { - "x": 612, - "y": 960 - } - }, - "e89733da-8e7f-48b9-a0ca-6c7f7b3e0afc": { - "id": "e89733da-8e7f-48b9-a0ca-6c7f7b3e0afc", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "maxGameNum", - "cmp": 4 - }, - "display": { - "x": 1344, - "y": 696 - } - }, - "bfc09d8b-40ef-4697-823e-f6c28371a18b": { - "id": "bfc09d8b-40ef-4697-823e-f6c28371a18b", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "maxGameNum", - "min": 5, - "max": 30 - }, - "display": { - "x": 1320, - "y": 612 - } - }, - "ecfdebd2-e48d-4501-8ffd-33771ea788cd": { - "id": "ecfdebd2-e48d-4501-8ffd-33771ea788cd", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 720, - "y": 624 - }, - "children": [ - "801fa819-f99c-4b29-8a4c-6b422614f5ea", - "aeb1db0a-ce87-4673-bfd2-47044ba43af8", - "f927fad5-6bab-4a2e-be7c-98939b76dd32", - "74dc3d66-3022-4aac-8d34-85a52a50f601" - ] - }, - "801fa819-f99c-4b29-8a4c-6b422614f5ea": { - "id": "801fa819-f99c-4b29-8a4c-6b422614f5ea", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 960, - "y": 540 - }, - "children": [ - "716444a6-5f39-44f2-80c0-2181ca3d7689", - "6fb0e1c1-6464-4b40-8bfa-883377fb7778" - ] - }, - "aeb1db0a-ce87-4673-bfd2-47044ba43af8": { - "id": "aeb1db0a-ce87-4673-bfd2-47044ba43af8", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 960, - "y": 696 - }, - "children": [ - "bfc09d8b-40ef-4697-823e-f6c28371a18b", - "e89733da-8e7f-48b9-a0ca-6c7f7b3e0afc" - ] - }, - "74dc3d66-3022-4aac-8d34-85a52a50f601": { - "id": "74dc3d66-3022-4aac-8d34-85a52a50f601", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "betCoin", - "cmp": 0 - }, - "display": { - "x": 1056, - "y": 1152 - } - }, - "ff0cfe0e-b25b-4e57-8350-a988ee16da04": { - "id": "ff0cfe0e-b25b-4e57-8350-a988ee16da04", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betSrcCoin", - "min": 15, - "max": 35 - }, - "display": { - "x": 768, - "y": -744 - } - }, - "2600c6ff-388f-405d-802f-857a2bc5049e": { - "id": "2600c6ff-388f-405d-802f-857a2bc5049e", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "生成初始押注额度", - "properties": {}, - "display": { - "x": 516, - "y": -624 - }, - "children": [ - "44aa2c38-49cc-4b47-935c-478671025ebc", - "ff0cfe0e-b25b-4e57-8350-a988ee16da04", - "fca64ef6-59fe-459a-b17b-15f2cb444494", - "f02189b7-d510-4c72-9c90-a6d8d8b22618", - "95b19b79-ba48-4458-85d0-348e30cb89eb", - "a0925c1e-0a2b-4cf3-8ca2-c7b51c80d145", - "524d7dcd-ad9c-49d9-9112-8979a4e5178d" - ] - }, - "fca64ef6-59fe-459a-b17b-15f2cb444494": { - "id": "fca64ef6-59fe-459a-b17b-15f2cb444494", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "playerCoin" - }, - "display": { - "x": 756, - "y": -684 - } - }, - "95b19b79-ba48-4458-85d0-348e30cb89eb": { - "id": "95b19b79-ba48-4458-85d0-348e30cb89eb", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 804, - "y": -564 - } - }, - "524d7dcd-ad9c-49d9-9112-8979a4e5178d": { - "id": "524d7dcd-ad9c-49d9-9112-8979a4e5178d", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betArea", - "min": 1, - "max": 3 - }, - "display": { - "x": 756, - "y": -444 - } - }, - "98e13cbc-ed04-4e85-8b06-4689e5432c2a": { - "id": "98e13cbc-ed04-4e85-8b06-4689e5432c2a", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 492, - "y": -24 - }, - "children": [ - "edc549af-53dc-4866-b6a8-c8d104f5eb5f", - "8ac94f1b-5ac2-484e-b47e-077f11116c1f" - ] - }, - "8ac94f1b-5ac2-484e-b47e-077f11116c1f": { - "id": "8ac94f1b-5ac2-484e-b47e-077f11116c1f", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 672, - "y": 36 - } - }, - "13c0d7af-9312-45e0-89be-bcf852972c7a": { - "id": "13c0d7af-9312-45e0-89be-bcf852972c7a", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 300, - "maxTime": 900 - }, - "display": { - "x": 1524, - "y": -432 - } - }, - "333c338a-edc1-46df-8640-ce69553ec829": { - "id": "333c338a-edc1-46df-8640-ce69553ec829", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 1332, - "y": -372 - }, - "children": [ - "18f20a87-f766-48c3-866b-d88a27b25f9e", - "28932c02-c37d-4060-8253-b10cd2c9d224", - "13c0d7af-9312-45e0-89be-bcf852972c7a", - "1297e23e-f652-4224-81b1-645a65bab464" - ] - }, - "f564c5ce-896f-46e3-90b9-3bea59defa88": { - "id": "f564c5ce-896f-46e3-90b9-3bea59defa88", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 1488, - "y": -228 - } - }, - "8cb03d04-efbb-45c4-87ec-8bc7d56dc073": { - "id": "8cb03d04-efbb-45c4-87ec-8bc7d56dc073", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 1056, - "y": -240 - }, - "children": [ - "3959a9c9-ea71-4034-b5f9-e3f014cc17fc", - "f564c5ce-896f-46e3-90b9-3bea59defa88" - ] - }, - "3959a9c9-ea71-4034-b5f9-e3f014cc17fc": { - "id": "3959a9c9-ea71-4034-b5f9-e3f014cc17fc", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 1212, - "y": -312 - }, - "child": "333c338a-edc1-46df-8640-ce69553ec829" - }, - "4a212c84-5d1d-4e5d-8c0f-a9f9d11e439d": { - "id": "4a212c84-5d1d-4e5d-8c0f-a9f9d11e439d", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 200, - "maxTime": 600 - }, - "display": { - "x": 1524, - "y": -132 - } - }, - "c10ca763-66cf-4b6c-87d7-ca835f7974e9": { - "id": "c10ca763-66cf-4b6c-87d7-ca835f7974e9", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 1332, - "y": -96 - }, - "children": [ - "4a212c84-5d1d-4e5d-8c0f-a9f9d11e439d", - "11948c7f-5c40-4107-8d56-6125dd54e5e2" - ] - }, - "a9e5ea0d-ac6c-49e9-96d4-6581cdb7c470": { - "id": "a9e5ea0d-ac6c-49e9-96d4-6581cdb7c470", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 1476, - "y": 60 - } - }, - "8fa27d60-d1bf-4180-86fa-0f7df43964aa": { - "id": "8fa27d60-d1bf-4180-86fa-0f7df43964aa", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 1068, - "y": 24 - }, - "children": [ - "45e66071-e115-49e6-abc6-9e4e3451c183", - "a9e5ea0d-ac6c-49e9-96d4-6581cdb7c470" - ] - }, - "45e66071-e115-49e6-abc6-9e4e3451c183": { - "id": "45e66071-e115-49e6-abc6-9e4e3451c183", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 1200, - "y": -60 - }, - "child": "c10ca763-66cf-4b6c-87d7-ca835f7974e9" - }, - "f02189b7-d510-4c72-9c90-a6d8d8b22618": { - "id": "f02189b7-d510-4c72-9c90-a6d8d8b22618", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "playerCoin" - }, - "display": { - "x": 828, - "y": -624 - } - }, - "2008f23e-56e8-4818-be5c-b2519e5234fa": { - "id": "2008f23e-56e8-4818-be5c-b2519e5234fa", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "takeCoinDiv", - "min": 20, - "max": 40 - }, - "display": { - "x": 1332, - "y": 768 - } - }, - "f927fad5-6bab-4a2e-be7c-98939b76dd32": { - "id": "f927fad5-6bab-4a2e-be7c-98939b76dd32", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 960, - "y": 816 - }, - "children": [ - "2008f23e-56e8-4818-be5c-b2519e5234fa", - "ccc49727-0ca1-4694-9fdd-c471621bf8ae", - "68ec252c-c055-4c2d-a1be-2985696ce689", - "1873d62c-2aa1-456b-8cbc-e56b2f2d1299", - "604b38aa-b2ca-40ac-9f89-1581ce12a281" - ] - }, - "ccc49727-0ca1-4694-9fdd-c471621bf8ae": { - "id": "ccc49727-0ca1-4694-9fdd-c471621bf8ae", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "takeCoin" - }, - "display": { - "x": 1320, - "y": 816 - } - }, - "604b38aa-b2ca-40ac-9f89-1581ce12a281": { - "id": "604b38aa-b2ca-40ac-9f89-1581ce12a281", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "takeCoin", - "cmp": 0 - }, - "display": { - "x": 1308, - "y": 1008 - } - }, - "68ec252c-c055-4c2d-a1be-2985696ce689": { - "id": "68ec252c-c055-4c2d-a1be-2985696ce689", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "takeCoinDiv" - }, - "display": { - "x": 1368, - "y": 876 - } - }, - "1873d62c-2aa1-456b-8cbc-e56b2f2d1299": { - "id": "1873d62c-2aa1-456b-8cbc-e56b2f2d1299", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 1332, - "y": 936 - } - }, - "1297e23e-f652-4224-81b1-645a65bab464": { - "id": "1297e23e-f652-4224-81b1-645a65bab464", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "betSrcCoin", - "gIPArea": "@0" - }, - "display": { - "x": 1548, - "y": -348 - } - }, - "11948c7f-5c40-4107-8d56-6125dd54e5e2": { - "id": "11948c7f-5c40-4107-8d56-6125dd54e5e2", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "betArea" - }, - "display": { - "x": 1548, - "y": -48 - } - }, - "edc549af-53dc-4866-b6a8-c8d104f5eb5f": { - "id": "edc549af-53dc-4866-b6a8-c8d104f5eb5f", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 672, - "y": -72 - } - }, - "44aa2c38-49cc-4b47-935c-478671025ebc": { - "id": "44aa2c38-49cc-4b47-935c-478671025ebc", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 708, - "y": -816 - } - }, - "a0925c1e-0a2b-4cf3-8ca2-c7b51c80d145": { - "id": "a0925c1e-0a2b-4cf3-8ca2-c7b51c80d145", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betCoin" - }, - "display": { - "x": 804, - "y": -504 - } - }, - "c99835ea-a71f-4259-9a55-a3a47c53ce4c": { - "id": "c99835ea-a71f-4259-9a55-a3a47c53ce4c", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 准备结算\n5 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 636, - "y": 540 - } - }, - "18f20a87-f766-48c3-866b-d88a27b25f9e": { - "id": "18f20a87-f766-48c3-866b-d88a27b25f9e", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betCoin", - "gIPValue2": "@2" - }, - "display": { - "x": 1548, - "y": -552 - } - }, - "28932c02-c37d-4060-8253-b10cd2c9d224": { - "id": "28932c02-c37d-4060-8253-b10cd2c9d224", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betSrcCoin" - }, - "display": { - "x": 1596, - "y": -492 - } - } - }, - "display": { - "camera_x": 220.14000000315718, - "camera_y": 153.3199999993667, - "camera_z": 0.75, - "x": -60, - "y": 372 - }, - "custom_nodes": [ - { - "version": "0.3.0", - "scope": "node", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "key", - "min": 0, - "max": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 0, - "maxTime": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "\"\"" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckBool", - "category": "condition", - "title": "CheckBool()", - "description": "检查一个黑板的key值", - "properties": { - "keyName": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "key", - "value": 0, - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LogAction", - "category": "action", - "title": "LogAction(,)", - "description": "输出日志", - "properties": { - "info": "info", - "level": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetPct", - "category": "action", - "title": "RVBBetPct(,)", - "description": "红黑下注\ngIPpct 下注百分比,黑板key 支持@\ngIPArea 下注区域,黑板key 支持@", - "properties": { - "gIPpct": "key", - "gIPArea": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {} - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "key", - "gIPValue": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "key", - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "key", - "num": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": 0, - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - } - ] -} \ No newline at end of file diff --git a/data/botai/rvbfollowwin.json b/data/botai/rvbfollowwin.json deleted file mode 100644 index 8a415c4..0000000 --- a/data/botai/rvbfollowwin.json +++ /dev/null @@ -1,1174 +0,0 @@ -{ - "version": "0.3.0", - "scope": "tree", - "id": "3729efe7-b5eb-4656-8694-23a7f4d3b92d", - "title": "RVBFollowWinBot", - "description": "跟龙 倍投", - "root": "3868f9e0-f1f2-4927-9b75-f4049a3f5fa6", - "properties": {}, - "nodes": { - "32f44dae-b2da-4b7f-8e9b-a0594d9b9c7c": { - "id": "32f44dae-b2da-4b7f-8e9b-a0594d9b9c7c", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 696, - "y": -288 - } - }, - "8ee2e525-0e10-4339-9fc1-091059a33a3b": { - "id": "8ee2e525-0e10-4339-9fc1-091059a33a3b", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 276, - "y": -156 - }, - "children": [ - "32f44dae-b2da-4b7f-8e9b-a0594d9b9c7c", - "8289c2a3-9316-4a88-a2cd-b1f36d22d315", - "254e71dd-e4b5-45fd-9a43-812dfcf99f4e", - "3fe9e989-b8c9-4a07-b4af-45966df9aad7", - "87f04e22-3804-4713-8030-3367f2a3dc48", - "79dcac3e-9c14-4963-958f-82410069335b" - ] - }, - "fe47e8e1-19ef-448e-8c20-c9839229f1cf": { - "id": "fe47e8e1-19ef-448e-8c20-c9839229f1cf", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betSrcCoin", - "min": 2, - "max": 6 - }, - "display": { - "x": 276, - "y": -528 - } - }, - "f60a1323-ca6a-43cc-bd26-ef5a3c5c750c": { - "id": "f60a1323-ca6a-43cc-bd26-ef5a3c5c750c", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 972, - "y": 48 - } - }, - "bec1e9bc-4be0-47ff-8a69-f2211bd68011": { - "id": "bec1e9bc-4be0-47ff-8a69-f2211bd68011", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 600, - "maxTime": 1200 - }, - "display": { - "x": 996, - "y": 156 - } - }, - "254e71dd-e4b5-45fd-9a43-812dfcf99f4e": { - "id": "254e71dd-e4b5-45fd-9a43-812dfcf99f4e", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "sameNum", - "num": 2 - }, - "display": { - "x": 720, - "y": -180 - } - }, - "3fe9e989-b8c9-4a07-b4af-45966df9aad7": { - "id": "3fe9e989-b8c9-4a07-b4af-45966df9aad7", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "betArea" - }, - "display": { - "x": 696, - "y": -132 - } - }, - "e683afae-4710-4113-9c6a-ffde88d780a1": { - "id": "e683afae-4710-4113-9c6a-ffde88d780a1", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": -24, - "y": 996 - }, - "children": [ - "9bfd94ac-09b8-41b7-9898-62fa25e6e1ff", - "1bf7fa77-6cc7-4120-8862-61668a6768bc", - "e785463c-b082-403e-8b33-e2123551313d", - "383031e5-3af8-4b56-826a-76fff677d1c2" - ] - }, - "9bfd94ac-09b8-41b7-9898-62fa25e6e1ff": { - "id": "9bfd94ac-09b8-41b7-9898-62fa25e6e1ff", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 216, - "y": 876 - } - }, - "b9d620f1-7c32-423b-bab4-dc50183a602d": { - "id": "b9d620f1-7c32-423b-bab4-dc50183a602d", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "saveLimit", - "cmp": 0 - }, - "display": { - "x": 864, - "y": 900 - } - }, - "17c1ea6f-6b58-45d3-9457-4ac747100654": { - "id": "17c1ea6f-6b58-45d3-9457-4ac747100654", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "saveLimit" - }, - "display": { - "x": 852, - "y": 828 - } - }, - "e785463c-b082-403e-8b33-e2123551313d": { - "id": "e785463c-b082-403e-8b33-e2123551313d", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 500, - "maxTime": 3500 - }, - "display": { - "x": 204, - "y": 1152 - } - }, - "383031e5-3af8-4b56-826a-76fff677d1c2": { - "id": "383031e5-3af8-4b56-826a-76fff677d1c2", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {}, - "display": { - "x": 168, - "y": 1296 - } - }, - "9501a1ea-d5d4-4437-b008-5901df5a3155": { - "id": "9501a1ea-d5d4-4437-b008-5901df5a3155", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "maxGameNum", - "cmp": 4 - }, - "display": { - "x": 912, - "y": 1080 - } - }, - "1a77bfb7-6ec1-4414-bcdf-7f5c8ea05e0a": { - "id": "1a77bfb7-6ec1-4414-bcdf-7f5c8ea05e0a", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "maxGameNum", - "min": 10, - "max": 40 - }, - "display": { - "x": 888, - "y": 996 - } - }, - "a0833ec6-4c79-491d-8983-58ccae4d0329": { - "id": "a0833ec6-4c79-491d-8983-58ccae4d0329", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "生成初始押注额度", - "properties": {}, - "display": { - "x": 36, - "y": -468 - }, - "children": [ - "5731b7b0-8447-43cf-8754-303d98a3634a", - "822d814e-a660-4d75-83ee-b06873791200", - "1df794f8-957a-4fdd-8057-b010928bf805", - "fe47e8e1-19ef-448e-8c20-c9839229f1cf", - "5caa26b4-ff66-4b35-8713-8de52405da42", - "86f7dc9c-ca22-4f66-9f5f-d75e3f0a8c02", - "45246284-428b-44b8-b976-169186544c9e", - "f37176cd-a3ec-4223-aebb-4a301c86b92a" - ] - }, - "822d814e-a660-4d75-83ee-b06873791200": { - "id": "822d814e-a660-4d75-83ee-b06873791200", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "needStartBet", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 252, - "y": -624 - } - }, - "1df794f8-957a-4fdd-8057-b010928bf805": { - "id": "1df794f8-957a-4fdd-8057-b010928bf805", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@1" - }, - "display": { - "x": 276, - "y": -576 - } - }, - "8ad87cb8-b5cc-456f-bf95-ba0d0b0b9cf4": { - "id": "8ad87cb8-b5cc-456f-bf95-ba0d0b0b9cf4", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "betArea" - }, - "display": { - "x": 1020, - "y": 228 - } - }, - "f37176cd-a3ec-4223-aebb-4a301c86b92a": { - "id": "f37176cd-a3ec-4223-aebb-4a301c86b92a", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betSrcCoin" - }, - "display": { - "x": 324, - "y": -324 - } - }, - "87f04e22-3804-4713-8030-3367f2a3dc48": { - "id": "87f04e22-3804-4713-8030-3367f2a3dc48", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "needStartBet" - }, - "display": { - "x": 768, - "y": -84 - } - }, - "79dcac3e-9c14-4963-958f-82410069335b": { - "id": "79dcac3e-9c14-4963-958f-82410069335b", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue1": "needStartBet", - "gIPValue2": "@2" - }, - "display": { - "x": 756, - "y": -36 - } - }, - "19403a37-6769-4911-a71c-cb49f92a47b4": { - "id": "19403a37-6769-4911-a71c-cb49f92a47b4", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 144, - "y": 636 - }, - "children": [ - "69225c33-f1ab-4347-8071-620d2134cf31", - "858e1bb5-4a33-4dc5-8a84-2330d0669bf0", - "4e3753b8-309a-4976-984c-7ec00665ccf2" - ] - }, - "69225c33-f1ab-4347-8071-620d2134cf31": { - "id": "69225c33-f1ab-4347-8071-620d2134cf31", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 360, - "y": 564 - } - }, - "858e1bb5-4a33-4dc5-8a84-2330d0669bf0": { - "id": "858e1bb5-4a33-4dc5-8a84-2330d0669bf0", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "@1", - "cmp": 2 - }, - "display": { - "x": 432, - "y": 636 - } - }, - "4e3753b8-309a-4976-984c-7ec00665ccf2": { - "id": "4e3753b8-309a-4976-984c-7ec00665ccf2", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@0" - }, - "display": { - "x": 420, - "y": 708 - } - }, - "5caa26b4-ff66-4b35-8713-8de52405da42": { - "id": "5caa26b4-ff66-4b35-8713-8de52405da42", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "playerCoin" - }, - "display": { - "x": 264, - "y": -480 - } - }, - "86f7dc9c-ca22-4f66-9f5f-d75e3f0a8c02": { - "id": "86f7dc9c-ca22-4f66-9f5f-d75e3f0a8c02", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "playerCoin" - }, - "display": { - "x": 336, - "y": -432 - } - }, - "45246284-428b-44b8-b976-169186544c9e": { - "id": "45246284-428b-44b8-b976-169186544c9e", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 312, - "y": -384 - } - }, - "1bf7fa77-6cc7-4120-8862-61668a6768bc": { - "id": "1bf7fa77-6cc7-4120-8862-61668a6768bc", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 288, - "y": 1008 - }, - "children": [ - "418a21fb-0971-4d1e-bbad-984453cde8bf", - "7024613f-625c-4dc8-8ebf-9f6b885d4142", - "3562d05e-c36f-422c-b9c0-44dd803c64c7", - "b2ecc51c-39f6-48c9-9176-586e2ac5f2ef" - ] - }, - "418a21fb-0971-4d1e-bbad-984453cde8bf": { - "id": "418a21fb-0971-4d1e-bbad-984453cde8bf", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 528, - "y": 924 - }, - "children": [ - "17c1ea6f-6b58-45d3-9457-4ac747100654", - "b9d620f1-7c32-423b-bab4-dc50183a602d" - ] - }, - "7024613f-625c-4dc8-8ebf-9f6b885d4142": { - "id": "7024613f-625c-4dc8-8ebf-9f6b885d4142", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 528, - "y": 1080 - }, - "children": [ - "1a77bfb7-6ec1-4414-bcdf-7f5c8ea05e0a", - "9501a1ea-d5d4-4437-b008-5901df5a3155" - ] - }, - "8289c2a3-9316-4a88-a2cd-b1f36d22d315": { - "id": "8289c2a3-9316-4a88-a2cd-b1f36d22d315", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "sameNum", - "min": 2, - "max": 4 - }, - "display": { - "x": 720, - "y": -228 - } - }, - "65cd19af-85ed-4007-b276-cd4784c9e2eb": { - "id": "65cd19af-85ed-4007-b276-cd4784c9e2eb", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 720, - "y": 96 - }, - "children": [ - "f60a1323-ca6a-43cc-bd26-ef5a3c5c750c", - "5c2c3259-96a7-4d01-85dd-9b89bbf95d9e", - "bec1e9bc-4be0-47ff-8a69-f2211bd68011", - "886ee374-f912-4bd0-8095-b3961096e536" - ] - }, - "886ee374-f912-4bd0-8095-b3961096e536": { - "id": "886ee374-f912-4bd0-8095-b3961096e536", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 804, - "y": 240 - }, - "children": [ - "8ad87cb8-b5cc-456f-bf95-ba0d0b0b9cf4", - "a8daa59d-2bba-4fc5-b0d8-9e8dbb6a3329" - ] - }, - "a8daa59d-2bba-4fc5-b0d8-9e8dbb6a3329": { - "id": "a8daa59d-2bba-4fc5-b0d8-9e8dbb6a3329", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@1" - }, - "display": { - "x": 1008, - "y": 300 - } - }, - "5c2c3259-96a7-4d01-85dd-9b89bbf95d9e": { - "id": "5c2c3259-96a7-4d01-85dd-9b89bbf95d9e", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betIsOk", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 984, - "y": 96 - } - }, - "630af409-8ad9-44c6-8686-29a39b94d392": { - "id": "630af409-8ad9-44c6-8686-29a39b94d392", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@0" - }, - "display": { - "x": 324, - "y": 312 - } - }, - "b2ecc51c-39f6-48c9-9176-586e2ac5f2ef": { - "id": "b2ecc51c-39f6-48c9-9176-586e2ac5f2ef", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "betCoin", - "cmp": 0 - }, - "display": { - "x": 600, - "y": 1488 - } - }, - "4cf9a0a2-32b6-4aff-826a-f7d6e69726c7": { - "id": "4cf9a0a2-32b6-4aff-826a-f7d6e69726c7", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 84, - "y": 348 - }, - "children": [ - "630af409-8ad9-44c6-8686-29a39b94d392", - "8992bffc-13af-4cb0-ab3b-fb37424be47e", - "9dc23b33-85ab-4010-85cc-bb61b1cb1b89" - ] - }, - "8992bffc-13af-4cb0-ab3b-fb37424be47e": { - "id": "8992bffc-13af-4cb0-ab3b-fb37424be47e", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 300, - "y": 384 - } - }, - "9dc23b33-85ab-4010-85cc-bb61b1cb1b89": { - "id": "9dc23b33-85ab-4010-85cc-bb61b1cb1b89", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 300, - "y": 456 - } - }, - "de240ce6-74f8-4c15-8f6f-f0486d98cf93": { - "id": "de240ce6-74f8-4c15-8f6f-f0486d98cf93", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 948, - "y": 372 - } - }, - "3868f9e0-f1f2-4927-9b75-f4049a3f5fa6": { - "id": "3868f9e0-f1f2-4927-9b75-f4049a3f5fa6", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": -360, - "y": 144 - }, - "children": [ - "a0833ec6-4c79-491d-8983-58ccae4d0329", - "3fb1e974-7d51-4a6f-9701-fe001c3bd3a3", - "19403a37-6769-4911-a71c-cb49f92a47b4", - "e683afae-4710-4113-9c6a-ffde88d780a1" - ] - }, - "3fb1e974-7d51-4a6f-9701-fe001c3bd3a3": { - "id": "3fb1e974-7d51-4a6f-9701-fe001c3bd3a3", - "name": "MemSequence", - "category": "composite", - "title": "MemSequence", - "description": "", - "properties": {}, - "display": { - "x": -48, - "y": 60 - }, - "children": [ - "8ee2e525-0e10-4339-9fc1-091059a33a3b", - "96caa228-3af2-4e17-846d-41975eff29eb", - "4cf9a0a2-32b6-4aff-826a-f7d6e69726c7" - ] - }, - "96caa228-3af2-4e17-846d-41975eff29eb": { - "id": "96caa228-3af2-4e17-846d-41975eff29eb", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 468, - "y": 192 - }, - "children": [ - "e85533fb-029e-4366-8c59-d98768b9d994", - "de240ce6-74f8-4c15-8f6f-f0486d98cf93" - ] - }, - "e85533fb-029e-4366-8c59-d98768b9d994": { - "id": "e85533fb-029e-4366-8c59-d98768b9d994", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 588, - "y": 72 - }, - "child": "65cd19af-85ed-4007-b276-cd4784c9e2eb" - }, - "5731b7b0-8447-43cf-8754-303d98a3634a": { - "id": "5731b7b0-8447-43cf-8754-303d98a3634a", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 216, - "y": -672 - } - }, - "9c95a923-029b-49d7-bf78-48c9842dc0dc": { - "id": "9c95a923-029b-49d7-bf78-48c9842dc0dc", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "takeCoinDiv", - "min": 10, - "max": 30 - }, - "display": { - "x": 936, - "y": 1188 - } - }, - "3562d05e-c36f-422c-b9c0-44dd803c64c7": { - "id": "3562d05e-c36f-422c-b9c0-44dd803c64c7", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 528, - "y": 1224 - }, - "children": [ - "8b13cab6-11cb-496e-81db-3fb2c38113e1", - "9c95a923-029b-49d7-bf78-48c9842dc0dc", - "86c9f692-be00-4d13-88a2-289f80251c60", - "6fecd80b-3aa1-465e-a723-174c44c46213", - "2bd2caca-136a-4e2c-9822-722df79a15be" - ] - }, - "86c9f692-be00-4d13-88a2-289f80251c60": { - "id": "86c9f692-be00-4d13-88a2-289f80251c60", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "takeCoin" - }, - "display": { - "x": 924, - "y": 1236 - } - }, - "2bd2caca-136a-4e2c-9822-722df79a15be": { - "id": "2bd2caca-136a-4e2c-9822-722df79a15be", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "takeCoin", - "cmp": 0 - }, - "display": { - "x": 912, - "y": 1428 - } - }, - "8b13cab6-11cb-496e-81db-3fb2c38113e1": { - "id": "8b13cab6-11cb-496e-81db-3fb2c38113e1", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "takeCoinDiv" - }, - "display": { - "x": 972, - "y": 1140 - } - }, - "6fecd80b-3aa1-465e-a723-174c44c46213": { - "id": "6fecd80b-3aa1-465e-a723-174c44c46213", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 936, - "y": 1344 - } - } - }, - "display": { - "camera_x": 582.9299999917857, - "camera_y": -88.36499998209183, - "camera_z": 0.75, - "x": -480, - "y": 252 - }, - "custom_nodes": [ - { - "version": "0.3.0", - "scope": "node", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "key", - "min": 0, - "max": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 0, - "maxTime": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "\"\"" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckBool", - "category": "condition", - "title": "CheckBool()", - "description": "检查一个黑板的key值", - "properties": { - "keyName": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "key", - "value": 0, - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LogAction", - "category": "action", - "title": "LogAction(,)", - "description": "输出日志", - "properties": { - "info": "info", - "level": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetPct", - "category": "action", - "title": "RVBBetPct(,)", - "description": "红黑下注\ngIPpct 下注百分比,黑板key 支持@\ngIPArea 下注区域,黑板key 支持@", - "properties": { - "gIPpct": "key", - "gIPArea": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {} - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "key", - "gIPValue": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "key", - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "key", - "num": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": 0, - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - } - ] -} \ No newline at end of file diff --git a/data/botai/rvbinvertwin.json b/data/botai/rvbinvertwin.json deleted file mode 100644 index 6c35203..0000000 --- a/data/botai/rvbinvertwin.json +++ /dev/null @@ -1,1285 +0,0 @@ -{ - "version": "0.3.0", - "scope": "tree", - "id": "bcbcd98d-0a18-4edc-80a0-f1ac01fbb289", - "title": "RVBInvertWinBot", - "description": "反龙 倍投", - "root": "5e8ef189-1c68-4e2d-96a2-093a9260e4c5", - "properties": {}, - "nodes": { - "04a7e3aa-fbc7-4eee-855b-0be19910dbc2": { - "id": "04a7e3aa-fbc7-4eee-855b-0be19910dbc2", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 744, - "y": -240 - } - }, - "d82746db-e3c3-4c20-a798-f4929bb7bc58": { - "id": "d82746db-e3c3-4c20-a798-f4929bb7bc58", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 360, - "y": -84 - }, - "children": [ - "04a7e3aa-fbc7-4eee-855b-0be19910dbc2", - "7ee1ee6e-7a67-431d-b74a-86dcf4d7c736", - "9a735735-d5e2-4ad9-a25c-1aa3102a097c", - "22f65664-750a-4786-86f7-0b1a55caf32f", - "7eab985d-b081-4b8d-9e47-0f936888da5e", - "c10981f9-a77c-4d35-80f7-83108bd43a15", - "132af4ee-8feb-4c71-8702-0d34384b5a7c" - ] - }, - "22169c28-d742-4508-8753-3568224e6965": { - "id": "22169c28-d742-4508-8753-3568224e6965", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betSrcCoin", - "min": 2, - "max": 6 - }, - "display": { - "x": 324, - "y": -480 - } - }, - "e78284a9-88a0-4db9-9cc7-4c481b5085df": { - "id": "e78284a9-88a0-4db9-9cc7-4c481b5085df", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 1056, - "y": 192 - } - }, - "509f2c7a-9091-429e-a713-750250e50aa8": { - "id": "509f2c7a-9091-429e-a713-750250e50aa8", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 600, - "maxTime": 1200 - }, - "display": { - "x": 1092, - "y": 336 - } - }, - "9a735735-d5e2-4ad9-a25c-1aa3102a097c": { - "id": "9a735735-d5e2-4ad9-a25c-1aa3102a097c", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "sameNum", - "num": 3 - }, - "display": { - "x": 768, - "y": -132 - } - }, - "22f65664-750a-4786-86f7-0b1a55caf32f": { - "id": "22f65664-750a-4786-86f7-0b1a55caf32f", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "betArea" - }, - "display": { - "x": 744, - "y": -84 - } - }, - "bfd009ae-3e5c-4f60-8939-17d4216e65d7": { - "id": "bfd009ae-3e5c-4f60-8939-17d4216e65d7", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 24, - "y": 1044 - }, - "children": [ - "2099f74a-10b9-47fa-8fb6-7f09c56892c2", - "c9bfe3cf-4d62-48b5-8ee0-364b25ff174e", - "5f63726c-7922-4fcf-b393-05cf6e0c6bf7", - "cd38883a-38c9-4e1e-bc09-3dea72740355" - ] - }, - "2099f74a-10b9-47fa-8fb6-7f09c56892c2": { - "id": "2099f74a-10b9-47fa-8fb6-7f09c56892c2", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 264, - "y": 924 - } - }, - "13e3c21b-919b-4608-8c4f-156c275b8f01": { - "id": "13e3c21b-919b-4608-8c4f-156c275b8f01", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "saveLimit", - "cmp": 0 - }, - "display": { - "x": 912, - "y": 948 - } - }, - "243c4715-ef1d-46c4-aa1a-7a1cea7640d8": { - "id": "243c4715-ef1d-46c4-aa1a-7a1cea7640d8", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "saveLimit" - }, - "display": { - "x": 900, - "y": 876 - } - }, - "5f63726c-7922-4fcf-b393-05cf6e0c6bf7": { - "id": "5f63726c-7922-4fcf-b393-05cf6e0c6bf7", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 500, - "maxTime": 3500 - }, - "display": { - "x": 252, - "y": 1200 - } - }, - "cd38883a-38c9-4e1e-bc09-3dea72740355": { - "id": "cd38883a-38c9-4e1e-bc09-3dea72740355", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {}, - "display": { - "x": 216, - "y": 1344 - } - }, - "1b9c36d2-95ac-401f-8da9-1cad33396832": { - "id": "1b9c36d2-95ac-401f-8da9-1cad33396832", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "maxGameNum", - "cmp": 4 - }, - "display": { - "x": 960, - "y": 1128 - } - }, - "ca9584e7-ec24-447c-811e-d986401ce76d": { - "id": "ca9584e7-ec24-447c-811e-d986401ce76d", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "maxGameNum", - "min": 40, - "max": 80 - }, - "display": { - "x": 936, - "y": 1044 - } - }, - "2be54f8d-7266-4246-86e8-8174fb4bf191": { - "id": "2be54f8d-7266-4246-86e8-8174fb4bf191", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "生成初始押注额度", - "properties": {}, - "display": { - "x": 84, - "y": -420 - }, - "children": [ - "191cc1aa-c2fd-41d6-aa56-1b9a440de6ba", - "34adecfc-97b9-4d6c-a62f-0397acffb5dd", - "1c3b2110-eb51-4aa5-bef8-cfa3960f5e80", - "22169c28-d742-4508-8753-3568224e6965", - "7045671b-03f0-4490-8f3f-1b5e5f4eca86", - "f519275f-63b3-4491-a588-72f36f9dbf17", - "c236ac94-5ed8-4c3e-8504-30d6d632aa6c", - "3c3872e0-36fc-496a-89a6-7dae8248f7f7" - ] - }, - "34adecfc-97b9-4d6c-a62f-0397acffb5dd": { - "id": "34adecfc-97b9-4d6c-a62f-0397acffb5dd", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "needStartBet", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 300, - "y": -576 - } - }, - "1c3b2110-eb51-4aa5-bef8-cfa3960f5e80": { - "id": "1c3b2110-eb51-4aa5-bef8-cfa3960f5e80", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@1" - }, - "display": { - "x": 324, - "y": -528 - } - }, - "2a1e554f-1b42-410d-874b-d3fc859f76fe": { - "id": "2a1e554f-1b42-410d-874b-d3fc859f76fe", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "betArea" - }, - "display": { - "x": 1116, - "y": 408 - } - }, - "3c3872e0-36fc-496a-89a6-7dae8248f7f7": { - "id": "3c3872e0-36fc-496a-89a6-7dae8248f7f7", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betSrcCoin" - }, - "display": { - "x": 372, - "y": -276 - } - }, - "7eab985d-b081-4b8d-9e47-0f936888da5e": { - "id": "7eab985d-b081-4b8d-9e47-0f936888da5e", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "needStartBet" - }, - "display": { - "x": 816, - "y": -24 - } - }, - "c10981f9-a77c-4d35-80f7-83108bd43a15": { - "id": "c10981f9-a77c-4d35-80f7-83108bd43a15", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue1": "needStartBet", - "gIPValue2": "@2" - }, - "display": { - "x": 804, - "y": 24 - } - }, - "2e099a8f-9b75-4f55-a62c-80dbe1ea0c66": { - "id": "2e099a8f-9b75-4f55-a62c-80dbe1ea0c66", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 192, - "y": 684 - }, - "children": [ - "8590d78b-fa12-4811-87f2-8e60b63aa1c8", - "9be91e8d-2024-457f-9c4e-e9d6ba1eb89a", - "3de2a4dd-b7f7-476f-9f40-58f1588cddeb" - ] - }, - "8590d78b-fa12-4811-87f2-8e60b63aa1c8": { - "id": "8590d78b-fa12-4811-87f2-8e60b63aa1c8", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 408, - "y": 612 - } - }, - "9be91e8d-2024-457f-9c4e-e9d6ba1eb89a": { - "id": "9be91e8d-2024-457f-9c4e-e9d6ba1eb89a", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "@1", - "cmp": 2 - }, - "display": { - "x": 480, - "y": 684 - } - }, - "3de2a4dd-b7f7-476f-9f40-58f1588cddeb": { - "id": "3de2a4dd-b7f7-476f-9f40-58f1588cddeb", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "needStartBet", - "gIPValue": "@0" - }, - "display": { - "x": 468, - "y": 756 - } - }, - "7045671b-03f0-4490-8f3f-1b5e5f4eca86": { - "id": "7045671b-03f0-4490-8f3f-1b5e5f4eca86", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "playerCoin" - }, - "display": { - "x": 312, - "y": -432 - } - }, - "f519275f-63b3-4491-a588-72f36f9dbf17": { - "id": "f519275f-63b3-4491-a588-72f36f9dbf17", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "playerCoin" - }, - "display": { - "x": 384, - "y": -384 - } - }, - "c236ac94-5ed8-4c3e-8504-30d6d632aa6c": { - "id": "c236ac94-5ed8-4c3e-8504-30d6d632aa6c", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 360, - "y": -336 - } - }, - "c9bfe3cf-4d62-48b5-8ee0-364b25ff174e": { - "id": "c9bfe3cf-4d62-48b5-8ee0-364b25ff174e", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 336, - "y": 1056 - }, - "children": [ - "e31db30e-34af-4e2e-b65b-6be86e089141", - "9a2d8fb2-f8fa-4782-8c62-81da19d633a3", - "41e3bada-b468-4a60-9115-090e440bd49a", - "455c4049-1886-4ab0-8609-c9d3fd0d8263" - ] - }, - "e31db30e-34af-4e2e-b65b-6be86e089141": { - "id": "e31db30e-34af-4e2e-b65b-6be86e089141", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 576, - "y": 972 - }, - "children": [ - "243c4715-ef1d-46c4-aa1a-7a1cea7640d8", - "13e3c21b-919b-4608-8c4f-156c275b8f01" - ] - }, - "9a2d8fb2-f8fa-4782-8c62-81da19d633a3": { - "id": "9a2d8fb2-f8fa-4782-8c62-81da19d633a3", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 576, - "y": 1128 - }, - "children": [ - "ca9584e7-ec24-447c-811e-d986401ce76d", - "1b9c36d2-95ac-401f-8da9-1cad33396832" - ] - }, - "7ee1ee6e-7a67-431d-b74a-86dcf4d7c736": { - "id": "7ee1ee6e-7a67-431d-b74a-86dcf4d7c736", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "sameNum", - "min": 3, - "max": 5 - }, - "display": { - "x": 768, - "y": -180 - } - }, - "2c51e0ee-4d4f-43c2-8419-0d66ada2fdb1": { - "id": "2c51e0ee-4d4f-43c2-8419-0d66ada2fdb1", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 816, - "y": 276 - }, - "children": [ - "e78284a9-88a0-4db9-9cc7-4c481b5085df", - "3ef80a4a-aa41-4d47-b06f-847af6ee0e93", - "509f2c7a-9091-429e-a713-750250e50aa8", - "464528f0-4195-4946-8279-fb3bbc0b37e3" - ] - }, - "464528f0-4195-4946-8279-fb3bbc0b37e3": { - "id": "464528f0-4195-4946-8279-fb3bbc0b37e3", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 900, - "y": 420 - }, - "children": [ - "2a1e554f-1b42-410d-874b-d3fc859f76fe", - "af0c68f9-fc34-4a05-86bc-3f7d2d17830b" - ] - }, - "af0c68f9-fc34-4a05-86bc-3f7d2d17830b": { - "id": "af0c68f9-fc34-4a05-86bc-3f7d2d17830b", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@1" - }, - "display": { - "x": 1104, - "y": 480 - } - }, - "3ef80a4a-aa41-4d47-b06f-847af6ee0e93": { - "id": "3ef80a4a-aa41-4d47-b06f-847af6ee0e93", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betIsOk", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 1080, - "y": 276 - } - }, - "b9901516-891a-496f-9d09-4905203f905d": { - "id": "b9901516-891a-496f-9d09-4905203f905d", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betIsOk", - "gIPValue": "@0" - }, - "display": { - "x": 372, - "y": 360 - } - }, - "455c4049-1886-4ab0-8609-c9d3fd0d8263": { - "id": "455c4049-1886-4ab0-8609-c9d3fd0d8263", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "betCoin", - "cmp": 0 - }, - "display": { - "x": 660, - "y": 1524 - } - }, - "99088e7a-2b9f-4a9f-8df3-b1bb39366142": { - "id": "99088e7a-2b9f-4a9f-8df3-b1bb39366142", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 132, - "y": 396 - }, - "children": [ - "b9901516-891a-496f-9d09-4905203f905d", - "9eefd3d3-d61e-46af-808e-cd298da3bef7", - "9575b0af-999d-413f-8b99-713dd3fa59d8" - ] - }, - "9eefd3d3-d61e-46af-808e-cd298da3bef7": { - "id": "9eefd3d3-d61e-46af-808e-cd298da3bef7", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 348, - "y": 432 - } - }, - "9575b0af-999d-413f-8b99-713dd3fa59d8": { - "id": "9575b0af-999d-413f-8b99-713dd3fa59d8", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 348, - "y": 504 - } - }, - "a7da2d4a-9556-4049-8855-b24190414a8b": { - "id": "a7da2d4a-9556-4049-8855-b24190414a8b", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 1044, - "y": 552 - } - }, - "5e8ef189-1c68-4e2d-96a2-093a9260e4c5": { - "id": "5e8ef189-1c68-4e2d-96a2-093a9260e4c5", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": -312, - "y": 192 - }, - "children": [ - "2be54f8d-7266-4246-86e8-8174fb4bf191", - "c3e8cb6f-4d62-47d3-af65-f876e4afcf44", - "2e099a8f-9b75-4f55-a62c-80dbe1ea0c66", - "bfd009ae-3e5c-4f60-8939-17d4216e65d7" - ] - }, - "c3e8cb6f-4d62-47d3-af65-f876e4afcf44": { - "id": "c3e8cb6f-4d62-47d3-af65-f876e4afcf44", - "name": "MemSequence", - "category": "composite", - "title": "MemSequence", - "description": "", - "properties": {}, - "display": { - "x": 0, - "y": 108 - }, - "children": [ - "d82746db-e3c3-4c20-a798-f4929bb7bc58", - "c7deb35f-1a13-4025-95eb-7a284ecd3385", - "99088e7a-2b9f-4a9f-8df3-b1bb39366142" - ] - }, - "c7deb35f-1a13-4025-95eb-7a284ecd3385": { - "id": "c7deb35f-1a13-4025-95eb-7a284ecd3385", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 564, - "y": 312 - }, - "children": [ - "4afdfe17-63c5-49f8-a97a-62a64b7f2dc6", - "a7da2d4a-9556-4049-8855-b24190414a8b" - ] - }, - "4afdfe17-63c5-49f8-a97a-62a64b7f2dc6": { - "id": "4afdfe17-63c5-49f8-a97a-62a64b7f2dc6", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 684, - "y": 252 - }, - "child": "2c51e0ee-4d4f-43c2-8419-0d66ada2fdb1" - }, - "191cc1aa-c2fd-41d6-aa56-1b9a440de6ba": { - "id": "191cc1aa-c2fd-41d6-aa56-1b9a440de6ba", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 264, - "y": -624 - } - }, - "132af4ee-8feb-4c71-8702-0d34384b5a7c": { - "id": "132af4ee-8feb-4c71-8702-0d34384b5a7c", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 660, - "y": 96 - }, - "children": [ - "73a509d2-7eb1-4666-8a29-53c9a0fc0f4e", - "72e53829-3919-43fe-afc9-e3e02ede7ffe" - ] - }, - "73a509d2-7eb1-4666-8a29-53c9a0fc0f4e": { - "id": "73a509d2-7eb1-4666-8a29-53c9a0fc0f4e", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 996, - "y": 72 - }, - "children": [ - "b436f8d6-18cc-4f03-8b91-90d43c2969b8", - "941cfa1c-5228-41d3-b37e-eb1b35890235" - ] - }, - "b436f8d6-18cc-4f03-8b91-90d43c2969b8": { - "id": "b436f8d6-18cc-4f03-8b91-90d43c2969b8", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betArea", - "value": 0, - "cmp": 2 - }, - "display": { - "x": 1260, - "y": -48 - } - }, - "941cfa1c-5228-41d3-b37e-eb1b35890235": { - "id": "941cfa1c-5228-41d3-b37e-eb1b35890235", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betArea", - "gIPValue": "@1" - }, - "display": { - "x": 1284, - "y": 12 - } - }, - "72e53829-3919-43fe-afc9-e3e02ede7ffe": { - "id": "72e53829-3919-43fe-afc9-e3e02ede7ffe", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 996, - "y": 120 - }, - "children": [ - "4f1b9b1c-ba0e-4647-8506-15158a24707e", - "0b7f9248-bd04-444f-85b1-cfd06be650ee" - ] - }, - "4f1b9b1c-ba0e-4647-8506-15158a24707e": { - "id": "4f1b9b1c-ba0e-4647-8506-15158a24707e", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "betArea", - "value": 1, - "cmp": 2 - }, - "display": { - "x": 1284, - "y": 60 - } - }, - "0b7f9248-bd04-444f-85b1-cfd06be650ee": { - "id": "0b7f9248-bd04-444f-85b1-cfd06be650ee", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "betArea", - "gIPValue": "@0" - }, - "display": { - "x": 1308, - "y": 120 - } - }, - "0da9990b-5d53-4bbe-8e9f-4d6b9066746d": { - "id": "0da9990b-5d53-4bbe-8e9f-4d6b9066746d", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "takeCoinDiv", - "min": 10, - "max": 30 - }, - "display": { - "x": 924, - "y": 1188 - } - }, - "41e3bada-b468-4a60-9115-090e440bd49a": { - "id": "41e3bada-b468-4a60-9115-090e440bd49a", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 576, - "y": 1236 - }, - "children": [ - "0da9990b-5d53-4bbe-8e9f-4d6b9066746d", - "20475fe6-09d0-4813-8cdc-1736deba8418", - "7ce22449-b59a-40be-8f1b-5bcf2ce0754e", - "d08a6179-81dd-4431-84ff-f623c888d4a8", - "7046f547-8d2e-43d3-a8b6-822386ae6e0e" - ] - }, - "20475fe6-09d0-4813-8cdc-1736deba8418": { - "id": "20475fe6-09d0-4813-8cdc-1736deba8418", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "takeCoin" - }, - "display": { - "x": 912, - "y": 1236 - } - }, - "7046f547-8d2e-43d3-a8b6-822386ae6e0e": { - "id": "7046f547-8d2e-43d3-a8b6-822386ae6e0e", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "takeCoin", - "cmp": 0 - }, - "display": { - "x": 900, - "y": 1428 - } - }, - "7ce22449-b59a-40be-8f1b-5bcf2ce0754e": { - "id": "7ce22449-b59a-40be-8f1b-5bcf2ce0754e", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "takeCoinDiv" - }, - "display": { - "x": 960, - "y": 1296 - } - }, - "d08a6179-81dd-4431-84ff-f623c888d4a8": { - "id": "d08a6179-81dd-4431-84ff-f623c888d4a8", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 924, - "y": 1356 - } - } - }, - "display": { - "camera_x": 616.7549999991315, - "camera_y": -272.9800000007963, - "camera_z": 0.75, - "x": -540, - "y": 180 - }, - "custom_nodes": [ - { - "version": "0.3.0", - "scope": "node", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "key", - "min": 0, - "max": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 0, - "maxTime": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "\"\"" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckBool", - "category": "condition", - "title": "CheckBool()", - "description": "检查一个黑板的key值", - "properties": { - "keyName": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "key", - "value": 0, - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LogAction", - "category": "action", - "title": "LogAction(,)", - "description": "输出日志", - "properties": { - "info": "info", - "level": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetPct", - "category": "action", - "title": "RVBBetPct(,)", - "description": "红黑下注\ngIPpct 下注百分比,黑板key 支持@\ngIPArea 下注区域,黑板key 支持@", - "properties": { - "gIPpct": "key", - "gIPArea": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {} - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "key", - "gIPValue": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "key", - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "key", - "num": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": 0, - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - } - ] -} \ No newline at end of file diff --git a/data/botai/rvbrandom.json b/data/botai/rvbrandom.json deleted file mode 100644 index 54fe92c..0000000 --- a/data/botai/rvbrandom.json +++ /dev/null @@ -1,1026 +0,0 @@ -{ - "version": "0.3.0", - "scope": "tree", - "id": "7dc34556-b453-4e90-8fa4-468cb40c1a94", - "title": "RVBRandomBot", - "description": "随机下注", - "root": "61acd76e-6aed-4df1-8e46-a86644fd41d3", - "properties": {}, - "nodes": { - "7a63cc18-b09a-489b-98c9-e3aec5ebb761": { - "id": "7a63cc18-b09a-489b-98c9-e3aec5ebb761", - "name": "MemSequence", - "category": "composite", - "title": "MemSequence", - "description": "", - "properties": {}, - "display": { - "x": 312, - "y": -348 - }, - "children": [ - "636e84b3-e817-452f-874c-7f4146eef5ba", - "0db31a0d-b752-4850-8402-a2c8f95a3651", - "b716de05-b53b-4cb4-be2a-49a2961a38d5", - "82ef36d0-175c-4045-9aed-f900e51f649c" - ] - }, - "0db31a0d-b752-4850-8402-a2c8f95a3651": { - "id": "0db31a0d-b752-4850-8402-a2c8f95a3651", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 100, - "maxTime": 4000 - }, - "display": { - "x": 696, - "y": -420 - } - }, - "b716de05-b53b-4cb4-be2a-49a2961a38d5": { - "id": "b716de05-b53b-4cb4-be2a-49a2961a38d5", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "10|100" - }, - "display": { - "x": 684, - "y": -264 - }, - "children": [ - "44b72066-4117-42fc-8c11-12e641ac7963", - "61296429-2d2f-4ea2-88f7-e0bbd6f881d3" - ] - }, - "61acd76e-6aed-4df1-8e46-a86644fd41d3": { - "id": "61acd76e-6aed-4df1-8e46-a86644fd41d3", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 108, - "y": 324 - }, - "children": [ - "7a63cc18-b09a-489b-98c9-e3aec5ebb761", - "a95b1a70-8eb6-41e3-b938-8d88cfb807de" - ] - }, - "a95b1a70-8eb6-41e3-b938-8d88cfb807de": { - "id": "a95b1a70-8eb6-41e3-b938-8d88cfb807de", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 360, - "y": 564 - }, - "children": [ - "397dc2cf-c281-4992-a858-069be6a1b791", - "db5bac79-6fb0-43c8-a119-09925c126e28", - "67ac5481-3e6f-4612-a33a-a431d09163ef", - "4176b141-6c22-47f0-b03f-de940e092514" - ] - }, - "397dc2cf-c281-4992-a858-069be6a1b791": { - "id": "397dc2cf-c281-4992-a858-069be6a1b791", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 4 - }, - "display": { - "x": 600, - "y": 444 - } - }, - "f3b1d188-97d4-4a39-9623-5f21eda87ca1": { - "id": "f3b1d188-97d4-4a39-9623-5f21eda87ca1", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "saveLimit", - "cmp": 0 - }, - "display": { - "x": 1248, - "y": 468 - } - }, - "1d3e262c-ec24-45af-8138-9a12d624edcc": { - "id": "1d3e262c-ec24-45af-8138-9a12d624edcc", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "saveLimit" - }, - "display": { - "x": 1236, - "y": 396 - } - }, - "67ac5481-3e6f-4612-a33a-a431d09163ef": { - "id": "67ac5481-3e6f-4612-a33a-a431d09163ef", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 500, - "maxTime": 3000 - }, - "display": { - "x": 588, - "y": 720 - } - }, - "4176b141-6c22-47f0-b03f-de940e092514": { - "id": "4176b141-6c22-47f0-b03f-de940e092514", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {}, - "display": { - "x": 564, - "y": 912 - } - }, - "451ea4cd-408b-48fe-852d-a38711db5357": { - "id": "451ea4cd-408b-48fe-852d-a38711db5357", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "maxGameNum", - "cmp": 4 - }, - "display": { - "x": 1296, - "y": 648 - } - }, - "32d3b272-ee17-45ef-8681-c8593701d96a": { - "id": "32d3b272-ee17-45ef-8681-c8593701d96a", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "maxGameNum", - "min": 50, - "max": 80 - }, - "display": { - "x": 1272, - "y": 564 - } - }, - "db5bac79-6fb0-43c8-a119-09925c126e28": { - "id": "db5bac79-6fb0-43c8-a119-09925c126e28", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 672, - "y": 576 - }, - "children": [ - "1efd066c-8ed8-4b1c-8ebd-257c45afafc5", - "62c3db0e-241c-4497-8b06-fecdf5e8d10e", - "e053f60d-7c4b-4810-925f-364a5a6f7f97", - "a9836e66-89c0-4805-bc00-d001854fb972" - ] - }, - "1efd066c-8ed8-4b1c-8ebd-257c45afafc5": { - "id": "1efd066c-8ed8-4b1c-8ebd-257c45afafc5", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 912, - "y": 492 - }, - "children": [ - "1d3e262c-ec24-45af-8138-9a12d624edcc", - "f3b1d188-97d4-4a39-9623-5f21eda87ca1" - ] - }, - "62c3db0e-241c-4497-8b06-fecdf5e8d10e": { - "id": "62c3db0e-241c-4497-8b06-fecdf5e8d10e", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 912, - "y": 648 - }, - "children": [ - "32d3b272-ee17-45ef-8681-c8593701d96a", - "451ea4cd-408b-48fe-852d-a38711db5357" - ] - }, - "a9836e66-89c0-4805-bc00-d001854fb972": { - "id": "a9836e66-89c0-4805-bc00-d001854fb972", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "betCoin", - "cmp": 0 - }, - "display": { - "x": 1008, - "y": 1104 - } - }, - "e6e7396f-2b1a-4d80-858a-51e5b7781d28": { - "id": "e6e7396f-2b1a-4d80-858a-51e5b7781d28", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betSrcCoin", - "min": 15, - "max": 35 - }, - "display": { - "x": 720, - "y": -792 - } - }, - "636e84b3-e817-452f-874c-7f4146eef5ba": { - "id": "636e84b3-e817-452f-874c-7f4146eef5ba", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "生成初始押注额度", - "properties": {}, - "display": { - "x": 468, - "y": -672 - }, - "children": [ - "6354ee40-1eb7-4117-96c0-ca164c722f97", - "e6e7396f-2b1a-4d80-858a-51e5b7781d28", - "06b2fa81-958e-492d-844c-63ec253a45c6", - "1bcebd0c-d082-4dde-9f5d-f54162699ee7", - "982002cc-2646-41c3-84b6-8c610e1c087f", - "cc63113d-9572-43e7-8f23-f6ca0678b796", - "871ccb22-30c2-4d0a-9d52-534ad305de4b" - ] - }, - "cc63113d-9572-43e7-8f23-f6ca0678b796": { - "id": "cc63113d-9572-43e7-8f23-f6ca0678b796", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "betSrcCoin", - "gINSaveCoin": "betCoin" - }, - "display": { - "x": 756, - "y": -552 - } - }, - "06b2fa81-958e-492d-844c-63ec253a45c6": { - "id": "06b2fa81-958e-492d-844c-63ec253a45c6", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "playerCoin" - }, - "display": { - "x": 708, - "y": -732 - } - }, - "982002cc-2646-41c3-84b6-8c610e1c087f": { - "id": "982002cc-2646-41c3-84b6-8c610e1c087f", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 756, - "y": -612 - } - }, - "6354ee40-1eb7-4117-96c0-ca164c722f97": { - "id": "6354ee40-1eb7-4117-96c0-ca164c722f97", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 648, - "y": -876 - } - }, - "871ccb22-30c2-4d0a-9d52-534ad305de4b": { - "id": "871ccb22-30c2-4d0a-9d52-534ad305de4b", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "betArea", - "min": 0, - "max": 2 - }, - "display": { - "x": 708, - "y": -492 - } - }, - "82ef36d0-175c-4045-9aed-f900e51f649c": { - "id": "82ef36d0-175c-4045-9aed-f900e51f649c", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 444, - "y": -72 - }, - "children": [ - "ef706ab5-b108-4475-97a3-c8336c48b451", - "01308bf4-dcb1-437f-810e-31d0487a4c9e" - ] - }, - "ef706ab5-b108-4475-97a3-c8336c48b451": { - "id": "ef706ab5-b108-4475-97a3-c8336c48b451", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 1 - }, - "display": { - "x": 636, - "y": -96 - } - }, - "01308bf4-dcb1-437f-810e-31d0487a4c9e": { - "id": "01308bf4-dcb1-437f-810e-31d0487a4c9e", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 624, - "y": -12 - } - }, - "c0da4159-f259-4881-9c52-1e41cc8aa75e": { - "id": "c0da4159-f259-4881-9c52-1e41cc8aa75e", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 300, - "maxTime": 900 - }, - "display": { - "x": 1464, - "y": -444 - } - }, - "25c0e6a3-b5b8-4be2-a168-83bde0188ba9": { - "id": "25c0e6a3-b5b8-4be2-a168-83bde0188ba9", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "@2" - }, - "display": { - "x": 1500, - "y": -360 - } - }, - "e18e1e73-ff91-4a13-892c-78719aab101d": { - "id": "e18e1e73-ff91-4a13-892c-78719aab101d", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 1272, - "y": -408 - }, - "children": [ - "c0da4159-f259-4881-9c52-1e41cc8aa75e", - "25c0e6a3-b5b8-4be2-a168-83bde0188ba9" - ] - }, - "615b29db-284f-4b90-818c-2151ec030aac": { - "id": "615b29db-284f-4b90-818c-2151ec030aac", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 1440, - "y": -276 - } - }, - "44b72066-4117-42fc-8c11-12e641ac7963": { - "id": "44b72066-4117-42fc-8c11-12e641ac7963", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 1008, - "y": -288 - }, - "children": [ - "78a7aff1-616d-4372-9b03-1345ee67aed9", - "615b29db-284f-4b90-818c-2151ec030aac" - ] - }, - "78a7aff1-616d-4372-9b03-1345ee67aed9": { - "id": "78a7aff1-616d-4372-9b03-1345ee67aed9", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 1140, - "y": -372 - }, - "child": "e18e1e73-ff91-4a13-892c-78719aab101d" - }, - "05965a4d-b80a-40f0-899e-da9291c589aa": { - "id": "05965a4d-b80a-40f0-899e-da9291c589aa", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 200, - "maxTime": 600 - }, - "display": { - "x": 1476, - "y": -180 - } - }, - "7f387e61-6dfb-4e92-8123-4f8a46dcfce6": { - "id": "7f387e61-6dfb-4e92-8123-4f8a46dcfce6", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "betCoin", - "gIPArea": "betArea" - }, - "display": { - "x": 1512, - "y": -96 - } - }, - "6fc1821d-dba7-408a-8297-bdcff52b2750": { - "id": "6fc1821d-dba7-408a-8297-bdcff52b2750", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 1284, - "y": -144 - }, - "children": [ - "05965a4d-b80a-40f0-899e-da9291c589aa", - "7f387e61-6dfb-4e92-8123-4f8a46dcfce6" - ] - }, - "fb22c1ec-6b73-4e0c-8332-069407b31bb6": { - "id": "fb22c1ec-6b73-4e0c-8332-069407b31bb6", - "name": "Runner", - "category": "action", - "title": "Runner", - "description": "", - "properties": {}, - "display": { - "x": 1428, - "y": 12 - } - }, - "61296429-2d2f-4ea2-88f7-e0bbd6f881d3": { - "id": "61296429-2d2f-4ea2-88f7-e0bbd6f881d3", - "name": "Priority", - "category": "composite", - "title": "Priority", - "description": "", - "properties": {}, - "display": { - "x": 1020, - "y": -24 - }, - "children": [ - "555526d7-e9c7-46fd-892f-2dafa22ddc78", - "fb22c1ec-6b73-4e0c-8332-069407b31bb6" - ] - }, - "555526d7-e9c7-46fd-892f-2dafa22ddc78": { - "id": "555526d7-e9c7-46fd-892f-2dafa22ddc78", - "name": "Inverter", - "category": "decorator", - "title": "Inverter", - "description": "", - "properties": {}, - "display": { - "x": 1152, - "y": -108 - }, - "child": "6fc1821d-dba7-408a-8297-bdcff52b2750" - }, - "1bcebd0c-d082-4dde-9f5d-f54162699ee7": { - "id": "1bcebd0c-d082-4dde-9f5d-f54162699ee7", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "betSrcCoin", - "gIPValue1": "betSrcCoin", - "gIPValue2": "playerCoin" - }, - "display": { - "x": 780, - "y": -672 - } - }, - "a445b081-8aeb-4a8d-859e-337c2c599763": { - "id": "a445b081-8aeb-4a8d-859e-337c2c599763", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "takeCoinDiv", - "min": 5, - "max": 40 - }, - "display": { - "x": 1284, - "y": 720 - } - }, - "e053f60d-7c4b-4810-925f-364a5a6f7f97": { - "id": "e053f60d-7c4b-4810-925f-364a5a6f7f97", - "name": "Sequence", - "category": "composite", - "title": "Sequence", - "description": "", - "properties": {}, - "display": { - "x": 912, - "y": 768 - }, - "children": [ - "a445b081-8aeb-4a8d-859e-337c2c599763", - "04848730-ff32-4fde-b3a4-1fb1a39af240", - "be0f13cd-8aa5-4c15-8333-c69d4cd339ef", - "6cd3023a-d433-45a9-8bbe-a99a828d3be6", - "e47faeae-783f-4cca-8c91-91b7ac112009" - ] - }, - "04848730-ff32-4fde-b3a4-1fb1a39af240": { - "id": "04848730-ff32-4fde-b3a4-1fb1a39af240", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "takeCoin" - }, - "display": { - "x": 1272, - "y": 768 - } - }, - "e47faeae-783f-4cca-8c91-91b7ac112009": { - "id": "e47faeae-783f-4cca-8c91-91b7ac112009", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "takeCoin", - "cmp": 0 - }, - "display": { - "x": 1260, - "y": 960 - } - }, - "be0f13cd-8aa5-4c15-8333-c69d4cd339ef": { - "id": "be0f13cd-8aa5-4c15-8333-c69d4cd339ef", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "takeCoinDiv" - }, - "display": { - "x": 1320, - "y": 828 - } - }, - "6cd3023a-d433-45a9-8bbe-a99a828d3be6": { - "id": "6cd3023a-d433-45a9-8bbe-a99a828d3be6", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "takeCoin", - "gIPValue1": "takeCoin", - "gIPValue2": "@100" - }, - "display": { - "x": 1284, - "y": 888 - } - } - }, - "display": { - "camera_x": 285.7500000118962, - "camera_y": 135.66499998217478, - "camera_z": 0.75, - "x": -96, - "y": 324 - }, - "custom_nodes": [ - { - "version": "0.3.0", - "scope": "node", - "name": "RVBSceneState", - "category": "condition", - "title": "RVBSceneState()", - "description": "红黑场景状态判定\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandIntAction", - "category": "action", - "title": "RandIntAction(,,)", - "description": "随机获得一个[min,max)的整数,保存到黑板的index key中", - "properties": { - "index": "key", - "min": 0, - "max": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandWait", - "category": "action", - "title": "RandWait(,)", - "description": "节点暂停[minTime,maxTime)毫秒", - "properties": { - "minTime": 0, - "maxTime": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RandomWeightComposite", - "category": "composite", - "title": "RandomWeightComposite()", - "description": "根据权重随机,选择一个子节点。\n权重使用|分割。\n需要注意子节点的顺序,个数需要和权重对应", - "properties": { - "weight": "\"\"" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckBool", - "category": "condition", - "title": "CheckBool()", - "description": "检查一个黑板的key值", - "properties": { - "keyName": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckInt", - "category": "condition", - "title": "CheckInt(,,)", - "description": "检查黑板的一个值和待比较值\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "keyName": "key", - "value": 0, - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LogAction", - "category": "action", - "title": "LogAction(,)", - "description": "输出日志", - "properties": { - "info": "info", - "level": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetPct", - "category": "action", - "title": "RVBBetPct(,)", - "description": "红黑下注\ngIPpct 下注百分比,黑板key 支持@\ngIPArea 下注区域,黑板key 支持@", - "properties": { - "gIPpct": "key", - "gIPArea": 1 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBLastWinArea", - "category": "action", - "title": "RVBLastWinArea()", - "description": "获得最后的下注结果保存到key,没有返回失败", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "LeaveGame", - "category": "action", - "title": "LeaveGame", - "description": "离开游戏", - "properties": {} - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerCoin", - "category": "condition", - "title": "CheckPlayerCoin(,)", - "description": "检查用户金币\ngIPCoin 支持@ 用户需要比较的金币\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPCoin": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetOutLimitCoin", - "category": "action", - "title": "GetOutLimitCoin()", - "description": "获得玩家游戏踢出限制\ngINKey 保存到黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerGameNum", - "category": "condition", - "title": "CheckPlayerGameNum(,)", - "description": "检查用户游戏次数\ngIPGameNum支持@ 用户需要游戏次数\ncmp 比较\t\n 0 //小于\n 1 //小于等于\n 2 //等于\n 3 //大于\n 4 //大于等于", - "properties": { - "gIPGameNum": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "CheckPlayerLastWinOrLost", - "category": "condition", - "title": "CheckPlayerLastWinOrLost(,)", - "description": "检查玩家上次输赢情况\ngIPLResult 比较值 支持@\ncmp 比较", - "properties": { - "gIPLResult": "key", - "cmp": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntAction", - "category": "action", - "title": "SetIntAction(,)", - "description": "设置int参数值\ngINKey 黑版key值\ngIPValue 设置的值,支持@", - "properties": { - "gINKey": "key", - "gIPValue": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBBetCoin", - "category": "action", - "title": "RVBBetCoin(,)", - "description": "红黑押注\ngIPBetCoin 押注金额 支持@\ngIPArea 押注区域支持@", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBCheckBetCoin", - "category": "action", - "title": "RVBCheckBetCoin(,)", - "description": "修正押注金额,保存到黑板key\ngIPSrcCoin 押注金额支持@\ngINSaveCoin 保存后key", - "properties": { - "gIPSrcCoin": "key", - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntMulti", - "category": "action", - "title": "SetIntMulti(,,)", - "description": "设置乘法,保存数值\ngINKey 保存黑版key\ngIPValue1 v1 支持@\ngIPValue2 v2 支持@", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerCoin", - "category": "action", - "title": "GetPlayerCoin()", - "description": "得到玩家金币\ngINKey 保存key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "SetIntDiv", - "category": "action", - "title": "SetIntDiv(,,)", - "description": "设定除法保存数据到黑板\ngINKey \ngIPValue1\ngIPValue2", - "properties": { - "gINKey": "key", - "gIPValue1": 0, - "gIPValue2": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "RVBHistoryIsSame", - "category": "condition", - "title": "RVBHistoryIsSame()", - "description": "判定是上几局都是相同的结果", - "properties": { - "gIPNum": "key", - "num": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "GetPlayerTakeCoin", - "category": "action", - "title": "GetPlayerTakeCoin()", - "description": "获得玩家入场携带金币\ngINKey 保存黑板key", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTHistoryIsSame", - "category": "condition", - "title": "DVTHistoryIsSame()", - "description": "判定是上几局都是相同的结果\ngIPNum 支持@", - "properties": { - "gIPNum": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTLastWinArea", - "category": "action", - "title": "DVTLastWinArea()", - "description": "龙虎最后获胜的区域保存到黑板", - "properties": { - "gINKey": "key" - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTBetCoin", - "category": "action", - "title": "DVTBetCoin(,)", - "description": "龙虎押注", - "properties": { - "gIPBetCoin": "key", - "gIPArea": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTCheckBetCoin", - "category": "action", - "title": "DVTCheckBetCoin(,)", - "description": "龙虎检查下注额度", - "properties": { - "gIPSrcCoin": 0, - "gINSaveCoin": 0 - } - }, - { - "version": "0.3.0", - "scope": "node", - "name": "DVTSceneState", - "category": "condition", - "title": "DVTSceneState()", - "description": "龙虎状态检查\n0 准备押注\n1 押注\n2 准备开牌\n3 开牌\n4 结算", - "properties": { - "state": 0 - } - } - ] -} \ No newline at end of file diff --git a/data/fishpath/path.json b/data/fishpath/path.json deleted file mode 100644 index f630728..0000000 --- a/data/fishpath/path.json +++ /dev/null @@ -1 +0,0 @@ -{"count":3,"pools":[{"id":-1,"type":2,"scatter":0,"s_obj":{"helix":0,"h_obj":{"offset":0},"custom":0,"c_obj":{"start":0,"offset":0}},"move":0,"m_obj":{"sx":0,"sy":0,"ex":0,"ey":0,"sp":0},"points":[{"x":-464,"y":-77,"stay":0},{"x":354,"y":1175,"stay":100},{"x":1352,"y":1038,"stay":50},{"x":897,"y":-374,"stay":50}],"stay":200,"length":3986}],"maxId":3,"lastEdit":1} \ No newline at end of file diff --git a/gamerule/fortunemouse/constants.go b/gamerule/fortunemouse/constants.go new file mode 100644 index 0000000..e99fda7 --- /dev/null +++ b/gamerule/fortunemouse/constants.go @@ -0,0 +1,22 @@ +package fortunemouse + +// 房间类型 +const ( + RoomMode_Classic int = iota //经典 + RoomMode_Max +) + +// 场景状态 +const ( + FortuneMouseStateStart int = iota //默认状态 + FortuneMouseStateMax +) + +// 玩家操作 +const ( + FortuneMousePlayerOpStart int = iota + FortuneMousePlayerOpSwitch +) +const NowByte int64 = 10000 + +const GameDataKey = "FortuneData" diff --git a/gamerule/thirteen/constants.go b/gamerule/thirteen/constants.go index 64d4508..d3eb482 100644 --- a/gamerule/thirteen/constants.go +++ b/gamerule/thirteen/constants.go @@ -34,6 +34,7 @@ const ( ThirteenWaterPlayerOpTest = 3 // test ThirteenWaterPlayerOpReset = 4 // 重新选牌 ThirteenWaterPlayerJoin = 5 // 加入游戏 + ThirteenWaterPlayerOpSelect = 6 // 预选牌 ) const ( ThirteenWaterSceneWaitTimeout = time.Second * 2 //等待倒计时 diff --git a/gamerule/thirteen/logic.go b/gamerule/thirteen/logic.go index e0cd97a..e3933b9 100644 --- a/gamerule/thirteen/logic.go +++ b/gamerule/thirteen/logic.go @@ -105,7 +105,7 @@ type Group struct { Head [3]int Mid [5]int End [5]int - PokerType int + PokerType int // -1 无牌数据,0 有牌数据, 1-13 特殊牌型 } func (p *Group) String() string { @@ -245,36 +245,35 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group { // 不可能 } else if n == 0 { // 逻辑点数相同 // 比花色,比三条就行了 - //n, index1, index2 := IndexCompareColorByLogic(c1, c2) - n = 0 + n, index1, index2 := IndexCompareColorByLogic(c1, c2) if n == 1 { // 花色交换,结束 - //if index1 >= 0 && index2 >= 0 { - // for k, v := range cards.Head { - // if v == r1[index1] { - // cards.Head[k] = -1 - // break - // } - // } - // for k, v := range cards.Mid { - // if v == r2[index2] { - // cards.Mid[k] = -1 - // break - // } - // } - // for k, v := range cards.Head { - // if v == -1 && r2[index2] >= 0 { - // cards.Head[k] = r2[index2] - // break - // } - // } - // for k, v := range cards.Mid { - // if v == -1 && r1[index1] >= 0 { - // cards.Mid[k] = r1[index1] - // break - // } - // } - //} + if index1 >= 0 && index2 >= 0 { + for k, v := range cards.Head { + if v == r1[index1] { + cards.Head[k] = -1 + break + } + } + for k, v := range cards.Mid { + if v == r2[index2] { + cards.Mid[k] = -1 + break + } + } + for k, v := range cards.Head { + if v == -1 && r2[index2] >= 0 { + cards.Head[k] = r2[index2] + break + } + } + for k, v := range cards.Mid { + if v == -1 && r1[index1] >= 0 { + cards.Mid[k] = r1[index1] + break + } + } + } } else if n == 0 { // 比癞子数 if l.LaiZiCount(r1) < l.LaiZiCount(r2) { @@ -381,13 +380,12 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group { } } else if n == 0 { // 点数相同 // 比花色 - //n, index1, index2 := IndexCompareColorByLogic(nHead[:], nMid[:]) - n = 0 + n, index1, index2 := IndexCompareColorByLogic(nHead[:], nMid[:]) if n == 1 { // 交换花色,结束 - //if index1 >= 0 && index2 >= 0 { - // cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1] - //} + if index1 >= 0 && index2 >= 0 { + cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1] + } } else if n == 0 { // 比癞子多少 if l.LaiZiCount(r1) < l.LaiZiCount(r2) { @@ -426,13 +424,13 @@ func (l *Logic) SortMidAndEnd(cards *Group) *Group { } } else if n == 0 { // 点数相同比花色 - //n, index1, index2 := IndexCompareColorByLogic(cards.Head[:], cards.Mid[:]) - //if n == 1 { - // // 交换最大花色的牌 - // if index1 >= 0 && index2 >= 0 { - // cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1] - // } - //} + n, index1, index2 := IndexCompareColorByLogic(cards.Head[:], cards.Mid[:]) + if n == 1 { + // 交换最大花色的牌 + if index1 >= 0 && index2 >= 0 { + cards.Head[index1], cards.Mid[index2] = cards.Mid[index2], cards.Head[index1] + } + } } } } @@ -612,13 +610,19 @@ func (l *Logic) findAllCombine(cards [13]int) (pokers []*Group) { i++ } } else if i == PokersTypeTwoPairs { + // 6,7,8 对子 + // 4,5,6 两对 al := len(copyCards) - if al == 7 || al == 6 { + if al == 8 || al == 7 { copy(poker.Mid[2:], card) } else if al == 5 || al == 4 { copy(poker.Mid[:], card) - } else if al == 8 { - copy(poker.Mid[:], card) + } else if al == 6 { + if poker.Mid[2] == -1 { + copy(poker.Mid[2:], card) + } else { + copy(poker.Mid[:], card) + } } else { copyCards = append(copyCards, card...) i++ @@ -828,10 +832,10 @@ func (l *Logic) CompareHead(c, cs [3]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } // 比癞子数 z1, z2 := l.LaiZiCount(c[:]), l.LaiZiCount(cs[:]) if z1 < z2 { @@ -863,10 +867,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypeStraightFlush: _, c1 := FindMaxSameColorFlush(c[:], l.LaiZi) @@ -882,20 +886,20 @@ func (l *Logic) CompareFive(c, cs [5]int) int { } if ch1 && ch2 { // 比花色 - //n := CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n := CompareColorByLogic(c1, c2) + if n != 0 { + return n + } } else if !ch1 && !ch2 { n := CompareLogic(c1, c2) if n != 0 { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } } else { if ch1 { return -1 @@ -922,10 +926,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypeFullHouse: _, c1 := FindMaxGourdCards(c[:], l.LaiZi) @@ -940,10 +944,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypeFlush: _, c1 := FindMaxSameColors(c[:], l.LaiZi) @@ -954,10 +958,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypeStraight: _, c1 := FindMaxFlush(c[:], l.LaiZi) @@ -973,20 +977,20 @@ func (l *Logic) CompareFive(c, cs [5]int) int { } if ch1 && ch2 { // 比花色 - //n := CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n := CompareColorByLogic(c1, c2) + if n != 0 { + return n + } } else if !ch1 && !ch2 { n := CompareLogic(c1, c2) if n != 0 { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } } else { if ch1 { return -1 @@ -1013,10 +1017,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypeTwoPairs: r1, c1 := FindMaxPairs(c[:], l.LaiZi) @@ -1047,10 +1051,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypePair: r1, c1 := FindMaxPairs(c[:], l.LaiZi) @@ -1071,10 +1075,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c1, c2) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c1, c2) + if n != 0 { + return n + } case PokersTypeOne: // 乌龙不会有癞子 @@ -1084,10 +1088,10 @@ func (l *Logic) CompareFive(c, cs [5]int) int { return n } // 比花色 - //n = CompareColorByLogic(c[:], cs[:]) - //if n != 0 { - // return n - //} + n = CompareColorByLogic(c[:], cs[:]) + if n != 0 { + return n + } return 0 } @@ -1130,10 +1134,10 @@ func (l *Logic) IsDP(head [3]int, mid, end [5]int) bool { return n == 1 } // 比花色 - //n = CompareColorByLogic(c1, changeMid) - //if n != 0 { - // return n == 1 - //} + n = CompareColorByLogic(c1, changeMid) + if n != 0 { + return n == 1 + } // 比癞子数 z1, z2 := l.LaiZiCount(r1), l.LaiZiCount(r2) if z1 < z2 { @@ -1158,10 +1162,10 @@ func (l *Logic) IsDP(head [3]int, mid, end [5]int) bool { return n == 1 } // 比花色 - //n = CompareColorByLogic(c1, changeMid) - //if n != 0 { - // return n == 1 - //} + n = CompareColorByLogic(c1, changeMid) + if n != 0 { + return n == 1 + } // 比癞子数 z1, z2 := l.LaiZiCount(r1), l.LaiZiCount(r2) if z1 < z2 { @@ -1178,10 +1182,10 @@ func (l *Logic) IsDP(head [3]int, mid, end [5]int) bool { return n == 1 } // 比花色 - //n = CompareColorByLogic(head[:], mid[:]) - //if n != 0 { - // return n == 1 - //} + n = CompareColorByLogic(head[:], mid[:]) + if n != 0 { + return n == 1 + } } } diff --git a/gamerule/thirteen/logic_test.go b/gamerule/thirteen/logic_test.go index da8a789..08cf3bb 100644 --- a/gamerule/thirteen/logic_test.go +++ b/gamerule/thirteen/logic_test.go @@ -87,6 +87,17 @@ func TestFindAllPokers(t *testing.T) { {46, 35, 30, 50, 34, 9, 25, 41, 3, 26, 2, 6, 45}, } + // + //牌序- A, K, Q, J,10, 9, 8, 7, 6, 5, 4, 3, 2 + //黑桃-51,50,49,48,47,46,45,44,43,42,41,40,39 + //红桃-38,37,36,35,34,33,32,31,30,29,28,27,26 + //梅花-25,24,23,22,21,20,19,18,17,16,15,14,13 + //方片-12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 + //data = [][13]int{ + // //{31, 42, 14, 49, 23, 25, 12, 6, 33, 20, 34, 21, 7}, + // {13, 23, 24, 36, 37, 38, 39, 51, 51, 50, 10, 11, 12}, + //} + for _, v := range data { cards := v fmt.Println(PokersShow(cards[:])) diff --git a/gamesrv/avengers/scenepolicy_avengers.go b/gamesrv/avengers/scenepolicy_avengers.go index b73f65c..abb1ed2 100644 --- a/gamesrv/avengers/scenepolicy_avengers.go +++ b/gamesrv/avengers/scenepolicy_avengers.go @@ -934,31 +934,30 @@ func AvengersCheckAndSaveLog(sceneEx *AvengersSceneData, playerEx *AvengersPlaye if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) totalin := int64(playerEx.RollGameType.BaseResult.TotalBet) totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet), WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin, - ValidBet: validBet, - ValidFlow: validFlow, - IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), + IsFirstGame: false, IsFree: playerEx.RollGameType.BaseResult.IsFree, WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame, WinTotal: playerEx.RollGameType.BaseResult.WinTotal, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + GameTime: 2, + }) } } } diff --git a/gamesrv/base/divisionsystem.go b/gamesrv/base/divisionsystem.go deleted file mode 100644 index f63a62c..0000000 --- a/gamesrv/base/divisionsystem.go +++ /dev/null @@ -1,6 +0,0 @@ -package base - -// 提供税收和流水,根据代理需求后台进行分账 -func ProfitDistribution(p *Player, tax, taxex, validFlow int64) { - //LogChannelSingleton.WriteMQData(model.GenerateTaxDivide(p.SnId, p.Platform, p.Channel, p.BeUnderAgentCode, p.PackageID, tax, taxex, validFlow, p.scene.GameId, p.scene.GameMode, p.scene.GetDBGameFree().GetId(), p.PromoterTree)) -} diff --git a/gamesrv/base/gamedetail.go b/gamesrv/base/gamedetail.go new file mode 100644 index 0000000..9b43209 --- /dev/null +++ b/gamesrv/base/gamedetail.go @@ -0,0 +1,255 @@ +package base + +import ( + "time" + + "github.com/globalsign/mgo/bson" + + "mongo.games.com/game/model" + "mongo.games.com/game/mq" +) + +/* + 记录游戏对局记录 +*/ + +type SaveGameDetailedParam struct { + LogId string // 日志id + Detail string // 游戏详细信息 + GameTime int64 // 游戏时长 + Trend20Lately string // 最近20局开奖结果 + CtrlType int // 调控类型 1控赢 2控输 + PlayerPool map[int]int // 个人水池分 + OnlyLog bool // 只返回日志,不保存 +} + +// SaveGameDetailedLog 保存游戏详细记录 +func (this *Scene) SaveGameDetailedLog(param *SaveGameDetailedParam) *SaveGameDetailedCopy { + if this == nil || param == nil { + return nil + } + + if param.GameTime <= 0 { + param.GameTime = int64(time.Now().Sub(this.GameNowTime).Seconds()) + } + + if param.GameTime < 0 { + param.GameTime = 0 + } + + now := time.Now() + + var ret SaveGameDetailedCopy + ret.Param = param + f := func(plt string) { + log := &model.GameDetailedLog{ + Id: bson.NewObjectId(), + LogId: param.LogId, + GameId: this.GameId, + Platform: plt, + MatchId: this.GetMatch().GetMatchSortId(), + SceneId: this.SceneId, + GameMode: this.GameMode, + GameFreeid: this.GetGameFreeId(), + PlayerCount: int32(len(this.Players)), + GameTiming: int32(param.GameTime), + GameBaseBet: this.GetBaseScore(), + GameDetailedNote: param.Detail, + GameDetailVer: GameDetailedVer[int(this.GameId)], + CpCtx: this.CpCtx, + Time: now, + Trend20Lately: param.Trend20Lately, + Ts: now.Unix(), + CtrlType: param.CtrlType, + PlayerPool: make(map[int]int), + CycleId: this.CycleID, + } + for k, v := range param.PlayerPool { + log.PlayerPool[k] = v + } + if param.OnlyLog { + ret.Log = append(ret.Log, log) + } else { + mq.Write(log) + } + } + + switch { + case this.IsCoinScene(): + mapPlatform := make(map[string]bool) + for _, v := range this.Players { + if v == nil { + continue + } + if _, ok := mapPlatform[v.Platform]; ok { + continue + } + mapPlatform[v.Platform] = true + f(v.Platform) + } + default: + f(this.Platform) + } + return &ret +} + +type SaveGamePlayerListLogParam struct { + LogId string // 详情日志id + Platform string // 平台 + Snid int32 // 玩家id + PlayerName string // 玩家名字 + Channel string // 渠道 + ChannelId string // 推广渠道 + TotalIn int64 // 总投入 + TotalOut int64 // 总产出(税前) + TaxCoin int64 // 总税收 + BetAmount int64 // 下注量 + WinAmountNoAnyTax int64 // 税后赢取额(净利润,正负值) + IsFirstGame bool // 是否第一次游戏 + IsFree bool // 拉霸专用 是否免费 + WinSmallGame int64 // 拉霸专用 小游戏奖励 + WinTotal int64 // 拉霸专用 本局输赢 + GameTime int64 // 游戏时长 + OnlyLog bool // 只返回日志,不保存 +} + +// SaveGamePlayerListLog 保存玩家对局记录 +func (this *Scene) SaveGamePlayerListLog(param *SaveGamePlayerListLogParam) *SaveGamePlayerListLogCopy { + if this == nil { + return nil + } + if param == nil { + return nil + } + + p := this.GetPlayer(param.Snid) + if p == nil { + return nil + } + + if param.PlayerName == "" { + param.PlayerName = p.Name + } + + var ret SaveGamePlayerListLogCopy + ret.Param = param + + baseScore := this.GetBaseScore() + + // 上报玩家游戏记录 + if !p.IsRob && (param.IsFree || param.TotalIn != 0 || param.TotalOut != 0) { + e := p.ReportGameEvent(&ReportGameEventParam{ + Tax: param.TaxCoin, + Change: param.WinAmountNoAnyTax, + In: param.TotalIn, + Out: param.TotalOut, + GameTime: param.GameTime, + OnlyLog: param.OnlyLog, + }) + if e != nil { + ret.UpLog = e + } + } + + // 保存玩家游戏日志 + now := time.Now() + log := &model.GamePlayerListLog{ + LogId: bson.NewObjectId(), + SnId: p.SnId, + Name: param.PlayerName, + GameId: this.GameId, + BaseScore: baseScore, + TaxCoin: param.TaxCoin, + Platform: param.Platform, + Channel: param.Channel, + SceneId: this.SceneId, + GameMode: this.GameMode, + GameFreeid: this.GetGameFreeId(), + GameDetailedLogId: param.LogId, + IsFirstGame: param.IsFirstGame, + BetAmount: param.BetAmount, + WinAmountNoAnyTax: param.WinAmountNoAnyTax, + TotalIn: param.TotalIn, + TotalOut: param.TotalOut, + Time: now, + RoomType: this.SceneMode, + GameDif: this.GetDBGameFree().GetGameDif(), + GameClass: this.GetDBGameFree().GetGameClass(), + MatchId: this.GetMatch().GetMatchSortId(), + MatchType: int64(this.GetMatch().GetMatchType()), + Ts: now.Unix(), + IsFree: param.IsFree, + WinSmallGame: param.WinSmallGame, + WinTotal: param.WinTotal, + CycleId: this.CycleID, + } + if param.OnlyLog { + ret.Log = append(ret.Log, log) + } else { + mq.Write(log) + } + return &ret +} + +// SaveGamePlayerListLogCopy 临时记录 +// 为了拉霸统计游戏时长,需要临时缓存游戏记录 +type SaveGamePlayerListLogCopy struct { + Param *SaveGamePlayerListLogParam + Log []*model.GamePlayerListLog + UpLog *ReportGameEventOnly // mq上报数据 +} + +func (s *SaveGamePlayerListLogCopy) Save() { + for _, v := range s.Log { + mq.Write(v) + } + if s.UpLog != nil { + for _, v := range s.UpLog.Log { + mq.Write(v, mq.BackGameRecord) + } + } +} + +// SaveGameDetailedCopy 临时记录 +// 为了拉霸统计游戏时长,需要临时缓存游戏记录 +type SaveGameDetailedCopy struct { + Param *SaveGameDetailedParam + Log []*model.GameDetailedLog +} + +func (s *SaveGameDetailedCopy) Save() { + for _, v := range s.Log { + mq.Write(v) + } +} + +// LabaLog 拉霸缓存游戏记录 +type LabaLog struct { + PlayerListLog *SaveGamePlayerListLogCopy + GameDetailLog *SaveGameDetailedCopy +} + +// Cache 临时缓存 +func (l *LabaLog) Cache(s *Scene, detailLog *SaveGameDetailedParam, playerListLog *SaveGamePlayerListLogParam) { + if s == nil { + return + } + detailLog.OnlyLog = true + playerListLog.OnlyLog = true + l.GameDetailLog = s.SaveGameDetailedLog(detailLog) + l.PlayerListLog = s.SaveGamePlayerListLog(playerListLog) +} + +// Save 保存 +func (l *LabaLog) Save(f func(log *LabaLog)) { + f(l) + l.PlayerListLog.Save() + l.GameDetailLog.Save() + l.Clear() +} + +// Clear 清空 +func (l *LabaLog) Clear() { + l.PlayerListLog = nil + l.GameDetailLog = nil +} diff --git a/gamesrv/base/gamewarning.go b/gamesrv/base/gamewarning.go index 4a0ddbe..a4e0021 100644 --- a/gamesrv/base/gamewarning.go +++ b/gamesrv/base/gamewarning.go @@ -68,27 +68,6 @@ func NewGameWarning(param string) { }), nil, "NewGameWarning").Start() } -// func WarningLoseCoin(gameFreeId int32, snid int32, loseCoin int64) { -// if model.GameParamData.WarningLoseLimit == 0 { -// return -// } -// if loseCoin < model.GameParamData.WarningLoseLimit { -// return -// } -// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningGame":%v,"WarningSnid":%v,"LoseCoin":%v}`, -// Warning_LoseCoinLimit, gameFreeId, snid, loseCoin)) -// - -//func WarningBetCoinCheck(sceneId, gameFreeId int32, snid int32, betCoin int64) { -// if model.GameParamData.WarningBetMax == 0 { -// return -// } -// if betCoin > model.GameParamData.WarningBetMax { -// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningGame":%v,"WarningScene":%v}`, -// Warning_BetCoinMax, snid, gameFreeId, sceneId)) -// } -//} - func WarningCoinPool(warnType int, gameFreeId int32) { NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningGame":%v}`, warnType, gameFreeId)) @@ -97,24 +76,3 @@ func WarningBlackPlayer(snid, gameFreeId int32) { NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningGame":%v}`, Warning_BlackPlayer, snid, gameFreeId)) } - -//func WarningWinnerRate(snid int32, winCoin, loseCoin int64) { -// if model.GameParamData.WarningWinRate == 0 { -// return -// } -// if (winCoin+1)/(loseCoin+1) < model.GameParamData.WarningWinRate { -// return -// } -// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningRate":%v,"WinCoin":%v,"LoseCoin":%v}`, -// Warning_WinRate, snid, (winCoin+1)/(loseCoin+1), winCoin, loseCoin)) -//} -//func WarningWinnerCoin(snid int32, winCoin, loseCoin int64) { -// if model.GameParamData.WarningWinMoney == 0 { -// return -// } -// if (winCoin - loseCoin) < model.GameParamData.WarningWinMoney { -// return -// } -// NewGameWarning(fmt.Sprintf(`{"WarningType":%v,"WarningSnid":%v,"WarningCoin":%v,"WinCoin":%v,"LoseCoin":%v}`, -// Warning_WinCoin, snid, (winCoin - loseCoin), winCoin, loseCoin)) -//} diff --git a/gamesrv/base/handredJacklistmgr.go b/gamesrv/base/handredJacklistmgr.go deleted file mode 100644 index e444859..0000000 --- a/gamesrv/base/handredJacklistmgr.go +++ /dev/null @@ -1,300 +0,0 @@ -package base - -import ( - "fmt" - "strconv" - "strings" - "time" - - "mongo.games.com/game/model" - - "github.com/globalsign/mgo/bson" - "mongo.games.com/goserver/core/basic" - "mongo.games.com/goserver/core/logger" - "mongo.games.com/goserver/core/module" - "mongo.games.com/goserver/core/task" -) - -// HundredJackListManager 排行榜 key: platform+gamefreeId -type HundredJackListManager struct { - HundredJackTsList map[string][]*HundredJackInfo - HundredJackSortList map[string][]*HundredJackInfo -} - -// HundredJackListMgr 实例化 -var HundredJackListMgr = &HundredJackListManager{ - HundredJackTsList: make(map[string][]*HundredJackInfo), - HundredJackSortList: make(map[string][]*HundredJackInfo), -} - -// HundredJackInfo 数据结构 -type HundredJackInfo struct { - model.HundredjackpotLog - linkSnids []int32 //点赞人数 -} - -// ModuleName . -func (hm *HundredJackListManager) ModuleName() string { - return "HundredJackListManager" -} - -// Init . -func (hm *HundredJackListManager) Init() { - //data := model. -} - -// Update . -func (hm *HundredJackListManager) Update() { -} - -// Shutdown . -func (hm *HundredJackListManager) Shutdown() { - module.UnregisteModule(hm) -} - -// ISInitJackInfo 仅初始化一次 -var ISInitJackInfo bool - -// InitTsJackInfo 初始化TsJackInfo -func (hm *HundredJackListManager) InitTsJackInfo(platform string, freeID int32) { - key := fmt.Sprintf("%v-%v", platform, freeID) - task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - datas, err := model.GetHundredjackpotLogTsByPlatformAndGameFreeID(platform, freeID) - if err != nil { - logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err) - return nil - } - return datas - }), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) { - datas := data.([]model.HundredjackpotLog) - if data != nil && datas != nil { - for i := range datas { - if i == model.HundredjackpotLogMaxLimitPerQuery { - break - } - data := &HundredJackInfo{ - HundredjackpotLog: datas[i], - } - strlikeSnids := strings.Split(datas[i].LinkeSnids, "|") - for _, v := range strlikeSnids { - if v == "" { - break - } - snid, err := strconv.Atoi(v) - if err == nil { - data.linkSnids = append(data.linkSnids, int32(snid)) - } - } - hm.HundredJackTsList[key] = append(hm.HundredJackTsList[key], data) - } - // logger.Logger.Warnf("InitTsJackInfo data:%v", datas) - } else { - hm.HundredJackTsList[key] = []*HundredJackInfo{} - } - return - }), "InitTsJackInfo").Start() -} - -// InitSortJackInfo 初始化SortJackInfo -func (hm *HundredJackListManager) InitSortJackInfo(platform string, freeID int32) { - - key := fmt.Sprintf("%v-%v", platform, freeID) - task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - datas, err := model.GetHundredjackpotLogCoinByPlatformAndGameFreeID(platform, freeID) - if err != nil { - logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err) - return nil - } - return datas - }), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) { - datas := data.([]model.HundredjackpotLog) - if data != nil && datas != nil { - for i := range datas { - if i == model.HundredjackpotLogMaxLimitPerQuery { - break - } - data := &HundredJackInfo{ - HundredjackpotLog: datas[i], - } - strlikeSnids := strings.Split(datas[i].LinkeSnids, "|") - for _, v := range strlikeSnids { - snid, err := strconv.Atoi(v) - if err == nil { - data.linkSnids = append(data.linkSnids, int32(snid)) - } - } - hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key], data) - } - // logger.Logger.Warnf("InitSortJackInfo data:%v", datas) - } else { - hm.HundredJackSortList[key] = []*HundredJackInfo{} - } - return - }), "InitSortJackInfo").Start() -} - -// InitHundredJackListInfo 初始化 HundredJackListInfo -func (hm *HundredJackListManager) InitHundredJackListInfo(platform string, freeID int32) { - if ISInitJackInfo { - return - } - key := fmt.Sprintf("%v-%v", platform, freeID) - if _, exist := hm.HundredJackTsList[key]; !exist { - hm.InitTsJackInfo(platform, freeID) - } - if _, exist := hm.HundredJackSortList[key]; !exist { - hm.InitSortJackInfo(platform, freeID) - } - ISInitJackInfo = true - return -} - -// GetJackTsInfo 返回TsInfo -func (hm *HundredJackListManager) GetJackTsInfo(platform string, freeID int32) []*HundredJackInfo { - key := fmt.Sprintf("%v-%v", platform, freeID) - if _, exist := hm.HundredJackTsList[key]; !exist { // 玩家进入scene 已经初始化 - hm.InitTsJackInfo(platform, freeID) - } - return hm.HundredJackTsList[key] -} - -// GetJackSortInfo 返回SortInfo -func (hm *HundredJackListManager) GetJackSortInfo(platform string, freeID int32) []*HundredJackInfo { - key := fmt.Sprintf("%v-%v", platform, freeID) - if _, exist := hm.HundredJackSortList[key]; !exist { - hm.InitSortJackInfo(platform, freeID) - } - return hm.HundredJackSortList[key] -} - -// Insert 插入 -func (hm *HundredJackListManager) Insert(coin, turncoin int64, snid, roomid, jackType, inGame, vip int32, platform, channel, name string, gamedata []string) { - key := fmt.Sprintf("%v-%v", platform, roomid) - log := model.NewHundredjackpotLogEx(snid, coin, turncoin, roomid, jackType, inGame, vip, platform, channel, name, gamedata) - ///////////////////实际不走这里 - if _, exist := hm.HundredJackTsList[key]; !exist { - hm.InitTsJackInfo(platform, roomid) - } - if _, exist := hm.HundredJackSortList[key]; !exist { - hm.InitSortJackInfo(platform, roomid) - } - ///////////////////// - hm.InsertLog(log) - data := &HundredJackInfo{ - HundredjackpotLog: *log, - } - /*logger.Logger.Trace("HundredJackListManager log 1 ", log.SnID, log.LogID, data.GameData) - for _, v := range hm.HundredJackTsList[key] { - logger.Logger.Trace("HundredJackListManager log 2 ", v.SnID, v.LogID, v.GameData) - }*/ - for i, v := range hm.HundredJackSortList[key] { // 插入 - if v.Coin < log.Coin { - d1 := append([]*HundredJackInfo{}, hm.HundredJackSortList[key][i:]...) - hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key][:i], data) - hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key], d1...) - goto Exit - } - } - if len(hm.HundredJackSortList[key]) < model.HundredjackpotLogMaxLimitPerQuery { - hm.HundredJackSortList[key] = append(hm.HundredJackSortList[key], data) - } -Exit: - d1 := append([]*HundredJackInfo{}, hm.HundredJackTsList[key][0:]...) - hm.HundredJackTsList[key] = append(hm.HundredJackTsList[key][:0], data) - hm.HundredJackTsList[key] = append(hm.HundredJackTsList[key], d1...) - var delList []*HundredJackInfo - if len(hm.HundredJackTsList[key]) > model.HundredjackpotLogMaxLimitPerQuery { - delList = append(delList, hm.HundredJackTsList[key][model.HundredjackpotLogMaxLimitPerQuery:]...) - hm.HundredJackTsList[key] = hm.HundredJackTsList[key][:model.HundredjackpotLogMaxLimitPerQuery] - } - if len(hm.HundredJackSortList[key]) > model.HundredjackpotLogMaxLimitPerQuery { - delList = append(delList, hm.HundredJackSortList[key][model.HundredjackpotLogMaxLimitPerQuery:]...) - hm.HundredJackSortList[key] = hm.HundredJackSortList[key][:model.HundredjackpotLogMaxLimitPerQuery] - } - /*for _, v := range hm.HundredJackTsList[key] { - logger.Logger.Trace("HundredJackListManager log 3 ", v.SnID, v.LogID, v.GameData) - }*/ - for _, v := range delList { - if hm.IsCanDel(v, hm.HundredJackTsList[key], hm.HundredJackSortList[key]) { // 两个排行帮都不包含 - logger.Logger.Info("HundredJackListManager DelOneJackInfo ", v.LogID) - hm.DelOneJackInfo(v.Platform, v.LogID) - } - } -} - -// IsCanDel 能否删除 -func (hm *HundredJackListManager) IsCanDel(deldata *HundredJackInfo, tsList, sortList []*HundredJackInfo) bool { - for _, v := range tsList { - if v.LogID == deldata.LogID { - return false - } - } - for _, v := range sortList { - if v.LogID == deldata.LogID { - return false - } - } - return true -} - -// InsertLog insert db -func (hm *HundredJackListManager) InsertLog(log *model.HundredjackpotLog) { - task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - err := model.InsertHundredjackpotLog(log) - if err != nil { - logger.Logger.Error("HundredJackListManager Insert ", err) - } - return err - }), nil, "InsertHundredJack").Start() -} - -// UpdateLikeNum updata likenum -func (hm *HundredJackListManager) UpdateLikeNum(plt string, gid bson.ObjectId, like int32, likesnids string) { - task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - err := model.UpdateLikeNum(plt, gid, like, likesnids) - if err != nil { - logger.Logger.Error("HundredJackListManager UpdateHundredLikeNum ", err) - } - return err - }), nil, "UpdateHundredLikeNum").Start() -} - -// UpdatePlayBlackNum updata playblacknum -func (hm *HundredJackListManager) UpdatePlayBlackNum(plt string, gid bson.ObjectId, playblack int32) []string { - var ret []string - task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - data, err := model.UpdatePlayBlackNum(plt, gid, playblack) - if err != nil { - logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err) - return nil - } - return data - }), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) { - if data != nil { - ret = data.([]string) - logger.Logger.Warnf("UpdatePlayBlackNum data:%v", ret) - } - return - }), "UpdatePlayBlackNum").Start() - - logger.Logger.Error("HundredJackListManager UpdatePlayBlackNum ", ret) - if len(ret) == 0 { - return ret - } - return nil -} - -// DelOneJackInfo del -func (hm *HundredJackListManager) DelOneJackInfo(plt string, gid bson.ObjectId) { - task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { - err := model.RemoveHundredjackpotLogOne(plt, gid) - if err != nil { - logger.Logger.Error("HundredJackListManager DelOneJackInfo ", err) - } - return err - }), nil, "DelOneJackInfo").Start() -} - -func init() { - module.RegisteModule(HundredJackListMgr, time.Hour, 0) -} diff --git a/gamesrv/base/player.go b/gamesrv/base/player.go index 53d263d..1bcdf6e 100644 --- a/gamesrv/base/player.go +++ b/gamesrv/base/player.go @@ -2,6 +2,7 @@ package base import ( "fmt" + "github.com/jinzhu/now" "math" "math/rand" "time" @@ -621,7 +622,20 @@ func (this *Player) AddRankScore(rankType int32, num int64) { } } -func (this *Player) ReportGameEvent(tax, taxex, changeCoin, validbet, validFlow, in, out int64) { +type ReportGameEventParam struct { + Tax int64 // 税收 + Change int64 // 净输赢,正负值,不带税收 + In, Out int64 // 投入,产出(税前) + GameTime int64 // 游戏时长,秒 + OnlyLog bool // 只返回数据,不上报 +} + +type ReportGameEventOnly struct { + Param *ReportGameEventParam + Log []*model.PlayerGameRecEvent +} + +func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEventOnly { // 记录玩家 首次参与该场次的游戏时间 游戏次数 var gameFirstTime, gameFreeFirstTime time.Time var gameTimes, gameFreeTimes int64 @@ -638,12 +652,53 @@ func (this *Player) ReportGameEvent(tax, taxex, changeCoin, validbet, validFlow, gameFreeTimes = dataGame.Statics.GameTimes } - gamingTime := int32(time.Now().Sub(this.scene.GameNowTime).Seconds()) - mq.Write(model.CreatePlayerGameRecEvent(this.SnId, tax, taxex, changeCoin, validbet, validFlow, in, out, - this.scene.GameId, this.scene.GetGameFreeId(), int32(this.scene.GameMode), - this.scene.GetRecordId(), this.Channel, this.ChannelId, this.BeUnderAgentCode, this.Platform, this.City, this.DeviceOS, - this.CreateTime, gamingTime, gameFirstTime, gameFreeFirstTime, gameTimes, gameFreeTimes, this.LastLoginTime, - this.TelephonePromoter, this.DeviceId), mq.BackGameRecord) + isNew := int32(0) + tCreateDay := now.New(this.CreateTime.Local()).BeginningOfDay() + if now.BeginningOfDay().Equal(tCreateDay) { + isNew = 1 + } + + if param.GameTime < 0 { + param.GameTime = int64(time.Now().Sub(this.scene.GameNowTime).Seconds()) + } + if param.GameTime < 0 { + param.GameTime = 0 + } + + var ret ReportGameEventOnly + ret.Param = param + log := &model.PlayerGameRecEvent{ + Platform: this.Platform, + RecordId: this.scene.GetRecordId(), + SnId: this.GetSnId(), + Channel: this.Channel, + ChannelId: this.ChannelId, + City: this.City, + OS: this.DeviceOS, + GameId: this.scene.GameId, + ModeId: this.scene.GameMode, + Tax: param.Tax, + Amount: param.Change, + CreateTime: this.CreateTime.Unix(), + CreateDayTime: tCreateDay.Unix(), + Out: param.Out, + In: param.In, + IsNew: isNew, + GameFreeID: this.scene.GetGameFreeId(), + GamingTime: int32(param.GameTime), + FirstTime: gameFirstTime.Unix(), + PlayTimes: gameTimes, + FirstGameTime: gameFreeFirstTime.Unix(), + PlayGameTimes: gameFreeTimes, + LastLoginTime: this.LastLoginTime.Unix(), + DeviceId: this.DeviceId, + } + if param.OnlyLog { + ret.Log = append(ret.Log, log) + } else { + mq.Write(log, mq.BackGameRecord) + } + return &ret } // 汇总玩家该次游戏总产生的税收 diff --git a/gamesrv/base/scene.go b/gamesrv/base/scene.go index a0ca96f..4d6a2e4 100644 --- a/gamesrv/base/scene.go +++ b/gamesrv/base/scene.go @@ -87,7 +87,8 @@ type Scene struct { SystemCoinOut int64 //本局游戏机器人营收 机器人赢:正值 机器人输:负值 ChessRank []int32 RealCtrl bool - CycleID string + CycleID string // 房卡场多轮对局id + LogId string // 游戏每局id } func NewScene(args *CreateSceneParam) *Scene { @@ -160,75 +161,104 @@ func (this *Scene) GetGameFreeId() int32 { func (this *Scene) GetKeyGameId() string { return this.KeyGameId } + func (this *Scene) SetKeyGameId(keyGameId string) { this.KeyGameId = keyGameId } + func (this *Scene) GetSceneId() int { return int(this.SceneId) } + func (this *Scene) SetSceneId(sceneId int) { this.SceneId = int32(sceneId) } + func (this *Scene) GetGroupId() int32 { return this.GroupId } + func (this *Scene) SetGroupId(groupId int32) { this.GroupId = groupId } + func (this *Scene) GetExtraData() interface{} { return this.ExtraData } + func (this *Scene) SetExtraData(data interface{}) { this.ExtraData = data } + func (this *Scene) GetSceneState() SceneState { return this.SceneState } + func (this *Scene) SetSceneState(state SceneState) { this.SceneState = state } + func (this *Scene) GetGameId() int { return int(this.GameId) } + func (this *Scene) SetGameId(gameId int) { this.GameId = int32(gameId) } + func (this *Scene) GetPlayerNum() int { - return int(this.WGCreateScene.GetPlayerNum()) + n := this.WGCreateScene.GetPlayerNum() + if n > 0 { + return int(n) + } + return int(this.PlayerNum) } + func (this *Scene) SetPlayerNum(playerNum int) { + this.WGCreateScene.PlayerNum = int32(playerNum) this.PlayerNum = int32(playerNum) } + func (this *Scene) GetGameMode() int { return int(this.GameMode) } + func (this *Scene) SetGameMode(gameMode int) { this.GameMode = int32(gameMode) } + func (this *Scene) GetGaming() bool { return this.Gaming } + func (this *Scene) SetGaming(gaming bool) { this.Gaming = gaming } + func (this *Scene) GetTesting() bool { return this.Testing } + func (this *Scene) SetTesting(testing bool) { this.Testing = testing } + func (this *Scene) GetCreator() int32 { return this.Creator } + func (this *Scene) SetCreator(creator int32) { this.Creator = creator } + func (this *Scene) GetSceneMode() int { return int(this.SceneMode) } + func (this *Scene) SetSceneMode(sceneMode int) { this.SceneMode = int32(sceneMode) } + func (this *Scene) GetParams() []int64 { return this.Params } @@ -236,42 +266,55 @@ func (this *Scene) GetParams() []int64 { func (this *Scene) GetStateStartTime() time.Time { return this.StateStartTime } + func (this *Scene) SetStateStartTime(stateStartTime time.Time) { this.StateStartTime = stateStartTime } + func (this *Scene) GetGameStartTime() time.Time { return this.GameStartTime } + func (this *Scene) SetGameStartTime(gameStartTime time.Time) { this.GameStartTime = gameStartTime } + func (this *Scene) GetGameNowTime() time.Time { return this.GameNowTime } + func (this *Scene) SetGameNowTime(gameNowTime time.Time) { this.GameNowTime = gameNowTime } + func (this *Scene) GetNumOfGames() int { return this.NumOfGames } + func (this *Scene) SetNumOfGames(numOfGames int) { this.NumOfGames = numOfGames } + func (this *Scene) GetCpCtx() model.CoinPoolCtx { return this.CpCtx } + func (this *Scene) SetCpCtx(cpCtx model.CoinPoolCtx) { this.CpCtx = cpCtx } + func (this *Scene) GetAudiences() map[int32]*Player { return this.audiences } + func (this *Scene) GetDisbandGen() int { return this.disbandGen } + func (this *Scene) SetDisbandGen(disbandGen int) { this.disbandGen = disbandGen } + func (this *Scene) GetScenePolicy() ScenePolicy { return this.sp } @@ -1403,112 +1446,6 @@ func (this *Scene) ClearAutoPlayer() { } } -type GameDetailedParam struct { - Trend20Lately string //最近20局开奖结果 - CtrlType int - PlayerPool map[int]int - CycleId string -} - -// 保存详细游戏日志 -func (this *Scene) SaveGameDetailedLog(logid string, gamedetailednote string, gameDetailedParam *GameDetailedParam) { - if this != nil { - if !this.Testing { //测试场屏蔽掉 - trend20Lately := gameDetailedParam.Trend20Lately - baseScore := this.GetDBGameFree().GetBaseScore() - if common.IsLocalGame(int(this.GameId)) { - baseScore = this.BaseScore - } - if this.IsCoinScene() { - mapPlatform := make(map[string]bool) - for _, p := range this.Players { - if _, ok := mapPlatform[p.Platform]; !ok { - mapPlatform[p.Platform] = true - log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId), - this.GetDBGameFree().GetGameMode(), this.GetDBGameFree().Id, int32(len(this.Players)), - int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore, - gamedetailednote, p.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[int(this.GameId)], trend20Lately, - gameDetailedParam.CtrlType, gameDetailedParam.PlayerPool, gameDetailedParam.CycleId) - if log != nil { - if this.IsMatchScene() { - log.MatchId = this.GetMatch().GetMatchSortId() - } - if this.IsCustom() { - log.CycleId = this.CycleID - } - mq.Write(log) - } - } - } - } else { - log := model.NewGameDetailedLogEx(logid, int32(this.GameId), int32(this.SceneId), - this.GetDBGameFree().GetGameMode(), this.GetDBGameFree().Id, int32(len(this.Players)), - int32(time.Now().Unix()-this.GameNowTime.Unix()), baseScore, - gamedetailednote, this.Platform, this.ClubId, this.RoomId, this.CpCtx, GameDetailedVer[int(this.GameId)], trend20Lately, - gameDetailedParam.CtrlType, gameDetailedParam.PlayerPool, gameDetailedParam.CycleId) - if log != nil { - if this.IsMatchScene() { - log.MatchId = this.GetMatch().GetMatchSortId() - } - if this.IsCustom() { - log.CycleId = this.CycleID - } - newLog := new(model.GameDetailedLog) - *newLog = *log - mq.Write(log) - } - } - } - } -} - -type SaveGamePlayerListLogParam struct { - Platform string //平台 - Channel string //渠道 - Promoter string //推广员 - PackageTag string //包标识 - InviterId int32 //邀请人 - LogId string //日志id - TotalIn int64 //总投入 - TotalOut int64 //总产出 - TaxCoin int64 //总税收 - ClubPumpCoin int64 //俱乐部抽水 - BetAmount int64 //下注量 - WinAmountNoAnyTax int64 //税后赢取额(净利润,正负值) - ValidBet int64 //有效下注 - ValidFlow int64 //有效流水 - IsFirstGame bool //是否第一次游戏 - IsLeave bool //是否中途离开,用于金花,德州可以中途离开游戏使用 - IsFree bool //拉霸专用 是否免费 - WinSmallGame int64 //拉霸专用 小游戏奖励 - WinTotal int64 //拉霸专用 本局输赢 - PlayerName string //玩家名字 - CycleId string // 房卡场对局id -} - -func GetSaveGamePlayerListLogParam(platform, channel, promoter, packageTag, logid string, - inviterId int32, totalin, totalout, taxCoin, clubPumpCoin, betAmount, winAmountNoAnyTax, validBet, validFlow int64, - isFirstGame, isLeave bool) *SaveGamePlayerListLogParam { - return &SaveGamePlayerListLogParam{ - Platform: platform, - Channel: channel, - Promoter: promoter, - PackageTag: packageTag, - InviterId: inviterId, - LogId: logid, - TotalIn: totalin, - TotalOut: totalout, - TaxCoin: taxCoin, - ClubPumpCoin: clubPumpCoin, - BetAmount: betAmount, - WinAmountNoAnyTax: winAmountNoAnyTax, - ValidBet: validBet, - ValidFlow: validFlow, - IsFirstGame: isFirstGame, - IsLeave: isLeave, - } -} - func (this *Scene) SaveFriendRecord(snid int32, isWin int32, billCoin int64, baseScore int32) { if this.SceneMode == common.SceneModePrivate { return @@ -1519,57 +1456,6 @@ func (this *Scene) SaveFriendRecord(snid int32, isWin int32, billCoin int64, bas } } -// 保存玩家和GameDetailedLog的映射表 -func (this *Scene) SaveGamePlayerListLog(snid int32, param *SaveGamePlayerListLogParam) { - if this != nil { - if !this.Testing { //测试场屏蔽掉 龙虎两边都压,totalin和totalout都=0,这个条件去掉 - //统计流水值 - playerEx := this.GetPlayer(snid) - //有些结算的时候,玩家已经退场,不要用是否在游戏,0709,修改为扣税后数值 - if playerEx != nil && !param.IsLeave && !playerEx.IsRob && (param.IsFree || param.TotalIn != 0 || param.TotalOut != 0) { - totalFlow := param.ValidFlow * int64(this.GetDBGameFree().GetBetWaterRate()) / 100 - playerEx.TotalConvertibleFlow += totalFlow - playerEx.TotalFlow += totalFlow - playerEx.ValidCacheBetTotal += param.ValidBet - //报表统计 - //playerEx.SaveReportForm(int(this.GetDBGameFree().GetGameClass()), this.SceneMode, this.KeyGameId, - // param.WinAmountNoAnyTax, totalFlow, param.ValidBet) - //分配利润 - ProfitDistribution(playerEx, param.TaxCoin, param.ClubPumpCoin, totalFlow) - //上报游戏事件 - playerEx.ReportGameEvent(param.TaxCoin, param.ClubPumpCoin, param.WinAmountNoAnyTax, param.ValidBet, totalFlow, param.TotalIn, param.TotalOut) - } - - roomType := int32(this.SceneMode) - if this.GameId == common.GameId_Avengers || - this.GameId == common.GameId_CaiShen || - this.GameId == common.GameId_EasterIsland || - this.GameId == common.GameId_IceAge || - this.GameId == common.GameId_TamQuoc { //复仇者联盟强制为0,所有场次操作记录放一起 - roomType = 0 - } - baseScore := this.GetDBGameFree().GetBaseScore() - if common.IsLocalGame(int(this.GameId)) { - baseScore = this.BaseScore - } - - Name := param.PlayerName - if playerEx != nil { - Name = param.PlayerName - } - - log := model.NewGamePlayerListLogEx(snid, param.LogId, param.Platform, param.Channel, param.Promoter, param.PackageTag, - this.GameId, baseScore, this.SceneId, int32(this.GetGameMode()), - this.GetGameFreeId(), param.TotalIn, param.TotalOut, this.ClubId, this.RoomId, param.TaxCoin, param.ClubPumpCoin, roomType, - param.BetAmount, param.WinAmountNoAnyTax, this.KeyGameId, Name, this.GetDBGameFree().GetGameClass(), - param.IsFirstGame, this.GetMatch().GetMatchSortId(), int64(this.GetMatch().GetMatchType()), param.IsFree, param.WinSmallGame, param.WinTotal, param.CycleId) - if log != nil { - mq.Write(log) - } - } - } -} - func (this *Scene) IsPlayerFirst(p *Player) bool { if p == nil { return false diff --git a/gamesrv/caishen/scenepolicy_caishen.go b/gamesrv/caishen/scenepolicy_caishen.go index cf4ba08..b227c93 100644 --- a/gamesrv/caishen/scenepolicy_caishen.go +++ b/gamesrv/caishen/scenepolicy_caishen.go @@ -1023,31 +1023,31 @@ func CaiShenCheckAndSaveLog(sceneEx *CaiShenSceneData, playerEx *CaiShenPlayerDa if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) totalin := int64(playerEx.RollGameType.BaseResult.TotalBet) totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet), WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), IsFree: playerEx.RollGameType.BaseResult.IsFree, WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame, WinTotal: playerEx.RollGameType.BaseResult.WinTotal, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + GameTime: 2, + }) } } } diff --git a/gamesrv/chess/scene.go b/gamesrv/chess/scene.go index ad40fdf..00ba0dc 100644 --- a/gamesrv/chess/scene.go +++ b/gamesrv/chess/scene.go @@ -767,6 +767,7 @@ func (e *SceneEx) ToBilled(p1, p2 *PlayerEx, isWin int) (*chesstitians.Chesstiti UserIcon: p1.Head, Platform: p1.Platform, Channel: p1.Channel, + ChannelId: p1.ChannelId, Promoter: p1.BeUnderAgentCode, PackageTag: p1.PackageID, InviterId: p1.InviterId, diff --git a/gamesrv/chess/scenepolicy.go b/gamesrv/chess/scenepolicy.go index 95084c5..116ecdd 100644 --- a/gamesrv/chess/scenepolicy.go +++ b/gamesrv/chess/scenepolicy.go @@ -1298,9 +1298,6 @@ func (this *SceneStateBilled) OnEnter(s *base.Scene) { } else { totalout += (o_player.GainCoin + o_player.GainTaxCoin) } - - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) sceneEx.SaveFriendRecord(o_player.UserId, o_player.IsWin, o_player.GainCoin, sceneEx.GetBaseScore()) // 游戏数据统计 @@ -1313,16 +1310,29 @@ func (this *SceneStateBilled) OnEnter(s *base.Scene) { }) // 玩家游戏记录 - sceneEx.SaveGamePlayerListLog(o_player.UserId, - base.GetSaveGamePlayerListLogParam(o_player.Platform, o_player.Channel, o_player.Promoter, - o_player.PackageTag, logid, o_player.InviterId, totalin, totalout, o_player.GainTaxCoin, - 0, 0, o_player.GainCoin, validBet, validFlow, o_player.IsFirst, o_player.IsLeave)) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: logid, + Platform: o_player.Platform, + Snid: o_player.UserId, + PlayerName: "", + Channel: o_player.Channel, + ChannelId: o_player.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: o_player.GainTaxCoin, + BetAmount: 0, + WinAmountNoAnyTax: o_player.GainCoin, + IsFirstGame: o_player.IsFirst, + }) isSave = true } } if isSave { // 牌局记录 - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + }) } } sceneEx.NotifySceneRoundPause() diff --git a/gamesrv/clawdoll/scenepolicy_clawdoll.go b/gamesrv/clawdoll/scenepolicy_clawdoll.go index 6b2d895..ce712e3 100644 --- a/gamesrv/clawdoll/scenepolicy_clawdoll.go +++ b/gamesrv/clawdoll/scenepolicy_clawdoll.go @@ -781,34 +781,28 @@ func (this *StateBilled) OnEnter(s *base.Scene) { sceneEx.logid, _ = model.AutoIncGameLogId() info, err := model.MarshalGameNoteByHUNDRED(LogBaseResult) if err == nil { - sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: sceneEx.logid, + Detail: info, + }) } TotalBetValue := 0 totalin := int64(TotalBetValue) totalout := playerEx.gainCoin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, - LogId: sceneEx.logid, - TotalIn: totalin, - TotalOut: totalout, - TaxCoin: playerEx.taxCoin, - BetAmount: int64(TotalBetValue), - WinAmountNoAnyTax: playerEx.gainCoin, - ValidBet: validBet, - ValidFlow: validFlow, - IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), - IsFree: false, - WinSmallGame: 0, - WinTotal: 0, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: sceneEx.logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: playerEx.taxCoin, + BetAmount: int64(TotalBetValue), + IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), + }) } playerEx.lastIsWin = playerEx.IsWin diff --git a/gamesrv/easterisland/scenepolicy_easterisland.go b/gamesrv/easterisland/scenepolicy_easterisland.go index 2474ad4..0b19dde 100644 --- a/gamesrv/easterisland/scenepolicy_easterisland.go +++ b/gamesrv/easterisland/scenepolicy_easterisland.go @@ -892,31 +892,31 @@ func EasterIslandCheckAndSaveLog(sceneEx *EasterIslandSceneData, playerEx *Easte if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) totalin := int64(playerEx.RollGameType.BaseResult.TotalBet) totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet), WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), IsFree: playerEx.RollGameType.BaseResult.IsFree, WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame, WinTotal: playerEx.RollGameType.BaseResult.WinTotal, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + GameTime: 2, + }) } } } diff --git a/gamesrv/fishing/playerdata_fishing.go b/gamesrv/fishing/playerdata_fishing.go index cad0291..8e244fa 100644 --- a/gamesrv/fishing/playerdata_fishing.go +++ b/gamesrv/fishing/playerdata_fishing.go @@ -262,13 +262,24 @@ func (this *FishingPlayerData) SaveDetailedLog(s *base.Scene) { info, err := model.MarshalGameNoteByFISH(&fd) if err == nil { logid, _ := model.AutoIncGameLogId() - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - param := base.GetSaveGamePlayerListLogParam(this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, logid, - this.InviterId, totalin, totalout, int64(this.sTaxCoin), 0, totalin, - totalout, validFlow, validBet, sceneEx.IsPlayerFirst(this.Player), false) - sceneEx.SaveGamePlayerListLog(this.SnId, param) - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: logid, + Platform: this.Platform, + Snid: this.SnId, + PlayerName: this.Name, + Channel: this.Channel, + ChannelId: this.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: int64(this.sTaxCoin), + BetAmount: totalin, + WinAmountNoAnyTax: totalout, + IsFirstGame: sceneEx.IsPlayerFirst(this.Player), + }) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + }) } pack := &server_proto.GWFishRecord{ diff --git a/gamesrv/fortunedragon/scenepolicy_fortunedragon.go b/gamesrv/fortunedragon/scenepolicy_fortunedragon.go index c5fc2d8..c2041a1 100644 --- a/gamesrv/fortunedragon/scenepolicy_fortunedragon.go +++ b/gamesrv/fortunedragon/scenepolicy_fortunedragon.go @@ -407,7 +407,9 @@ func (this *SceneStateStartFortuneDragon) OnPlayerOp(s *base.Scene, p *base.Play var gameEndStr string var data assemble.GameEnd if err == nil { + s.SetGameNowTime(time.Now()) data = assemble.DataToCli(Response).(assemble.GameEnd) + data.Results[0].BetMode = playerEx.BetMode if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 { //logger.Logger.Trace("=====================AddCoin=====TotalBet===", -data.TotalBet) //第一次触发或者正常模式 @@ -512,7 +514,11 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) var totalin, totalout int64 if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 { totalin = playerEx.totalBet @@ -520,25 +526,22 @@ func FortuneDragonAndSaveLog(sceneEx *FortuneDragonSceneData, playerEx *FortuneD if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 { totalout = int64(data.RoundReward) + playerEx.taxCoin } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: totalin, WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + IsFree: playerEx.isFree, + GameTime: 2, + }) } } diff --git a/gamesrv/fortunemouse/action_fortunemouse.go b/gamesrv/fortunemouse/action_fortunemouse.go new file mode 100644 index 0000000..2015e97 --- /dev/null +++ b/gamesrv/fortunemouse/action_fortunemouse.go @@ -0,0 +1,46 @@ +package fortunemouse + +import ( + "mongo.games.com/game/common" + "mongo.games.com/game/gamesrv/base" + "mongo.games.com/game/protocol/fortunemouse" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/netlib" +) + +type CSFortuneMouseOpPacketFactory struct { +} +type CSFortuneMouseOpHandler struct { +} + +func (this *CSFortuneMouseOpPacketFactory) CreatePacket() interface{} { + pack := &fortunemouse.CSFortuneMouseOp{} + return pack +} + +func (this *CSFortuneMouseOpHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error { + if op, ok := data.(*fortunemouse.CSFortuneMouseOp); ok { + p := base.PlayerMgrSington.GetPlayer(sid) + if p == nil { + logger.Logger.Warn("CSFortuneMouseOpHandler p == nil") + return nil + } + scene := p.GetScene() + if scene == nil { + logger.Logger.Warn("CSFortuneMouseOpHandler p.scene == nil") + return nil + } + if !scene.HasPlayer(p) { + return nil + } + if scene.GetScenePolicy() != nil { + scene.GetScenePolicy().OnPlayerOp(scene, p, int(op.GetOpCode()), op.GetParams()) + } + return nil + } + return nil +} +func init() { + common.RegisterHandler(int(fortunemouse.FortuneMousePID_PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP), &CSFortuneMouseOpHandler{}) + netlib.RegisterFactory(int(fortunemouse.FortuneMousePID_PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP), &CSFortuneMouseOpPacketFactory{}) +} diff --git a/gamesrv/fortunemouse/playerdata_fortunemouse.go b/gamesrv/fortunemouse/playerdata_fortunemouse.go new file mode 100644 index 0000000..204763e --- /dev/null +++ b/gamesrv/fortunemouse/playerdata_fortunemouse.go @@ -0,0 +1,51 @@ +package fortunemouse + +import ( + "mongo.games.com/game/gamerule/fortunemouse" + "mongo.games.com/game/gamesrv/base" + "mongo.games.com/game/gamesrv/slotspkg/slots" +) + +type FortuneMousePlayerData struct { + *base.Player + leaveTime int32 //离开时间 + SlotsSession *base.SlotsSession + + BetSizeIndex int64 `json:"bsi"` //选中的单注下标 + BetLevelIndex int64 `json:"bli"` //选中的等级下标 + BetLineIndex int64 `json:"bii"` //选中的线数下标 + BetMode int64 `json:"bm,optional"` //0.常规 1.必中 + + taxCoin int64 + winCoin int64 + currentLogId string + totalBet int64 + + isRespin bool //只用于判断是否可以离开 +} + +type SpinLock struct { + ReSpinStatus int `json:"rs,omitempty"` //0.默认 1.第一次触发 2.进行中 3.结束 + //OXSpecial + NewSuperStack []int64 `json:"nss,omitempty"` +} + +func (p *FortuneMousePlayerData) init() { + p.SlotsSession = base.NewSession(uint64(p.SnId), p.Coin*fortunemouse.NowByte) +} +func (p *FortuneMousePlayerData) Clear() { + p.taxCoin = 0 + p.winCoin = 0 + p.currentLogId = "" +} + +// 需要带到world上进行数据处理 +func (p *FortuneMousePlayerData) PushPlayer() map[string]string { + cache := slots.SlotsMgrSington.PushPlayer(p.SlotsSession) + return cache +} + +// 进房的时候需要带进来 +func (p *FortuneMousePlayerData) PullPlayer(data map[string]string) { + slots.SlotsMgrSington.PullPlayer(p.SlotsSession, data) +} diff --git a/gamesrv/fortunemouse/scenedata_fortunemouse.go b/gamesrv/fortunemouse/scenedata_fortunemouse.go new file mode 100644 index 0000000..d560055 --- /dev/null +++ b/gamesrv/fortunemouse/scenedata_fortunemouse.go @@ -0,0 +1,45 @@ +package fortunemouse + +import ( + "mongo.games.com/game/gamesrv/base" + "mongo.games.com/game/gamesrv/slotspkg/assemble" +) + +type FortuneMouseSceneData struct { + *base.Scene //场景 + players map[int32]*FortuneMousePlayerData //玩家信息 + BetConfig *assemble.BetConfig +} + +func NewFortuneMouseSceneData(s *base.Scene) *FortuneMouseSceneData { + sceneEx := &FortuneMouseSceneData{ + Scene: s, + players: make(map[int32]*FortuneMousePlayerData), + } + sceneEx.Init() + return sceneEx +} +func (s *FortuneMouseSceneData) Init() { + +} + +func (s *FortuneMouseSceneData) Clear() { + //应该是水池变一次就判断修改一次 + //s.slotRateWeight = s.slotRateWeightTotal[0] +} +func (s *FortuneMouseSceneData) SceneDestroy(force bool) { + //销毁房间 + s.Scene.Destroy(force) +} + +func (s *FortuneMouseSceneData) delPlayer(SnId int32) { + if _, exist := s.players[SnId]; exist { + delete(s.players, SnId) + } +} +func (s *FortuneMouseSceneData) OnPlayerLeave(p *base.Player, reason int) { + if /*playerEx*/ _, ok := p.ExtraData.(*FortuneMousePlayerData); ok { + + } + s.delPlayer(p.SnId) +} diff --git a/gamesrv/fortunemouse/scenepolicy_fortunemouse.go b/gamesrv/fortunemouse/scenepolicy_fortunemouse.go new file mode 100644 index 0000000..65356b3 --- /dev/null +++ b/gamesrv/fortunemouse/scenepolicy_fortunemouse.go @@ -0,0 +1,594 @@ +package fortunemouse + +import ( + "encoding/json" + "mongo.games.com/game/common" + "mongo.games.com/game/gamerule/fortunemouse" + "mongo.games.com/game/gamesrv/base" + "mongo.games.com/game/gamesrv/slotspkg/assemble" + "mongo.games.com/game/gamesrv/slotspkg/slots" + "mongo.games.com/game/model" + "mongo.games.com/game/proto" + protocol "mongo.games.com/game/protocol/fortunemouse" + "mongo.games.com/game/protocol/server" + "mongo.games.com/goserver/core" + "mongo.games.com/goserver/core/logger" + "time" +) + +// //////////////////////////////////////////////////////////// +var ScenePolicyFortuneMouseSington = &ScenePolicyFortuneMouse{} + +type ScenePolicyFortuneMouse struct { + base.BaseScenePolicy + states [fortunemouse.FortuneMouseStateMax]base.SceneState +} + +// 创建场景扩展数据 +func (this *ScenePolicyFortuneMouse) CreateSceneExData(s *base.Scene) interface{} { + sceneEx := NewFortuneMouseSceneData(s) + if sceneEx != nil { + if sceneEx.GetInit() { + s.SetExtraData(sceneEx) + } + } + return sceneEx +} + +// 创建玩家扩展数据 +func (this *ScenePolicyFortuneMouse) CreatePlayerExData(s *base.Scene, p *base.Player) interface{} { + playerEx := &FortuneMousePlayerData{Player: p} + p.SetExtraData(playerEx) + return playerEx +} + +// 场景开启事件 +func (this *ScenePolicyFortuneMouse) OnStart(s *base.Scene) { + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnStart, sceneId=", s.GetSceneId()) + sceneEx := NewFortuneMouseSceneData(s) + if sceneEx != nil { + if sceneEx.GetInit() { + s.SetExtraData(sceneEx) + s.ChangeSceneState(fortunemouse.FortuneMouseStateStart) + } + } +} + +// 场景关闭事件 +func (this *ScenePolicyFortuneMouse) OnStop(s *base.Scene) { + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnStop , sceneId=", s.GetSceneId()) +} + +// 场景心跳事件 +func (this *ScenePolicyFortuneMouse) OnTick(s *base.Scene) { + if s == nil { + return + } + if s.GetSceneState() != nil { + s.GetSceneState().OnTick(s) + } +} + +// 玩家进入事件 +func (this *ScenePolicyFortuneMouse) OnPlayerEnter(s *base.Scene, p *base.Player) { + if s == nil || p == nil { + return + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.Name) + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + playerEx := &FortuneMousePlayerData{Player: p} + + playerEx.init() + + d := p.GameData[fortunemouse.GameDataKey] + if d != nil { + m := make(map[string]string) + json.Unmarshal(d.Data.([]byte), &m) + playerEx.PullPlayer(m) + } else { + m := make(map[string]string) + //json.Unmarshal(d.Data.([]byte), &m) + playerEx.PullPlayer(m) + } + + playerEx.SlotsSession.SetCoin(playerEx.Coin * fortunemouse.NowByte) + + playerEx.Clear() + + sceneEx.players[p.SnId] = playerEx + + p.SetExtraData(playerEx) + FortuneMouseSendRoomInfo(s, sceneEx, playerEx) + + s.FirePlayerEvent(p, base.PlayerEventEnter, nil) + } +} + +// 玩家离开事件 +func (this *ScenePolicyFortuneMouse) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) { + if s == nil || p == nil { + return + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId) + if playerEx, ok := p.ExtraData.(*FortuneMousePlayerData); ok { + m := playerEx.PushPlayer() + if m != nil && len(m) > 0 { + b, err := json.Marshal(m) + if err != nil { + logger.Logger.Error("OnPlayerLeave, json.Marshal error:", err) + } else { + p.GameData[fortunemouse.GameDataKey] = &model.PlayerGameData{ + Platform: p.Platform, + SnId: p.SnId, + Id: fortunemouse.GameDataKey, + Data: b, + } + } + } + } + if sceneEx, ok := s.ExtraData.(*FortuneMouseSceneData); ok { + s.FirePlayerEvent(p, base.PlayerEventLeave, nil) + sceneEx.OnPlayerLeave(p, reason) + } +} + +// 玩家掉线 +func (this *ScenePolicyFortuneMouse) OnPlayerDropLine(s *base.Scene, p *base.Player) { + if s == nil || p == nil { + return + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId) + s.FirePlayerEvent(p, base.PlayerEventDropLine, nil) +} + +// 玩家重连 +func (this *ScenePolicyFortuneMouse) OnPlayerRehold(s *base.Scene, p *base.Player) { + if s == nil || p == nil { + return + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId) + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok { + FortuneMouseSendRoomInfo(s, sceneEx, playerEx) + } + } +} + +// 返回房间 +func (this *ScenePolicyFortuneMouse) OnPlayerReturn(s *base.Scene, p *base.Player) { + if s == nil || p == nil { + return + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerReturn, GetSceneId()=", s.GetSceneId(), " player=", p.Name) + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok { + //if p.IsMarkFlag(base.PlayerState_Auto) { + // p.UnmarkFlag(base.PlayerState_Auto) + // p.SyncFlag() + //} + //发送房间信息给自己 + FortuneMouseSendRoomInfo(s, sceneEx, playerEx) + s.FirePlayerEvent(p, base.PlayerEventReturn, nil) + } + } +} + +func FortuneMouseSendRoomInfo(s *base.Scene, sceneEx *FortuneMouseSceneData, playerEx *FortuneMousePlayerData) { + pack := FortuneMouseCreateRoomInfoPacket(s, sceneEx, playerEx) + logger.Logger.Trace("RoomInfo: ", pack) + playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO), pack) +} +func FortuneMouseCreateRoomInfoPacket(s *base.Scene, sceneEx *FortuneMouseSceneData, playerEx *FortuneMousePlayerData) interface{} { + //房间信息 + pack := &protocol.SCFortuneMouseRoomInfo{ + RoomId: s.SceneId, + GameId: s.GameId, + RoomMode: s.SceneMode, + SceneType: s.GetSceneType(), + Params: common.CopySliceInt64ToInt32(s.Params), + NumOfGames: proto.Int(sceneEx.NumOfGames), + State: proto.Int(s.SceneState.GetState()), + ParamsEx: s.GetDBGameFree().OtherIntParams, + GameFreeId: proto.Int32(s.GetDBGameFree().Id), + //BetLimit: s.GetDBGameFree().BetLimit, + } + + //自己的信息 + if playerEx != nil { + pd := &protocol.FortuneMousePlayerData{ + SnId: proto.Int32(playerEx.SnId), + Name: proto.String(playerEx.Name), + Head: proto.Int32(playerEx.Head), + Sex: proto.Int32(playerEx.Sex), + Coin: proto.Int64(playerEx.Coin), + Pos: proto.Int(playerEx.Pos), + Flag: proto.Int(playerEx.GetFlag()), + City: proto.String(playerEx.City), + HeadOutLine: proto.Int32(playerEx.HeadOutLine), + VIP: proto.Int32(playerEx.VIP), + } + pack.Player = pd + } + + //get data + Response, err := slots.SlotsMgrSington.Enter(playerEx.SlotsSession, int64(s.GameId)) + if err == nil { + data := assemble.DataToCli(Response).(assemble.TableInfo) + pi, _ := json.Marshal(data) + pack.PlayerInfo = string(pi) + if sceneEx.BetConfig == nil { + sceneEx.BetConfig = &data.BetConfig + } + } else { + logger.Logger.Error("slots enter err:", err) + } + proto.SetDefaults(pack) + return pack +} +func (this *ScenePolicyFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool { + if s == nil || p == nil { + return false + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params) + if s.GetSceneState() != nil { + if s.GetSceneState().OnPlayerOp(s, p, opcode, params) { + p.SetLastOPTimer(time.Now()) + return true + } + return false + } + return true +} + +func (this *ScenePolicyFortuneMouse) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) { + if s == nil || p == nil { + return + } + logger.Logger.Trace("(this *ScenePolicyFortuneMouse) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params) + if s.GetSceneState() != nil { + s.GetSceneState().OnPlayerEvent(s, p, evtcode, params) + } +} + +// 当前状态能否换桌 +func (this *ScenePolicyFortuneMouse) CanChangeCoinScene(s *base.Scene, p *base.Player) bool { + if s == nil || p == nil { + return false + } + if s.GetSceneState() != nil { + return s.GetSceneState().CanChangeCoinScene(s, p) + } + return false +} + +// 状态基类 +type SceneBaseStateFortuneMouse struct { +} + +func (this *SceneBaseStateFortuneMouse) GetTimeout(s *base.Scene) int { + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + return int(time.Now().Sub(sceneEx.GetStateStartTime()) / time.Second) + } + return 0 +} + +func (this *SceneBaseStateFortuneMouse) CanChangeTo(s base.SceneState) bool { + return true +} + +// 当前状态能否换桌 +func (this *SceneBaseStateFortuneMouse) CanChangeCoinScene(s *base.Scene, p *base.Player) bool { + return true +} +func (this *SceneBaseStateFortuneMouse) OnEnter(s *base.Scene) { + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + sceneEx.SetStateStartTime(time.Now()) + } +} + +func (this *SceneBaseStateFortuneMouse) OnLeave(s *base.Scene) {} +func (this *SceneBaseStateFortuneMouse) OnTick(s *base.Scene) { + if time.Now().Sub(s.GameStartTime) > time.Second*3 { + if sceneEx, ok := s.ExtraData.(*FortuneMouseSceneData); ok { + for _, p := range sceneEx.players { + if p.IsOnLine() { + p.leaveTime = 0 + continue + } + p.leaveTime++ + if p.leaveTime < 60*2 { + continue + } + //踢出玩家 + sceneEx.PlayerLeave(p.Player, common.PlayerLeaveReason_LongTimeNoOp, true) + } + } + s.GameStartTime = time.Now() + } +} +func (this *SceneBaseStateFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool { + return false +} +func (this *SceneBaseStateFortuneMouse) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) { +} + +// //////////////////////////////////////////////////////////// +// 开始状态 +// //////////////////////////////////////////////////////////// +type SceneStateStartFortuneMouse struct { + SceneBaseStateFortuneMouse +} + +func (this *SceneStateStartFortuneMouse) GetState() int { + return fortunemouse.FortuneMouseStateStart +} + +func (this *SceneStateStartFortuneMouse) CanChangeTo(s base.SceneState) bool { + return false +} + +// 当前状态能否换桌 +func (this *SceneStateStartFortuneMouse) CanChangeCoinScene(s *base.Scene, p *base.Player) bool { + if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok { + if playerEx.isRespin { + return false + } + } + return true +} + +func (this *SceneStateStartFortuneMouse) GetTimeout(s *base.Scene) int { + return 0 +} + +func (this *SceneStateStartFortuneMouse) OnEnter(s *base.Scene) { + this.SceneBaseStateFortuneMouse.OnEnter(s) + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + sceneEx.SetGameNowTime(time.Now()) + } +} + +// 状态离开时 +func (this *SceneStateStartFortuneMouse) OnLeave(s *base.Scene) { + this.SceneBaseStateFortuneMouse.OnLeave(s) + logger.Logger.Tracef("(this *SceneStateStartFortuneMouse) OnLeave, sceneid=%v", s.GetSceneId()) +} + +// 玩家操作 +func (this *SceneStateStartFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool { + logger.Logger.Tracef("(this *SceneStateStartFortuneMouse) OnPlayerOp, sceneid=%v params=%v", s.GetSceneId(), params) + if this.SceneBaseStateFortuneMouse.OnPlayerOp(s, p, opcode, params) { + return true + } + if sceneEx, ok := s.GetExtraData().(*FortuneMouseSceneData); ok { + if playerEx, ok := p.GetExtraData().(*FortuneMousePlayerData); ok { + switch opcode { + case fortunemouse.FortuneMousePlayerOpStart: + playerEx.Clear() + if len(params) < 3 { + pack := &protocol.SCFortuneMouseBilled{ + OpRetCode: proto.Int32(1), + } + proto.SetDefaults(pack) + logger.Logger.Trace("SCFortuneMouseBilled", pack.String()) + playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED), pack) + return true + } + playerEx.BetSizeIndex = params[0] + playerEx.BetLevelIndex = params[1] + playerEx.BetLineIndex = params[2] + //playerEx.BetMode = params[3] + needCoin := sceneEx.BetConfig.BetSize[params[0]] * float64(sceneEx.BetConfig.BetLevel[params[1]]) * + float64(sceneEx.BetConfig.BetLines[params[2]]) + if needCoin > float64(playerEx.Coin) { + pack := &protocol.SCFortuneMouseBilled{ + OpRetCode: proto.Int32(1), + } + proto.SetDefaults(pack) + logger.Logger.Trace("SCFortuneMouseBilled:", pack.String()) + playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED), pack) + return true + } + + //playerEx.SlotsSession.SetCoin(playerEx.Coin * fortunemouse.NowByte) + //logger.Logger.Trace("=============init dif coin", playerEx.Coin-playerEx.SlotsSession.Coin()/fortunemouse.NowByte) + + //get data + Response, err := slots.SlotsMgrSington.Play(playerEx.SlotsSession, &base.SpinReq{ + GameId: int64(sceneEx.GameId), + BetSizeIndex: playerEx.BetSizeIndex, + BetLevelIndex: playerEx.BetLevelIndex, + BetLineIndex: playerEx.BetLineIndex, + BetMode: playerEx.BetMode, + Ts: time.Now().Unix(), + }) + var gameEndStr string + var data assemble.GameEnd + if err == nil { + s.SetGameNowTime(time.Now()) + data = assemble.DataToCli(Response).(assemble.GameEnd) + var respinStatus int + if data.Results[0].ArrSpins[0].Special != nil { + sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special) + var spinLock SpinLock + json.Unmarshal(sp, &spinLock) + respinStatus = spinLock.ReSpinStatus + } + if respinStatus == 0 || respinStatus == 1 { + //第一次触发或者正常模式 + //logger.Logger.Trace("=============addcoin1111 ", -data.TotalBet) + playerEx.AddCoin(int64(-data.TotalBet), common.GainWay_HundredSceneLost, base.SyncFlag_ToClient, "system", s.GetSceneName()) + playerEx.totalBet = int64(data.TotalBet) + //logger.Logger.Trace("=======bet======dif++++ ", float64(playerEx.Coin)-data.BetAfterCoin) + } + var taxCoin float64 + if data.RoundReward > 0 { + //税收比例 + taxRate := sceneEx.GetDBGameFree().GetTaxRate() + if taxRate < 0 || taxRate > 10000 { + taxRate = 500 + } + taxCoin = data.RoundReward * float64(taxRate) / 10000 + data.RoundReward = data.RoundReward - taxCoin + playerEx.AddServiceFee(int64(taxCoin)) + playerEx.taxCoin = int64(taxCoin) + playerEx.winCoin = int64(data.RoundReward) + } + pi, _ := json.Marshal(data) + gameEndStr = string(pi) + if respinStatus == 0 || respinStatus == 3 { + //logger.Logger.Trace("===win==========addcoin222 ", data.RoundReward) + playerEx.AddCoin(int64(data.RoundReward), common.GainWay_HundredSceneWin, 0, "system", s.GetSceneName()) + //logger.Logger.Trace("=======win======dif++++ ", float64(playerEx.Coin)-data.FinalCoin) + //免费游戏结束或者正常模式 + sceneEx.StaticsLaba(&base.StaticLabaParam{ + SnId: playerEx.SnId, + Gain: int64(data.RoundReward - data.TotalBet), + GainTax: int64(taxCoin), + IsAddTimes: true, + }) + } + if respinStatus == 0 || respinStatus == 3 { + playerEx.isRespin = false + } else { + playerEx.isRespin = true + } + } else { + logger.Logger.Error("slots Play err:", err) + } + + playerEx.SlotsSession.SetCoin(int64(data.FinalCoin) * fortunemouse.NowByte) + + //logger.Logger.Trace("======end=======init dif coin", playerEx.Coin-playerEx.SlotsSession.Coin()/fortunemouse.NowByte) + + if playerEx.Coin != int64(data.FinalCoin) { + logger.Logger.Error("==========playerEx.Coin != data.FinalCoin==============", (float64(playerEx.Coin)-data.FinalCoin)/10000) + } + pack := &protocol.SCFortuneMouseBilled{ + OpRetCode: proto.Int32(0), + GameEndStr: proto.String(gameEndStr), + } + proto.SetDefaults(pack) + logger.Logger.Trace("SCFortuneMouseBilled", pack.String()) + playerEx.SendToClient(int(protocol.FortuneMousePID_PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED), pack) + + // 记录本次操作 + FortuneMouseAndSaveLog(sceneEx, playerEx, data) + } + } + } + return true +} + +// 玩家事件 +func (this *SceneStateStartFortuneMouse) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) { + logger.Logger.Trace("(this *SceneStateStartFortuneMouse) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode) + this.SceneBaseStateFortuneMouse.OnPlayerEvent(s, p, evtcode, params) +} + +func (this *SceneStateStartFortuneMouse) OnTick(s *base.Scene) { + this.SceneBaseStateFortuneMouse.OnTick(s) +} + +// ////////////////////////////////////////////////////////////////////////////// +func (this *ScenePolicyFortuneMouse) RegisteSceneState(state base.SceneState) { + if state == nil { + return + } + stateid := state.GetState() + if stateid < 0 || stateid >= fortunemouse.FortuneMouseStateMax { + return + } + this.states[stateid] = state +} + +func (this *ScenePolicyFortuneMouse) GetSceneState(s *base.Scene, stateid int) base.SceneState { + if stateid >= 0 && stateid < fortunemouse.FortuneMouseStateMax { + return this.states[stateid] + } + return nil +} +func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMousePlayerData, data assemble.GameEnd) { + if !playerEx.IsRob { + data.SnId = playerEx.SnId + var respinStatus int + if data.Results[0].ArrSpins[0].Special != nil { + sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special) + var spinLock SpinLock + json.Unmarshal(sp, &spinLock) + respinStatus = spinLock.ReSpinStatus + } + if respinStatus == 0 || respinStatus == 1 { + data.TotalBet = 0 + } + info, err := model.MarshalGameNoteByROLL(data) + if err == nil { + logid, _ := model.AutoIncGameLogId() + playerEx.currentLogId = logid + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) + var totalin, totalout int64 + if respinStatus == 0 || respinStatus == 1 { + totalin = playerEx.totalBet + } + if respinStatus == 0 || respinStatus == 3 { + totalout = int64(data.RoundReward) + playerEx.taxCoin + } + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: playerEx.taxCoin, + BetAmount: playerEx.totalBet, + WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin, + IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), + IsFree: totalin == 0, + GameTime: 2, + }) + } + } + + //统计输下注金币数 + if !sceneEx.Testing && !playerEx.IsRob { + playerBet := &server.PlayerData{ + SnId: proto.Int32(playerEx.SnId), + Bet: proto.Int64(playerEx.CurrentBet), + Gain: proto.Int64(int64(data.RoundReward) + playerEx.taxCoin), + Tax: proto.Int64(playerEx.taxCoin), + Coin: proto.Int64(playerEx.GetCoin()), + GameCoinTs: proto.Int64(playerEx.GameCoinTs), + } + gwPlayerBet := &server.GWPlayerData{ + SceneId: sceneEx.SceneId, + GameFreeId: proto.Int32(sceneEx.GetDBGameFree().GetId()), + } + gwPlayerBet.Datas = append(gwPlayerBet.Datas, playerBet) + sceneEx.SyncPlayerDatas(&base.PlayerDataParam{ + HasRobotGaming: false, + Data: gwPlayerBet, + }) + } + + playerEx.taxCoin = 0 + playerEx.winCoin = 0 + + if sceneEx.CheckNeedDestroy() && data.Results[0].FreeNum <= 0 { + sceneEx.SceneDestroy(true) + } +} +func init() { + //主状态 + ScenePolicyFortuneMouseSington.RegisteSceneState(&SceneStateStartFortuneMouse{}) + core.RegisteHook(core.HOOK_BEFORE_START, func() error { + base.RegisteScenePolicy(common.GameId_FortuneMouse, fortunemouse.RoomMode_Classic, ScenePolicyFortuneMouseSington) + return nil + }) +} diff --git a/gamesrv/fortuneox/scenepolicy_fortuneox.go b/gamesrv/fortuneox/scenepolicy_fortuneox.go index 1e05719..d6a4b33 100644 --- a/gamesrv/fortuneox/scenepolicy_fortuneox.go +++ b/gamesrv/fortuneox/scenepolicy_fortuneox.go @@ -405,6 +405,7 @@ func (this *SceneStateStartFortuneOx) OnPlayerOp(s *base.Scene, p *base.Player, var gameEndStr string var data assemble.GameEnd if err == nil { + s.SetGameNowTime(time.Now()) data = assemble.DataToCli(Response).(assemble.GameEnd) var respinStatus int if data.Results[0].ArrSpins[0].Special != nil { @@ -510,40 +511,49 @@ func (this *ScenePolicyFortuneOx) GetSceneState(s *base.Scene, stateid int) base func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerData, data assemble.GameEnd) { if !playerEx.IsRob { data.SnId = playerEx.SnId - if data.Results[0].FreeStatus != 1 && data.Results[0].FreeNumMax != 0 { + var respinStatus int + if data.Results[0].ArrSpins[0].Special != nil { + sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special) + var spinLock SpinLock + json.Unmarshal(sp, &spinLock) + respinStatus = spinLock.ReSpinStatus + } + if respinStatus != 0 && respinStatus != 1 { data.TotalBet = 0 } + info, err := model.MarshalGameNoteByROLL(data) if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) var totalin, totalout int64 - if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 { + if respinStatus == 0 || respinStatus == 1 { totalin = playerEx.totalBet } - if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 { + if respinStatus == 0 || respinStatus == 3 { totalout = int64(data.RoundReward) + playerEx.taxCoin } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, - BetAmount: playerEx.totalBet, + BetAmount: totalin, WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + IsFree: totalin == 0, + GameTime: 2, + }) } } diff --git a/gamesrv/fortunerabbit/scenepolicy_fortunerabbit.go b/gamesrv/fortunerabbit/scenepolicy_fortunerabbit.go index 13e788c..a292add 100644 --- a/gamesrv/fortunerabbit/scenepolicy_fortunerabbit.go +++ b/gamesrv/fortunerabbit/scenepolicy_fortunerabbit.go @@ -405,6 +405,7 @@ func (this *SceneStateStartFortuneRabbit) OnPlayerOp(s *base.Scene, p *base.Play var gameEndStr string var data assemble.GameEnd if err == nil { + s.SetGameNowTime(time.Now()) data = assemble.DataToCli(Response).(assemble.GameEnd) if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 { //第一次触发或者正常模式 @@ -511,7 +512,11 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) var totalin, totalout int64 if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 { totalin = playerEx.totalBet @@ -519,25 +524,22 @@ func FortuneRabbitAndSaveLog(sceneEx *FortuneRabbitSceneData, playerEx *FortuneR if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 { totalout = int64(data.RoundReward) + playerEx.taxCoin } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, - BetAmount: playerEx.totalBet, + BetAmount: totalin, WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + IsFree: playerEx.isFree, + GameTime: 2, + }) } } diff --git a/gamesrv/fortunetiger/scenepolicy_fortunetiger.go b/gamesrv/fortunetiger/scenepolicy_fortunetiger.go index 9edc6be..9557faf 100644 --- a/gamesrv/fortunetiger/scenepolicy_fortunetiger.go +++ b/gamesrv/fortunetiger/scenepolicy_fortunetiger.go @@ -405,10 +405,14 @@ func (this *SceneStateStartFortuneTiger) OnPlayerOp(s *base.Scene, p *base.Playe var gameEndStr string var data assemble.GameEnd if err == nil { + s.SetGameNowTime(time.Now()) data = assemble.DataToCli(Response).(assemble.GameEnd) var respinStatus int if data.Results[0].ArrSpins[0].Special != nil { - respinStatus = data.Results[0].ArrSpins[0].Special.(SpinLock).ReSpinStatus + sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special) + var spinLock SpinLock + json.Unmarshal(sp, &spinLock) + respinStatus = spinLock.ReSpinStatus } if respinStatus == 0 || respinStatus == 1 { //第一次触发或者正常模式 @@ -514,7 +518,11 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) var totalin, totalout int64 if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 { totalin = playerEx.totalBet @@ -522,25 +530,22 @@ func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTig if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 { totalout = int64(data.RoundReward) + playerEx.taxCoin } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, - BetAmount: playerEx.totalBet, + BetAmount: totalin, WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + IsFree: totalin == 0, + GameTime: 2, + }) } } diff --git a/gamesrv/fruits/scenedata_fruits.go b/gamesrv/fruits/scenedata_fruits.go index 94f20de..3a24307 100644 --- a/gamesrv/fruits/scenedata_fruits.go +++ b/gamesrv/fruits/scenedata_fruits.go @@ -326,7 +326,11 @@ func (s *FruitsSceneData) SaveLog(p *FruitsPlayerData, isOffline int) { info, err := model.MarshalGameNoteByROLL(&FruitsType) if err == nil { logId, _ := model.AutoIncGameLogId() - s.SaveGameDetailedLog(logId, info, &base.GameDetailedParam{}) + s.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logId, + Detail: info, + GameTime: 2, + }) //水池上下文环境s s.CpCtx = p.cpCtx var totalIn, totalOut int64 @@ -336,22 +340,22 @@ func (s *FruitsSceneData) SaveLog(p *FruitsPlayerData, isOffline int) { if nowGetCoin > 0 && isF { totalOut = p.Coin - p.startCoin + betCoin /*+ p.taxCoin*/ } - s.SaveGamePlayerListLog(p.SnId, - &base.SaveGamePlayerListLogParam{ - Platform: p.Platform, - Channel: p.Channel, - Promoter: p.BeUnderAgentCode, - PackageTag: p.PackageID, - InviterId: p.InviterId, - LogId: logId, - TotalIn: totalIn, - TotalOut: totalOut, - TaxCoin: p.taxCoin, - ClubPumpCoin: 0, - BetAmount: totalIn, - WinAmountNoAnyTax: p.Coin - p.startCoin, - IsFirstGame: s.IsPlayerFirst(p.Player), - }) + s.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: logId, + Platform: p.Platform, + Snid: p.SnId, + PlayerName: p.Name, + Channel: p.Channel, + ChannelId: p.ChannelId, + TotalIn: totalIn, + TotalOut: totalOut, + TaxCoin: p.taxCoin, + BetAmount: totalIn, + WinAmountNoAnyTax: p.Coin - p.startCoin, + IsFirstGame: s.IsPlayerFirst(p.Player), + IsFree: totalIn == 0, + GameTime: 2, + }) } s.GameNowTime = time.Now() if s.CheckNeedDestroy() && p.freeTimes == 0 && p.maryFreeTimes == 0 { diff --git a/gamesrv/iceage/scenepolicy_iceage.go b/gamesrv/iceage/scenepolicy_iceage.go index be0ebff..762891e 100644 --- a/gamesrv/iceage/scenepolicy_iceage.go +++ b/gamesrv/iceage/scenepolicy_iceage.go @@ -942,31 +942,31 @@ func IceAgeCheckAndSaveLog(sceneEx *IceAgeSceneData, playerEx *IceAgePlayerData) if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) totalin := int64(playerEx.RollGameType.BaseResult.TotalBet) totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet), WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), IsFree: playerEx.RollGameType.BaseResult.IsFree, WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame, WinTotal: playerEx.RollGameType.BaseResult.WinTotal, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + GameTime: 2, + }) } } } diff --git a/gamesrv/main.go b/gamesrv/main.go index 5154fc0..5a06e0d 100644 --- a/gamesrv/main.go +++ b/gamesrv/main.go @@ -31,6 +31,7 @@ import ( _ "mongo.games.com/game/gamesrv/caishen" _ "mongo.games.com/game/gamesrv/easterisland" _ "mongo.games.com/game/gamesrv/fortunedragon" + _ "mongo.games.com/game/gamesrv/fortunemouse" _ "mongo.games.com/game/gamesrv/fortuneox" _ "mongo.games.com/game/gamesrv/fortunerabbit" _ "mongo.games.com/game/gamesrv/fortunetiger" diff --git a/gamesrv/richblessed/scenedata_richblessed.go b/gamesrv/richblessed/scenedata_richblessed.go index 9d31d45..8b35d71 100644 --- a/gamesrv/richblessed/scenedata_richblessed.go +++ b/gamesrv/richblessed/scenedata_richblessed.go @@ -348,7 +348,11 @@ func (s *RichBlessedSceneData) SaveLog(p *RichBlessedPlayerData, isOffline int) info, err := model.MarshalGameNoteByROLL(&RichBlessed) if err == nil { logId, _ := model.AutoIncGameLogId() - s.SaveGameDetailedLog(logId, info, &base.GameDetailedParam{}) + s.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logId, + Detail: info, + GameTime: 2, + }) //水池上下文环境s s.CpCtx = p.cpCtx var totalIn, totalOut int64 @@ -358,22 +362,22 @@ func (s *RichBlessedSceneData) SaveLog(p *RichBlessedPlayerData, isOffline int) if nowGetCoin > 0 { totalOut = p.Coin - p.startCoin + betCoin /*+ p.taxCoin*/ } - s.SaveGamePlayerListLog(p.SnId, - &base.SaveGamePlayerListLogParam{ - Platform: p.Platform, - Channel: p.Channel, - Promoter: p.BeUnderAgentCode, - PackageTag: p.PackageID, - InviterId: p.InviterId, - LogId: logId, - TotalIn: totalIn, - TotalOut: totalOut, - TaxCoin: p.taxCoin, - ClubPumpCoin: 0, - BetAmount: totalIn, - WinAmountNoAnyTax: p.Coin - p.startCoin, - IsFirstGame: s.IsPlayerFirst(p.Player), - }) + s.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: logId, + Platform: p.Platform, + Snid: p.SnId, + PlayerName: p.Name, + Channel: p.Channel, + ChannelId: p.ChannelId, + TotalIn: totalIn, + TotalOut: totalOut, + TaxCoin: p.taxCoin, + BetAmount: totalIn, + WinAmountNoAnyTax: p.Coin - p.startCoin, + IsFirstGame: s.IsPlayerFirst(p.Player), + IsFree: totalIn == 0, + GameTime: 2, + }) } s.GameNowTime = time.Now() if s.CheckNeedDestroy() && p.freeTimes == 0 { diff --git a/gamesrv/slotspkg/internal/generic/errors/init.go b/gamesrv/slotspkg/internal/generic/errors/init.go index b34b914..b67b7ea 100644 --- a/gamesrv/slotspkg/internal/generic/errors/init.go +++ b/gamesrv/slotspkg/internal/generic/errors/init.go @@ -1,6 +1,6 @@ package errors -import "github.com/idealeak/goserver/core/logger" +import "mongo.games.com/goserver/core/logger" var ( begins = []Code{ErrorBegin} diff --git a/gamesrv/slotspkg/slots/handler.go b/gamesrv/slotspkg/slots/handler.go index 1615253..f4b8dd4 100644 --- a/gamesrv/slotspkg/slots/handler.go +++ b/gamesrv/slotspkg/slots/handler.go @@ -1,7 +1,6 @@ package slots import ( - "github.com/idealeak/goserver/core/logger" "mongo.games.com/game/gamesrv/base" "mongo.games.com/game/gamesrv/slotspkg/internal/generic/errors" "mongo.games.com/game/gamesrv/slotspkg/internal/generic/global" @@ -10,6 +9,7 @@ import ( "mongo.games.com/game/gamesrv/slotspkg/internal/module/shared" "mongo.games.com/game/gamesrv/slotspkg/slots/machine" "mongo.games.com/game/gamesrv/slotspkg/slots/types/cli" + "mongo.games.com/goserver/core/logger" ) func (sm *SlotsMgr) Enter(s *base.SlotsSession, gameId int64) (*cli.SlotsEnterResponse, error) { diff --git a/gamesrv/smallrocket/scene.go b/gamesrv/smallrocket/scene.go index d7fec18..d329343 100644 --- a/gamesrv/smallrocket/scene.go +++ b/gamesrv/smallrocket/scene.go @@ -33,6 +33,7 @@ type PlayerData struct { Platform string //平台 Channel string //渠道信息 + ChannelId string PackageID string //推广包标识 对应客户端的packagetag flag int } @@ -333,6 +334,7 @@ func (this *SceneEx) BackupPlayer(p *PlayerEx, isBilled bool) { flag: p.GetFlag(), Platform: p.Platform, Channel: p.Channel, + ChannelId: p.ChannelId, PackageID: p.PackageID, CurIsWin: p.CurIsWin, Name: p.Name, diff --git a/gamesrv/smallrocket/scenepolicy.go b/gamesrv/smallrocket/scenepolicy.go index d690fda..cfe3367 100644 --- a/gamesrv/smallrocket/scenepolicy.go +++ b/gamesrv/smallrocket/scenepolicy.go @@ -1166,33 +1166,28 @@ func (this *StateBilled) OnEnter(s *base.Scene) { if !playerEx.IsRob { info, err := model.MarshalGameNoteByHUNDRED(LogBaseResult) if err == nil { - sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: sceneEx.logid, + Detail: info, + }) } totalin := int64(TotalBetValue) totalout := playerEx.gainCoin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: sceneEx.logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(TotalBetValue), WinAmountNoAnyTax: playerEx.gainCoin, - ValidBet: validBet, - ValidFlow: validFlow, - IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), - IsFree: false, - WinSmallGame: 0, - WinTotal: 0, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + IsFirstGame: s.IsPlayerFirst(playerEx.Player), + }) } } @@ -1248,34 +1243,30 @@ func (this *StateBilled) OnEnter(s *base.Scene) { if !playerEx.IsRob { info, err := model.MarshalGameNoteByHUNDRED(LogBaseResult) if err == nil { - sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: sceneEx.logid, + Detail: info, + }) } totalin := int64(TotalBetValue) totalout := playerEx.gainCoin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + //validFlow := totalin + totalout + //validBet := common.AbsI64(totalin - totalout) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: sceneEx.logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(TotalBetValue), WinAmountNoAnyTax: playerEx.gainCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: playerEx.IsPlayerFirst, - IsFree: false, - WinSmallGame: 0, - WinTotal: 0, - PlayerName: playerEx.Name, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + }) } } } diff --git a/gamesrv/tamquoc/scenepolicy_tamquoc.go b/gamesrv/tamquoc/scenepolicy_tamquoc.go index a3495d7..e1f908d 100644 --- a/gamesrv/tamquoc/scenepolicy_tamquoc.go +++ b/gamesrv/tamquoc/scenepolicy_tamquoc.go @@ -778,31 +778,31 @@ func TamQuocCheckAndSaveLog(sceneEx *TamQuocSceneData, playerEx *TamQuocPlayerDa if err == nil { logid, _ := model.AutoIncGameLogId() playerEx.currentLogId = logid - sceneEx.SaveGameDetailedLog(logid, info, &base.GameDetailedParam{}) + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: logid, + Detail: info, + GameTime: 2, + }) totalin := int64(playerEx.RollGameType.BaseResult.TotalBet) totalout := playerEx.RollGameType.BaseResult.ChangeCoin + playerEx.taxCoin + totalin - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - logParam := &base.SaveGamePlayerListLogParam{ - Platform: playerEx.Platform, - Channel: playerEx.Channel, - Promoter: playerEx.BeUnderAgentCode, - PackageTag: playerEx.PackageID, - InviterId: playerEx.InviterId, + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ LogId: logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, TotalIn: totalin, TotalOut: totalout, TaxCoin: playerEx.taxCoin, BetAmount: int64(playerEx.RollGameType.BaseResult.TotalBet), WinAmountNoAnyTax: playerEx.RollGameType.BaseResult.ChangeCoin, - ValidBet: validBet, - ValidFlow: validFlow, IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player), IsFree: playerEx.RollGameType.BaseResult.IsFree, WinSmallGame: playerEx.RollGameType.BaseResult.WinSmallGame, WinTotal: playerEx.RollGameType.BaseResult.WinTotal, - } - sceneEx.SaveGamePlayerListLog(playerEx.SnId, logParam) + GameTime: 2, + }) } } } diff --git a/gamesrv/thirteen/player.go b/gamesrv/thirteen/player.go index f3d5a70..d59c380 100644 --- a/gamesrv/thirteen/player.go +++ b/gamesrv/thirteen/player.go @@ -12,6 +12,7 @@ type PlayerEx struct { cards [13]int //手牌信息 allGroup map[int]*thirteen.Group //玩家所有牌型 cardsO *thirteen.Group //确定的牌型信息 + preCardsO *thirteen.Group //预确定的牌型 isDP bool // 是否倒排 gainCoin int64 //本局赢的金币 taxCoin int64 //本局税收 @@ -36,6 +37,7 @@ func (this *PlayerEx) Clear() { } this.allGroup = make(map[int]*thirteen.Group) this.cardsO = &thirteen.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1} + this.preCardsO = &thirteen.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1} this.isDP = false this.gainCoin = 0 this.taxCoin = 0 diff --git a/gamesrv/thirteen/scene.go b/gamesrv/thirteen/scene.go index 77b3318..2659e20 100644 --- a/gamesrv/thirteen/scene.go +++ b/gamesrv/thirteen/scene.go @@ -487,6 +487,7 @@ func (this *SceneEx) GetScore(player *PlayerEx) { player.winAllPlayers[p.Pos] += rate p.winAllPlayers[player.Pos] -= rate player.tableScore[3] += rate - 1 + p.tableScore[3] -= rate - 1 } //中墩 rate = int64(1) @@ -509,6 +510,7 @@ func (this *SceneEx) GetScore(player *PlayerEx) { player.winAllPlayers[p.Pos] += rate p.winAllPlayers[player.Pos] -= rate player.tableScore[4] += rate - 1 + p.tableScore[4] -= rate - 1 } //尾墩 rate = int64(1) @@ -529,6 +531,7 @@ func (this *SceneEx) GetScore(player *PlayerEx) { player.winAllPlayers[p.Pos] += rate p.winAllPlayers[player.Pos] -= rate player.tableScore[5] += rate - 1 + p.tableScore[5] -= rate - 1 } if s == 3 { player.winThreePos[p.Pos] = score @@ -1097,10 +1100,10 @@ func (this *SceneEx) CountScore() { playerEx.winAllPlayers[k] += v // 全垒打分数 if playerEx.Pos == this.isCanAllHitPos { - this.seats[k].score[5] -= v - this.seats[k].winAllPlayers[playerEx.Pos] -= v - playerEx.score[5] += v - playerEx.winAllPlayers[k] += v + this.seats[k].score[5] -= v * 2 + this.seats[k].winAllPlayers[playerEx.Pos] -= v * 2 + playerEx.score[5] += v * 2 + playerEx.winAllPlayers[k] += v * 2 } } } diff --git a/gamesrv/thirteen/scenepolicy.go b/gamesrv/thirteen/scenepolicy.go index 775faa0..2bb9a47 100644 --- a/gamesrv/thirteen/scenepolicy.go +++ b/gamesrv/thirteen/scenepolicy.go @@ -181,11 +181,22 @@ func (this *PolicyThirteen) OnPlayerLeave(s *base.Scene, p *base.Player, reason } else { totalin -= playerEx.gainCoin } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - sceneEx.SaveGamePlayerListLog(playerEx.SnId, base.GetSaveGamePlayerListLogParam(playerEx.Platform, playerEx.Channel, playerEx.BeUnderAgentCode, - playerEx.PackageID, sceneEx.logid, playerEx.InviterId, totalin, totalout, playerEx.taxCoin, - 0, 0, playerEx.gainCoin, validBet, validFlow, sceneEx.IsPlayerFirst(sceneEx.GetPlayer(playerEx.SnId)), false)) + //validFlow := totalin + totalout + //validBet := common.AbsI64(totalin - totalout) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: sceneEx.logid, + Platform: playerEx.Platform, + Snid: playerEx.SnId, + PlayerName: playerEx.Name, + Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: playerEx.taxCoin, + BetAmount: 0, + WinAmountNoAnyTax: playerEx.gainCoin, + IsFirstGame: sceneEx.IsPlayerFirst(sceneEx.GetPlayer(playerEx.SnId)), + }) sceneEx.Statistics(&base.StaticParam{ SnId: playerEx.SnId, @@ -855,10 +866,15 @@ func (this *StateOp) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, param copy(playerEx.cardsO.Mid[:], common.Int64Toint(params[3:8])) copy(playerEx.cardsO.End[:], common.Int64Toint(params[8:])) playerEx.cardsO.PokerType = 0 + tp := sceneEx.logic.GetSpecialType(playerEx.cards) + if tp > 0 { + playerEx.cardsO.PokerType = tp + } sceneEx.SendSelectCards(playerEx, 0, int64(opcode)) } else { sceneEx.SendSelectCards(playerEx, int(params[0]), int64(opcode)) } + playerEx.preCardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1} playerEx.Trusteeship = 0 playerEx.UnmarkFlag(base.PlayerState_Auto) playerEx.deterMine = true @@ -875,6 +891,38 @@ func (this *StateOp) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, param //提前进入亮牌阶段 s.ChangeSceneState(rule.ThirteenWaterSceneStateShowCards) } + + case rule.ThirteenWaterPlayerOpSelect: + playerEx.deterMine = false + playerEx.cardsO = &rule.Group{Head: [3]int{-1, -1, -1}, Mid: [5]int{-1, -1, -1, -1, -1}, End: [5]int{-1, -1, -1, -1, -1}, PokerType: -1} + playerEx.Trusteeship = 0 + playerEx.UnmarkFlag(base.PlayerState_Auto) + pack := &thirteen.SCThirteenPlayerOp{ + OpRetCode: thirteen.OpResultCode_OPRC_Sucess, + OpCode: int32(opcode), + OpParam: params, + Pos: int32(playerEx.GetPos()), + } + if len(params) == 13 { + //校验牌 + a := rule.DelCards(playerEx.cards[:], common.Int64Toint(params)) + if len(a) != 0 { + logger.Logger.Error("the cards is error.") + returnFunc(thirteen.OpResultCode_OPRC_Error) + return true + } + //牌赋值 + copy(playerEx.preCardsO.Head[:], common.Int64Toint(params[:3])) + copy(playerEx.preCardsO.Mid[:], common.Int64Toint(params[3:8])) + copy(playerEx.preCardsO.End[:], common.Int64Toint(params[8:])) + playerEx.preCardsO.PokerType = 0 + tp := sceneEx.logic.GetSpecialType(playerEx.cards) + if tp > 0 { + playerEx.preCardsO.PokerType = tp + } + } + playerEx.SendToClient(int(thirteen.TWMmoPacketID_PACKET_SCThirteenPlayerOp), pack) + case rule.ThirteenWaterPlayerOpReset: // 取消确认 playerEx.deterMine = false @@ -902,8 +950,13 @@ func (this *StateOp) OnLeave(s *base.Scene) { for _, player := range sceneEx.players { if player != nil && player.IsGameing() { + // 使用预选牌 + if player.preCardsO != nil && player.preCardsO.PokerType != -1 && (player.cardsO == nil || player.cardsO.PokerType == -1) { + player.cardsO = player.preCardsO + } + // 判断是否倒水 if player.cardsO != nil && player.cardsO.PokerType != -1 { - if player.cardsO.PokerType < 1000000 { + if player.cardsO.PokerType == 0 { player.isDP = sceneEx.logic.IsDP(player.cardsO.Head, player.cardsO.Mid, player.cardsO.End) } continue @@ -1223,11 +1276,8 @@ func (this *StateHit) OnEnter(s *base.Scene) { } } } - if sceneEx.isCanAllHitPos != -1 { - hitNum++ - } - // 每个打枪加1秒,全垒打再加1秒 - sceneEx.hitTime += time.Second * (time.Duration(hitNum)) + // 每个打枪加2秒,全垒打再加2秒 + sceneEx.hitTime += time.Second * 2 * (time.Duration(hitNum)) sceneEx.ShowCards() } } @@ -1323,7 +1373,7 @@ func (this *StateBilled) OnEnter(s *base.Scene) { RoomType: sceneEx.GetSceneType(), BaseScore: int32(sceneEx.GetBaseScore()), NowRound: int32(sceneEx.NumOfGames), - ClubRate: sceneEx.Scene.PumpCoin, + TaxRate: s.GetDBGameFree().GetTaxRate(), } var person []model.ThirteenWaterPerson for _, o_player := range sceneEx.players { @@ -1390,11 +1440,20 @@ func (this *StateBilled) OnEnter(s *base.Scene) { } else { totalin -= o_player.gainCoin } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) - sceneEx.SaveGamePlayerListLog(o_player.SnId, base.GetSaveGamePlayerListLogParam(o_player.Platform, o_player.Channel, o_player.BeUnderAgentCode, - o_player.PackageID, sceneEx.logid, o_player.InviterId, totalin, totalout, o_player.taxCoin, - 0, 0, o_player.gainCoin, validBet, validFlow, p.IsFirst, false)) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: sceneEx.logid, + Platform: o_player.Platform, + Snid: o_player.SnId, + PlayerName: o_player.Name, + Channel: o_player.Channel, + ChannelId: o_player.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: o_player.taxCoin, + BetAmount: 0, + WinAmountNoAnyTax: o_player.gainCoin, + IsFirstGame: p.IsFirst, + }) } } } @@ -1453,10 +1512,11 @@ func (this *StateBilled) OnEnter(s *base.Scene) { thirteenWaterType.PlayerCount = len(person) info, err := model.MarshalGameNoteByFIGHT(&thirteenWaterType) if err == nil { - sceneEx.SaveGameDetailedLog(sceneEx.logid, info, &base.GameDetailedParam{ - Trend20Lately: "", - CtrlType: sceneEx.ctrlType, - PlayerPool: playerPool, + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: sceneEx.logid, + Detail: info, + CtrlType: sceneEx.ctrlType, + PlayerPool: playerPool, }) } } diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 5a249ae..2f29da4 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -1737,6 +1737,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: playerEx.Head, Platform: playerEx.Platform, Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, Promoter: playerEx.BeUnderAgentCode, PackageTag: playerEx.PackageID, InviterId: playerEx.InviterId, @@ -1888,6 +1889,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: losePlayer.Head, Platform: losePlayer.Platform, Channel: losePlayer.Channel, + ChannelId: losePlayer.ChannelId, Promoter: losePlayer.BeUnderAgentCode, PackageTag: losePlayer.PackageID, InviterId: losePlayer.InviterId, @@ -2030,6 +2032,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: lastWinPlayer.Head, Platform: lastWinPlayer.Platform, Channel: lastWinPlayer.Channel, + ChannelId: lastWinPlayer.ChannelId, Promoter: lastWinPlayer.BeUnderAgentCode, PackageTag: lastWinPlayer.PackageID, InviterId: lastWinPlayer.InviterId, @@ -2141,6 +2144,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: playerEx.Head, Platform: playerEx.Platform, Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, Promoter: playerEx.BeUnderAgentCode, PackageTag: playerEx.PackageID, InviterId: playerEx.InviterId, @@ -2246,6 +2250,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: playerEx.Head, Platform: playerEx.Platform, Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, Promoter: playerEx.BeUnderAgentCode, PackageTag: playerEx.PackageID, InviterId: playerEx.InviterId, @@ -2397,6 +2402,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: playerEx.Head, Platform: playerEx.Platform, Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, Promoter: playerEx.BeUnderAgentCode, PackageTag: playerEx.PackageID, InviterId: playerEx.InviterId, @@ -2527,6 +2533,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { UserIcon: playerEx.Head, Platform: playerEx.Platform, Channel: playerEx.Channel, + ChannelId: playerEx.ChannelId, Promoter: playerEx.BeUnderAgentCode, PackageTag: playerEx.PackageID, InviterId: playerEx.InviterId, @@ -2729,8 +2736,6 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { playerEx.UpdatePigBankCoin(o_player.GainCoin) } - validFlow := totalin + totalout - validBet := common.AbsI64(totalin - totalout) sceneEx.SaveFriendRecord(o_player.UserId, o_player.IsWin, o_player.BillCoin, sceneEx.GetBaseScore()) // 玩家数据统计 @@ -2752,20 +2757,29 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { }) // 保存玩家游戏记录 - param := base.GetSaveGamePlayerListLogParam(o_player.Platform, o_player.Channel, o_player.Promoter, - o_player.PackageTag, sceneEx.recordId, o_player.InviterId, totalin, totalout, o_player.BillTaxCoin, - 0, 0, o_player.GainCoin+o_player.BombCoin, validBet, validFlow, o_player.IsFirst, o_player.IsLeave) - param.CycleId = sceneEx.CycleID - sceneEx.SaveGamePlayerListLog(o_player.UserId, param) + sceneEx.SaveGamePlayerListLog(&base.SaveGamePlayerListLogParam{ + LogId: sceneEx.recordId, + Platform: o_player.Platform, + Snid: o_player.UserId, + Channel: o_player.Channel, + ChannelId: o_player.ChannelId, + TotalIn: totalin, + TotalOut: totalout, + TaxCoin: o_player.BillTaxCoin, + BetAmount: 0, + WinAmountNoAnyTax: o_player.GainCoin + o_player.BombCoin, + IsFirstGame: o_player.IsFirst, + }) } } if isSave { // 牌局记录 - sceneEx.SaveGameDetailedLog(sceneEx.recordId, info, &base.GameDetailedParam{ + sceneEx.SaveGameDetailedLog(&base.SaveGameDetailedParam{ + LogId: sceneEx.recordId, + Detail: info, Trend20Lately: "", CtrlType: sceneEx.ctrlType, PlayerPool: tienlenType.PlayerPool, - CycleId: sceneEx.CycleID, }) } } diff --git a/go.mod b/go.mod index 1ae0dd7..24ed7df 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,6 @@ require ( github.com/golang-jwt/jwt/v4 v4.5.1 github.com/google/go-querystring v1.1.0 github.com/howeyc/fsnotify v0.9.0 - github.com/idealeak/goserver v0.0.0-20201014040547-b8f686262078 github.com/jinzhu/now v1.1.5 github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 github.com/mojocn/base64Captcha v1.3.6 @@ -26,13 +25,13 @@ require ( github.com/tomas-qstarrs/boost v1.0.3 github.com/tomas-qstarrs/excel-converter v1.0.2 github.com/wendal/errors v0.0.0-20181209125328-7f31f4b264ec + github.com/xuri/excelize/v2 v2.9.0 github.com/zegoim/zego_server_assistant/token/go/src v0.0.0-20231013093807-4e80bab42ec3 github.com/zeromicro/go-zero v1.7.3 go.etcd.io/etcd/client/v3 v3.5.16 go.mongodb.org/mongo-driver v1.17.1 golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c google.golang.org/protobuf v1.35.1 - gorm.io/driver/mysql v1.5.7 gorm.io/gorm v1.25.12 mongo.games.com/goserver v0.0.0-00010101000000-000000000000 ) @@ -70,7 +69,7 @@ require ( github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/richardlehane/mscfb v1.0.4 // indirect - github.com/richardlehane/msoleps v1.0.3 // indirect + github.com/richardlehane/msoleps v1.0.4 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect @@ -92,7 +91,8 @@ require ( github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/xtaci/kcp-go v5.4.20+incompatible // indirect - github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 // indirect + github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d // indirect + github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect go.etcd.io/etcd/api/v3 v3.5.16 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.16 // indirect @@ -103,7 +103,7 @@ require ( go.uber.org/multierr v1.9.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/crypto v0.28.0 // indirect - golang.org/x/image v0.13.0 // indirect + golang.org/x/image v0.18.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.26.0 // indirect @@ -115,4 +115,5 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + gorm.io/driver/mysql v1.5.7 // indirect ) diff --git a/go.sum b/go.sum index 79422ec..ea89a77 100644 --- a/go.sum +++ b/go.sum @@ -157,8 +157,6 @@ github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T github.com/howeyc/fsnotify v0.9.0 h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY= github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/idealeak/goserver v0.0.0-20201014040547-b8f686262078 h1:0Z5Im7EJiMKEiIQPPApdK0uOtyV5Ylo9wA3N9jWrfsU= -github.com/idealeak/goserver v0.0.0-20201014040547-b8f686262078/go.mod h1:ozCWDPw33jhq/GX7nsWS0cFCm5Jyag/Fy0LSQpKXT1I= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/innopals/sls-logrus-hook v0.0.0-20190808032145-2fe1d6f7ce00 h1:QfdUfoZWIzBZ/FMtdUE/3wUwzsMU+PGTld17NDBld3k= github.com/innopals/sls-logrus-hook v0.0.0-20190808032145-2fe1d6f7ce00/go.mod h1:Q24O6QMGImDU3WY71P4YAxNb36NNn5qaznCfMUoXVfc= @@ -279,8 +277,8 @@ github.com/richardlehane/mscfb v1.0.3/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7 github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= -github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM= -github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/richardlehane/msoleps v1.0.4 h1:WuESlvhX3gH2IHcd8UqyCuFY5yiq/GR/yqaSM/9/g00= +github.com/richardlehane/msoleps v1.0.4/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -386,8 +384,12 @@ github.com/xtaci/kcp-go v5.4.20+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45 github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 h1:EWU6Pktpas0n8lLQwDsRyZfmkPeRbdgPtW609es+/9E= github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37/go.mod h1:HpMP7DB2CyokmAh4lp0EQnnWhmycP/TvwBGzvuie+H0= github.com/xuri/efp v0.0.0-20200605144744-ba689101faaf/go.mod h1:uBiSUepVYMhGTfDeBKKasV4GpgBlzJ46gXUBAqV8qLk= -github.com/xuri/efp v0.0.0-20220603152613-6918739fd470 h1:6932x8ltq1w4utjmfMPVj09jdMlkY0aiA6+Skbtl3/c= -github.com/xuri/efp v0.0.0-20220603152613-6918739fd470/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d h1:llb0neMWDQe87IzJLS4Ci7psK/lVsjIS2otl+1WyRyY= +github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.9.0 h1:1tgOaEq92IOEumR1/JfYS/eR0KHOCsRv/rYXXh6YJQE= +github.com/xuri/excelize/v2 v2.9.0/go.mod h1:uqey4QBZ9gdMeWApPLdhm9x+9o2lq4iVmjiLfBS5hdE= +github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A= +github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 h1:ilQV1hzziu+LLM3zUTJ0trRztfwgjqKnBWNtSRkbmwM= github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78/go.mod h1:aL8wCCfTfSfmXjznFBSZNN13rSJjlIOI1fUNAtF7rmI= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -441,8 +443,9 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= golang.org/x/image v0.0.0-20200922025426-e59bae62ef32/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg= golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= +golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= +golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= diff --git a/model/dataevent.go b/model/dataevent.go index 3cb9070..b3d138f 100644 --- a/model/dataevent.go +++ b/model/dataevent.go @@ -275,49 +275,6 @@ type PlayerGameRecEvent struct { ChannelId string //推广渠道id } -func CreatePlayerGameRecEvent(snid int32, tax, taxex, amount, validbet, validflow, in, out int64, gameid, gameFreeId, modeid int32, recordId, channel, channelId, promoter, - platform, city, os string, createDayTime time.Time, gamingTime int32, firstGameFreeTime, firstGameTime time.Time, - playGameFreeTimes, playerGameTimes int64, lastLoginTime time.Time, teleponePromoter int32, deviceId string) *PlayerGameRecEvent { - isNewbie := int32(0) - tCreateDay := now.New(createDayTime).BeginningOfDay() - if now.BeginningOfDay().Equal(tCreateDay) { - isNewbie = 1 - } - if gamingTime < 0 { - gamingTime = 0 - } - return &PlayerGameRecEvent{RecordId: recordId, - SnId: snid, - Channel: channel, - Promoter: promoter, - TelephonePromoter: teleponePromoter, - Platform: platform, - City: city, - OS: os, - GameId: gameid, - ModeId: modeid, - Tax: tax, - //Taxex: taxex, - Amount: amount, - ValidBet: validbet, - ValidFlow: validflow, - In: in, - Out: out, - CreateTime: time.Now().Local().Unix(), - CreateDayTime: tCreateDay.Local().Unix(), - IsNew: isNewbie, - GameFreeID: gameFreeId, - GamingTime: gamingTime, - FirstTime: firstGameFreeTime.Unix(), - FirstGameTime: firstGameTime.Unix(), - PlayTimes: playGameFreeTimes, - PlayGameTimes: playerGameTimes, - LastLoginTime: lastLoginTime.Unix(), - DeviceId: deviceId, - ChannelId: channelId, - } -} - // 玩家游戏记录 //type PlayerGameRecPayEvent struct { // SnId int32 //用户ID diff --git a/model/gamelogtype.go b/model/gamelogtype.go index 0d9b998..d9f4185 100644 --- a/model/gamelogtype.go +++ b/model/gamelogtype.go @@ -168,8 +168,8 @@ type ThirteenWaterType struct { NowRound int32 //当前局数 PlayerCount int //玩家数量 BaseScore int32 //底分 + TaxRate int32 //税率(万分比) PlayerData []ThirteenWaterPerson //玩家信息 - ClubRate int32 //俱乐部抽水比例 } type ThirteenWaterPoker struct { @@ -1536,6 +1536,7 @@ type TienLenPerson struct { UserIcon int32 //玩家头像 Platform string `json:"-"` Channel string `json:"-"` + ChannelId string `json:"-"` Promoter string `json:"-"` PackageTag string `json:"-"` InviterId int32 `json:"-"` @@ -1581,6 +1582,7 @@ type ChesstitiansPerson struct { UserIcon int32 //玩家头像 Platform string `json:"-"` Channel string `json:"-"` + ChannelId string `json:"-"` Promoter string `json:"-"` PackageTag string `json:"-"` InviterId int32 `json:"-"` diff --git a/model/gameplayerlistlog.go b/model/gameplayerlistlog.go index 4441b2d..9d06b23 100644 --- a/model/gameplayerlistlog.go +++ b/model/gameplayerlistlog.go @@ -51,7 +51,7 @@ type GamePlayerListLog struct { GameClass int32 //游戏类型 1棋牌 2电子 3百人 4捕鱼 5视讯 6彩票 7体育 MatchId int64 MatchType int64 //0.普通场 1.锦标赛 2.冠军赛 3.vip专属 - Ts int32 + Ts int64 IsFree bool //拉霸专用 是否免费 WinSmallGame int64 //拉霸专用 小游戏奖励 WinTotal int64 //拉霸专用 输赢 @@ -95,7 +95,7 @@ func NewGamePlayerListLogEx(snid int32, gamedetailedlogid string, platform, chan cl.WinSmallGame = winSmallGame cl.WinTotal = winTotal tNow := time.Now() - cl.Ts = int32(tNow.Unix()) + cl.Ts = tNow.Unix() cl.Time = tNow cl.MatchId = matchid cl.MatchType = matchType diff --git a/protocol/cashmania/cashmania.pb.go b/protocol/cashmania/cashmania.pb.go new file mode 100644 index 0000000..623796b --- /dev/null +++ b/protocol/cashmania/cashmania.pb.go @@ -0,0 +1,799 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1-devel +// protoc v3.19.4 +// source: protocol/cashmania/cashmania.proto + +package cashmania + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +//cashmania +//龙 +type CashManiaPID int32 + +const ( + CashManiaPID_PACKET_CASHMANIA_ZERO CashManiaPID = 0 // 弃用消息号 + CashManiaPID_PACKET_CASHMANIA_SCCASHMANIAROOMINFO CashManiaPID = 5650 //房间信息 + CashManiaPID_PACKET_CASHMANIA_CSCASHMANIAOP CashManiaPID = 5651 + CashManiaPID_PACKET_CASHMANIA_SCCASHMANIAOP CashManiaPID = 5652 + CashManiaPID_PACKET_CASHMANIA_SCCASHMANIAROOMSTATE CashManiaPID = 5653 + CashManiaPID_PACKET_CASHMANIA_SCCASHMANIABILLED CashManiaPID = 5654 +) + +// Enum value maps for CashManiaPID. +var ( + CashManiaPID_name = map[int32]string{ + 0: "PACKET_CASHMANIA_ZERO", + 5650: "PACKET_CASHMANIA_SCCASHMANIAROOMINFO", + 5651: "PACKET_CASHMANIA_CSCASHMANIAOP", + 5652: "PACKET_CASHMANIA_SCCASHMANIAOP", + 5653: "PACKET_CASHMANIA_SCCASHMANIAROOMSTATE", + 5654: "PACKET_CASHMANIA_SCCASHMANIABILLED", + } + CashManiaPID_value = map[string]int32{ + "PACKET_CASHMANIA_ZERO": 0, + "PACKET_CASHMANIA_SCCASHMANIAROOMINFO": 5650, + "PACKET_CASHMANIA_CSCASHMANIAOP": 5651, + "PACKET_CASHMANIA_SCCASHMANIAOP": 5652, + "PACKET_CASHMANIA_SCCASHMANIAROOMSTATE": 5653, + "PACKET_CASHMANIA_SCCASHMANIABILLED": 5654, + } +) + +func (x CashManiaPID) Enum() *CashManiaPID { + p := new(CashManiaPID) + *p = x + return p +} + +func (x CashManiaPID) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CashManiaPID) Descriptor() protoreflect.EnumDescriptor { + return file_protocol_cashmania_cashmania_proto_enumTypes[0].Descriptor() +} + +func (CashManiaPID) Type() protoreflect.EnumType { + return &file_protocol_cashmania_cashmania_proto_enumTypes[0] +} + +func (x CashManiaPID) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CashManiaPID.Descriptor instead. +func (CashManiaPID) EnumDescriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{0} +} + +type CashManiaPlayerData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` //名字 + SnId int32 `protobuf:"varint,2,opt,name=SnId,proto3" json:"SnId,omitempty"` //账号 + Head int32 `protobuf:"varint,3,opt,name=Head,proto3" json:"Head,omitempty"` //头像 + Sex int32 `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` //性别 + Coin int64 `protobuf:"varint,5,opt,name=Coin,proto3" json:"Coin,omitempty"` //金币 + Pos int32 `protobuf:"varint,6,opt,name=Pos,proto3" json:"Pos,omitempty"` //座位位置 + Flag int32 `protobuf:"varint,7,opt,name=Flag,proto3" json:"Flag,omitempty"` //二进制标记 + Params []string `protobuf:"bytes,8,rep,name=Params,proto3" json:"Params,omitempty"` //其他数据 如:ip 等 + City string `protobuf:"bytes,9,opt,name=City,proto3" json:"City,omitempty"` //城市 + HeadOutLine int32 `protobuf:"varint,10,opt,name=HeadOutLine,proto3" json:"HeadOutLine,omitempty"` //头像框 + VIP int32 `protobuf:"varint,11,opt,name=VIP,proto3" json:"VIP,omitempty"` +} + +func (x *CashManiaPlayerData) Reset() { + *x = CashManiaPlayerData{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CashManiaPlayerData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CashManiaPlayerData) ProtoMessage() {} + +func (x *CashManiaPlayerData) ProtoReflect() protoreflect.Message { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CashManiaPlayerData.ProtoReflect.Descriptor instead. +func (*CashManiaPlayerData) Descriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{0} +} + +func (x *CashManiaPlayerData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CashManiaPlayerData) GetSnId() int32 { + if x != nil { + return x.SnId + } + return 0 +} + +func (x *CashManiaPlayerData) GetHead() int32 { + if x != nil { + return x.Head + } + return 0 +} + +func (x *CashManiaPlayerData) GetSex() int32 { + if x != nil { + return x.Sex + } + return 0 +} + +func (x *CashManiaPlayerData) GetCoin() int64 { + if x != nil { + return x.Coin + } + return 0 +} + +func (x *CashManiaPlayerData) GetPos() int32 { + if x != nil { + return x.Pos + } + return 0 +} + +func (x *CashManiaPlayerData) GetFlag() int32 { + if x != nil { + return x.Flag + } + return 0 +} + +func (x *CashManiaPlayerData) GetParams() []string { + if x != nil { + return x.Params + } + return nil +} + +func (x *CashManiaPlayerData) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *CashManiaPlayerData) GetHeadOutLine() int32 { + if x != nil { + return x.HeadOutLine + } + return 0 +} + +func (x *CashManiaPlayerData) GetVIP() int32 { + if x != nil { + return x.VIP + } + return 0 +} + +//房间信息 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO +type SCCashManiaRoomInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoomId int32 `protobuf:"varint,1,opt,name=RoomId,proto3" json:"RoomId,omitempty"` //房间id + GameFreeId int32 `protobuf:"varint,2,opt,name=GameFreeId,proto3" json:"GameFreeId,omitempty"` + GameId int32 `protobuf:"varint,3,opt,name=GameId,proto3" json:"GameId,omitempty"` //游戏id + RoomMode int32 `protobuf:"varint,4,opt,name=RoomMode,proto3" json:"RoomMode,omitempty"` //游戏模式 + Params []int32 `protobuf:"varint,5,rep,packed,name=Params,proto3" json:"Params,omitempty"` //规则参数 + NumOfGames int32 `protobuf:"varint,6,opt,name=NumOfGames,proto3" json:"NumOfGames,omitempty"` //当前第几局 + State int32 `protobuf:"varint,7,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态 + ParamsEx []int64 `protobuf:"varint,8,rep,packed,name=ParamsEx,proto3" json:"ParamsEx,omitempty"` //其他参数 + SceneType int32 `protobuf:"varint,9,opt,name=SceneType,proto3" json:"SceneType,omitempty"` //房间模式 + Player *CashManiaPlayerData `protobuf:"bytes,10,opt,name=Player,proto3" json:"Player,omitempty"` //房间内的玩家信息 + PlayerInfo string `protobuf:"bytes,11,opt,name=PlayerInfo,proto3" json:"PlayerInfo,omitempty"` +} + +func (x *SCCashManiaRoomInfo) Reset() { + *x = SCCashManiaRoomInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCCashManiaRoomInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCCashManiaRoomInfo) ProtoMessage() {} + +func (x *SCCashManiaRoomInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCCashManiaRoomInfo.ProtoReflect.Descriptor instead. +func (*SCCashManiaRoomInfo) Descriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{1} +} + +func (x *SCCashManiaRoomInfo) GetRoomId() int32 { + if x != nil { + return x.RoomId + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetGameFreeId() int32 { + if x != nil { + return x.GameFreeId + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetGameId() int32 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetRoomMode() int32 { + if x != nil { + return x.RoomMode + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetParams() []int32 { + if x != nil { + return x.Params + } + return nil +} + +func (x *SCCashManiaRoomInfo) GetNumOfGames() int32 { + if x != nil { + return x.NumOfGames + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetState() int32 { + if x != nil { + return x.State + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetParamsEx() []int64 { + if x != nil { + return x.ParamsEx + } + return nil +} + +func (x *SCCashManiaRoomInfo) GetSceneType() int32 { + if x != nil { + return x.SceneType + } + return 0 +} + +func (x *SCCashManiaRoomInfo) GetPlayer() *CashManiaPlayerData { + if x != nil { + return x.Player + } + return nil +} + +func (x *SCCashManiaRoomInfo) GetPlayerInfo() string { + if x != nil { + return x.PlayerInfo + } + return "" +} + +//玩家操作 +//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP +type CSCashManiaOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码 0.spin + Params []int64 `protobuf:"varint,2,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数 下注索引编号 +} + +func (x *CSCashManiaOp) Reset() { + *x = CSCashManiaOp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSCashManiaOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSCashManiaOp) ProtoMessage() {} + +func (x *CSCashManiaOp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CSCashManiaOp.ProtoReflect.Descriptor instead. +func (*CSCashManiaOp) Descriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{2} +} + +func (x *CSCashManiaOp) GetOpCode() int32 { + if x != nil { + return x.OpCode + } + return 0 +} + +func (x *CSCashManiaOp) GetParams() []int64 { + if x != nil { + return x.Params + } + return nil +} + +//玩家操作返回 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP +type SCCashManiaOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码 + OpRetCode int32 `protobuf:"varint,2,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //操作结果 1.金币不足 2.低于该值不能押注 + Params []int64 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数 +} + +func (x *SCCashManiaOp) Reset() { + *x = SCCashManiaOp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCCashManiaOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCCashManiaOp) ProtoMessage() {} + +func (x *SCCashManiaOp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCCashManiaOp.ProtoReflect.Descriptor instead. +func (*SCCashManiaOp) Descriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{3} +} + +func (x *SCCashManiaOp) GetOpCode() int32 { + if x != nil { + return x.OpCode + } + return 0 +} + +func (x *SCCashManiaOp) GetOpRetCode() int32 { + if x != nil { + return x.OpRetCode + } + return 0 +} + +func (x *SCCashManiaOp) GetParams() []int64 { + if x != nil { + return x.Params + } + return nil +} + +//房间状态 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE +type SCCashManiaRoomState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State int32 `protobuf:"varint,1,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态 + SubState int32 `protobuf:"varint,2,opt,name=SubState,proto3" json:"SubState,omitempty"` //房间当前子状态 + Params []int32 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //状态参数 +} + +func (x *SCCashManiaRoomState) Reset() { + *x = SCCashManiaRoomState{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCCashManiaRoomState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCCashManiaRoomState) ProtoMessage() {} + +func (x *SCCashManiaRoomState) ProtoReflect() protoreflect.Message { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCCashManiaRoomState.ProtoReflect.Descriptor instead. +func (*SCCashManiaRoomState) Descriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{4} +} + +func (x *SCCashManiaRoomState) GetState() int32 { + if x != nil { + return x.State + } + return 0 +} + +func (x *SCCashManiaRoomState) GetSubState() int32 { + if x != nil { + return x.SubState + } + return 0 +} + +func (x *SCCashManiaRoomState) GetParams() []int32 { + if x != nil { + return x.Params + } + return nil +} + +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED +type SCCashManiaBilled struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpRetCode int32 `protobuf:"varint,1,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //0.spin成功 1.spin失败 + GameEndStr string `protobuf:"bytes,2,opt,name=GameEndStr,proto3" json:"GameEndStr,omitempty"` +} + +func (x *SCCashManiaBilled) Reset() { + *x = SCCashManiaBilled{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCCashManiaBilled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCCashManiaBilled) ProtoMessage() {} + +func (x *SCCashManiaBilled) ProtoReflect() protoreflect.Message { + mi := &file_protocol_cashmania_cashmania_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCCashManiaBilled.ProtoReflect.Descriptor instead. +func (*SCCashManiaBilled) Descriptor() ([]byte, []int) { + return file_protocol_cashmania_cashmania_proto_rawDescGZIP(), []int{5} +} + +func (x *SCCashManiaBilled) GetOpRetCode() int32 { + if x != nil { + return x.OpRetCode + } + return 0 +} + +func (x *SCCashManiaBilled) GetGameEndStr() string { + if x != nil { + return x.GameEndStr + } + return "" +} + +var File_protocol_cashmania_cashmania_proto protoreflect.FileDescriptor + +var file_protocol_cashmania_cashmania_proto_rawDesc = []byte{ + 0x0a, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x61, 0x73, 0x68, 0x6d, + 0x61, 0x6e, 0x69, 0x61, 0x2f, 0x63, 0x61, 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x63, 0x61, 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x22, + 0xfd, 0x01, 0x0a, 0x13, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x61, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, + 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x48, + 0x65, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x53, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x46, + 0x6c, 0x61, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, + 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x48, + 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x56, 0x49, 0x50, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x56, 0x49, 0x50, 0x22, + 0xe1, 0x02, 0x0a, 0x13, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x61, 0x52, + 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, + 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x4e, + 0x75, 0x6d, 0x4f, 0x66, 0x47, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x4e, 0x75, 0x6d, 0x4f, 0x66, 0x47, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x12, 0x1c, 0x0a, + 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x61, + 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x2e, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, + 0x61, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x22, 0x3f, 0x0a, 0x0d, 0x43, 0x53, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, + 0x69, 0x61, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5d, 0x0a, 0x0d, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, + 0x6e, 0x69, 0x61, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x22, 0x60, 0x0a, 0x14, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, 0x61, 0x6e, + 0x69, 0x61, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x51, 0x0a, 0x11, 0x53, 0x43, 0x43, 0x61, 0x73, 0x68, 0x4d, + 0x61, 0x6e, 0x69, 0x61, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x70, + 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4f, + 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, + 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x47, 0x61, + 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x2a, 0xf3, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x73, + 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x61, 0x50, 0x49, 0x44, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x41, 0x43, + 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x5a, 0x45, + 0x52, 0x4f, 0x10, 0x00, 0x12, 0x29, 0x0a, 0x24, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, + 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, 0x43, 0x41, 0x53, 0x48, 0x4d, + 0x41, 0x4e, 0x49, 0x41, 0x52, 0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x92, 0x2c, 0x12, + 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, + 0x4e, 0x49, 0x41, 0x5f, 0x43, 0x53, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x4f, + 0x50, 0x10, 0x93, 0x2c, 0x12, 0x23, 0x0a, 0x1e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, + 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, 0x43, 0x41, 0x53, 0x48, 0x4d, + 0x41, 0x4e, 0x49, 0x41, 0x4f, 0x50, 0x10, 0x94, 0x2c, 0x12, 0x2a, 0x0a, 0x25, 0x50, 0x41, 0x43, + 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, + 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, + 0x54, 0x45, 0x10, 0x95, 0x2c, 0x12, 0x27, 0x0a, 0x22, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, + 0x43, 0x41, 0x53, 0x48, 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x5f, 0x53, 0x43, 0x43, 0x41, 0x53, 0x48, + 0x4d, 0x41, 0x4e, 0x49, 0x41, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x96, 0x2c, 0x42, 0x29, + 0x5a, 0x27, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, + 0x63, 0x61, 0x73, 0x68, 0x6d, 0x61, 0x6e, 0x69, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, +} + +var ( + file_protocol_cashmania_cashmania_proto_rawDescOnce sync.Once + file_protocol_cashmania_cashmania_proto_rawDescData = file_protocol_cashmania_cashmania_proto_rawDesc +) + +func file_protocol_cashmania_cashmania_proto_rawDescGZIP() []byte { + file_protocol_cashmania_cashmania_proto_rawDescOnce.Do(func() { + file_protocol_cashmania_cashmania_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_cashmania_cashmania_proto_rawDescData) + }) + return file_protocol_cashmania_cashmania_proto_rawDescData +} + +var file_protocol_cashmania_cashmania_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_protocol_cashmania_cashmania_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_protocol_cashmania_cashmania_proto_goTypes = []interface{}{ + (CashManiaPID)(0), // 0: cashmania.CashManiaPID + (*CashManiaPlayerData)(nil), // 1: cashmania.CashManiaPlayerData + (*SCCashManiaRoomInfo)(nil), // 2: cashmania.SCCashManiaRoomInfo + (*CSCashManiaOp)(nil), // 3: cashmania.CSCashManiaOp + (*SCCashManiaOp)(nil), // 4: cashmania.SCCashManiaOp + (*SCCashManiaRoomState)(nil), // 5: cashmania.SCCashManiaRoomState + (*SCCashManiaBilled)(nil), // 6: cashmania.SCCashManiaBilled +} +var file_protocol_cashmania_cashmania_proto_depIdxs = []int32{ + 1, // 0: cashmania.SCCashManiaRoomInfo.Player:type_name -> cashmania.CashManiaPlayerData + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_protocol_cashmania_cashmania_proto_init() } +func file_protocol_cashmania_cashmania_proto_init() { + if File_protocol_cashmania_cashmania_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protocol_cashmania_cashmania_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CashManiaPlayerData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_cashmania_cashmania_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCCashManiaRoomInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_cashmania_cashmania_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSCashManiaOp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_cashmania_cashmania_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCCashManiaOp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_cashmania_cashmania_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCCashManiaRoomState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_cashmania_cashmania_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCCashManiaBilled); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protocol_cashmania_cashmania_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protocol_cashmania_cashmania_proto_goTypes, + DependencyIndexes: file_protocol_cashmania_cashmania_proto_depIdxs, + EnumInfos: file_protocol_cashmania_cashmania_proto_enumTypes, + MessageInfos: file_protocol_cashmania_cashmania_proto_msgTypes, + }.Build() + File_protocol_cashmania_cashmania_proto = out.File + file_protocol_cashmania_cashmania_proto_rawDesc = nil + file_protocol_cashmania_cashmania_proto_goTypes = nil + file_protocol_cashmania_cashmania_proto_depIdxs = nil +} diff --git a/protocol/cashmania/cashmania.proto b/protocol/cashmania/cashmania.proto new file mode 100644 index 0000000..fe0d37e --- /dev/null +++ b/protocol/cashmania/cashmania.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package cashmania; +option go_package = "mongo.games.com/game/protocol/cashmania"; + +//cashmania +//龙 +enum CashManiaPID { + PACKET_CASHMANIA_ZERO = 0;// 弃用消息号 + PACKET_CASHMANIA_SCCASHMANIAROOMINFO = 5650; //房间信息 + PACKET_CASHMANIA_CSCASHMANIAOP = 5651; + PACKET_CASHMANIA_SCCASHMANIAOP = 5652; + PACKET_CASHMANIA_SCCASHMANIAROOMSTATE = 5653; + PACKET_CASHMANIA_SCCASHMANIABILLED = 5654; +} + +message CashManiaPlayerData { + string Name = 1; //名字 + int32 SnId = 2; //账号 + int32 Head = 3; //头像 + int32 Sex = 4; //性别 + int64 Coin = 5; //金币 + int32 Pos = 6; //座位位置 + int32 Flag = 7; //二进制标记 + repeated string Params = 8; //其他数据 如:ip 等 + string City = 9; //城市 + int32 HeadOutLine = 10; //头像框 + int32 VIP = 11; +} +//房间信息 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO +message SCCashManiaRoomInfo { + int32 RoomId = 1; //房间id + int32 GameFreeId = 2; + int32 GameId = 3; //游戏id + int32 RoomMode = 4; //游戏模式 + repeated int32 Params = 5; //规则参数 + int32 NumOfGames = 6; //当前第几局 + int32 State = 7; //房间当前状态 + repeated int64 ParamsEx = 8; //其他参数 + int32 SceneType = 9; //房间模式 + CashManiaPlayerData Player = 10; //房间内的玩家信息 + string PlayerInfo = 11; +} +//玩家操作 +//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP +message CSCashManiaOp { + int32 OpCode = 1; //操作码 0.spin + repeated int64 Params = 2; //操作参数 下注索引编号 +} +//玩家操作返回 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP +message SCCashManiaOp { + int32 OpCode = 1; //操作码 + int32 OpRetCode = 2; //操作结果 1.金币不足 2.低于该值不能押注 + repeated int64 Params = 3; //操作参数 +} +//房间状态 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE +message SCCashManiaRoomState { + int32 State = 1; //房间当前状态 + int32 SubState = 2; //房间当前子状态 + repeated int32 Params = 3; //状态参数 +} +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED +message SCCashManiaBilled{ + int32 OpRetCode = 1;//0.spin成功 1.spin失败 + string GameEndStr = 2; +} \ No newline at end of file diff --git a/protocol/doc.md b/protocol/doc.md index 2dd90d6..e8d8f01 100644 --- a/protocol/doc.md +++ b/protocol/doc.md @@ -159,31 +159,39 @@ ### samloc.proto - 5550~5569 -### thirteen.protp +### thirteen.proto - 5570~5580 -### smallrocket.protp +### smallrocket.proto - 5581~5599 -### fortunedragon.prot +### fortunedragon.proto - 5600~5609 -### fortunerabbit.prot +### fortunerabbit.proto - 5610~5619 -### fortuneox.prot +### fortuneox.proto - 5620~5629 -### fortunetiger.prot +### fortunetiger.proto - 5630~5639 -### fortunemouse.prot +### fortunemouse.proto - 5640~5649 +### cashmania.proto + +- 5650~5659 + +### gatesofolympus.proto + +- 5660~5669 + ### game.proto(玩家离开) - 8000~8099 \ No newline at end of file diff --git a/protocol/gatesofolympus/gatesofolympus.pb.go b/protocol/gatesofolympus/gatesofolympus.pb.go new file mode 100644 index 0000000..2d4df78 --- /dev/null +++ b/protocol/gatesofolympus/gatesofolympus.pb.go @@ -0,0 +1,806 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1-devel +// protoc v3.19.4 +// source: protocol/gatesofolympus/gatesofolympus.proto + +package gatesofolympus + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +//gatesofolympus +//龙 +type GatesOfOlympusPID int32 + +const ( + GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_ZERO GatesOfOlympusPID = 0 // 弃用消息号 + GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO GatesOfOlympusPID = 5660 //房间信息 + GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP GatesOfOlympusPID = 5661 + GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP GatesOfOlympusPID = 5662 + GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE GatesOfOlympusPID = 5663 + GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED GatesOfOlympusPID = 5664 +) + +// Enum value maps for GatesOfOlympusPID. +var ( + GatesOfOlympusPID_name = map[int32]string{ + 0: "PACKET_GATESOFOLYMPUS_ZERO", + 5660: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO", + 5661: "PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP", + 5662: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP", + 5663: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE", + 5664: "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED", + } + GatesOfOlympusPID_value = map[string]int32{ + "PACKET_GATESOFOLYMPUS_ZERO": 0, + "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO": 5660, + "PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP": 5661, + "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP": 5662, + "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE": 5663, + "PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED": 5664, + } +) + +func (x GatesOfOlympusPID) Enum() *GatesOfOlympusPID { + p := new(GatesOfOlympusPID) + *p = x + return p +} + +func (x GatesOfOlympusPID) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GatesOfOlympusPID) Descriptor() protoreflect.EnumDescriptor { + return file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes[0].Descriptor() +} + +func (GatesOfOlympusPID) Type() protoreflect.EnumType { + return &file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes[0] +} + +func (x GatesOfOlympusPID) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GatesOfOlympusPID.Descriptor instead. +func (GatesOfOlympusPID) EnumDescriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{0} +} + +type GatesOfOlympusPlayerData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` //名字 + SnId int32 `protobuf:"varint,2,opt,name=SnId,proto3" json:"SnId,omitempty"` //账号 + Head int32 `protobuf:"varint,3,opt,name=Head,proto3" json:"Head,omitempty"` //头像 + Sex int32 `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` //性别 + Coin int64 `protobuf:"varint,5,opt,name=Coin,proto3" json:"Coin,omitempty"` //金币 + Pos int32 `protobuf:"varint,6,opt,name=Pos,proto3" json:"Pos,omitempty"` //座位位置 + Flag int32 `protobuf:"varint,7,opt,name=Flag,proto3" json:"Flag,omitempty"` //二进制标记 + Params []string `protobuf:"bytes,8,rep,name=Params,proto3" json:"Params,omitempty"` //其他数据 如:ip 等 + City string `protobuf:"bytes,9,opt,name=City,proto3" json:"City,omitempty"` //城市 + HeadOutLine int32 `protobuf:"varint,10,opt,name=HeadOutLine,proto3" json:"HeadOutLine,omitempty"` //头像框 + VIP int32 `protobuf:"varint,11,opt,name=VIP,proto3" json:"VIP,omitempty"` +} + +func (x *GatesOfOlympusPlayerData) Reset() { + *x = GatesOfOlympusPlayerData{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GatesOfOlympusPlayerData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GatesOfOlympusPlayerData) ProtoMessage() {} + +func (x *GatesOfOlympusPlayerData) ProtoReflect() protoreflect.Message { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GatesOfOlympusPlayerData.ProtoReflect.Descriptor instead. +func (*GatesOfOlympusPlayerData) Descriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{0} +} + +func (x *GatesOfOlympusPlayerData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GatesOfOlympusPlayerData) GetSnId() int32 { + if x != nil { + return x.SnId + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetHead() int32 { + if x != nil { + return x.Head + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetSex() int32 { + if x != nil { + return x.Sex + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetCoin() int64 { + if x != nil { + return x.Coin + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetPos() int32 { + if x != nil { + return x.Pos + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetFlag() int32 { + if x != nil { + return x.Flag + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetParams() []string { + if x != nil { + return x.Params + } + return nil +} + +func (x *GatesOfOlympusPlayerData) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *GatesOfOlympusPlayerData) GetHeadOutLine() int32 { + if x != nil { + return x.HeadOutLine + } + return 0 +} + +func (x *GatesOfOlympusPlayerData) GetVIP() int32 { + if x != nil { + return x.VIP + } + return 0 +} + +//房间信息 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO +type SCGatesOfOlympusRoomInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoomId int32 `protobuf:"varint,1,opt,name=RoomId,proto3" json:"RoomId,omitempty"` //房间id + GameFreeId int32 `protobuf:"varint,2,opt,name=GameFreeId,proto3" json:"GameFreeId,omitempty"` + GameId int32 `protobuf:"varint,3,opt,name=GameId,proto3" json:"GameId,omitempty"` //游戏id + RoomMode int32 `protobuf:"varint,4,opt,name=RoomMode,proto3" json:"RoomMode,omitempty"` //游戏模式 + Params []int32 `protobuf:"varint,5,rep,packed,name=Params,proto3" json:"Params,omitempty"` //规则参数 + NumOfGames int32 `protobuf:"varint,6,opt,name=NumOfGames,proto3" json:"NumOfGames,omitempty"` //当前第几局 + State int32 `protobuf:"varint,7,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态 + ParamsEx []int64 `protobuf:"varint,8,rep,packed,name=ParamsEx,proto3" json:"ParamsEx,omitempty"` //其他参数 + SceneType int32 `protobuf:"varint,9,opt,name=SceneType,proto3" json:"SceneType,omitempty"` //房间模式 + Player *GatesOfOlympusPlayerData `protobuf:"bytes,10,opt,name=Player,proto3" json:"Player,omitempty"` //房间内的玩家信息 + PlayerInfo string `protobuf:"bytes,11,opt,name=PlayerInfo,proto3" json:"PlayerInfo,omitempty"` +} + +func (x *SCGatesOfOlympusRoomInfo) Reset() { + *x = SCGatesOfOlympusRoomInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCGatesOfOlympusRoomInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCGatesOfOlympusRoomInfo) ProtoMessage() {} + +func (x *SCGatesOfOlympusRoomInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCGatesOfOlympusRoomInfo.ProtoReflect.Descriptor instead. +func (*SCGatesOfOlympusRoomInfo) Descriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{1} +} + +func (x *SCGatesOfOlympusRoomInfo) GetRoomId() int32 { + if x != nil { + return x.RoomId + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetGameFreeId() int32 { + if x != nil { + return x.GameFreeId + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetGameId() int32 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetRoomMode() int32 { + if x != nil { + return x.RoomMode + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetParams() []int32 { + if x != nil { + return x.Params + } + return nil +} + +func (x *SCGatesOfOlympusRoomInfo) GetNumOfGames() int32 { + if x != nil { + return x.NumOfGames + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetState() int32 { + if x != nil { + return x.State + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetParamsEx() []int64 { + if x != nil { + return x.ParamsEx + } + return nil +} + +func (x *SCGatesOfOlympusRoomInfo) GetSceneType() int32 { + if x != nil { + return x.SceneType + } + return 0 +} + +func (x *SCGatesOfOlympusRoomInfo) GetPlayer() *GatesOfOlympusPlayerData { + if x != nil { + return x.Player + } + return nil +} + +func (x *SCGatesOfOlympusRoomInfo) GetPlayerInfo() string { + if x != nil { + return x.PlayerInfo + } + return "" +} + +//玩家操作 +//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP +type CSGatesOfOlympusOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码 0.spin + Params []int64 `protobuf:"varint,2,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数 下注索引编号 +} + +func (x *CSGatesOfOlympusOp) Reset() { + *x = CSGatesOfOlympusOp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSGatesOfOlympusOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSGatesOfOlympusOp) ProtoMessage() {} + +func (x *CSGatesOfOlympusOp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CSGatesOfOlympusOp.ProtoReflect.Descriptor instead. +func (*CSGatesOfOlympusOp) Descriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{2} +} + +func (x *CSGatesOfOlympusOp) GetOpCode() int32 { + if x != nil { + return x.OpCode + } + return 0 +} + +func (x *CSGatesOfOlympusOp) GetParams() []int64 { + if x != nil { + return x.Params + } + return nil +} + +//玩家操作返回 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP +type SCGatesOfOlympusOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` //操作码 + OpRetCode int32 `protobuf:"varint,2,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //操作结果 1.金币不足 2.低于该值不能押注 + Params []int64 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //操作参数 +} + +func (x *SCGatesOfOlympusOp) Reset() { + *x = SCGatesOfOlympusOp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCGatesOfOlympusOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCGatesOfOlympusOp) ProtoMessage() {} + +func (x *SCGatesOfOlympusOp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCGatesOfOlympusOp.ProtoReflect.Descriptor instead. +func (*SCGatesOfOlympusOp) Descriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{3} +} + +func (x *SCGatesOfOlympusOp) GetOpCode() int32 { + if x != nil { + return x.OpCode + } + return 0 +} + +func (x *SCGatesOfOlympusOp) GetOpRetCode() int32 { + if x != nil { + return x.OpRetCode + } + return 0 +} + +func (x *SCGatesOfOlympusOp) GetParams() []int64 { + if x != nil { + return x.Params + } + return nil +} + +//房间状态 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE +type SCGatesOfOlympusRoomState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State int32 `protobuf:"varint,1,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态 + SubState int32 `protobuf:"varint,2,opt,name=SubState,proto3" json:"SubState,omitempty"` //房间当前子状态 + Params []int32 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //状态参数 +} + +func (x *SCGatesOfOlympusRoomState) Reset() { + *x = SCGatesOfOlympusRoomState{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCGatesOfOlympusRoomState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCGatesOfOlympusRoomState) ProtoMessage() {} + +func (x *SCGatesOfOlympusRoomState) ProtoReflect() protoreflect.Message { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCGatesOfOlympusRoomState.ProtoReflect.Descriptor instead. +func (*SCGatesOfOlympusRoomState) Descriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{4} +} + +func (x *SCGatesOfOlympusRoomState) GetState() int32 { + if x != nil { + return x.State + } + return 0 +} + +func (x *SCGatesOfOlympusRoomState) GetSubState() int32 { + if x != nil { + return x.SubState + } + return 0 +} + +func (x *SCGatesOfOlympusRoomState) GetParams() []int32 { + if x != nil { + return x.Params + } + return nil +} + +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED +type SCGatesOfOlympusBilled struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpRetCode int32 `protobuf:"varint,1,opt,name=OpRetCode,proto3" json:"OpRetCode,omitempty"` //0.spin成功 1.spin失败 + GameEndStr string `protobuf:"bytes,2,opt,name=GameEndStr,proto3" json:"GameEndStr,omitempty"` +} + +func (x *SCGatesOfOlympusBilled) Reset() { + *x = SCGatesOfOlympusBilled{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCGatesOfOlympusBilled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCGatesOfOlympusBilled) ProtoMessage() {} + +func (x *SCGatesOfOlympusBilled) ProtoReflect() protoreflect.Message { + mi := &file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SCGatesOfOlympusBilled.ProtoReflect.Descriptor instead. +func (*SCGatesOfOlympusBilled) Descriptor() ([]byte, []int) { + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP(), []int{5} +} + +func (x *SCGatesOfOlympusBilled) GetOpRetCode() int32 { + if x != nil { + return x.OpRetCode + } + return 0 +} + +func (x *SCGatesOfOlympusBilled) GetGameEndStr() string { + if x != nil { + return x.GameEndStr + } + return "" +} + +var File_protocol_gatesofolympus_gatesofolympus_proto protoreflect.FileDescriptor + +var file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc = []byte{ + 0x0a, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x73, + 0x6f, 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, + 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, + 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x22, 0x82, + 0x02, 0x0a, 0x18, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, + 0x73, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, + 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x65, 0x78, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, + 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x10, 0x0a, + 0x03, 0x50, 0x6f, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x46, + 0x6c, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x43, + 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x69, 0x74, 0x79, 0x12, + 0x20, 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x4f, 0x75, 0x74, 0x4c, 0x69, 0x6e, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x49, 0x50, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x56, 0x49, 0x50, 0x22, 0xf0, 0x02, 0x0a, 0x18, 0x53, 0x43, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, + 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, + 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x47, 0x61, + 0x6d, 0x65, 0x46, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x61, 0x6d, 0x65, + 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x4e, 0x75, 0x6d, 0x4f, 0x66, 0x47, 0x61, 0x6d, + 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x4e, 0x75, 0x6d, 0x4f, 0x66, 0x47, + 0x61, 0x6d, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x18, 0x08, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x45, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x53, 0x63, 0x65, 0x6e, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x06, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, 0x66, 0x6f, 0x6c, + 0x79, 0x6d, 0x70, 0x75, 0x73, 0x2e, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, + 0x6d, 0x70, 0x75, 0x73, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x06, + 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x44, 0x0a, 0x12, 0x43, 0x53, 0x47, 0x61, 0x74, 0x65, + 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, + 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x62, 0x0a, 0x12, + 0x53, 0x43, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, + 0x4f, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x70, + 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4f, + 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x22, 0x65, 0x0a, 0x19, 0x53, 0x43, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, + 0x6d, 0x70, 0x75, 0x73, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75, 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x56, 0x0a, 0x16, 0x53, 0x43, 0x47, 0x61, 0x74, + 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, 0x75, 0x73, 0x42, 0x69, 0x6c, 0x6c, 0x65, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x47, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x74, 0x72, 0x2a, + 0xaf, 0x02, 0x0a, 0x11, 0x47, 0x61, 0x74, 0x65, 0x73, 0x4f, 0x66, 0x4f, 0x6c, 0x79, 0x6d, 0x70, + 0x75, 0x73, 0x50, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, + 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x5f, 0x5a, + 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x33, 0x0a, 0x2e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, + 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x5f, 0x53, + 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x52, + 0x4f, 0x4f, 0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x9c, 0x2c, 0x12, 0x2d, 0x0a, 0x28, 0x50, 0x41, + 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, + 0x50, 0x55, 0x53, 0x5f, 0x43, 0x53, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, + 0x4d, 0x50, 0x55, 0x53, 0x4f, 0x50, 0x10, 0x9d, 0x2c, 0x12, 0x2d, 0x0a, 0x28, 0x50, 0x41, 0x43, + 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, + 0x55, 0x53, 0x5f, 0x53, 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, + 0x50, 0x55, 0x53, 0x4f, 0x50, 0x10, 0x9e, 0x2c, 0x12, 0x34, 0x0a, 0x2f, 0x50, 0x41, 0x43, 0x4b, + 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, + 0x53, 0x5f, 0x53, 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, + 0x55, 0x53, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x9f, 0x2c, 0x12, 0x31, + 0x0a, 0x2c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, 0x46, + 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x5f, 0x53, 0x43, 0x47, 0x41, 0x54, 0x45, 0x53, 0x4f, + 0x46, 0x4f, 0x4c, 0x59, 0x4d, 0x50, 0x55, 0x53, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xa0, + 0x2c, 0x42, 0x2e, 0x5a, 0x2c, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x2f, 0x67, 0x61, 0x74, 0x65, 0x73, 0x6f, 0x66, 0x6f, 0x6c, 0x79, 0x6d, 0x70, 0x75, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protocol_gatesofolympus_gatesofolympus_proto_rawDescOnce sync.Once + file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData = file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc +) + +func file_protocol_gatesofolympus_gatesofolympus_proto_rawDescGZIP() []byte { + file_protocol_gatesofolympus_gatesofolympus_proto_rawDescOnce.Do(func() { + file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData) + }) + return file_protocol_gatesofolympus_gatesofolympus_proto_rawDescData +} + +var file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_protocol_gatesofolympus_gatesofolympus_proto_goTypes = []interface{}{ + (GatesOfOlympusPID)(0), // 0: gatesofolympus.GatesOfOlympusPID + (*GatesOfOlympusPlayerData)(nil), // 1: gatesofolympus.GatesOfOlympusPlayerData + (*SCGatesOfOlympusRoomInfo)(nil), // 2: gatesofolympus.SCGatesOfOlympusRoomInfo + (*CSGatesOfOlympusOp)(nil), // 3: gatesofolympus.CSGatesOfOlympusOp + (*SCGatesOfOlympusOp)(nil), // 4: gatesofolympus.SCGatesOfOlympusOp + (*SCGatesOfOlympusRoomState)(nil), // 5: gatesofolympus.SCGatesOfOlympusRoomState + (*SCGatesOfOlympusBilled)(nil), // 6: gatesofolympus.SCGatesOfOlympusBilled +} +var file_protocol_gatesofolympus_gatesofolympus_proto_depIdxs = []int32{ + 1, // 0: gatesofolympus.SCGatesOfOlympusRoomInfo.Player:type_name -> gatesofolympus.GatesOfOlympusPlayerData + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_protocol_gatesofolympus_gatesofolympus_proto_init() } +func file_protocol_gatesofolympus_gatesofolympus_proto_init() { + if File_protocol_gatesofolympus_gatesofolympus_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GatesOfOlympusPlayerData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCGatesOfOlympusRoomInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSGatesOfOlympusOp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCGatesOfOlympusOp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCGatesOfOlympusRoomState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCGatesOfOlympusBilled); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protocol_gatesofolympus_gatesofolympus_proto_goTypes, + DependencyIndexes: file_protocol_gatesofolympus_gatesofolympus_proto_depIdxs, + EnumInfos: file_protocol_gatesofolympus_gatesofolympus_proto_enumTypes, + MessageInfos: file_protocol_gatesofolympus_gatesofolympus_proto_msgTypes, + }.Build() + File_protocol_gatesofolympus_gatesofolympus_proto = out.File + file_protocol_gatesofolympus_gatesofolympus_proto_rawDesc = nil + file_protocol_gatesofolympus_gatesofolympus_proto_goTypes = nil + file_protocol_gatesofolympus_gatesofolympus_proto_depIdxs = nil +} diff --git a/protocol/gatesofolympus/gatesofolympus.proto b/protocol/gatesofolympus/gatesofolympus.proto new file mode 100644 index 0000000..ef76923 --- /dev/null +++ b/protocol/gatesofolympus/gatesofolympus.proto @@ -0,0 +1,68 @@ +syntax = "proto3"; +package gatesofolympus; +option go_package = "mongo.games.com/game/protocol/gatesofolympus"; + +//gatesofolympus +//龙 +enum GatesOfOlympusPID { + PACKET_GATESOFOLYMPUS_ZERO = 0;// 弃用消息号 + PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO = 5660; //房间信息 + PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP = 5661; + PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSOP = 5662; + PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMSTATE = 5663; + PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED = 5664; +} + +message GatesOfOlympusPlayerData { + string Name = 1; //名字 + int32 SnId = 2; //账号 + int32 Head = 3; //头像 + int32 Sex = 4; //性别 + int64 Coin = 5; //金币 + int32 Pos = 6; //座位位置 + int32 Flag = 7; //二进制标记 + repeated string Params = 8; //其他数据 如:ip 等 + string City = 9; //城市 + int32 HeadOutLine = 10; //头像框 + int32 VIP = 11; +} +//房间信息 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMINFO +message SCGatesOfOlympusRoomInfo { + int32 RoomId = 1; //房间id + int32 GameFreeId = 2; + int32 GameId = 3; //游戏id + int32 RoomMode = 4; //游戏模式 + repeated int32 Params = 5; //规则参数 + int32 NumOfGames = 6; //当前第几局 + int32 State = 7; //房间当前状态 + repeated int64 ParamsEx = 8; //其他参数 + int32 SceneType = 9; //房间模式 + GatesOfOlympusPlayerData Player = 10; //房间内的玩家信息 + string PlayerInfo = 11; +} +//玩家操作 +//PACKET_FORTUNEMOUSE_CSFORTUNEMOUSEOP +message CSGatesOfOlympusOp { + int32 OpCode = 1; //操作码 0.spin + repeated int64 Params = 2; //操作参数 下注索引编号 +} +//玩家操作返回 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEOP +message SCGatesOfOlympusOp { + int32 OpCode = 1; //操作码 + int32 OpRetCode = 2; //操作结果 1.金币不足 2.低于该值不能押注 + repeated int64 Params = 3; //操作参数 +} +//房间状态 +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEROOMSTATE +message SCGatesOfOlympusRoomState { + int32 State = 1; //房间当前状态 + int32 SubState = 2; //房间当前子状态 + repeated int32 Params = 3; //状态参数 +} +//PACKET_FORTUNEMOUSE_SCFORTUNEMOUSEBILLED +message SCGatesOfOlympusBilled{ + int32 OpRetCode = 1;//0.spin成功 1.spin失败 + string GameEndStr = 2; +} \ No newline at end of file diff --git a/protocol/thirteen/thirteen.pb.go b/protocol/thirteen/thirteen.pb.go index e3c891e..77cbe10 100644 --- a/protocol/thirteen/thirteen.pb.go +++ b/protocol/thirteen/thirteen.pb.go @@ -386,7 +386,7 @@ type CSThirteenPlayerOp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 + OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 6预选 // 确定牌时,两种参数规则,都可以 // 第一种:玩家从推荐牌型中选择一个,把Poker.IndexType发过来(减少数据传输) // 第二种:按头墩中墩尾墩顺序把牌发过来 diff --git a/protocol/thirteen/thirteen.proto b/protocol/thirteen/thirteen.proto index 0ac7d2d..fe2bed2 100644 --- a/protocol/thirteen/thirteen.proto +++ b/protocol/thirteen/thirteen.proto @@ -73,7 +73,7 @@ message SCThirteenPlayerCards { //玩家操作 //PACKET_CSThirteenPlayerOp message CSThirteenPlayerOp { - int32 OpCode = 1; // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 + int32 OpCode = 1; // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 6预选 // 确定牌时,两种参数规则,都可以 // 第一种:玩家从推荐牌型中选择一个,把Poker.IndexType发过来(减少数据传输) diff --git a/statistics/.gitignore b/statistics/.gitignore new file mode 100644 index 0000000..3c58f2a --- /dev/null +++ b/statistics/.gitignore @@ -0,0 +1,29 @@ +# ---> Go +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib +*.xlsx + +# Test binary, built with `go test -c` +*.test +local_test.go + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work + +.idea +.vscode +log + diff --git a/statistics/README.md b/statistics/README.md new file mode 100644 index 0000000..71f24d5 --- /dev/null +++ b/statistics/README.md @@ -0,0 +1,7 @@ +# statistics + +数据分析服务 + * mongodb同步到mysql + * 接收消息队列数据 + * 历史数据查询 + * 数据统计 \ No newline at end of file diff --git a/statistics/build_linux.bat b/statistics/build_linux.bat new file mode 100644 index 0000000..7962122 --- /dev/null +++ b/statistics/build_linux.bat @@ -0,0 +1,8 @@ +set GOPATH=D:\godev +go env -w GO111MODULE=on + +set CGO_ENABLED=0 +set GOOS=linux +set GOARCH=amd64 +go build +pause \ No newline at end of file diff --git a/statistics/constant/constant.go b/statistics/constant/constant.go new file mode 100644 index 0000000..78818e0 --- /dev/null +++ b/statistics/constant/constant.go @@ -0,0 +1,8 @@ +package constant + +const ( + InviteScoreTypeBind = 1 // 绑定邀请码 + InviteScoreTypePay = 2 // 充值返佣 + InviteScoreTypeRecharge = 3 // 充值完成 + InviteScoreTypePayMe = 4 // 充值(自己) +) diff --git a/statistics/etc/config.yaml b/statistics/etc/config.yaml new file mode 100644 index 0000000..ba82d5c --- /dev/null +++ b/statistics/etc/config.yaml @@ -0,0 +1,27 @@ +# 平台id +platforms: + - 1 + +# 几秒同步一次数据 +# 注册表,登录日志表 +update_second: 60 +# 注册表每次同步多少条数据 +update_account_num: 100 +# 登录日志每次同步多少条数据 +update_login_num: 100 +# 几秒读取一次玩家id列表 +update_second_snid: 30 +# 最多触发几个玩家数据更新 +update_snid_num: 100 + +# 邀请数据统计 +# 几秒读取一次邀请记录 +update_second_invite: 10 +# 一次最多读取多少条邀请记录 +update_invite_num: 30 + +# 道具获得数量统计 +# 几秒读取一次道具日志 +update_second_item: 10 +# 一次最多读取多少道具日志 +update_item_num: 100 \ No newline at end of file diff --git a/statistics/etc/mongo.yaml b/statistics/etc/mongo.yaml new file mode 100644 index 0000000..7f9e42d --- /dev/null +++ b/statistics/etc/mongo.yaml @@ -0,0 +1,53 @@ +global: + user: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_global + Username: + Password: + Options: + log: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_log + Username: + Password: + Options: + monitor: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_monitor + Username: + Password: + Options: +platforms: + 0: + user: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_user_plt_000 + Username: + Password: + Options: + log: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_log_plt_000 + Username: + Password: + Options: + 1: + user: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_user_plt_001 + Username: + Password: + Options: + log: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_log_plt_001 + Username: + Password: + Options: \ No newline at end of file diff --git a/statistics/etc/mysql.yaml b/statistics/etc/mysql.yaml new file mode 100644 index 0000000..82d1fe3 --- /dev/null +++ b/statistics/etc/mysql.yaml @@ -0,0 +1,38 @@ +platforms: + global: + HostName: 127.0.0.1 + HostPort: 3306 + Database: win88_user + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + 0: + HostName: 127.0.0.1 + HostPort: 3306 + Database: win88_plt_000 + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + 1: + HostName: 127.0.0.1 + HostPort: 3306 + Database: win88_plt_001 + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + count: # 破产日志库 + HostName: 127.0.0.1 + HostPort: 3306 + Database: dbmis_count + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + +# 最大空闲连接数 +MaxIdleConns: 10 +# 最大连接数 +MaxOpenConns: 100 +# 连接可复用的最大时间 +ConnMaxLifetime: 3600 +# 连接最大空闲时间 +ConnMaxIdletime: 0 \ No newline at end of file diff --git a/statistics/logger.xml b/statistics/logger.xml new file mode 100644 index 0000000..f6eb37b --- /dev/null +++ b/statistics/logger.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/statistics/main.go b/statistics/main.go new file mode 100644 index 0000000..c738b31 --- /dev/null +++ b/statistics/main.go @@ -0,0 +1,212 @@ +package main + +import ( + "context" + "fmt" + "os" + "os/signal" + "sync" + "time" + + "github.com/spf13/viper" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/mongox" + "mongo.games.com/goserver/core/mysqlx" + "mongo.games.com/goserver/core/utils" + "mongo.games.com/goserver/core/viperx" + + mongomodel "mongo.games.com/game/statistics/modelmongo" + mysqlmodel "mongo.games.com/game/statistics/modelmysql" + "mongo.games.com/game/statistics/static" + "mongo.games.com/game/statistics/syn" +) + +var VP *viper.Viper + +// DoTick 定时执行 +func DoTick(ctx context.Context, wg *sync.WaitGroup, duration time.Duration, fu func(ctx context.Context)) { + wg.Add(1) + go func() { + defer wg.Done() + for { + select { + case <-ctx.Done(): + return + case <-time.After(duration): + utils.RecoverPanicFunc() // 捕获异常 + fu(ctx) + } + } + }() +} + +// DoTickPlatform 定时执行,根据platform执行 +func DoTickPlatform(ctx context.Context, wg *sync.WaitGroup, duration time.Duration, batchSize int, + fu func(ctx context.Context, platform string, batchSize int)) { + wg.Add(1) + go func() { + defer wg.Done() + for { + select { + case <-ctx.Done(): + return + case <-time.After(duration): + utils.RecoverPanicFunc() // 捕获异常 + wg := new(sync.WaitGroup) + for _, v := range VP.GetStringSlice("platforms") { + platform := v + wg.Add(1) + go func() { + defer wg.Done() + fu(ctx, platform, batchSize) + }() + } + wg.Wait() + } + } + }() +} + +func main() { + VP = viperx.GetViper("config.yaml") + // mongo + vp := viperx.GetViper("mongo.yaml") + // mongo初始化 + conf := &mongox.Config{} + err := vp.Unmarshal(conf) + if err != nil { + panic(fmt.Errorf("mongo config error: %v", err)) + } + mongox.Init(conf) + defer mongox.Close() + + // mysql + vp = viperx.GetViper("mysql.yaml") + myConf := &mysqlx.Config{} + err = vp.Unmarshal(myConf) + if err != nil { + panic(fmt.Errorf("mysql config error: %v", err)) + } + mysqlx.Init(myConf) + defer mysqlx.Close() + + mysqlx.SetAutoMigrateTables(mysqlmodel.Tables) + + wg := &sync.WaitGroup{} + ctx, cancel := context.WithCancel(context.Background()) + + DoTick(ctx, wg, time.Duration(VP.GetInt64("update_second"))*time.Second, SyncSnId) + + DoTick(ctx, wg, time.Duration(VP.GetInt64("update_second_snid"))*time.Second, func(ctx context.Context) { + wg := new(sync.WaitGroup) + for _, v := range VP.GetStringSlice("platforms") { + platform := v + wg.Add(1) + go func() { + defer wg.Done() + Static(platform) + }() + } + wg.Wait() + }) + + DoTick(ctx, wg, time.Duration(VP.GetInt64("update_second_invite"))*time.Second, SyncInvite) + + DoTickPlatform(ctx, wg, time.Duration(VP.GetInt64("update_second_item"))*time.Second, VP.GetInt("update_item_num"), + func(ctx context.Context, platform string, batchSize int) { + err := syn.ItemGainDone(&syn.Data[mongomodel.ItemLog]{ + Platform: platform, + BatchSize: batchSize, + }) + if err != nil { + logger.Logger.Errorf("SyncItem error:%v", err) + } + }) + + logger.Logger.Info("start") + + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt, os.Kill) + sig := <-c + logger.Logger.Infof("closing down (signal: %v)", sig) + + // release + cancel() + wg.Wait() + + logger.Logger.Info("closed") +} + +// SyncSnId 同步注册和登录日志 +func SyncSnId(ctx context.Context) { + wg := new(sync.WaitGroup) + for _, v := range VP.GetStringSlice("platforms") { + platform := v + wg.Add(1) + go func() { + defer wg.Done() + _, err := syn.UserAccount(platform, VP.GetInt("update_account_num")) + if err != nil { + logger.Logger.Errorf("SyncUserAccount error: %v", err) + return + } + + _, err = syn.LogLogin(platform, VP.GetInt("update_login_num")) + if err != nil { + logger.Logger.Errorf("SyncLogLogin error: %v", err) + return + } + }() + } + wg.Wait() +} + +// Static 玩家id触发数据统计 +func Static(platform string) { + // 查询需要更新的玩家id + var ids []*mysqlmodel.UserID + db, err := mysqlx.GetDatabase(platform) + if err != nil { + logger.Logger.Errorf("GetDatabase error: %v", err) + return + } + if err := db.Limit(VP.GetInt("update_snid_num")).Find(&ids).Error; err != nil { + logger.Logger.Warnf("Get UserID error: %v", err) + return + } + + if len(ids) == 0 { + logger.Logger.Tracef("Static: no need to update") + return + } + + // 统计玩家跳出记录 + if err := static.UserLogin(platform, ids); err != nil { + logger.Logger.Errorf("StaticUserLogin error: %v", err) + return + } + + // 删除更新过的玩家id + if err := db.Delete(ids).Error; err != nil { + logger.Logger.Errorf("Delete error: %v", err) + return + } +} + +// SyncInvite 同步邀请数据 +func SyncInvite(ctx context.Context) { + wg := new(sync.WaitGroup) + for _, v := range VP.GetStringSlice("platforms") { + platform := v + wg.Add(1) + go func() { + defer wg.Done() + err := syn.SyncInviteScore(platform, VP.GetInt("update_invite_num")) + if err != nil { + logger.Logger.Errorf("SyncInviteScore error: %v", err) + return + } + }() + } + wg.Wait() +} diff --git a/statistics/modelmongo/log_gameplayerlistlog.go b/statistics/modelmongo/log_gameplayerlistlog.go new file mode 100644 index 0000000..a2a2917 --- /dev/null +++ b/statistics/modelmongo/log_gameplayerlistlog.go @@ -0,0 +1,47 @@ +package modelmongo + +import ( + "time" + + "go.mongodb.org/mongo-driver/bson/primitive" +) + +const LogGamePlayerListLog = "log_gameplayerlistlog" + +type GamePlayerListLog struct { + LogId primitive.ObjectID `bson:"_id"` + SnId int32 //用户Id + Name string //名称 + GameId int32 //游戏id + BaseScore int32 //游戏底注 + ClubId int32 //俱乐部Id + ClubRoom string //俱乐部包间 + TaxCoin int64 //税收 + ClubPumpCoin int64 //俱乐部额外抽水 + Platform string //平台id + Channel string //渠道 + Promoter string //推广员 + PackageTag string //包标识 + SceneId int32 //场景ID + GameMode int32 //游戏类型 + GameFreeid int32 //游戏类型房间号 + GameDetailedLogId string //游戏记录Id + IsFirstGame bool //是否第一次游戏 + //对于拉霸类:BetAmount=100 WinAmountNoAnyTax=0 (表示投入多少、收益多少,值>=0) + //拉霸类小游戏会是:BetAmount=0 WinAmountNoAnyTax=100 (投入0、收益多少,值>=0) + //对战场:BetAmount=0 WinAmountNoAnyTax=100 (投入会有是0、收益有正负,WinAmountNoAnyTax=100则盈利,WinAmountNoAnyTax=-100则输100) + BetAmount int64 //下注金额 + WinAmountNoAnyTax int64 //盈利金额,不包含任何税 + TotalIn int64 //本局投入 + TotalOut int64 //本局产出 + Time time.Time //记录时间 + RoomType int32 //房间类型 + GameDif string //游戏标识 + GameClass int32 //游戏类型 1棋牌 2电子 3百人 4捕鱼 5视讯 6彩票 7体育 + MatchId int32 + MatchType int32 //0.普通场 1.锦标赛 2.冠军赛 3.vip专属 + Ts int32 + IsFree bool //拉霸专用 是否免费 + WinSmallGame int64 //拉霸专用 小游戏奖励 + WinTotal int64 //拉霸专用 输赢 +} diff --git a/statistics/modelmongo/log_invitescore.go b/statistics/modelmongo/log_invitescore.go new file mode 100644 index 0000000..4a0b636 --- /dev/null +++ b/statistics/modelmongo/log_invitescore.go @@ -0,0 +1,19 @@ +package modelmongo + +import ( + "go.mongodb.org/mongo-driver/bson/primitive" +) + +const LogInviteScore = "log_invitescore" + +type InviteScore struct { + Id primitive.ObjectID `bson:"_id"` + UpSnid int // 上级代理 + DownSnid int // 下级代理 + Level int // 代理层级 例如 1:DownSnid 是 UpSnid 的 1 级代理; 2: DownSnid 是 UpSnid 的 2 级代理 + Tp int // 返佣类型 + Rate int // 返佣比例 + Score int // 积分 + Money int // 充值金额 + Ts int // 时间戳 +} diff --git a/statistics/modelmongo/log_item.go b/statistics/modelmongo/log_item.go new file mode 100644 index 0000000..4d7221f --- /dev/null +++ b/statistics/modelmongo/log_item.go @@ -0,0 +1,27 @@ +package modelmongo + +import "go.mongodb.org/mongo-driver/bson/primitive" + +const LogItem = "log_itemlog" + +type ItemInfo struct { + ItemId int32 + ItemNum int64 +} + +type ItemLog struct { + LogId primitive.ObjectID `bson:"_id"` + Platform string //平台 + SnId int32 //玩家id + LogType int32 //记录类型 0.获取 1.消耗 + ItemId int32 //道具id + ItemName string //道具名称 + Count int64 //个数 + CreateTs int64 //记录时间 + Remark string //备注 + TypeId int32 // 变化类型 + GameId int32 // 游戏id,游戏中获得时有值 + GameFreeId int32 // 场次id,游戏中获得时有值 + Cost []*ItemInfo // 消耗的道具 + Id string // 撤销的id,兑换失败 +} diff --git a/statistics/modelmongo/log_login.go b/statistics/modelmongo/log_login.go new file mode 100644 index 0000000..5145ffe --- /dev/null +++ b/statistics/modelmongo/log_login.go @@ -0,0 +1,33 @@ +package modelmongo + +import ( + "time" + + "go.mongodb.org/mongo-driver/bson/primitive" +) + +const LogLogin = "log_login" + +const ( + LogTypeLogin int32 = iota // 登录 + LogTypeLogout // 登出 + LogTypeRehold // 重连 + LogTypeDrop // 掉线 +) + +type LoginLog struct { + LogId primitive.ObjectID `bson:"_id"` + Platform string //平台id + SnId int32 + LogType int32 + Ts int64 + Time time.Time + GameId int // 玩家掉线时所在游戏id + LastGameID int // 玩家最后所在游戏id + ChannelId string // 推广渠道 + + DeviceName string + AppVersion string + BuildVersion string + AppChannel string +} diff --git a/statistics/modelmongo/user_account.go b/statistics/modelmongo/user_account.go new file mode 100644 index 0000000..89979bf --- /dev/null +++ b/statistics/modelmongo/user_account.go @@ -0,0 +1,24 @@ +package modelmongo + +import ( + "time" + + "go.mongodb.org/mongo-driver/bson/primitive" +) + +const UserAccount = "user_account" + +type Account struct { + AccountId primitive.ObjectID `bson:"_id"` + SnId int32 // 玩家账号直接在这里生成 + Platform string // 平台 + RegisterTs int64 // 注册时间戳 + RegisteTime time.Time + ChannelId string // 推广渠道 + + Tel string `gorm:"index"` + DeviceName string `gorm:"index"` + AppVersion string `gorm:"index"` + BuildVersion string `gorm:"index"` + AppChannel string `gorm:"index"` +} diff --git a/statistics/modelmysql/bankrupt.go b/statistics/modelmysql/bankrupt.go new file mode 100644 index 0000000..1ade115 --- /dev/null +++ b/statistics/modelmysql/bankrupt.go @@ -0,0 +1,12 @@ +package modelmysql + +type Bankrupt struct { + Id int `json:"id" gorm:"column:id"` + Platform int `json:"platform" gorm:"column:platform"` + Snid int `json:"snid" gorm:"column:snid"` + RegTs int `json:"register_time" gorm:"column:register_time"` + GameId int `json:"game_id" gorm:"column:game_id"` + GameFreeId int `json:"game_free_id" gorm:"column:game_free_id"` + Coin int `json:"use_coin" gorm:"column:use_coin"` + Ts int `json:"bankrupt_time" gorm:"column:bankrupt_time"` +} diff --git a/statistics/modelmysql/log_invitescore.go b/statistics/modelmysql/log_invitescore.go new file mode 100644 index 0000000..b5ffdf4 --- /dev/null +++ b/statistics/modelmysql/log_invitescore.go @@ -0,0 +1,26 @@ +package modelmysql + +type LogInviteScoreMid struct { + ID uint `gorm:"primaryKey"` + MID string +} + +type LogInviteScore struct { + ID uint `gorm:"primaryKey"` + UpSnid int `gorm:"index"` // 上级代理 + DownSnid int `gorm:"index"` // 下级代理 + Level int `gorm:"index"` // 代理层级 例如 1:DownSnid 是 UpSnid 的 1 级代理; 2: DownSnid 是 UpSnid 的 2 级代理 + Tp int `gorm:"index"` // 返佣类型 + Rate int `gorm:"index"` // 返佣比例 + Score int `gorm:"index"` // 积分 + Money int `gorm:"index"` // 充值金额 + Ts int `gorm:"index"` // 时间戳 +} + +type LogInviteUser struct { + ID uint `gorm:"primaryKey"` + Psnid int `gorm:"index"` // 当前玩家 + Snid int `gorm:"index"` // 一级代理 + Level int `gorm:"index"` // 代理层级 例如 1:DownSnid 是 UpSnid 的 1 级代理; 2: DownSnid 是 UpSnid 的 2 级代理 + Ts int `gorm:"index"` // 绑定时间 +} diff --git a/statistics/modelmysql/log_itemgain.go b/statistics/modelmysql/log_itemgain.go new file mode 100644 index 0000000..a672611 --- /dev/null +++ b/statistics/modelmysql/log_itemgain.go @@ -0,0 +1,16 @@ +package modelmysql + +// ItemGain 道具获得数量,以小时,道具id,做主键 +type ItemGain struct { + ID uint `gorm:"primaryKey"` + Hour int64 `gorm:"index:idx_item"` // 小时时间戳,每小时统计一次 + ItemId int32 `gorm:"index:idx_item"` // 道具id + ItemNum int64 // 道具数量 +} + +// ItemTotalGain 道具获得总数 +type ItemTotalGain struct { + ID uint `gorm:"primaryKey"` + ItemId int32 `gorm:"index"` // 道具id + ItemNum int64 // 道具数量 +} diff --git a/statistics/modelmysql/log_login.go b/statistics/modelmysql/log_login.go new file mode 100644 index 0000000..912d748 --- /dev/null +++ b/statistics/modelmysql/log_login.go @@ -0,0 +1,26 @@ +package modelmysql + +import "time" + +const ( + LogTypeLogin = 1 // 登录 + LogTypeRehold = 2 // 重连 + LogTypeOffline = 3 // 离线 +) + +type LogLogin struct { + ID uint `gorm:"primaryKey"` + Snid int `gorm:"index"` + OnlineType int `gorm:"index"` + //OnlineTs int `gorm:"index"` + OnlineTime time.Time `gorm:"index"` + OfflineType int `gorm:"index"` + //OfflineTs int `gorm:"index"` + OfflineTime time.Time `gorm:"index"` + ChannelId string `gorm:"index"` // 推广渠道 + + DeviceName string `gorm:"index"` + AppVersion string `gorm:"index"` + BuildVersion string `gorm:"index"` + AppChannel string `gorm:"index"` +} diff --git a/statistics/modelmysql/log_login_mid.go b/statistics/modelmysql/log_login_mid.go new file mode 100644 index 0000000..1b1385e --- /dev/null +++ b/statistics/modelmysql/log_login_mid.go @@ -0,0 +1,6 @@ +package modelmysql + +type LogLoginMid struct { + ID uint `gorm:"primaryKey"` + MID string +} diff --git a/statistics/modelmysql/log_mid.go b/statistics/modelmysql/log_mid.go new file mode 100644 index 0000000..ebca072 --- /dev/null +++ b/statistics/modelmysql/log_mid.go @@ -0,0 +1,11 @@ +package modelmysql + +const ( + MidTypeItem = 1 // 道具记录 +) + +type LogMid struct { + ID uint `gorm:"primaryKey"` + Tp int `gorm:"index"` // 类型 + MID string +} diff --git a/statistics/modelmysql/tables.go b/statistics/modelmysql/tables.go new file mode 100644 index 0000000..8f9bd15 --- /dev/null +++ b/statistics/modelmysql/tables.go @@ -0,0 +1,17 @@ +package modelmysql + +// 需要自动迁移的表添加在这里 Tables + +var Tables = []interface{}{ + &LogLogin{}, + &LogLoginMid{}, + &UserAccount{}, + &UserLogin{}, + &UserID{}, + &LogInviteScoreMid{}, + &LogInviteScore{}, + &LogInviteUser{}, + &LogMid{}, + &ItemGain{}, + &ItemTotalGain{}, +} diff --git a/statistics/modelmysql/user_account.go b/statistics/modelmysql/user_account.go new file mode 100644 index 0000000..0d56bbf --- /dev/null +++ b/statistics/modelmysql/user_account.go @@ -0,0 +1,18 @@ +package modelmysql + +import "time" + +type UserAccount struct { + ID uint `gorm:"primaryKey"` + MID string + Snid int `gorm:"index"` + //RegisterTs int `gorm:"index"` + RegisterTime time.Time `gorm:"index"` + ChannelId string `gorm:"index"` // 推广渠道 + + DeviceName string `gorm:"index"` + AppVersion string `gorm:"index"` + BuildVersion string `gorm:"index"` + AppChannel string `gorm:"index"` + Tel string `gorm:"index"` +} diff --git a/statistics/modelmysql/user_id.go b/statistics/modelmysql/user_id.go new file mode 100644 index 0000000..5a3ce33 --- /dev/null +++ b/statistics/modelmysql/user_id.go @@ -0,0 +1,9 @@ +package modelmysql + +/* + 服务定期查询注册和登录信息,然后获取玩家id,保存到这张表中;用于后续触发和玩家相关的数据统计 +*/ + +type UserID struct { + Snid int `gorm:"primaryKey"` +} diff --git a/statistics/modelmysql/user_login.go b/statistics/modelmysql/user_login.go new file mode 100644 index 0000000..4ed6e93 --- /dev/null +++ b/statistics/modelmysql/user_login.go @@ -0,0 +1,29 @@ +package modelmysql + +import "time" + +const ( + OutTypRegister = 1 // 注册 + OutTypeLogin = 2 // 登录 + OutTypeGaming = 3 // 游戏中 + OutTypeGameOver = 4 // 游戏结束 +) + +type UserLogin struct { + ID uint `gorm:"primaryKey"` + Snid int `gorm:"uniqueIndex"` + //OnlineTs int `gorm:"index"` + OnlineTime time.Time `gorm:"index"` + //OfflineTs int `gorm:"index"` + OfflineTime time.Time `gorm:"index"` + OutType int `gorm:"index"` // 跳出类型 + GameID int `gorm:"index"` // 游戏id + Age int + Sex int + DeviceName string `gorm:"index"` + AppVersion string `gorm:"index"` + BuildVersion string `gorm:"index"` + AppChannel string `gorm:"index"` + Tel string `gorm:"index"` + ChannelId string `gorm:"index"` // 推广渠道 +} diff --git a/statistics/mq/handler.go b/statistics/mq/handler.go new file mode 100644 index 0000000..71893fd --- /dev/null +++ b/statistics/mq/handler.go @@ -0,0 +1 @@ +package mq diff --git a/statistics/mq/readme b/statistics/mq/readme new file mode 100644 index 0000000..9c843ee --- /dev/null +++ b/statistics/mq/readme @@ -0,0 +1 @@ +接收消息队列 \ No newline at end of file diff --git a/statistics/static/readme b/statistics/static/readme new file mode 100644 index 0000000..b98bf32 --- /dev/null +++ b/statistics/static/readme @@ -0,0 +1 @@ +业务统计 \ No newline at end of file diff --git a/statistics/static/user_login.go b/statistics/static/user_login.go new file mode 100644 index 0000000..d217e2c --- /dev/null +++ b/statistics/static/user_login.go @@ -0,0 +1,371 @@ +package static + +import ( + "context" + "errors" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "mongo.games.com/goserver/core/logger" + + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" + + mongomodel "mongo.games.com/game/statistics/modelmongo" + mysqlmodel "mongo.games.com/game/statistics/modelmysql" +) + +func getAccountTel(platform string, id int) (string, error) { + acc := &mongomodel.Account{} + cc, err := mymongo.GetUserCollection(platform, mongomodel.UserAccount) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.UserAccount, err) + return "", err + } + dd := cc.FindOne(context.TODO(), bson.M{"snid": id}, options.FindOne().SetProjection(bson.M{"tel": 1})) + err = dd.Err() + if err != nil { + if errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Tracef("getAccountTel %v not found in user_account", id) + return "", nil + } + logger.Logger.Errorf("getAccountTel %v get user_account err: %v", id, err) + return "", err + } + if err := dd.Decode(acc); err != nil { + logger.Logger.Errorf("getAccountTel %v decode user_account err: %v", id, err) + return "", err + } + return acc.Tel, nil +} + +// 游戏结束离开 +func checkGameOver(db *mymysql.Database, login *mysqlmodel.UserLogin, platform string, id int) (bool, error) { + // 最早的一条掉线记录并且是游戏结束离开 + a := &mongomodel.LoginLog{} + c, err := mymongo.GetLogCollection(platform, mongomodel.LogLogin) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.LogLogin, err) + return false, err + } + d := c.FindOne(context.TODO(), bson.M{"snid": id, "logtype": mongomodel.LogTypeDrop, "gameid": 0, "lastgameid": bson.D{{"$gt", 0}}}, + options.FindOne().SetSort(bson.D{{"time", 1}})) + err = d.Err() + if err != nil { + if errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Tracef("checkGameOver %v not found in log_login", id) + return false, nil + } + logger.Logger.Errorf("checkGameOver %v get log_login err: %v", id, err) + return false, err + } + if err := d.Decode(a); err != nil { + logger.Logger.Errorf("checkGameOver %v decode log_login err: %v", id, err) + return false, err + } + + // account tel + tel, err := getAccountTel(platform, id) + if err != nil { + logger.Logger.Warnf("get account tel %v err: %v", id, err) + } + + update := &mysqlmodel.UserLogin{ + //OfflineTs: int(a.Ts), + OfflineTime: a.Time, + OutType: mysqlmodel.OutTypeGameOver, + GameID: a.LastGameID, + Tel: tel, + DeviceName: a.DeviceName, + AppVersion: a.AppVersion, + BuildVersion: a.BuildVersion, + AppChannel: a.AppChannel, + ChannelId: a.ChannelId, + } + + if err := db.Model(login).Select( + "OfflineTime", "OutType", "GameID", "DeviceName", "AppVersion", "BuildVersion", "AppChannel", "Tel", + ).Updates(update).Error; err != nil { + logger.Logger.Errorf("checkLogin %v update user_login err: %v", id, err) + return false, err + } + + return true, nil +} + +// 游戏中离开 +func checkGaming(db *mymysql.Database, login *mysqlmodel.UserLogin, platform string, id int) (bool, error) { + // 最早的一条掉线记录并且是游戏中掉线 + a := &mongomodel.LoginLog{} + c, err := mymongo.GetLogCollection(platform, mongomodel.LogLogin) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.LogLogin, err) + return false, err + } + d := c.FindOne(context.TODO(), bson.M{"snid": id, "logtype": mongomodel.LogTypeDrop, "gameid": bson.D{{"$gt", 0}}}, + options.FindOne().SetSort(bson.D{{"time", 1}})) + err = d.Err() + if err != nil { + if errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Tracef("checkGaming %v not found in log_login", id) + return false, nil + } + logger.Logger.Errorf("checkGaming %v get log_login err: %v", id, err) + return false, err + } + if err := d.Decode(a); err != nil { + logger.Logger.Errorf("checkGaming %v decode log_login err: %v", id, err) + return false, err + } + + // account tel + tel, err := getAccountTel(platform, id) + if err != nil { + logger.Logger.Warnf("get account tel %v err: %v", id, err) + } + + update := &mysqlmodel.UserLogin{ + //OfflineTs: int(a.Ts), + OfflineTime: a.Time, + OutType: mysqlmodel.OutTypeGaming, + GameID: a.GameId, + Tel: tel, + DeviceName: a.DeviceName, + AppVersion: a.AppVersion, + BuildVersion: a.BuildVersion, + AppChannel: a.AppChannel, + ChannelId: a.ChannelId, + } + + if err := db.Model(login).Select( + "OfflineTime", "OutType", "GameID", "DeviceName", "AppVersion", "BuildVersion", "AppChannel", "Tel", + ).Updates(update).Error; err != nil { + logger.Logger.Errorf("checkLogin %v update user_login err: %v", id, err) + return false, err + } + + return true, nil +} + +// 登录后离开 +func checkLogin(db *mymysql.Database, login *mysqlmodel.UserLogin, platform string, id int) (bool, error) { + // 最早的一条掉线记录 + a := &mongomodel.LoginLog{} + c, err := mymongo.GetLogCollection(platform, mongomodel.LogLogin) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.LogLogin, err) + return false, err + } + d := c.FindOne(context.TODO(), bson.M{"snid": id, "logtype": mongomodel.LogTypeDrop}, options.FindOne().SetSort(bson.D{{"time", 1}})) + err = d.Err() + if err != nil { + if errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Tracef("checkLogin %v not found in log_login", id) + return false, nil + } + logger.Logger.Errorf("checkLogin %v get log_login err: %v", id, err) + return false, err + } + if err := d.Decode(a); err != nil { + logger.Logger.Errorf("checkLogin %v decode log_login err: %v", id, err) + return false, err + } + + // account tel + tel, err := getAccountTel(platform, id) + if err != nil { + logger.Logger.Warnf("get account tel %v err: %v", id, err) + } + + update := &mysqlmodel.UserLogin{ + //OfflineTs: int(a.Ts), + OfflineTime: a.Time, + OutType: mysqlmodel.OutTypeLogin, + Tel: tel, + DeviceName: a.DeviceName, + AppVersion: a.AppVersion, + BuildVersion: a.BuildVersion, + AppChannel: a.AppChannel, + ChannelId: a.ChannelId, + } + + if err := db.Model(login).Select( + "OfflineTime", "OutType", "DeviceName", "AppVersion", "BuildVersion", "AppChannel", "Tel", + ).Updates(update).Error; err != nil { + logger.Logger.Errorf("checkLogin %v update user_login err: %v", id, err) + return false, err + } + + return true, nil +} + +// 注册后离开 +func checkRegister(db *mymysql.Database, login *mysqlmodel.UserLogin, platform string, id int) (bool, error) { + a := &mongomodel.Account{} + c, err := mymongo.GetUserCollection(platform, mongomodel.UserAccount) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.UserAccount, err) + return false, err + } + d := c.FindOne(context.TODO(), bson.M{"snid": id}) + err = d.Err() + if err != nil { + if errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Warnf("checkRegister %v not found in user_account", id) + return false, nil + } + logger.Logger.Errorf("checkRegister %v get user_account err: %v", id, err) + return false, err + } + if err := d.Decode(a); err != nil { + logger.Logger.Errorf("checkRegister %v decode user_account err: %v", id, err) + return false, err + } + + // account tel + tel, err := getAccountTel(platform, id) + if err != nil { + logger.Logger.Warnf("get account tel %v err: %v", id, err) + } + + login.Snid = id + //login.OnlineTs = int(a.RegisterTs) + login.OnlineTime = a.RegisteTime + //login.OfflineTs = int(a.RegisterTs) + login.OfflineTime = a.RegisteTime + login.OutType = mysqlmodel.OutTypRegister + login.Tel = tel + login.DeviceName = a.DeviceName + login.AppVersion = a.AppVersion + login.BuildVersion = a.BuildVersion + login.AppChannel = a.AppChannel + login.ChannelId = a.ChannelId + + if err := db.Create(login).Error; err != nil { + logger.Logger.Errorf("checkRegister create err: %v", err) + return false, err + } + return true, nil +} + +// UserLogin 玩家跳出统计 +func UserLogin(platform string, ids []*mysqlmodel.UserID) error { + f := func(id int) error { + // 玩家是否已经统计结束,已经是游戏结束状态 + login := &mysqlmodel.UserLogin{} + db, err := mymysql.GetDatabase(platform) + if err != nil { + logger.Logger.Errorf("UserLogin get db err: %v", err) + return err + } + if err = db.Where("snid = ?", id).Find(login).Error; err != nil { + logger.Logger.Errorf("UserLogin find %v err: %v", id, err) + return err + } + + switch login.OutType { + case mysqlmodel.OutTypeGameOver: + return nil + + case mysqlmodel.OutTypeGaming: + _, err := checkGameOver(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGameOver %v err: %v", id, err) + return err + } + return nil + + case mysqlmodel.OutTypeLogin: + ret, err := checkGameOver(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGameOver %v err: %v", id, err) + return err + } + if ret { + return nil + } + ret, err = checkGaming(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGaming %v err: %v", id, err) + return err + } + if ret { + return nil + } + + case mysqlmodel.OutTypRegister: + ret, err := checkGameOver(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGameOver %v err: %v", id, err) + return err + } + if ret { + return nil + } + ret, err = checkGaming(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGaming %v err: %v", id, err) + return err + } + if ret { + return nil + } + ret, err = checkLogin(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkLogin %v err: %v", id, err) + return err + } + if ret { + return nil + } + + default: + ret, err := checkRegister(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkRegister %v err: %v", id, err) + return err + } + if !ret { + logger.Logger.Warnf("UserLogin not found user_account checkRegister %v err: %v", id, err) + return nil + } + + ret, err = checkGameOver(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGameOver %v err: %v", id, err) + return err + } + if ret { + return nil + } + ret, err = checkGaming(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkGaming %v err: %v", id, err) + return err + } + if ret { + return nil + } + ret, err = checkLogin(db, login, platform, id) + if err != nil { + logger.Logger.Errorf("UserLogin checkLogin %v err: %v", id, err) + return err + } + if ret { + return nil + } + return nil + } + + return nil + } + + for _, v := range ids { + if err := f(v.Snid); err != nil { + return err + } + } + + return nil +} diff --git a/statistics/syn/datasync.go b/statistics/syn/datasync.go new file mode 100644 index 0000000..8f94fc7 --- /dev/null +++ b/statistics/syn/datasync.go @@ -0,0 +1,102 @@ +package syn + +import ( + "context" + "errors" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "gorm.io/gorm" + "mongo.games.com/goserver/core/logger" + + mysqlmodel "mongo.games.com/game/statistics/modelmysql" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" +) + +// Data 数据同步方法 +// T mongodb数据表结构 +// F mongodb中的每条数据的处理操作,自行实现 +type Data[T any] struct { + Platform string // 平台 + MidType int // 数据类型 例如 modelmysql.MidTypeItem + Database string // 库名称 + CollectionName string // 集合名称 + BatchSize int // 一次读取数量 + // F 自定义数据处理方法 + // data: mongodb中的一条日志 + F func(data *T, db *gorm.DB) (string, error) +} + +// CommonDone 数据获取方式,根据mongodb集合主键按时间顺序批量读取 +func (d *Data[T]) CommonDone() error { + db, err := mymysql.GetDatabase(d.Platform) + if err != nil { + logger.Logger.Errorf("mysql: failed to get database: %v", err) + return err + } + loginMID := &mysqlmodel.LogMid{Tp: d.MidType} + var n int64 + err = db.Model(&mysqlmodel.LogMid{}).Find(loginMID).Count(&n).Error + if err != nil { + logger.Logger.Errorf("mysql: failed to get log_mid: %v", err) + return err + } + if n == 0 { + if err = db.Create(loginMID).Error; err != nil { + logger.Logger.Errorf("mysql: failed to create log_mid: %v", err) + return err + } + } + + logger.Logger.Tracef("start log_mid tp:%v _id:%v", loginMID.Tp, loginMID.MID) + + _id, _ := primitive.ObjectIDFromHex(loginMID.MID) + filter := bson.M{"_id": bson.M{"$gt": _id}} + c, err := mymongo.GetCollection(d.Platform, mymongo.DatabaseType(d.Database), d.CollectionName) + if err != nil { + logger.Logger.Errorf("get collection %s %s error %v", d.Database, d.CollectionName, err) + return err + } + l, err := c.Find(context.TODO(), filter, + options.Find().SetSort(bson.D{primitive.E{Key: "_id", Value: 1}}), options.Find().SetLimit(int64(d.BatchSize))) + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Errorf("mongo: failed to get %v: %v", d.CollectionName, err) + return err + } + + var logs []*T + if err = l.All(context.TODO(), &logs); err != nil { + l.Close(context.TODO()) + if errors.Is(err, mongo.ErrNoDocuments) { + return nil + } + + logger.Logger.Errorf("mongo: failed to get %v: %v", d.CollectionName, err) + return err + } + l.Close(context.TODO()) + if len(logs) == 0 { + logger.Logger.Infof("sync %v finished", d.CollectionName) + return nil + } + + err = db.Transaction(func(tx *gorm.DB) error { + for _, v := range logs { + loginMID.MID, err = d.F(v, tx) + if err != nil { + logger.Logger.Errorf("Process %v error:%v", d.CollectionName, err) + return err + } + if err = tx.Model(loginMID).Updates(loginMID).Error; err != nil { + logger.Logger.Errorf("mysql: failed to update %v log_mid: %v", d.CollectionName, err) + return err + } + } + return nil + }) + + return err +} diff --git a/statistics/syn/log_invitescore.go b/statistics/syn/log_invitescore.go new file mode 100644 index 0000000..1531469 --- /dev/null +++ b/statistics/syn/log_invitescore.go @@ -0,0 +1,291 @@ +package syn + +import ( + "context" + "errors" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "gorm.io/gorm" + + "mongo.games.com/game/statistics/constant" + mongomodel "mongo.games.com/game/statistics/modelmongo" + mysqlmodel "mongo.games.com/game/statistics/modelmysql" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" +) + +func SyncInviteScore(platform string, batchSize int) error { + db, err := mymysql.GetDatabase(platform) + if err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to get database: %v", err) + return err + } + inviteMID := &mysqlmodel.LogInviteScoreMid{ID: 1} + var n int64 + err = db.Model(&mysqlmodel.LogInviteScoreMid{}).Find(inviteMID).Count(&n).Error + if err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to get log_invitescore_mid: %v", err) + return err + } + if n == 0 { + if err = db.Create(inviteMID).Error; err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to create log_invitescore_mid: %v", err) + return err + } + } + + logger.Logger.Tracef("start SyncInviteScore log_invitescore _id:%v", inviteMID.MID) + + _id, _ := primitive.ObjectIDFromHex(inviteMID.MID) + filter := bson.M{"_id": bson.M{"$gt": _id}} + c, err := mymongo.GetLogCollection(platform, mongomodel.LogInviteScore) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.LogInviteScore, err) + return err + } + l, err := c.Find(context.TODO(), filter, + options.Find().SetSort(bson.D{primitive.E{Key: "_id", Value: 1}}), options.Find().SetLimit(int64(batchSize))) + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Errorf("mongo: SyncInviteScore failed to get log_invitescore: %v", err) + return err + } + + var logs []*mongomodel.InviteScore + if err = l.All(context.TODO(), &logs); err != nil { + l.Close(context.TODO()) + if errors.Is(err, mongo.ErrNoDocuments) { + return err + } + + logger.Logger.Errorf("mongo: SyncInviteScore failed to get log_invitescore: %v", err) + return err + } + l.Close(context.TODO()) + + getPSnId := func(tx *gorm.DB, snid int) (int, error) { + if snid <= 0 { + return 0, nil + } + ret := new(mysqlmodel.LogInviteUser) + if err = tx.First(ret, "snid = ? and level = 1", snid).Error; err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Errorf("mysql: SyncInviteScore failed to getPSnId: %v", err) + return 0, err + } + return ret.Psnid, nil + } + + getDownSnId := func(tx *gorm.DB, snid []int) ([]int, error) { + if len(snid) == 0 { + return nil, nil + } + var ret []int + var us []*mysqlmodel.LogInviteUser + if err = tx.Select("snid").Where("psnid IN ? AND level = 1", snid).Find(&us).Error; err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Errorf("mysql: SyncInviteScore failed to getDownSnId: %v", err) + return ret, err + } + for _, v := range us { + ret = append(ret, v.Snid) + } + return ret, nil + } + + bind := func(tx *gorm.DB, psnid, snid int, ts int) ([]*mysqlmodel.LogInviteUser, error) { + var lu []*mysqlmodel.LogInviteUser + var a1, a2, a3, a4, b1 int + var b2, b3, b4 []int + a4 = psnid + a3, err = getPSnId(tx, a4) + if err != nil { + return nil, err + } + a2, err = getPSnId(tx, a3) + if err != nil { + return nil, err + } + a1, err = getPSnId(tx, a2) + if err != nil { + return nil, err + } + b1 = snid + b2, err = getDownSnId(tx, []int{b1}) + if err != nil { + return nil, err + } + b3, err = getDownSnId(tx, b2) + if err != nil { + return nil, err + } + b4, err = getDownSnId(tx, b3) + if err != nil { + return nil, err + } + logger.Logger.Tracef("a1:%d, a2:%d, a3:%d, a4:%d, b1:%d, b2:%v, b3:%v, b4:%v", a1, a2, a3, a4, b1, b2, b3, b4) + if a1 > 0 { + if b1 > 0 { + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a1, + Snid: b1, + Level: 4, + Ts: ts, + }) + logger.Logger.Tracef("a1: %v %v %v", b1, 4, ts) + } + } + if a2 > 0 { + if b1 > 0 { + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a2, + Snid: b1, + Level: 3, + Ts: ts, + }) + logger.Logger.Tracef("a2: %v %v %v", b1, 3, ts) + } + for _, v := range b2 { + if v <= 0 { + continue + } + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a2, + Snid: v, + Level: 4, + Ts: ts, + }) + logger.Logger.Tracef("a2: %v %v %v", v, 4, ts) + } + } + if a3 > 0 { + if b1 > 0 { + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a3, + Snid: b1, + Level: 2, + Ts: ts, + }) + logger.Logger.Tracef("a3: %v %v %v", b1, 2, ts) + } + for _, v := range b2 { + if v <= 0 { + continue + } + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a3, + Snid: v, + Level: 3, + Ts: ts, + }) + logger.Logger.Tracef("a3: %v %v %v", v, 3, ts) + } + for _, v := range b3 { + if v <= 0 { + continue + } + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a3, + Snid: v, + Level: 4, + Ts: ts, + }) + logger.Logger.Tracef("a3: %v %v %v", v, 4, ts) + } + } + if a4 > 0 { + if b1 > 0 { + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a4, + Snid: b1, + Level: 1, + Ts: ts, + }) + logger.Logger.Tracef("a4: %v %v %v", b1, 1, ts) + } + for _, v := range b2 { + if v <= 0 { + continue + } + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a4, + Snid: v, + Level: 2, + Ts: ts, + }) + logger.Logger.Tracef("a4: %v %v %v", v, 2, ts) + } + for _, v := range b3 { + if v <= 0 { + continue + } + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a4, + Snid: v, + Level: 3, + Ts: ts, + }) + logger.Logger.Tracef("a4: %v %v %v", v, 3, ts) + } + for _, v := range b4 { + if v <= 0 { + continue + } + lu = append(lu, &mysqlmodel.LogInviteUser{ + Psnid: a4, + Snid: v, + Level: 4, + Ts: ts, + }) + logger.Logger.Tracef("a4: %v %v %v", v, 4, ts) + } + } + return lu, nil + } + + for _, v := range logs { + err = db.Transaction(func(tx *gorm.DB) error { + inviteMID.MID = v.Id.Hex() + if err = tx.Model(inviteMID).Updates(inviteMID).Error; err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to update log_invitescore_mid: %v", err) + return err + } + + err = tx.Save(&mysqlmodel.LogInviteScore{ + UpSnid: v.UpSnid, + DownSnid: v.DownSnid, + Level: v.Level, + Tp: v.Tp, + Rate: v.Rate, + Score: v.Score, + Money: v.Money, + Ts: v.Ts, + }).Error + if err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to insert: %v", err) + return err + } + + if v.Tp == constant.InviteScoreTypeBind && v.Level == 0 { + // 绑定关系 + lu, err := bind(tx, v.UpSnid, v.DownSnid, v.Ts) + if err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to bind: %v", err) + return err + } + if err = tx.CreateInBatches(lu, len(lu)).Error; err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to create log_invite_user: %v", err) + return err + } + } + + return nil + }) + if err != nil { + logger.Logger.Errorf("mysql: SyncInviteScore failed to transaction: %v", err) + return err + } + } + return nil +} diff --git a/statistics/syn/log_itemgain.go b/statistics/syn/log_itemgain.go new file mode 100644 index 0000000..4751255 --- /dev/null +++ b/statistics/syn/log_itemgain.go @@ -0,0 +1,61 @@ +package syn + +import ( + "errors" + "time" + + "gorm.io/gorm" + "mongo.games.com/goserver/core/mongox" + + mongomodel "mongo.games.com/game/statistics/modelmongo" + mysqlmodel "mongo.games.com/game/statistics/modelmysql" +) + +func ItemGainDone(data *Data[mongomodel.ItemLog]) error { + data.MidType = mysqlmodel.MidTypeItem + data.Database = string(mongox.DatabaseLog) + data.CollectionName = mongomodel.LogItem + data.F = func(data *mongomodel.ItemLog, db *gorm.DB) (string, error) { + if data == nil || data.LogId.Hex() == "" { + return "", errors.New("null") + } + if data.LogType != 0 || data.Id != "" { + return data.LogId.Hex(), nil + } + + hourTime := time.Unix(data.CreateTs, 0).Local() + hourTs := time.Date(hourTime.Year(), hourTime.Month(), hourTime.Day(), hourTime.Hour(), 0, 0, 0, time.Local).Unix() + + item := &mysqlmodel.ItemGain{} + err := db.Model(item).Where("hour = ? and item_id = ?", hourTs, data.ItemId).First(item).Error + if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + return "", err + } + item.Hour = hourTs + item.ItemId = data.ItemId + item.ItemNum += data.Count + if item.ID == 0 { + err = db.Create(item).Error + } else { + err = db.Model(item).Updates(item).Error + } + if err != nil { + return "", err + } + + itemTotal := &mysqlmodel.ItemTotalGain{} + err = db.Model(itemTotal).Where("item_id = ?", data.ItemId).First(itemTotal).Error + if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + return "", err + } + itemTotal.ItemId = data.ItemId + itemTotal.ItemNum += data.Count + if itemTotal.ID == 0 { + err = db.Create(itemTotal).Error + } else { + err = db.Model(itemTotal).Updates(itemTotal).Error + } + return data.LogId.Hex(), err + } + return data.CommonDone() +} diff --git a/statistics/syn/log_login.go b/statistics/syn/log_login.go new file mode 100644 index 0000000..7f338e1 --- /dev/null +++ b/statistics/syn/log_login.go @@ -0,0 +1,181 @@ +package syn + +import ( + "context" + "errors" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "gorm.io/gorm" + + mongomodel "mongo.games.com/game/statistics/modelmongo" + mysqlmodel "mongo.games.com/game/statistics/modelmysql" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" +) + +/* + 登录日志同步使用了mongo的_id,从小到大每次同步n个 +*/ + +// LogLogin 同步登录日志 +func LogLogin(platform string, batchSize int) ([]*mysqlmodel.LogLogin, error) { + db, err := mymysql.GetDatabase(platform) + if err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to get database: %v", err) + return nil, err + } + loginMID := &mysqlmodel.LogLoginMid{ID: 1} + var n int64 + err = db.Model(&mysqlmodel.LogLoginMid{}).Find(loginMID).Count(&n).Error + if err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to get log_login_mid: %v", err) + return nil, err + } + if n == 0 { + if err = db.Create(loginMID).Error; err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to create log_login_mid: %v", err) + return nil, err + } + } + + logger.Logger.Tracef("start SyncLogLogin log_login _id:%v", loginMID.MID) + + _id, _ := primitive.ObjectIDFromHex(loginMID.MID) + filter := bson.M{"_id": bson.M{"$gt": _id}} + c, err := mymongo.GetLogCollection(platform, mongomodel.LogLogin) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.LogLogin, err) + return nil, err + } + l, err := c.Find(context.TODO(), filter, + options.Find().SetSort(bson.D{primitive.E{Key: "_id", Value: 1}}), options.Find().SetLimit(int64(batchSize))) + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Errorf("mongo: SyncLogLogin failed to get log_login: %v", err) + return nil, err + } + + var logs []*mongomodel.LoginLog + if err = l.All(context.TODO(), &logs); err != nil { + l.Close(context.TODO()) + if errors.Is(err, mongo.ErrNoDocuments) { + return nil, nil + } + + logger.Logger.Errorf("mongo: SyncLogLogin failed to get loginlog: %v", err) + return nil, err + } + l.Close(context.TODO()) + + var ls []*mysqlmodel.LogLogin + for _, v := range logs { + logger.Logger.Tracef("mongo SyncLogLogin log_login: %+v", *v) + var e *mysqlmodel.LogLogin + switch v.LogType { + case mongomodel.LogTypeLogin, mongomodel.LogTypeRehold: + onlineType := mysqlmodel.LogTypeLogin + if v.LogType == mongomodel.LogTypeRehold { + onlineType = mysqlmodel.LogTypeRehold + } + + // 创建数据 + var n int64 + if err = db.Model(&mysqlmodel.LogLogin{}).Where("snid = ? AND online_type = ? AND online_time = ?", + v.SnId, onlineType, v.Time).Count(&n).Error; err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to get log_login count: %v", err) + return ls, err + } + + if n == 0 { + e = &mysqlmodel.LogLogin{ + Snid: int(v.SnId), + OnlineType: onlineType, + //OnlineTs: int(v.Ts), + OnlineTime: v.Time, + OfflineType: 0, + //OfflineTs: 0, + OfflineTime: v.Time, + DeviceName: v.DeviceName, + AppVersion: v.AppVersion, + BuildVersion: v.BuildVersion, + AppChannel: v.AppChannel, + ChannelId: v.ChannelId, + } + if err = db.Create(e).Error; err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to create log_login: %v", err) + return ls, err + } + } else { + continue + } + + case mongomodel.LogTypeLogout, mongomodel.LogTypeDrop: + // 修改数据 + e = &mysqlmodel.LogLogin{} + err = db.Model(&mysqlmodel.LogLogin{}).Where("snid = ?", v.SnId).Order("online_time DESC").First(e).Error + if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Errorf("mysql: SyncLogLogin failed to find log_login: %v", err) + return ls, err + } + + if errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Warnf("mysql: SyncLogLogin not found log_login: %v", v) + continue + } + + if e.OfflineType != 0 { + logger.Logger.Tracef("mysql: SyncLogLogin already offline: %+v", *e) + continue + } + + e.OfflineType = mysqlmodel.LogTypeOffline + //e.OfflineTs = int(v.Ts) + e.OfflineTime = v.Time + if err = db.Model(e).Select("OfflineType", "OfflineTime").Updates(e).Error; err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to update log_login: %v", err) + return ls, err + } + default: + continue + } + + if e != nil { + ls = append(ls, e) + } + } + + if len(logs) > 0 { + err = db.Transaction(func(tx *gorm.DB) error { + loginMID.MID = logs[len(logs)-1].LogId.Hex() + if err = tx.Model(loginMID).Updates(loginMID).Error; err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to update log_login_mid: %v", err) + return err + } + + for _, v := range ls { + if err = tx.First(&mysqlmodel.UserID{}, "snid = ?", v.Snid).Error; err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Errorf("mysql: SyncLogLogin failed to find user_id: %v", err) + return err + } + + if errors.Is(err, gorm.ErrRecordNotFound) { + if err = tx.Create(&mysqlmodel.UserID{Snid: v.Snid}).Error; err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to create user_id: %v", err) + return err + } + } + } + + return nil + }) + if err != nil { + logger.Logger.Errorf("mysql: SyncLogLogin failed to transaction: %v", err) + return nil, err + } + } + + return ls, nil +} diff --git a/statistics/syn/readme b/statistics/syn/readme new file mode 100644 index 0000000..37acc1c --- /dev/null +++ b/statistics/syn/readme @@ -0,0 +1 @@ +游戏服mongodb同步到mysql \ No newline at end of file diff --git a/statistics/syn/user_account.go b/statistics/syn/user_account.go new file mode 100644 index 0000000..72b1c52 --- /dev/null +++ b/statistics/syn/user_account.go @@ -0,0 +1,105 @@ +package syn + +import ( + "context" + "errors" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "gorm.io/gorm" + + mongomodel "mongo.games.com/game/statistics/modelmongo" + mysqlmodel "mongo.games.com/game/statistics/modelmysql" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" +) + +/* + 注册信息同步,使用mongo的_id,从小到大每次同步n个 +*/ + +// UserAccount 同步注册表 +func UserAccount(platform string, batchSize int) ([]*mysqlmodel.UserAccount, error) { + db, err := mymysql.GetDatabase(platform) + if err != nil { + logger.Logger.Errorf("mysql: UserAccount failed to get database: %v", err) + return nil, err + } + account := &mysqlmodel.UserAccount{} + err = db.Model(&mysqlmodel.UserAccount{}).Last(account).Error + if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Errorf("mysql: UserAccount failed to get account: %v", err) + return nil, err + } + + logger.Logger.Tracef("start UserAccount account _id:%v", account.MID) + + _id, _ := primitive.ObjectIDFromHex(account.MID) + filter := bson.M{"_id": bson.M{"$gt": _id}} + c, err := mymongo.GetUserCollection(platform, mongomodel.UserAccount) + if err != nil { + logger.Logger.Errorf("get collection %s error %v", mongomodel.UserAccount, err) + return nil, err + } + l, err := c.Find(context.TODO(), filter, + options.Find().SetSort(bson.D{primitive.E{Key: "_id", Value: 1}}), options.Find().SetLimit(int64(batchSize))) + if err != nil && !errors.Is(err, mongo.ErrNoDocuments) { + logger.Logger.Errorf("mongo: UserAccount failed to get account: %v", err) + return nil, err + } + + var accounts []*mongomodel.Account + if err = l.All(context.TODO(), &accounts); err != nil { + l.Close(context.TODO()) + if errors.Is(err, mongo.ErrNoDocuments) { + return nil, nil + } + + logger.Logger.Errorf("mongo: UserAccount failed to get account: %v", err) + return nil, err + } + l.Close(context.TODO()) + + var as []*mysqlmodel.UserAccount + err = db.Transaction(func(tx *gorm.DB) error { + for _, v := range accounts { + logger.Logger.Tracef("mongo account: %+v", *v) + a := &mysqlmodel.UserAccount{ + MID: v.AccountId.Hex(), + Snid: int(v.SnId), + //RegisterTs: int(v.RegisterTs), + RegisterTime: v.RegisteTime, + Tel: v.Tel, + ChannelId: v.ChannelId, + } + + if err = tx.Create(a).Error; err != nil { + logger.Logger.Errorf("mysql: UserAccount failed to create account: %v", err) + return err + } + + if err = tx.First(&mysqlmodel.UserID{}, "snid = ?", v.SnId).Error; err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { + logger.Logger.Errorf("mysql: UserAccount failed to find user_id: %v", err) + return err + } + + if errors.Is(err, gorm.ErrRecordNotFound) { + if err = tx.Create(&mysqlmodel.UserID{Snid: int(v.SnId)}).Error; err != nil { + logger.Logger.Errorf("mysql: UserAccount failed to create user_id: %v", err) + return err + } + } + + as = append(as, a) + } + return nil + }) + if err != nil { + logger.Logger.Errorf("mysql: UserAccount failed to transaction: %v", err) + return as, err + } + return as, nil +} diff --git a/statistics/task/build_linux.bat b/statistics/task/build_linux.bat new file mode 100644 index 0000000..0cc7a25 --- /dev/null +++ b/statistics/task/build_linux.bat @@ -0,0 +1,5 @@ +set CGO_ENABLED=0 +set GOOS=linux +set GOARCH=amd64 +go build -o ./task2 +pause \ No newline at end of file diff --git a/statistics/task/etc/DB_GameFree.dat b/statistics/task/etc/DB_GameFree.dat new file mode 100644 index 0000000..9ed5700 Binary files /dev/null and b/statistics/task/etc/DB_GameFree.dat differ diff --git a/statistics/task/etc/config.yaml b/statistics/task/etc/config.yaml new file mode 100644 index 0000000..dc134c6 --- /dev/null +++ b/statistics/task/etc/config.yaml @@ -0,0 +1,221 @@ +StartTime: "2024-11-26T00:00:00+08:00" +EndTime: "2024-11-27T00:00:00+08:00" + +Switch: # 1: open, 0: close + - 0 # 新用户游戏破产率 + - 0 # 新用户平均游戏时长 + - 0 # 新用户平均局数 + - 0 # 平均倍数 + - 1 # 活跃破产率 + - 1 # 控输赢胜率 + - 1 # 机器人胜率 + - 1 # 人均获得金币 + - 1 # 破产后离线 + - 1 # 充值玩家金币余额 + +Gamefreeids: + - 2070001 + - 2070002 + - 2070003 + - 2080001 + - 2080002 + - 2080003 + - 2090001 + - 2090002 + - 2090003 + - 2100001 + - 2100002 + - 2100003 + - 2400001 + - 2400002 + - 2400003 + - 2400004 + - 2400005 + - 2400006 + - 2440001 + - 2440002 + - 2440003 + - 2440004 + - 2440005 + - 2440006 + - 2410001 + - 2410002 + - 2410003 + - 2410004 + - 2410005 + - 2410006 + - 2450001 + - 2450002 + - 2450003 + - 2450004 + - 2450005 + - 2450006 + - 2420001 + - 2420002 + - 2420003 + - 2420004 + - 2420005 + - 2420006 + - 2460001 + - 2460002 + - 2460003 + - 2460004 + - 2460005 + - 2460006 + - 2430001 + - 2430002 + - 2430003 + - 2430004 + - 2430005 + - 2430006 + - 2470001 + - 2470002 + - 2470003 + - 2470004 + - 2470005 + - 2470006 + - 2150001 + - 2160001 + - 2170001 + - 2180001 + - 5210001 + - 5210002 + - 5210003 + - 5210004 + - 5210005 + - 2110001 + - 2110002 + - 2110003 + - 2110004 + - 2110005 + - 2110006 + - 2120001 + - 2120002 + - 2120003 + - 2120004 + - 2120005 + - 2120006 + - 2130001 + - 2130002 + - 2130003 + - 2140001 + - 2140002 + - 2140003 + - 6070001 + - 3010001 + - 3010002 + - 3010003 + - 3010004 + - 3020001 + - 3020002 + - 3020003 + - 3020004 + - 3030001 + - 3030002 + - 3030003 + - 3030004 + - 3040001 + - 3040002 + - 3040003 + - 3050001 + - 3050002 + - 3050003 + - 3060001 + - 3060002 + - 3060003 + - 3060004 + - 3070001 + - 3070002 + - 3070003 + - 3070004 + - 3080001 + - 3090001 + - 3100001 + - 3110001 + - 3120001 + +Tienlen: + - 2070001 + - 2070002 + - 2070003 + - 2080001 + - 2080002 + - 2080003 + - 2090001 + - 2090002 + - 2090003 + - 2100001 + - 2100002 + - 2100003 + - 2400001 + - 2400002 + - 2400003 + - 2400004 + - 2400005 + - 2400006 + - 2440001 + - 2440002 + - 2440003 + - 2440004 + - 2440005 + - 2440006 + - 2410001 + - 2410002 + - 2410003 + - 2410004 + - 2410005 + - 2410006 + - 2450001 + - 2450002 + - 2450003 + - 2450004 + - 2450005 + - 2450006 + - 2420001 + - 2420002 + - 2420003 + - 2420004 + - 2420005 + - 2420006 + - 2460001 + - 2460002 + - 2460003 + - 2460004 + - 2460005 + - 2460006 + - 2430001 + - 2430002 + - 2430003 + - 2430004 + - 2430005 + - 2430006 + - 2470001 + - 2470002 + - 2470003 + - 2470004 + - 2470005 + - 2470006 + + +Thirteen: + - 2110001 + - 2110002 + - 2110003 + - 2110004 + - 2110005 + - 2110006 + - 2120001 + - 2120002 + - 2120003 + - 2120004 + - 2120005 + - 2120006 + - 2130001 + - 2130002 + - 2130003 + - 2140001 + - 2140002 + - 2140003 + + + diff --git a/statistics/task/etc/mongo.yaml b/statistics/task/etc/mongo.yaml new file mode 100644 index 0000000..7f9e42d --- /dev/null +++ b/statistics/task/etc/mongo.yaml @@ -0,0 +1,53 @@ +global: + user: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_global + Username: + Password: + Options: + log: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_log + Username: + Password: + Options: + monitor: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_monitor + Username: + Password: + Options: +platforms: + 0: + user: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_user_plt_000 + Username: + Password: + Options: + log: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_log_plt_000 + Username: + Password: + Options: + 1: + user: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_user_plt_001 + Username: + Password: + Options: + log: + HostName: 127.0.0.1 + HostPort: 27017 + Database: win88_log_plt_001 + Username: + Password: + Options: \ No newline at end of file diff --git a/statistics/task/etc/mysql.yaml b/statistics/task/etc/mysql.yaml new file mode 100644 index 0000000..82d1fe3 --- /dev/null +++ b/statistics/task/etc/mysql.yaml @@ -0,0 +1,38 @@ +platforms: + global: + HostName: 127.0.0.1 + HostPort: 3306 + Database: win88_user + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + 0: + HostName: 127.0.0.1 + HostPort: 3306 + Database: win88_plt_000 + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + 1: + HostName: 127.0.0.1 + HostPort: 3306 + Database: win88_plt_001 + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + count: # 破产日志库 + HostName: 127.0.0.1 + HostPort: 3306 + Database: dbmis_count + Username: root + Password: 123456 + Options: charset=utf8mb4&parseTime=True&loc=Local + +# 最大空闲连接数 +MaxIdleConns: 10 +# 最大连接数 +MaxOpenConns: 100 +# 连接可复用的最大时间 +ConnMaxLifetime: 3600 +# 连接最大空闲时间 +ConnMaxIdletime: 0 \ No newline at end of file diff --git a/statistics/task/excelmgr.go b/statistics/task/excelmgr.go new file mode 100644 index 0000000..f324bb5 --- /dev/null +++ b/statistics/task/excelmgr.go @@ -0,0 +1,88 @@ +package main + +import ( + "fmt" + "github.com/xuri/excelize/v2" +) + +type ExcelData struct { + *excelize.File + Head []string + Index int + IndexCell int +} + +func (e *ExcelData) SetHead(head []string) *ExcelData { + if e == nil { + return nil + } + e.Index = 1 + e.SetSheetRow("Sheet1", "A1", &head) + return e +} + +func (e *ExcelData) SetRow(row []string) *ExcelData { + if e == nil { + return nil + } + e.Index++ + e.SetSheetRow("Sheet1", "A"+fmt.Sprintf("%d", e.Index), &row) + return e +} + +func (e *ExcelData) SetCell(val interface{}) *ExcelData { + if e == nil { + return nil + } + e.IndexCell++ + cell := fmt.Sprintf("%c%d", 'A'+e.IndexCell-1, e.Index) + e.SetCellValue("Sheet1", cell, val) + return e +} + +func (e *ExcelData) NewLine() *ExcelData { + if e == nil { + return nil + } + e.Index++ + e.IndexCell = 0 + return e +} + +type ExcelMgr struct { + List map[int]*ExcelData +} + +func NewExcelMgr() *ExcelMgr { + return &ExcelMgr{ + List: make(map[int]*ExcelData), + } +} + +func (e *ExcelMgr) Register(id int, head []string) *ExcelData { + e.List[id] = &ExcelData{ + File: excelize.NewFile(), + Head: head, + Index: 0, + } + + e.List[id].NewSheet("Sheet1") + + if len(head) > 0 { + e.List[id].SetHead(head) + } + + return e.List[id] +} + +func (e *ExcelMgr) Get(id int) *ExcelData { + return e.List[id] +} + +func (e *ExcelMgr) Save(id int, fileName string) error { + d := e.List[id] + if d == nil { + return nil + } + return d.SaveAs(fileName) +} diff --git a/statistics/task/gamefree/db_gamefree.go b/statistics/task/gamefree/db_gamefree.go new file mode 100644 index 0000000..81d8b55 --- /dev/null +++ b/statistics/task/gamefree/db_gamefree.go @@ -0,0 +1,77 @@ +package gamefree + +import ( + "google.golang.org/protobuf/proto" + "mongo.games.com/game/protocol/server" + "os" +) + +func init() { + buf, err := os.ReadFile("./etc/DB_GameFree.dat") + if err != nil { + panic(err) + } + err = PBDB_GameFreeMgr.unmarshal(buf) + if err != nil { + panic(err) + } +} + +var PBDB_GameFreeMgr = &DB_GameFreeMgr{ + Datas: &server.DB_GameFreeArray{}, + pool: make(map[int32]*server.DB_GameFree), +} + +type DB_GameFreeMgr struct { + Datas *server.DB_GameFreeArray + pool map[int32]*server.DB_GameFree +} + +func (this *DB_GameFreeMgr) unmarshal(data []byte) error { + err := proto.Unmarshal(data, this.Datas) + if err == nil { + this.arrangeData() + } + return err +} + +func (this *DB_GameFreeMgr) reunmarshal(data []byte) error { + newDatas := &server.DB_GameFreeArray{} + 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_GameFreeMgr) 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_GameFreeMgr) GetData(id int32) *server.DB_GameFree { + if data, ok := this.pool[id]; ok { + return data + } + return nil +} diff --git a/statistics/task/logger.xml b/statistics/task/logger.xml new file mode 100644 index 0000000..f6eb37b --- /dev/null +++ b/statistics/task/logger.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/statistics/task/main.go b/statistics/task/main.go new file mode 100644 index 0000000..bb555b8 --- /dev/null +++ b/statistics/task/main.go @@ -0,0 +1,427 @@ +package main + +import ( + "fmt" + "sort" + "time" + + "github.com/spf13/viper" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/mongox" + "mongo.games.com/goserver/core/mysqlx" + "mongo.games.com/goserver/core/viperx" + + "mongo.games.com/game/statistics/task/gamefree" + "mongo.games.com/game/statistics/task/task" +) + +const ( + ExcelTypeNewPlayerBankrupt = iota // 新用户游戏破产率 + ExcelTypeGameTimeAvg // 新用户平均游戏时长 + ExcelTypeGameCountAvg // 新用户平均局数 + ExcelTypeGameRate // 平均倍数 + ExcelTypeActiveRate // 活跃破产率 + ExcelTypeCtrlWinRate // 控输赢胜率 + ExcelTypeRobotWinRate // 机器人胜率 + ExcelTypeCoinAvg // 人均获得金币 + ExcelTypeBankruptOffline // 破产后离线 + ExcelTypeOfflineCoin // 充值当天最后金币 +) + +var VP *viper.Viper + +func main() { + defer func() { + logger.Logger.Flush() + logger.Logger.Close() + }() + VP = viperx.GetViper("config.yaml") + // mongo + vp := viperx.GetViper("mongo.yaml") + // mongo初始化 + conf := &mongox.Config{} + err := vp.Unmarshal(conf) + if err != nil { + panic(fmt.Errorf("mongo config error: %v", err)) + } + mongox.Init(conf) + defer mongox.Close() + + // mysql + vp = viperx.GetViper("mysql.yaml") + myConf := &mysqlx.Config{} + err = vp.Unmarshal(myConf) + if err != nil { + panic(fmt.Errorf("mysql config error: %v", err)) + } + mysqlx.Init(myConf) + defer mysqlx.Close() + + startTime, err := time.Parse(time.RFC3339, VP.GetString("StartTime")) + if err != nil { + panic(fmt.Sprintf("time.Parse err: %v", err)) + return + } + endTime, err := time.Parse(time.RFC3339, VP.GetString("EndTime")) + if err != nil { + panic(fmt.Sprintf("time.Parse err: %v", err)) + return + } + + mgr := NewExcelMgr() + mgr.Register(ExcelTypeNewPlayerBankrupt, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}) + mgr.Register(ExcelTypeGameTimeAvg, []string{"日期", "场次id", "参与人数", "平均游戏时长"}) + mgr.Register(ExcelTypeGameCountAvg, []string{"日期", "场次id", "参与人数", "平均局数"}) + mgr.Register(ExcelTypeGameRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}) + mgr.Register(ExcelTypeActiveRate, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}) + mgr.Register(ExcelTypeCtrlWinRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}) + mgr.Register(ExcelTypeCtrlWinRate*10, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}) + mgr.Register(ExcelTypeRobotWinRate, []string{"日期", "场次id", "总局数", "平均倍数", "有炸弹分局数", "炸弹分平均倍数", "2留在手里的局数"}) + mgr.Register(ExcelTypeCoinAvg, []string{"日期", "场次id", "参与人数", "人均获得金币"}) + mgr.Register(ExcelTypeBankruptOffline, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}) + mgr.Register(ExcelTypeOfflineCoin, []string{"日期", "场次id", "破产人数", "参与人数", "破产率"}) + switchArr := VP.GetIntSlice("Switch") + + for { + if startTime.Unix() >= endTime.Unix() { + break + } + startTimeStr := startTime.Format(time.RFC3339) + et := startTime.AddDate(0, 0, 1) + endTimeStr := et.Format(time.RFC3339) + logger.Logger.Infof("startTime: %v endTime: %v", startTimeStr, endTimeStr) + + if switchArr[ExcelTypeNewPlayerBankrupt] == 1 { + // 新用户游戏破产率 + mgr.GenNewPlayerBankruptRateExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeGameTimeAvg] == 1 { + // 新用户平均游戏时长 + mgr.GenNewPlayerGameTimeAvgExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeGameCountAvg] == 1 { + // 新用户平均局数 + mgr.GenGameCountExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeGameRate] == 1 { + // 平均倍数 + mgr.GenGameRateExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeActiveRate] == 1 { + // 活跃破产率 + mgr.GenActiveBankruptRateExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeCtrlWinRate] == 1 { + // 控赢胜率 + mgr.GenCtrlWinRateExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeRobotWinRate] == 1 { + // 机器人胜率 + mgr.GenRobotWinRateExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeCoinAvg] == 1 { + // 人均获得金币 + mgr.GenCoinAvgExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeBankruptOffline] == 1 { + // 破产后离线 + mgr.GenBankruptOfflineExcel("1", startTimeStr, endTimeStr) + } + if switchArr[ExcelTypeOfflineCoin] == 1 { + // 离线金币 + mgr.GenOfflineCoinExcel("1", startTimeStr, endTimeStr) + } + + startTime = et + } + + mgr.SaveAll(VP.GetString("StartTime")[:10], endTime.AddDate(0, 0, -1).Format(time.DateOnly)) +} + +func (e *ExcelMgr) SaveAll(startTime, endTime string) { + switchArr := VP.GetIntSlice("Switch") + if switchArr[ExcelTypeNewPlayerBankrupt] == 1 { + e.Save(ExcelTypeNewPlayerBankrupt, fmt.Sprintf("新用户破产率_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeGameTimeAvg] == 1 { + e.Save(ExcelTypeGameTimeAvg, fmt.Sprintf("新用户平局游戏时长_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeGameCountAvg] == 1 { + e.Save(ExcelTypeGameCountAvg, fmt.Sprintf("新用户平均局数_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeGameRate] == 1 { + e.Save(ExcelTypeGameRate, fmt.Sprintf("平均倍数_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeActiveRate] == 1 { + e.Save(ExcelTypeActiveRate, fmt.Sprintf("活跃破产率_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeCtrlWinRate] == 1 { + e.Save(ExcelTypeCtrlWinRate, fmt.Sprintf("控赢胜率_%s_%s.xlsx", startTime, endTime)) + e.Save(ExcelTypeCtrlWinRate*10, fmt.Sprintf("控输胜率_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeRobotWinRate] == 1 { + e.Save(ExcelTypeRobotWinRate, fmt.Sprintf("机器人输率_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeCoinAvg] == 1 { + e.Save(ExcelTypeCoinAvg, fmt.Sprintf("人均获得金币_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeBankruptOffline] == 1 { + e.Save(ExcelTypeBankruptOffline, fmt.Sprintf("破产后离线_%s_%s.xlsx", startTime, endTime)) + } + if switchArr[ExcelTypeOfflineCoin] == 1 { + e.Save(ExcelTypeOfflineCoin, fmt.Sprintf("离线金币_%s_%s.xlsx", startTime, endTime)) + } +} + +func GetGameFreeName(id int) string { + d := gamefree.PBDB_GameFreeMgr.GetData(int32(id)) + return fmt.Sprintf("%s_%s", d.Name, d.Title) +} + +func (e *ExcelMgr) GenNewPlayerBankruptRateExcel(plt string, startTime, endTime string) { + for _, v := range VP.GetIntSlice("Gamefreeids") { + _, a, b, err := task.NewPlayerBankruptRate(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("NewPlayerBankruptRate get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + ex := e.Get(ExcelTypeNewPlayerBankrupt) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(a) + ex.SetCell(b) + if b > 0 { + ex.SetCell(float64(a) / float64(b)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("NewPlayerBankruptRate GameFreeId: %v rate: %v", v, float64(a)/float64(b)) + } +} + +func (e *ExcelMgr) GenNewPlayerGameTimeAvgExcel(plt string, startTime, endTime string) { + for _, v := range VP.GetIntSlice("Gamefreeids") { + a, b, err := task.NewPlayerGameTimeAvg(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("NewPlayerGameTimeAvg get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + ex := e.Get(ExcelTypeGameTimeAvg) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(a) + if a > 0 { + avg := float64(b) / float64(a) + show := fmt.Sprintf("%v", time.Second*time.Duration(avg)) + ex.SetCell(show) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("NewPlayerGameTimeAvg GameFreeId: %v avg: %v", v, float64(b)/float64(a)) + } +} + +func (e *ExcelMgr) GenGameCountExcel(plt string, startTime, endTime string) { + for _, v := range VP.GetIntSlice("Gamefreeids") { + a, b, err := task.NewPlayerGameCountAvg(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("NewPlayerGameCountAvg get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + ex := e.Get(ExcelTypeGameCountAvg) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(a) + if a > 0 { + ex.SetCell(float64(b) / float64(a)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("NewPlayerGameCountAvg GameFreeId: %v avg: %v", v, float64(b)/float64(a)) + } +} + +func (e *ExcelMgr) GenGameRateExcel(plt string, startTime, endTime string) { + for _, v := range VP.GetIntSlice("Gamefreeids") { + total, bombTotal, remain2Total, rateAvg, bombRateAvg, err := task.PlayerGameRate(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("PlayerGameRate get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + ex := e.Get(ExcelTypeGameRate) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(total) + ex.SetCell(rateAvg) + ex.SetCell(bombTotal) + ex.SetCell(bombRateAvg) + ex.SetCell(remain2Total) + logger.Logger.Tracef("PlayerGameRate GameFreeId: %v total: %v rateAvg: %v bombTotal: %v bombRateAvg: %v remain2Total: %v", + v, total, rateAvg, bombTotal, bombRateAvg, remain2Total) + } +} + +func (e *ExcelMgr) GenActiveBankruptRateExcel(plt string, startTime, endTime string) { + for _, v := range VP.GetIntSlice("Gamefreeids") { + b, t, err := task.ActivePlayerBankruptRate(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("ActivePlayerBankruptRate get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + + ex := e.Get(ExcelTypeActiveRate) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(b) + ex.SetCell(t) + if t > 0 { + if b > t { + b = t + } + ex.SetCell(float64(b) / float64(t)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("ActivePlayerBankruptRate GameFreeId: %v rate: %v", v, float64(b)/float64(t)) + } +} + +func (e *ExcelMgr) GenCtrlWinRateExcel(plt string, startTime, endTime string) { + for _, v := range append(VP.GetIntSlice("Tienlen")) { + ret, err := task.GameDetailWinRate(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("GameDetailWinRate get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + if len(ret) > 0 { + ex := e.Get(ExcelTypeCtrlWinRate) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(ret[0].First) + ex.SetCell(ret[0].Second) + ex.SetCell(ret[0].Third) + ex.SetCell(ret[0].Total) + if ret[0].Total > 0 { + ex.SetCell(float64(ret[0].First+ret[0].Second) / float64(ret[0].Total)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("GameDetailWinRate GameFreeId:%v %+v", v, ret[0]) + } + if len(ret) > 1 { + ex := e.Get(ExcelTypeCtrlWinRate * 10) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(ret[1].First) + ex.SetCell(ret[1].Second) + ex.SetCell(ret[1].Third) + ex.SetCell(ret[1].Total) + if ret[1].Total > 0 { + ex.SetCell(float64(ret[1].First+ret[1].Second) / float64(ret[1].Total)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("GameDetailWinRate GameFreeId:%v %+v", v, ret[1]) + } + } +} + +func (e *ExcelMgr) GenRobotWinRateExcel(plt string, startTime, endTime string) { + for _, v := range append(VP.GetIntSlice("Tienlen"), VP.GetIntSlice("Thirteen")...) { + a, b, err := task.RobotWinRate(plt, startTime, endTime, v) + if err != nil { + logger.Logger.Errorf("RobotWinRate get StartTime:%v EndTime:%v GameFreeId:%v err: %v", startTime, endTime, v, err) + continue + } + + ex := e.Get(ExcelTypeRobotWinRate) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(GetGameFreeName(v)) + ex.SetCell(a) + ex.SetCell(b) + if b > 0 { + ex.SetCell(float64(b-a) / float64(b)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("RobotWinRate GameFreeId: %v rate: %v", v, float64(a)/float64(b)) + } +} + +func (e *ExcelMgr) GenCoinAvgExcel(plt string, startTime, endTime string) { + type KV struct { + K int + V string + } + + var list []KV + for k, v := range task.CoinName { + list = append(list, KV{K: k, V: v}) + } + + sort.Slice(list, func(i, j int) bool { + return list[i].K < list[j].K + }) + + for _, item := range list { + k, v := item.K, item.V + a, b, err := task.CoinAvg(plt, startTime, endTime, k) + if err != nil { + logger.Logger.Errorf("CoinAvg get StartTime:%v EndTime:%v tp:%v err: %v", startTime, endTime, k, err) + continue + } + ex := e.Get(ExcelTypeCoinAvg) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(v) + ex.SetCell(a) + ex.SetCell(b) + if a > 0 { + ex.SetCell(float64(b) / float64(a)) + } else { + ex.SetCell(0) + } + logger.Logger.Tracef("CoinAvg tp: %v rate: %v", k, float64(b)/float64(a)) + } +} + +func (e *ExcelMgr) GenBankruptOfflineExcel(plt string, startTime, endTime string) { + res, err := task.BankruptOffline(plt, startTime, endTime) + if err != nil { + logger.Logger.Errorf("BankruptOffline get StartTime:%v EndTime:%v err: %v", startTime, endTime, err) + return + } + ex := e.Get(ExcelTypeBankruptOffline) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(res.One) + ex.SetCell(res.Two) + ex.SetCell(res.Three) + ex.SetCell(res.Recharge) + ex.SetCell(fmt.Sprintf("%v", res.D)) + logger.Logger.Tracef("BankruptOffline %+v", res) +} + +func (e *ExcelMgr) GenOfflineCoinExcel(plt string, startTime, endTime string) { + res, err := task.OfflineCoin(plt, startTime, endTime) + if err != nil { + logger.Logger.Errorf("OfflineCoin get StartTime:%v EndTime:%v err: %v", startTime, endTime, err) + return + } + for _, v := range res { + ex := e.Get(ExcelTypeOfflineCoin) + ex.NewLine() + ex.SetCell(startTime[:10]) + ex.SetCell(v.Snid) + ex.SetCell(v.Coin) + } + logger.Logger.Tracef("OfflineCoin %+v", res) +} diff --git a/statistics/task/readme b/statistics/task/readme new file mode 100644 index 0000000..5fdb673 --- /dev/null +++ b/statistics/task/readme @@ -0,0 +1 @@ +查询历史数据 \ No newline at end of file diff --git a/statistics/task/task/bankruptcy.go b/statistics/task/task/bankruptcy.go new file mode 100644 index 0000000..ea4212d --- /dev/null +++ b/statistics/task/task/bankruptcy.go @@ -0,0 +1,189 @@ +package task + +import ( + "context" + "errors" + "fmt" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" + + "mongo.games.com/game/common" + mongomodel "mongo.games.com/game/statistics/modelmongo" +) + +// 新用户id +func GetNewPayerIds(plt string, startTime, endTime string) ([]int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + c, err := mymongo.GetUserCollection(plt, mongomodel.UserAccount) + if err != nil { + return nil, err + } + + var res []struct{ Snid int } + dd, err := c.Find(context.TODO(), bson.M{"registetime": bson.M{"$gte": s, "$lt": e}}, options.Find().SetProjection(bson.M{"snid": 1})) + if err != nil { + if errors.Is(err, mongo.ErrNoDocuments) { + return nil, nil + } + logger.Logger.Errorf("find new player snid get err: %v", err) + return nil, err + } + if err := dd.All(context.TODO(), &res); err != nil { + logger.Logger.Errorf("find new player snid decode err: %v", err) + return nil, err + } + var ret []int + for _, v := range res { + ret = append(ret, v.Snid) + } + logger.Logger.Tracef("find new player snid: %v", ret) + return ret, nil +} + +// 场次破产总人数 +func GameFreeIdBankruptPlayerCount(plt string, ids []int, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + db, err := mymysql.GetDatabase("count") + if err != nil { + return 0, err + } + var ret int + for _, v := range ids { + var n int64 + if err = db.Table("bankrupt_log").Where("snid = ? AND bankrupt_time >= ? AND bankrupt_time < ? AND game_free_id = ?", + v, s.Unix(), e.Unix(), gamefreeid).Count(&n).Error; err != nil { + logger.Logger.Errorf("find bankrupt player count get err: %v", err) + return 0, err + } + if n > 0 { + ret++ + } + } + return ret, nil +} + +// 场次参与总人数 +func PlayingGameCount(plt string, ids []int, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + c, err := mymongo.GetLogCollection(plt, mongomodel.LogGamePlayerListLog) + if err != nil { + return 0, err + } + + var ret int + for _, v := range ids { + // 参与过游戏 + n, err := c.CountDocuments(context.TODO(), bson.M{"snid": v, "time": bson.M{"$gte": s, "$lt": e}, "gamefreeid": gamefreeid}) + if err != nil { + logger.Logger.Errorf("find playing game count get err: %v", err) + return 0, err + } + if n > 0 { + ret++ + } + } + return ret, nil +} + +// NewPlayerBankruptRate 新用户破产率 +// 新用户游戏破产率 = 新用户游戏破产玩家数量/新用户游戏参与总人数;破产数量,每个玩家每个游戏破产只统计一次;参与人数,每个玩家每个游戏只统计一次; +// 返回 新用户数量,破产人数,参与人数 +func NewPlayerBankruptRate(plt string, startTime, endTime string, gamefreeid int) (n, a, b int, err error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return 0, 0, 0, fmt.Errorf("time format error") + } + ids, err := GetNewPayerIds(plt, startTime, endTime) + if err != nil { + return 0, 0, 0, err + } + + a, err = GameFreeIdBankruptPlayerCount(plt, ids, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, 0, err + } + b, err = PlayingGameCount(plt, ids, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, 0, err + } + if b == 0 { + return 0, 0, 0, nil + } + return +} + +// ActivePlayerCount 活跃玩家游戏总人数 +func ActivePlayerCount(plt string, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + c, err := mymongo.GetLogCollection(plt, mongomodel.LogGamePlayerListLog) + if err != nil { + return 0, err + } + + var count []struct { + Count int + } + cur, err := c.Aggregate(context.TODO(), bson.A{ + bson.M{"$match": bson.M{"time": bson.M{"$gte": s, "$lt": e}, "gamefreeid": gamefreeid}}, + bson.M{"$group": bson.M{"_id": "$snid"}}, + bson.M{"$count": "count"}, + }) + if err != nil { + logger.Logger.Errorf("find active player count get err: %v", err) + return 0, err + } + if err := cur.All(context.TODO(), &count); err != nil { + logger.Logger.Errorf("find active player count decode err: %v", err) + return 0, err + } + + if len(count) == 0 { + return 0, nil + } + + return count[0].Count, nil +} + +// ActivePlayerBankruptCount 活跃玩家破产总人数 +func ActivePlayerBankruptCount(plt string, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + db, err := mymysql.GetDatabase("count") + if err != nil { + return 0, err + } + var n int64 + if err = db.Table("bankrupt_log").Where("bankrupt_time >= ? AND bankrupt_time < ? AND game_free_id = ?", + s.Unix(), e.Unix(), gamefreeid).Group("snid").Count(&n).Error; err != nil { + logger.Logger.Errorf("find bankrupt count get err: %v", err) + return 0, err + } + return int(n), nil +} + +// ActivePlayerBankruptRate 活跃玩家破产率 +// 活跃玩家游戏破产率 = 活跃玩家游戏破产玩家数量/活跃玩家游戏总人数;破产数量,每个玩家每个游戏破产只统计一次;参与人数,每个玩家每个游戏只统计一次; +// 返回 破产人数,参与人数 +func ActivePlayerBankruptRate(plt string, startTime, endTime string, gamefreeid int) (a, b int, err error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return 0, 0, fmt.Errorf("time format error") + } + + a, err = ActivePlayerBankruptCount(plt, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + b, err = ActivePlayerCount(plt, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + if b == 0 { + return 0, 0, nil + } + return +} diff --git a/statistics/task/task/bankruptoffline.go b/statistics/task/task/bankruptoffline.go new file mode 100644 index 0000000..c6f71c1 --- /dev/null +++ b/statistics/task/task/bankruptoffline.go @@ -0,0 +1,153 @@ +package task + +import ( + "context" + "fmt" + "strconv" + "strings" + "time" + + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/game/common" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" +) + +// 破产后离线;破产后5分钟内有离线行为 + +type BankruptOfflineData struct { + One int + Two int + Three int + Recharge int + D time.Duration +} + +func BankruptOffline(plt string, startTime, endTime string) (ret *BankruptOfflineData, err error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return nil, fmt.Errorf("time format error") + } + db, err := mymysql.GetDatabase("count") + if err != nil { + return nil, err + } + + /* + SELECT + snid, + GROUP_CONCAT(bankrupt_time ORDER BY bankrupt_time ASC LIMIT 3) AS top_3_bankrupt_times, + COUNT(*) AS record_count + FROM + bankrupt_log + GROUP BY + snid; + */ + + type BankruptLog struct { + Snid int `gorm:"column:snid"` + MaxBankruptTime string `gorm:"column:top_3_bankrupt_times"` + Times []int64 `gorm:"-"` + } + + var logs []*BankruptLog + tx := db.Raw(` + WITH RankedData AS ( + SELECT + snid, + bankrupt_time, + ROW_NUMBER() OVER (PARTITION BY snid ORDER BY bankrupt_time ASC) AS ranks + FROM bankrupt_log + WHERE bankrupt_time >= ? AND bankrupt_time < ? + ) + SELECT + snid, + GROUP_CONCAT(bankrupt_time ORDER BY bankrupt_time ASC) AS top_3_bankrupt_times + FROM RankedData + WHERE ranks <= 3 + GROUP BY snid +`, s.Unix(), e.Unix()).Scan(&logs) + + if tx.Error != nil { + return nil, tx.Error + } + + var timeSecond int + var total int + + ret = &BankruptOfflineData{} + for _, v := range logs { + if v == nil || len(v.MaxBankruptTime) == 0 { + continue + } + for _, vv := range strings.Split(v.MaxBankruptTime, ",") { + n, err := strconv.Atoi(vv) + if err != nil { + return nil, err + } + v.Times = append(v.Times, int64(n)) + } + + // 破产后5分钟内有离线行为 + db, err = mymysql.GetDatabase(plt) + if err != nil { + return nil, err + } + + var isOffline bool + for k, vv := range v.Times { + var n int64 + stime, etime := time.Unix(vv, 0), time.Unix(vv, 0).Add(5*time.Minute) + if err = db.Table("user_logins").Where("snid = ? AND offline_time >= ? AND offline_time < ?", + v.Snid, stime, etime).Count(&n).Error; err != nil { + return nil, err + } + switch k { + case 0: + if n > 0 { + ret.One++ + isOffline = true + } + case 1: + if n > 0 { + ret.Two++ + isOffline = true + } + case 2: + if n > 0 { + ret.Three++ + isOffline = true + } + } + } + + if isOffline { + // 充值 + c, err := mymongo.GetLogCollection(plt, "log_dbshop") + if err != nil { + return nil, err + } + count, err := c.CountDocuments(context.TODO(), bson.M{"snid": v.Snid, "ts": bson.M{"$gte": s.Unix(), "$lt": e.Unix()}, "consume": 3, "state": 1}) + if err != nil { + return nil, err + } + if count > 0 { + ret.Recharge++ + } + + // 平均对局时长 + times, to, err := NewPlayerGameTime(plt, []int{v.Snid}, startTime, endTime, 0) + if err != nil { + return nil, err + } + timeSecond += times + total += to + } + } + + if total > 0 { + ret.D = time.Second * time.Duration(timeSecond/total) + } + + return ret, nil +} diff --git a/statistics/task/task/coin.go b/statistics/task/task/coin.go new file mode 100644 index 0000000..10747e6 --- /dev/null +++ b/statistics/task/task/coin.go @@ -0,0 +1,77 @@ +package task + +import ( + "context" + "fmt" + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/game/common" + "mongo.games.com/goserver/core/mongox" +) + +var CoinName = map[int]string{ + 44: "转盘", + 57: "轮盘视频", + 43: "签到", + 58: "签到视频", + 83: "累计签到", + 91: "累计签到进阶奖励", + 47: "vip每日礼包", + 105: "vip等级礼包", + 74: "集卡活动", + 67: "金币存钱罐", + 94: "赛季通行证等级奖励", + 95: "赛季通行证排行奖励", + 52: "排位赛段位奖励", + 65: "周卡奖励", + 5: "兑换", + 49: "礼包码兑换", + 38: "救济金", + 56: "救济金视频", +} + +func CoinHistory(plt string, startTime, endTime string, tp int, f func(data bson.M) error) error { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return fmt.Errorf("time format error") + } + c, err := mongox.GetLogCollection(plt, "log_coinex") + if err != nil { + return err + } + + cur, err := c.Find(context.TODO(), bson.M{"time": bson.M{"$gte": s, "$lt": e}, "logtype": tp, "cointype": 0}) + if err != nil { + return err + } + defer cur.Close(context.Background()) + + for cur.TryNext(context.Background()) { + data := bson.M{} + if err := cur.Decode(data); err != nil { + return err + } + if err := f(data); err != nil { + return err + } + } + + return nil +} + +func CoinAvg(plt string, startTime, endTime string, tp int) (playerNumber int, total int, err error) { + player := make(map[int32]struct{}) + err = CoinHistory(plt, startTime, endTime, tp, func(data bson.M) error { + snid := data["snid"].(int32) + count := int(data["count"].(int64)) + player[snid] = struct{}{} + if count > 0 { + total += count + } + return nil + }) + if err != nil { + return + } + playerNumber = len(player) + return +} diff --git a/statistics/task/task/ctrlrate.go b/statistics/task/task/ctrlrate.go new file mode 100644 index 0000000..25eaf26 --- /dev/null +++ b/statistics/task/task/ctrlrate.go @@ -0,0 +1,214 @@ +package task + +import ( + "context" + "encoding/json" + "fmt" + "sort" + + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/mongox" + + "mongo.games.com/game/common" +) + +func GameDetailFunc(plt string, startTime, endTime string, gamefreeid int, f func(data bson.M) error) error { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return fmt.Errorf("time format error") + } + + c, err := mongox.GetLogCollection(plt, "log_gamedetailed") + if err != nil { + return err + } + + cur, err := c.Find(context.TODO(), bson.M{"time": bson.M{"$gte": s, "$lt": e}, "gamefreeid": gamefreeid}) + if err != nil { + return err + } + defer cur.Close(context.Background()) + + for cur.TryNext(context.Background()) { + data := bson.M{} + if err := cur.Decode(data); err != nil { + return err + } + if err := f(data); err != nil { + return err + } + } + + return nil +} + +type GameDetailWinRateRet struct { + First int + Second int + Third int + Total int + IsWin bool +} + +func GameDetailWinRate(plt string, startTime, endTime string, gamefreeid int) (ret []GameDetailWinRateRet, err error) { + ret = make([]GameDetailWinRateRet, 2) + err = GameDetailFunc(plt, startTime, endTime, gamefreeid, func(data bson.M) error { + ff, ss, tt, to, ct := GameDetailCount(data) + if ct == 1 && to > 0 { + ret[0].First += ff + ret[0].Second += ss + ret[0].Third += tt + ret[0].Total += to + } + if ct == 2 && to > 0 { + ret[1].First += ff + ret[1].Second += ss + ret[1].Third += tt + ret[1].Total += to + } + return nil + }) + return +} + +type RabbitMQDataRaw struct { + Source int32 + Data interface{} +} + +func GameDetailCount(data bson.M) (first, second, third, to int, ctrlType int) { + if data == nil { + return + } + gameid := data["gameid"].(int32) + gamefreeid := data["gamefreeid"].(int32) + ctrlType = int(data["ctrltype"].(int32)) + logger.Logger.Tracef("GameDetail gameid:%d, gamefreeid:%d", gameid, gamefreeid) + + if ctrlType != 1 && ctrlType != 2 { + return + } + + detail := data["gamedetailednote"] + if detail == nil { + return + } + + raw := new(RabbitMQDataRaw) + if err := json.Unmarshal([]byte(detail.(string)), raw); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 1 error:%v %v", err, gameid) + return + } + + switch gameid { + case 207, 208, 209, 210, 240, 241, 242, 243, 244, 245, 246, 247: // tienlen + data := new(TienLenType) + b, err := json.Marshal(raw.Data) + if err != nil { + logger.Logger.Errorf("GameDetailCount Marshal error:%v %v", err, gameid) + return + } + if err := json.Unmarshal(b, data); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 2 error:%v %v", err, gameid) + return + } + + var has, hasPlayer bool + for _, v := range data.PlayerData { + if v.IsRob { + has = true + } + if !v.IsRob { + hasPlayer = true + } + } + if !has || !hasPlayer { + // 没有机器人 + return 0, 0, 0, 0, ctrlType + } + + sort.Slice(data.PlayerData, func(i, j int) bool { + a, b := data.PlayerData[i].BillCoin+data.PlayerData[i].BillTaxCoin, data.PlayerData[j].BillCoin+data.PlayerData[j].BillTaxCoin + if a != b { + return a > b + } + if data.PlayerData[i].IsRob != data.PlayerData[j].IsRob { + return !data.PlayerData[i].IsRob + } + return data.PlayerData[i].UserId < data.PlayerData[j].UserId + }) + + for k, v := range data.PlayerData { + if !v.IsRob && v.BillCoin > 0 && k <= 1 { + if k == 0 { + first = 1 + } + if k == 1 { + second = 1 + } + break + } + } + if len(data.PlayerData) > 2 && first+second == 0 && !data.PlayerData[2].IsRob { + third = 1 + } + to = 1 + + case 211, 212, 213, 214: + data := new(ThirteenWaterType) + b, err := json.Marshal(raw.Data) + if err != nil { + logger.Logger.Errorf("GameDetailCount Marshal error:%v %v", err, gameid) + return + } + if err := json.Unmarshal(b, data); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 2 error:%v %v", err, gameid) + return + } + + var has, hasPlayer bool + for _, v := range data.PlayerData { + if v.IsRob { + has = true + } + if !v.IsRob { + hasPlayer = true + } + } + if !has || !hasPlayer { + // 没有机器人 + return 0, 0, 0, 0, ctrlType + } + + sort.Slice(data.PlayerData, func(i, j int) bool { + a, b := data.PlayerData[i].AllScore, data.PlayerData[j].AllScore + if a != b { + return a > b + } + if data.PlayerData[i].IsRob != data.PlayerData[j].IsRob { + return !data.PlayerData[i].IsRob + } + return data.PlayerData[i].UserId < data.PlayerData[j].UserId + }) + + for k, v := range data.PlayerData { + if !v.IsRob && v.AllScore > 0 && k <= 1 { + if k == 0 { + first = 1 + } + if k == 1 { + second = 1 + } + break + } + } + + if len(data.PlayerData) > 2 && first+second == 0 && !data.PlayerData[2].IsRob { + third = 1 + } + + to = 1 + } + return +} diff --git a/statistics/task/task/gamebankruptcy.go b/statistics/task/task/gamebankruptcy.go new file mode 100644 index 0000000..21bbbcf --- /dev/null +++ b/statistics/task/task/gamebankruptcy.go @@ -0,0 +1,69 @@ +package task + +import ( + "context" + "fmt" + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/game/common" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" + mymysql "mongo.games.com/goserver/core/mysqlx" +) + +// 场次破产率 + +// GameFreeIdBankruptcyTimes 场次破产次数 +func GameFreeIdBankruptcyTimes(plt string, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + db, err := mymysql.GetDatabase("count") + if err != nil { + return 0, err + } + + var n int64 + if err = db.Table("bankrupt_log").Where("bankrupt_time >= ? AND bankrupt_time < ? AND game_free_id = ?", + s.Unix(), e.Unix(), gamefreeid).Count(&n).Error; err != nil { + logger.Logger.Errorf("find bankrupt count get err: %v", err) + return 0, err + } + + return int(n), nil +} + +// GameFreeIdTotalTimes 场次总局数 +func GameFreeIdTotalTimes(plt string, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + c, err := mymongo.GetLogCollection(plt, "log_gamedetailed") + if err != nil { + return 0, err + } + + n, err := c.CountDocuments(context.TODO(), bson.M{"time": bson.M{"$gte": s, "$lt": e}, "gamefreeid": gamefreeid}) + if err != nil { + logger.Logger.Errorf("find game total times get err: %v", err) + return 0, err + } + + return int(n), nil +} + +// GameBankruptcyRate 场次破产率 +// 返回 破产局数, 总局数, 错误 +func GameBankruptcyRate(plt string, startTime, endTime string, gamefreeid int) (int, int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return 0, 0, fmt.Errorf("time format error") + } + + b, err := GameFreeIdBankruptcyTimes(plt, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + + t, err := GameFreeIdTotalTimes(plt, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + + return b, t, nil +} diff --git a/statistics/task/task/gamecount.go b/statistics/task/task/gamecount.go new file mode 100644 index 0000000..911c202 --- /dev/null +++ b/statistics/task/task/gamecount.go @@ -0,0 +1,60 @@ +package task + +import ( + "context" + "fmt" + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/game/common" + mongomodel "mongo.games.com/game/statistics/modelmongo" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" +) + +// 新用户平均局数 + +func NewPlayerGameCount(plt string, ids []int, startTime, endTime string, gamefreeid int) (int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + c, err := mymongo.GetLogCollection(plt, mongomodel.LogGamePlayerListLog) + if err != nil { + return 0, err + } + + var ret int + for _, v := range ids { + n, err := c.CountDocuments(context.TODO(), bson.M{"snid": v, "gamefreeid": gamefreeid, "time": bson.M{"$gte": s, "$lt": e}}) + if err != nil { + logger.Logger.Errorf("find player gamedetailedlogid get err: %v", err) + return 0, err + } + ret += int(n) + } + + return ret, nil +} + +// NewPlayerGameCountAvg 新用户平均局数 +// 返回 参与人数,总局数 +func NewPlayerGameCountAvg(plt string, startTime, endTime string, gamefreeid int) (int, int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return 0, 0, fmt.Errorf("time format error") + } + ids, err := GetNewPayerIds(plt, startTime, endTime) + if err != nil { + return 0, 0, err + } + n, err := NewPlayerGameCount(plt, ids, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + if len(ids) == 0 { + return 0, 0, nil + } + + b, err := PlayingGameCount(plt, ids, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + + return b, n, nil +} diff --git a/statistics/task/task/gamelogtype.go b/statistics/task/task/gamelogtype.go new file mode 100644 index 0000000..74cbf60 --- /dev/null +++ b/statistics/task/task/gamelogtype.go @@ -0,0 +1,1625 @@ +package task + +// 赢三张 +type WinThreeType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + PlayerCount int //玩家数量 + BaseScore int32 //底分 + PlayerData []WinThreePerson //玩家信息 + Chip []PlayerChip //出牌详情 + ClubRate int32 //俱乐部抽水比例 + IsSmartOperation bool // 是否启用智能化运营 + GamePreUseSmartState int //-1:正常 + GameLastUseSmartState int //-1:正常 + RobotUseSmartState int64 // Robot使用智能化运营状况 +} +type PlayerChip struct { + UserId int32 //玩家ID + BetTotal int64 //玩家总投注 + Chip int64 //玩家得分 + StartCoin int64 //玩家开始前金币 + BetAfterCoin int64 //玩家投注后金币,也就是客户端应该显示的金币 + IsCheck bool //是否看牌 + Round int32 //当前轮次 + Op int32 //操作 +} + +type WinThreePerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Cardinfo []int32 //牌值 + KindOfCard int32 //牌型 + IsWin int32 //输赢 + IsRob bool //是否是机器人 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + Flag int //标识 + Pos int32 //位置 + StartCoin int64 //开始金币 + BetCoin int64 //押注额度 + RoundCheck int32 //轮次,看牌的 + IsFirst bool //是否第一次 + IsLeave bool + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + SingleFlag int32 //单控标记 +} + +// 经典牛牛 抢庄牛牛 +type BullFightType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + PlayerData []BullFightPerson //玩家信息 + ClubRate int32 //俱乐部抽水比例 + IsSmartOperation bool // 是否启用智能化运营 +} +type BullFightPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Cardinfo []int32 //牌值 + CardBakinfo []int32 //牌值 + IsWin int32 //输赢 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + TaxLottery int64 //彩金池,增加值 + ClubPump int64 //俱乐部额外抽水 + IsRob bool //是否是机器人 + Flag int //标识 + IsFirst bool + StartCoin int64 //开始金币 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + Rate int64 //斗牛倍率 + WBLevel int32 //黑白名单等级 + RobBankRate int64 //抢庄倍率 + SingleAdjust int32 // 单控输赢 1赢 2输 +} + +// 斗地主、跑得快 +type DoudizhuType struct { + RoomId int //房间Id + BasicScore int //基本分 + Spring int //春天 1代表春天 + BombScore int //炸弹分 + BaseScore int32 //底分 + PlayerCount int32 //玩家数量 + BaseCards []int //底牌 + BankerId int32 //斗地主地主Id + PlayerData []DoudizhuPerson //玩家信息 + ClubRate int32 //俱乐部抽水比例 + IsSmartOperation bool // 是否启用智能化运营 +} +type DoudizhuPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + OutCards [][]int64 //出的牌 + SurplusCards []int32 //剩下的牌 + IsWin int64 //输赢 + IsRob bool //是否是机器人 + IsFirst bool + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + StartCoin int64 //开始的金币数量 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 +} + +// 推饼 +type TuibingType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + PlayerData []TuibingPerson //玩家信息 + ClubRate int32 //俱乐部抽水比例 + IsSmartOperation bool // 是否启用智能化运营 +} +type TuibingPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Cardinfo []int32 //牌值 + IsWin int32 //输赢 + IsRob bool //是否是机器人 + IsFirst bool + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + Flag int //标识 + StartCoin int64 //开始金币 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + Rate int64 //倍率 + WBLevel int32 //黑白名单等级 +} + +// 十三水 +// 十三水牌值 +type ThirteenWaterType struct { + BaseScore int32 //底分 + PlayerData []ThirteenWaterPerson //玩家信息 +} + +type ThirteenWaterPoker struct { + Head [3]int + Mid [5]int + End [5]int + PokerType int +} + +type ThirteenWaterPerson struct { + UserId int32 //玩家ID + IsRob bool // 是否是机器人 + AllScore int // 总得分 +} + +// 二人麻将 +type MahjongType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int32 //玩家数量 + BaseScore int32 //底分 + HuType []int64 //本局胡牌牌型 + PlayerData []MahjongPerson //玩家信息 +} +type MahjongPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + SurplusCards []int64 //剩下的牌 + CardsChow [][]int64 //吃的牌 + CardsPong []int64 //碰的牌 + CardsMingKong []int64 //明杠的牌 + CardsAnKong []int64 //暗杠的牌 + IsWin int32 //输赢 + StartCoin int64 //开始金币 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + IsRob bool //是否是机器人 + IsFirst bool + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 +} + +// 百人牛牛 龙虎斗 百家乐 红黑大战 +type HundredType struct { + RegionId int32 //边池ID 庄家 天 地 玄 黄 + IsWin int //边池输赢 + Rate int //倍数 + CardsInfo []int32 //扑克牌值 + PlayerData []HundredPerson //玩家属性 + CardsKind int32 //牌类型 + CardPoint int32 //点数 + IsSmartOperation bool // 是否启用智能化运营 +} +type HundredPerson struct { + UserId int32 //用户Id + UserBetTotal int64 //用户下注 + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + IsRob bool //是否是机器人 + IsFirst bool + WBLevel int32 //黑白名单等级 + Result int32 //单控结果 + UserBetTotalDetail []int64 //用户下注明细 +} + +// 碰撞 +type CrashType struct { + RegionId int32 //边池ID 庄家 天 地 玄 黄 + IsWin int //边池输赢 + Rate int //倍数 + CardsInfo []int32 //扑克牌值 + PlayerData []CrashPerson //玩家属性 + CardsKind int32 //牌类型 + CardPoint int32 //点数 + IsSmartOperation bool // 是否启用智能化运营 + Hash string //Hash + Period int //当前多少期 + Wheel int //第几轮 +} + +// 碰撞 +type CrashPerson struct { + UserId int32 //用户Id + UserBetTotal int64 //用户下注 + UserMultiple int32 //下注倍数 + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + IsRob bool //是否是机器人 + IsFirst bool + WBLevel int32 //黑白名单等级 + Result int32 //单控结果 + UserBetTotalDetail []int64 //用户下注明细 + Tax int64 //税收 +} + +// 十点半 +type TenHalfType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + PlayerData []TenHalfPerson //玩家信息 + ClubRate int32 //俱乐部抽水比例 + IsSmartOperation bool // 是否启用智能化运营 +} + +type TenHalfPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Cardinfo []int32 //牌值 + IsWin int32 //输赢 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + IsRob bool //是否是机器人 + Flag int //标识 + IsFirst bool + StartCoin int64 //开始金币 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 +} + +type GanDengYanType struct { + RoomId int // 房间Id + RoomRounds int32 // 建房局数 + NowRound int32 // 当前局数 + BombScore int // 炸弹倍率 + BaseScore int32 // 底分 + PlayerCount int32 // 玩家数量 + BankerId int32 // 庄家id + PlayerData []GanDengYanPlayer // 玩家信息 + ClubRate int32 // 俱乐部抽水比例 +} + +type GanDengYanHandCards struct { + Cards []int64 + Index int32 +} + +type GanDengYanPlayer struct { + UserId int32 // 玩家ID + UserIcon int32 // 玩家头像 + ChangeCoin int64 // 玩家得分 + OutCards []*GanDengYanHandCards // 出的牌 + SurplusCards []int32 // 剩下的牌 + IsWin int64 // 输赢 + IsRob bool // 是否是机器人 + IsFirst bool + Tax int64 // 税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 // 俱乐部额外抽水 + StartCoin int64 // 开始的金币数量 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + NumMagic int32 // 癞子或2倍数 + NumCards int32 // 剩余牌数 + NumHand int32 // 手牌倍数 + Num int32 // 总倍数 +} + +// 红包扫雷 +type RedPackGameType struct { + BankerId int32 //庄家id + BankerBet int32 //庄家下注金额 + BankerWin int32 //庄家赢取 + BankerRest int32 //庄家退回钱数 + Rate int32 //倍数 + BombNum int32 //雷号 + HitBombCnt int32 //中雷的人数 + PlayerData []*RedPackPerson //玩家属性 +} +type RedPackPerson struct { + UserId int32 //用户Id + IsFirst bool + BeforeCoin int64 //抢包前金额 + AfterCoin int64 //抢包后金额 + ChangeCoin int64 //金额变化 + GrabCoin int32 //抢到红包的数量 + IsHit bool //是否中雷 + IsRob bool //是否是机器人 +} + +// 鱼场 +type BulletLevelTimes struct { + Level int32 //等级 + Times int32 //次数 +} +type FishCoinNum struct { + ID int32 // 鱼id + Num int32 //打死数量 + Power int32 //子弹价值 + Coin int32 //金币(总金币) + HitNum int32 //击中次数 +} + +type FishPlayerData struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + TotalIn int64 //玩家该阶段总投入 + TotalOut int64 //玩家该阶段总产出 + CurrCoin int64 //记录时玩家当前金币量 +} + +type FishDetiel struct { + BulletInfo *[]BulletLevelTimes //子弹统计 + HitInfo *[]FishCoinNum // + PlayData *FishPlayerData //统计 +} + +// 拉霸 +// 绝地求生记录详情 +type IslandSurvivalGameType struct { + //all + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + BetCoin int64 //下注金额 + WinCoin int64 //下注赢取金额 + IsFirst bool + Smallgamewinscore int64 //吃鸡游戏赢取的分数 + ChangeCoin int64 //本局游戏金额总变化 + FreeTimes int32 //免费转动次数 + AllWinNum int32 //中奖的线数 + LeftEnemy int32 //剩余敌人,需保存 + Killed int32 //总击杀敌人,需保存 + HitPoolIdx int //下注索引 + Cards []int //15张牌 +} + +const ( + WaterMarginSmallGame_Unop int32 = iota + WaterMarginSmallGame_AddOp + WaterMarginSmallGame_SubOp +) + +// 水浒传小游戏数据 +type WaterMarginSmallGameInfo struct { + AddOrSub int32 //加减操作 0:表示未操作 1:加 2:减 + Score int64 //本局小游戏参与的分数 + Multiple int32 //倍数 0:表示本局输了 >1:表示猜对小游戏 + Dice1 int32 //骰子1的点数 + Dice2 int32 //骰子2的点数 +} + +type WaterMarginType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + IsFirst bool //是否一次游戏 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + JackpotNowCoin int64 //爆奖金额 + Cards []int //15张牌 + HitPoolIdx int //压分的索引 + JackpotHitFlag int //如果jackpotnowcoin>0;该值标识中了哪些奖池,二进制字段 1:小奖(第0位) 2:中奖(第1位) 4:大奖(第2位) + TrigFree bool //是否触发免费转动 + SMGame []*WaterMarginSmallGameInfo //小游戏数据 +} + +type FootBallHeroesType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + IsFirst bool + Score int32 //总押注数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + Cards []int //15张牌 + CoinReward []int64 //礼物奖励 + Smallgamescore int64 //小游戏分数 + Smallgamewinscore int64 //小游戏赢取的分数 + SmallgameList []int32 //小游戏记录 + HitPoolIdx int //当前命中的奖池 +} +type FruitMachineType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + IsFirst bool + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + JackpotNowCoin int64 //爆奖金额 + Cards []int //15张牌 + Smallgamescore int64 //小游戏分数 + HitPoolIdx int //当前命中的奖池 +} +type GoddessType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + IsFirst bool + Smallgamescore int64 //小游戏分数 + Smallgamewinscore int64 //小游戏赢取的分数 + SmallgameCard int32 //小游戏卡牌 + CardsGoddess [3]int32 //3张牌 + BetMultiple int32 //押倍倍数 + SmallgameList []int32 //小游戏记录 + HitPoolIdx int //当前命中的奖池 +} +type RollLineType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + IsFirst bool + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + RoseCount int32 //玫瑰数量 + Cards []int //15张牌 + CoinReward []int64 //礼物奖励 + HitPoolIdx int //当前命中的奖池 +} +type IceAgeType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + Cards [][]int32 // 消除前后的牌(消除前15张,消除后15张...) + BetLines []int64 //下注的线 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + IsFree bool // 是否免费 + TotalBonusValue int64 // 总bonus数 + WBLevel int32 //黑白名单等级 + WinLines [][]int // 赢分的线 + WinJackpot int64 // 赢奖池分数 + WinBonus int64 // 赢小游戏分数 +} +type TamQuocType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + Cards []int32 //15张牌 + BetLines []int64 //下注的线 + WBLevel int32 //黑白名单等级 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + IsFree bool // 是否免费 + TotalBonusValue int64 // 总bonus数 + WinLines []int // 赢分的线 + WinJackpot int64 // 赢奖池分数 + WinBonus int64 // 赢小游戏分数 +} +type CaiShenType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + Cards []int32 //15张牌 + WBLevel int32 //黑白名单等级 + BetLines []int64 //下注的线 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + IsFree bool // 是否免费 + TotalBonusValue int64 // 总bonus数 + WinLines []int // 赢分的线 + WinJackpot int64 // 赢奖池分数 + WinBonus int64 // 赢小游戏分数 +} +type AvengersType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + Cards []int32 //15张牌 + WBLevel int32 //黑白名单等级 + BetLines []int64 //下注的线 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + IsFree bool // 是否免费 + TotalBonusValue int64 // 总bonus数 + WinLines []int // 赢分的线 + WinJackpot int64 // 赢奖池分数 + WinBonus int64 // 赢小游戏分数 +} +type EasterIslandType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + Cards []int32 //15张牌 + WBLevel int32 //黑白名单等级 + BetLines []int64 //下注的线 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + IsFree bool // 是否免费 + TotalBonusValue int64 // 总bonus数 + WinLines []int // 赢分的线 + WinJackpot int64 // 赢奖池分数 + WinBonus int64 // 赢小游戏分数 +} +type RollTeamType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + AllWinNum int32 //中奖的线数 + IsFirst bool + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + PokerBaseCoin int32 //扑克游戏获得的金币 + PokerRate int32 //游戏的翻倍值 + GameCount int32 //游戏次数 + HitPoolIdx int //当前命中的奖池 + Cards []int //15张牌 +} +type RollPerson struct { + UserId int32 //用户Id + UserBetTotal int64 //用户下注 + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + IsFirst bool + IsRob bool //是否是机器人 + WBLevel int32 //黑白名单等级 +} +type RollHundredType struct { + RegionId int32 //边池ID -1.庄家 0.大众 1.雷克萨斯 2.宝马 3.奔驰 4.保时捷 5.玛莎拉蒂 6.兰博基尼 7.法拉利 + IsWin int //边池输赢 1.赢 0.平 -1.输 + Rate int //倍数 + SType int32 //特殊牌型 临时使用 + RollPerson []RollPerson +} + +// 梭哈 +type FiveCardType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + PlayerCount int //玩家数量 + BaseScore int32 //底分 + PlayerData []FiveCardPerson //玩家信息 + ClubRate int32 //俱乐部抽水比例 +} + +// 梭哈 +type FiveCardPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Cardinfo []int32 //牌值 + IsWin int32 //输赢 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + IsRob bool //是否是机器人 + IsFirst bool //是否第一次 + IsLeave bool //中途离开 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + BetTotal int64 //用户当局总下注 + IsAllIn bool //是否全下 + WBLevel int32 //黑白名单等级 +} + +// 骰子 +type RollPointPerson struct { + UserId int32 //用户Id + UserBetTotal int64 //用户下注 + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + IsFirst bool + IsRob bool //是否是机器人 + WBLevel int32 //黑白名单等级 + BetCoin []int32 //押注金币 +} +type RollPointType struct { + RoomId int32 + Point []int32 + Score []int32 + BetCoin int64 + WinCoin int64 + Person []RollPointPerson +} + +// 轮盘 +type RouletteType struct { + BankerInfo RouletteBanker //庄家信息 + Person []RoulettePerson //下注玩家列表 + RouletteRegion []RouletteRegion //下区域 +} +type RouletteBanker struct { + Point int //当局开的点数 + TotalBetCoin int64 //总下注金额 + TotalWinCoin int64 //总输赢金额 +} +type RouletteRegion struct { + Id int //0-156 下注位置编号 + IsWin int //是否中奖 + BetCoin int64 //当前区域总下注金额 + WinCoin int64 //当前区域总输赢金额 + Player []RoulettePlayer //当前区域下注玩家列表 +} +type RoulettePlayer struct { + UserId int32 //用户Id + BetCoin int64 //当局下注额 +} +type RoulettePerson struct { + UserId int32 //用户Id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + UserBetTotal int64 //用户总下注 + UserWinCoin int64 //用户输赢 + IsRob bool //是否是机器人 + WBLevel int32 //黑白名单等级 + BetCoin map[int]int64 //下注区域对应金额 +} + +// 九线拉王 +type NineLineKingType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + IsFirst bool + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + AllWinNum int32 //中奖的线数 + FreeTimes int32 //免费转动次数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + JackpotNowCoin int64 //爆奖金额 + Cards []int //15张牌 + HitPoolIdx int //当前命中的奖池 + CommPool int64 //公共奖池 + PersonPool int64 //私人奖池 +} + +// 飞禽走兽 +type RollAnimalsType struct { + BetTotal int64 //总下注 + WinCoin int64 //用户输赢 + WinFlag []int64 //中奖元素 + RollLog []RollHundredType //每个区域下注信息 +} + +// 血战 +type BloodMahjongType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int32 //玩家数量 + BaseScore int32 //底分 + PlayerData []BloodMahjongPerson //玩家信息 +} + +// 碰杠牌 +type BloodMahjongCardsLog struct { + Card int64 //牌 + Pos []int //0.东 1.南 2.西 3.北 + Flag int //1.碰 2.明杠 3.暗杠 4.补杠 +} + +// 分数类型 +type BloodMahjongScoreTiles struct { + LogType int //0.胡 1.刮风 2.下雨 3.退税 4.查花猪 5.查大叫 6.被抢杠 补杠退钱 7.呼叫转移 + OtherPos []int //源自哪个位置的玩家 + Coin int64 //理论进账 + ActualCoin int64 //实际进账 + Rate int32 //倍率 + Params []int64 //【Honor】//胡牌类型 +} +type BloodMahjongPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Pos int32 //玩家位置 0.东 1.南 2.西 3.北 + IsLeave bool //是否离场 + Bankruptcy bool //是否破产 + HuNumber int32 //第几胡 1 2 3 + LackColor int64 //定缺花色 + Hands []int64 //手牌 + HuCards []int64 //胡牌 + CardsLog []BloodMahjongCardsLog //碰杠牌 + ScoreTiles []BloodMahjongScoreTiles //分数 + IsWin int32 //输赢 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + StartCoin int64 //开始金币 + ClubPump int64 //俱乐部额外抽水 + IsRob bool //是否是机器人 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 +} + +type PCProp struct { + Id uint32 + TypeName string // 金币类型 + AreaType int32 // 所在区域 0平台上 1有效区 2无效区 3小车内 + CoinVal int64 // 金币面值 + X float32 + Y float32 + Z float32 + RotX float32 + RotY float32 + RotZ float32 +} + +// 推币机 +type PushingCoinRecord struct { + RoomId int // 房间id + RoomType int // 房间类型 + GameMode int // 游戏模式 + BaseScore int64 // 底分 + ShakeTimes int32 // 震动次数 + WallUpTimes int32 // 升墙次数 + EventTimes []int32 // 事件次数 + Props []*PCProp // 所有金币 +} + +type HuntingRecord struct { + RoomId int // 房间ID + BaseScore int // 底分 + SnId int32 // 玩家ID + StartCoin int64 // 下注前金额 + Coin int64 // 下注后金额 + ChangeCoin int64 // 金币变化 + CoinPool int64 // 爆奖金额 + Point int64 // 单线点数 + LineNum int64 // 线数 + BetCoin int64 // 下注金额 + WinCoin int64 // 产出金额 + Level int // 当前关卡 + Gain int64 // 翻牌奖励 +} + +// 对战三公 +type SanGongPVPType struct { + RoomId int32 //房间ID + RoomRounds int32 //建房局数 + RoomType int32 //房间类型 + NowRound int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + PlayerData []SanGongPVPPerson //玩家信息 + ClubRate int32 //俱乐部抽水比例 + IsSmartOperation bool //是否启用智能化运营 +} +type SanGongPVPPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + ChangeCoin int64 //玩家得分 + Cardinfo []int32 //牌值 + IsWin int32 //输赢 + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + ClubPump int64 //俱乐部额外抽水 + IsRob bool //是否是机器人 + Flag int //标识 + IsFirst bool + StartCoin int64 //开始金币 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 +} + +// 德州牛仔 +type DZNZCardInfo struct { + CardId int32 //手牌ID 牛仔 公共牌 公牛 + CardsInfo []int32 //扑克牌值 + CardsKind int32 //牌类型 +} +type DZNZZoneInfo struct { + RegionId int32 //13个下注区域 + IsWin int //边池输赢 + Rate float32 //倍数 + PlayerData []HundredPerson //玩家属性 + IsSmartOperation bool //是否启用智能化运营 +} +type DZNZHundredInfo struct { + CardData []DZNZCardInfo //发牌信息 + ZoneInfo []DZNZZoneInfo //每个下注区域信息 +} + +// 财运之神 +type FortuneZhiShenType struct { + //基本信息 + RoomId int //房间Id + BasicScore int32 //单注 + PlayerSnId int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + TotalBetCoin int64 //总押注 + TotalLine int32 //总线数(固定) + TotalWinCoin int64 //总派彩 + NowGameState int //当前游戏模式(0,1,2,3)普通/免费/停留旋转/停留旋转2 + NowNRound int //第几轮 + IsOffline int //0,1 正常(不显示)/掉线(显示) + FirstFreeTimes int //免费游戏剩余次数 + SecondFreeTimes int //停留旋转游戏剩余次数 + //中奖统计 + HitPrizePool []int64 //命中奖池(小奖|中奖|大奖|巨奖) + WinLineNum int //中奖线个数 + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + GemstoneNum int //宝石数量 + GemstoneWinCoin int64 //宝石派彩 + //详情 + Cards []int32 //元素顺序 横向 + GemstoneRateCoin []int64 //宝石金额 横向 + //中奖线详情 + WinLine []FortuneZhiShenWinLine + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 +} +type FortuneZhiShenWinLine struct { + Id int //线号 + EleValue int32 //元素值 + Num int //数量 + Rate int64 //倍率 + WinCoin int64 //单线派彩 + WinFreeGame int //(0,1,2)旋转并停留*3/免费游戏*6/免费游戏*3 +} + +// 金鼓齐鸣记录详情 +type GoldDrumWinLineInfo struct { + EleValue int //元素值 + Rate int64 //倍率 + WinCoin int64 //单线派彩 + GameType int //(0,1,2)无/免费游戏/聚宝盆游戏 +} +type GoldDrumGameType struct { + //all + RoomId int32 //房间Id + BasicScore int32 //单注分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + BetCoin int64 //下注金额 + WinCoin int64 //下注赢取金额总金额 + //Smallgamewinscore int64 //小游戏赢取的分数 + ChangeCoin int64 //本局游戏金额总变化 + FreeTimes int32 //免费转动次数 + AllWinNum int32 //中奖的线数 + HitPoolIdx int //下注索引 + Cards []int //15张牌 + + NowGameState int //当前游戏模式(0,1)普通/免费 + HitPrizePool []int64 //命中奖池(多喜小奖|多寿中奖|多禄大奖|多福巨奖) + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + WinLineInfo []GoldDrumWinLineInfo //中奖线详情 + + NowFreeGameTime int32 //当前免费游戏第几次 + CornucopiaCards []int32 //聚宝盆游戏数据 -1 未开启 0小将 1中奖 2大奖 3巨奖 + IsOffline bool //玩家是否掉线 true 掉线 + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 +} + +// 金福报喜记录详情 +type CopperInfo struct { + Pos int32 //铜钱元素索引,从0开始 + Coin int64 //铜钱奖励金币 +} +type GoldBlessWinLineInfo struct { + EleValue int //元素值 + Rate int64 //倍率 + WinCoin int64 //单线派彩 + GameType int //(0,1,2,3)无/免费游戏/聚宝盆游戏/招福纳财游戏 +} +type GoldBlessGameType struct { + //all + RoomId int32 //房间Id + BasicScore int32 //单注分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + BetCoin int64 //下注金额 + WinCoin int64 //本局总赢取金额 + //Smallgamewinscore int64 //小游戏赢取的分数 + ChangeCoin int64 //本局游戏金额总变化 + FreeTimes int32 //免费转动次数 + AllWinNum int32 //中奖的线数 + HitPoolIdx int //下注索引 + Cards []int //15张牌 + + NowGameState int //当前游戏模式(0,1,2)普通/免费/招福纳财 + HitPrizePool []int64 //命中奖池(多喜小奖|多寿中奖|多禄大奖|多福巨奖) + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + WinLineInfo []GoldBlessWinLineInfo //中奖线详情 + CopperNum int32 //本局铜钱数量 + CopperCoin int64 //本局铜钱金额 + CoppersInfo []CopperInfo //铜钱结构 + + NowFreeGameTime int32 //当前免费游戏第几次 + CornucopiaCards []int32 //聚宝盆游戏数据 -1 未开启 0小将 1中奖 2大奖 3巨奖 + IsOffline bool //玩家是否掉线 true 掉线 + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 +} + +// 发发发 +type Classic888Type struct { + //基本信息 + RoomId int //房间Id + BasicScore int32 //单注 + PlayerSnId int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + TotalBetCoin int64 //总押注 + TotalLine int32 //总线数(固定) + TotalWinCoin int64 //总派彩 + NowGameState int //当前游戏模式(0,1,2)普通/免费/停留旋转 + NowNRound int //第几轮 + IsOffline int //0,1 正常(不显示)/掉线(显示) + FirstFreeTimes int //免费游戏剩余次数 + SecondFreeTimes int //停留旋转游戏剩余次数 + //中奖统计 + HitPrizePool []int64 //命中奖池(小奖|中奖|大奖|巨奖) + WinLineNum int //中奖线个数 + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + LanternNum int //灯笼数量 + LanternWinCoin int64 //灯笼派彩 + //详情 + Cards []int32 //元素顺序 横向 + LanternRateCoin []int64 //灯笼金额 横向 + //中奖线详情 + WinLine []Classic888WinLine + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 +} +type Classic888WinLine struct { + Id int //线号 + EleValue int32 //元素值 + Num int //数量 + Rate int64 //倍率 + WinCoin int64 //单线派彩 + WinFreeGame int //(0,1,2,3)旋转并停留*3/免费游戏*6/免费游戏*9/免费游戏*15 +} + +// 多福 +type RichBlessedType struct { + //基本信息 + RoomId int //房间Id + BasicScore int32 //单注 + PlayerSnId int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + TotalBetCoin int64 //总押注 + TotalLine int32 //总线数(固定) + TotalWinCoin int64 //总派彩 + NowGameState int //当前游戏模式(0,1,2)普通/免费/jack小游戏 + NowNRound int //第几轮 + IsOffline int //0,1 正常(不显示)/掉线(显示) + FirstFreeTimes int //免费游戏剩余次数 + //中奖统计 + WinLineNum int //中奖线个数 + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + //详情 + Cards []int32 //普通游戏/免费游戏 + //jack游戏 + JackEleValue int32 //元素值 + JackMidCards []int64 //掀开位置 + //中奖线详情 + WinLine []RichBlessedWinLine + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 + RealCtrl bool //人工调控 + WBState int32 //调控等级 + WeightKey int32 //当前使用权重 +} +type RichBlessedWinLine struct { + Id int //线号 + EleValue int32 //元素值 + Num int //数量 + Rate int64 //倍率 + WinCoin int64 //单线派彩 +} + +// 经典777 +type FruitsType struct { + //基本信息 + RoomId int //房间Id + BasicScore int32 //单注 + PlayerSnId int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + TotalBetCoin int64 //总押注 + TotalLine int32 //总线数(固定) + TotalWinCoin int64 //总派彩 + NowGameState int //当前游戏模式(0,1,2)普通/免费/小玛丽 + NowNRound int //第几轮 + IsOffline int //0,1 正常(不显示)/掉线(显示) + FirstFreeTimes int //免费游戏剩余次数 + MaryFreeTimes int //停留旋转游戏剩余次数 + //中奖统计 + HitPrizePool int64 //命中奖池金额 + WinLineNum int //中奖线个数 + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + JackPotNum int //777数量 + JackPotWinCoin int64 //777派彩 + //详情 + Cards []int32 //普通游戏/免费游戏 + //玛丽游戏 + MaryOutSide int32 //外圈 + MaryMidCards []int32 //内圈 + //中奖线详情 + WinLine []FruitsWinLine + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 + RealCtrl bool //人工调控 + WBState int32 //调控等级 + WeightKey int32 //当前使用权重 +} +type FruitsWinLine struct { + Id int //线号 + EleValue int32 //元素值 + Num int //数量 + Rate int64 //倍率 + WinCoin int64 //单线派彩 + WinFreeGame int //(0,1,2,3,4,5)小玛丽1/小玛丽2/小玛丽3/免费5/免费8/免费10 +} + +// 无尽宝藏记录详情 +type EndlessTreasureWinLineInfo struct { + EleValue int //元素值 + Rate int64 //倍率 + WinCoin int64 //单线派彩 + GameType int //(0,1,2,3)无/免费游戏/聚宝盆游戏/节节高游戏 +} +type EndlessTreasureGameType struct { + //all + RoomId int32 //房间Id + TotalBetScore int32 //总押注 + BasicScore float32 //单注分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + BetCoin int64 //下注金额 + WinCoin int64 //本局总赢取金额 + ChangeCoin int64 //本局游戏金额总变化 + FreeTimes int32 //免费转动次数 + AllWinNum int32 //中奖的线数 + Cards []int //15张牌 + + NowGameState int //当前游戏模式(0,1,2)普通/免费/节节高 + HitPrizePool []int64 //命中奖池(小奖|中奖|大奖|巨奖) + WinLineRate int64 //中奖线总倍率 + WinLineCoin int64 //中奖线派彩 + WinLineInfo []EndlessTreasureWinLineInfo //中奖线详情 + CopperNum int32 //本局铜钱数量 + CopperCoin int64 //本局铜钱金额 + CoppersInfo []CopperInfo //铜钱结构 + + NowFreeGameTime int32 //当前免费游戏第几次 + IsOffline bool //玩家是否掉线 true 掉线 + AddFreeTimes int32 //本局新增免费转动次数 + WBLevel int32 //黑白名单等级 + TaxCoin int64 //税收 +} + +// 拉霸类游戏 基础牌局记录 +type SlotBaseResultType struct { + RoomId int32 //房间Id + BasicBet int32 //基本分(单注金额) + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + IsFirst bool //是否第一次玩游戏 + IsFree bool //是否免费 + TotalBet int32 //总押注金额 + WinRate int32 //中奖的倍率 + FreeTimes int32 //免费转动次数 + AllWinNum int32 //中奖的总线数 + Tax int64 //暗税 + WBLevel int32 //黑白名单等级 + SingleFlag int32 //0不控1单控赢2单控输 + WinLineScore int64 //中奖线赢取分数 + WinJackpot int64 //奖池赢取分数 + WinSmallGame int64 //小游戏赢取分数 + WinTotal int64 //本次游戏总赢取(本次游戏赢取总金额=中奖线赢取+奖池赢取+小游戏赢取) + Cards []int32 //15张牌 + IsFoolPlayer bool //是否是新手 +} + +// 小火箭游戏 每局记录 +type SmallRocketBaseResultType struct { + //all + RoomId int32 //房间Id + TotalBetVal int64 //总押注 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + WinCoin int64 //本局总赢取金额 + + BetCoin1 int64 //下注金额1 + BetMul1 float64 //下注倍数1 + IsAutoBetAndTake1 bool //自动领取1 + TakeBetMul1 float64 //提款倍数1 + BetCoin2 int64 //下注金额2 + BetMul2 float64 //下注倍数2 + IsAutoBetAndTake2 bool //自动领取2 + TakeBetMul2 float64 //提款倍数2 + + TaxCoin int64 //税收 +} + +type GameResultLog struct { + BaseResult *SlotBaseResultType + AllLine int32 //线路数 + UserName string //昵称 + WinLines []int //赢分的线 + BetLines []int64 //下注的线 +} + +// 幸运骰子 +type LuckyDiceType struct { + RoomId int32 //房间Id + RoundId int32 //局数编号 + BaseScore int32 //底分 + PlayerSnid int32 //玩家id + UserName string //昵称 + BeforeCoin int64 //本局前金额 + AfterCoin int64 //本局后金额 + ChangeCoin int64 //金额变化 + Bet int64 //总押注数 + Refund int64 //返还押注数 + Award int64 //获奖金额 + BetSide int32 //压大压小 0大 1小 + Dices []int32 //3个骰子值 + Tax int64 //赢家税收 + WBLevel int32 //黑白名单等级 +} + +type CandyType struct { + RoomId int32 //房间Id + SpinID int32 //局数编号 + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + AllWinNum int32 //中奖的线数 + WinScore int32 //中奖的倍率 + AllLine int32 //线路数 + Cards []int32 //9张牌 + BetLines []int64 //下注的线 + WBLevel int32 //黑白名单等级 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + WinLines []int // 赢分的线 + WinJackpot int64 // 赢奖池分数 +} +type MiniPokerType struct { + RoomId int32 //房间Id + SpinID int32 //局数编号 + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + WinScore int32 //中奖的倍率 + Cards []int32 //5张牌 + WBLevel int32 //黑白名单等级 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + WinJackpot int64 // 赢奖池分数 +} +type CaoThapType struct { + RoomId int32 //房间Id + BasicScore int32 //基本分 + PlayerSnid int32 //玩家id + BeforeCoin int64 //下注前金额 + AfterCoin int64 //下注后金额 + ChangeCoin int64 //金额变化 + Score int32 //总押注数 + Tax int64 //暗税 + IsFirst bool + Cards []int32 //翻的牌 + WBLevel int32 //黑白名单等级 + UserName string // 昵称 + TotalPriceValue int64 // 总赢分 + WinJackpot int64 // 赢奖池分数 + BetInfo []CaoThapBetInfo // 每次下注信息 +} +type CaoThapBetInfo struct { + TurnID int32 // 操作ID + TurnTime int64 // 操作时间 + BetValue int64 // 下注金额 + Card int32 // 牌值 + PrizeValue int64 // 赢分 +} + +// 21点 +type BlackJackType struct { + RoomId int32 //房间ID + RoomType int32 //房间类型 + NumOfGames int //当前局数 + PlayerCount int //玩家数量 + PlayerData []*BlackJackPlayer //玩家信息 + BankerCards []int32 //庄家牌 + BankerCardType int32 //牌型 1:黑杰克 2:五小龙 3:其它点数 4:爆牌 + BankerCardPoint []int32 //点数 + BetCoin int64 //总下注 + GainCoinTax int64 //总输赢分(税前) +} + +type BlackJackCardInfo struct { + Cards []int32 //闲家牌 + CardType int32 //牌型 1:黑杰克 2:五小龙 3:其它点数 4:爆牌 + CardPoint []int32 //点数 + BetCoin int64 //下注 + GainCoinNoTax int64 //总输赢分(税后) + IsWin int32 //输赢 1赢 0平 -1输 +} + +type BlackJackPlayer struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + IsRob bool //是否是机器人 + Flag int //标识 + IsFirst bool //是否第一次 + Hands []BlackJackCardInfo //牌值 + IsWin int32 //输赢 + GainCoinNoTax int64 //总输赢分(税后) + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + BaoCoin int64 //保险金 + BaoChange int64 //保险金输赢分 + BetCoin int64 //下注额 + BetChange int64 //下注输赢分 + Seat int //座位号 +} + +type DezhouPots struct { + BetTotal int64 //边池下注 + Player []DezhouPotPlayer //边池的玩家 +} +type DezhouPotPlayer struct { + Snid int32 //玩家ID + IsWin int32 //边池输赢 +} + +// 德州牌局记录 +type DeZhouUserOp struct { + Snid int32 // 操作人 + Op int32 // 操作类型 见 dezhoupoker.proto + Stage int // 所处牌局阶段 见 constants.go + Chip int64 // 操作筹码, (不下注为0) + ChipOnTable int64 // 操作后桌子上筹码 + Round int32 // 轮数 + Sec float64 // 操作时距离本局开始时的秒数 + TargetId int32 // 操作对象ID(没其他玩家为对象为0) +} + +// 德州 +type DezhouType struct { + RoomId int32 //房间ID + RoomType int32 //房间类型 + NumOfGames int32 //当前局数 + BankId int32 //庄家ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + BaseCards []int32 //公牌 只限于德州用 + PlayerData []DezhouPerson //玩家信息 + Pots []DezhouPots //边池情况 + Actions string //牌局记录 + UserOps []*DeZhouUserOp //牌局记录new +} +type DezhouPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + IsRob bool //是否是机器人 + IsFirst bool //是否第一次 + IsLeave bool //中途离开 + InitCard []int32 //初始牌值 + Cardinfo []int32 //牌值 + IsWin int32 //输赢 + GainCoinNoTax int64 //总输赢分(税后) + Tax int64 //税,不一定有值,只是作为一个临时变量使用 + BetTotal int64 //用户当局总下注 + IsAllIn bool //是否全下 + RoundFold int32 //第几轮弃牌 + CardInfoEnd []int32 //结算时的牌型 + Seat int //座位号 +} + +// tienlen +type TienLenType struct { + GameId int //游戏id + BaseScore int32 //底分 + PlayerData []TienLenPerson //玩家信息 +} + +type TienLenPerson struct { + UserId int32 //玩家ID + IsRob bool //是否是机器人 + BillCoin int64 //最终得分(税后) + BillTaxCoin int64 //最终税收 + + BombCoin int64 //炸弹输赢分(税后) + BombTaxCoin int64 //炸弹税收 + CardInfoEnd []int32 //结算时的牌型 +} + +// chesstitians +type ChesstitiansType struct { + GameId int //游戏id + RoomId int32 //房间ID + RoomType int32 //房间类型 + NumOfGames int32 //当前局数 + BankId int32 //房主ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + TaxRate int32 //税率(万分比) + PlayerData []*ChesstitiansPerson //玩家信息 + RoomMode int +} +type ChesstitiansPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + IsRob bool //是否是机器人 + IsFirst bool //是否第一次 + IsLeave bool //中途离开 + IsWin int32 //输赢 + Seat int //座位号 + GainCoin int64 //手牌输赢分(税后) + GainTaxCoin int64 //手牌税收 +} + +// tala +type TaLaType struct { + GameId int //游戏id + RoomId int32 //房间ID + RoomType int32 //房间类型 + NumOfGames int32 //当前局数 + BankId int32 //房主ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + TaxRate int32 //税率(万分比) + RoomMode int + PlayerData []TaLaPerson //玩家信息 +} +type TaLaPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + IsRob bool //是否是机器人 + IsFirst bool //是否第一次 + IsLeave bool //中途离开 + Seat int //座位号 + ChiCoin int64 //吃输赢分(税后) + BillCoin int64 //最终得分(税后) + ChiTaxCoin int64 //吃税收 + BillTaxCoin int64 //最终税收 + IsHu bool //胡 + IsWin int32 //胜负 0平 1胜 2负 + IsLoseHu bool //包赔 + Phoms [][]int32 //phom + IsNoPhom bool //瘪 + Cards []int32 //手牌 + CardsValue int32 //点数 + OpPhom []int32 //寄 + TaLaPersonOp []TaLaPersonOp //操作信息 +} +type TaLaPersonOp struct { + Round int32 + MoCard int32 + ChuCard int32 + ChiCard int32 + Cards []int32 +} + +// samloc +type SamLocType struct { + GameId int //游戏id + RoomId int32 //房间ID + RoomType int32 //房间类型 + NumOfGames int32 //当前局数 + BankId int32 //房主ID + PlayerCount int //玩家数量 + BaseScore int32 //底分 + TaxRate int32 //税率(万分比) + PlayerData []SamLocPerson //玩家信息 + RoomMode int +} +type SamLocPerson struct { + UserId int32 //玩家ID + UserIcon int32 //玩家头像 + Platform string `json:"-"` + Channel string `json:"-"` + Promoter string `json:"-"` + PackageTag string `json:"-"` + InviterId int32 `json:"-"` + WBLevel int32 //黑白名单等级 + IsRob bool //是否是机器人 + IsFirst bool //是否第一次 + IsLeave bool //中途离开 + IsWin int32 //输赢 + Seat int //座位号 + GainCoin int64 //手牌输赢分(税后) + BombCoin int64 //炸弹输赢分(税后) + BillCoin int64 //最终得分(税后) + GainTaxCoin int64 //手牌税收 + BombTaxCoin int64 //炸弹税收 + BillTaxCoin int64 //最终税收 + DelOrderCards map[int][]int32 //已出牌 + CardInfoEnd []int32 //结算时的牌型 + IsTianHu bool //是否天胡 +} + +// 娃娃机 每局记录 +type ClawdollResultType struct { + //all + RoomId int32 //房间Id + MachineId int32 //娃娃机Id + PlayerSnid int32 //玩家id + BeforeClawdollItemNum int64 //变化前娃娃币 + AfterClawdollItemNum int64 //变化后娃娃币 + IsWin bool //是否成功 + Channel string //渠道 + Name string //场次名字 +} diff --git a/statistics/task/task/gamerate.go b/statistics/task/task/gamerate.go new file mode 100644 index 0000000..1fbf2de --- /dev/null +++ b/statistics/task/task/gamerate.go @@ -0,0 +1,110 @@ +package task + +import ( + "encoding/json" + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/goserver/core/logger" + "slices" +) + +// 场次平均倍数 + +func PlayerGameRate(plt string, startTime, endTime string, gamefreeid int) (total, bombTotal, remain2Total int, rateAvg, bombRateAvg float64, err error) { + var totalRate, totalBombRate float64 + err = GameDetailFunc(plt, startTime, endTime, gamefreeid, func(data bson.M) error { + rate, isBomb, bombRate, remain2 := GameDetailRate(data) + total++ + if isBomb { + bombTotal++ + } + totalRate += rate + totalBombRate += bombRate + if remain2 { + remain2Total++ + } + return nil + }) + if total > 0 { + rateAvg = totalRate / float64(total) + } + if bombTotal > 0 { + bombRateAvg = totalBombRate / float64(bombTotal) + } + return +} + +// rate 赢分/底分 +// isBomb 是否有炸弹 +// bombRate 炸弹倍数,炸弹赢分/底分 +// remain2 是否有剩余2 +func GameDetailRate(data bson.M) (rate float64, isBomb bool, bombRate float64, remain2 bool) { + if data == nil { + return + } + gameid := data["gameid"].(int32) + gamefreeid := data["gamefreeid"].(int32) + logger.Logger.Tracef("GameDetail gameid:%d, gamefreeid:%d", gameid, gamefreeid) + + detail := data["gamedetailednote"] + if detail == nil { + return + } + + raw := new(RabbitMQDataRaw) + if err := json.Unmarshal([]byte(detail.(string)), raw); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 1 error:%v %v", err, gameid) + return + } + + switch gameid { + case 207, 208, 209, 210, 240, 241, 242, 243, 244, 245, 246, 247: // tienlen + d := new(TienLenType) + b, err := json.Marshal(raw.Data) + if err != nil { + logger.Logger.Errorf("GameDetailCount Marshal error:%v %v", err, gameid) + return + } + if err := json.Unmarshal(b, d); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 2 error:%v %v", err, gameid) + return + } + + for _, v := range d.PlayerData { + if v.BillCoin > 0 { + rate = float64(v.BillCoin+v.BillTaxCoin) / float64(d.BaseScore) + } + if v.BombCoin > 0 { + isBomb = true + bombRate = float64(v.BombCoin+v.BombTaxCoin) / float64(d.BaseScore) + } + if slices.ContainsFunc(v.CardInfoEnd, func(i int32) bool { + switch i { + case 51, 38, 25, 12: + return true + } + return false + }) { + remain2 = true + } + } + + case 211, 212, 213, 214: + d := new(ThirteenWaterType) + b, err := json.Marshal(raw.Data) + if err != nil { + logger.Logger.Errorf("GameDetailCount Marshal error:%v %v", err, gameid) + return + } + if err := json.Unmarshal(b, d); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 2 error:%v %v", err, gameid) + return + } + + for _, v := range d.PlayerData { + if v.AllScore > 0 { + rate = float64(v.AllScore) / float64(d.BaseScore) + } + } + } + return +} diff --git a/statistics/task/task/gametime.go b/statistics/task/task/gametime.go new file mode 100644 index 0000000..3c184c7 --- /dev/null +++ b/statistics/task/task/gametime.go @@ -0,0 +1,104 @@ +package task + +import ( + "context" + "errors" + "fmt" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/mongo/options" + "mongo.games.com/game/common" + mongomodel "mongo.games.com/game/statistics/modelmongo" + "mongo.games.com/goserver/core/logger" + mymongo "mongo.games.com/goserver/core/mongox" +) + +// 新用户平均游戏时长 + +// 返回 总游戏时长,总局数,错误 +func NewPlayerGameTime(plt string, ids []int, startTime, endTime string, gamefreeid int) (int, int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + c, err := mymongo.GetLogCollection(plt, mongomodel.LogGamePlayerListLog) + if err != nil { + return 0, 0, err + } + + c2, err := mymongo.GetLogCollection(plt, "log_gamedetailed") + if err != nil { + return 0, 0, err + } + + var ret int + var total int + for _, v := range ids { + // 查询玩家游戏时长 + where := bson.M{"snid": v, "time": bson.M{"$gte": s, "$lt": e}} + if gamefreeid > 0 { + where["gamefreeid"] = gamefreeid + } + cur, err := c.Find(context.TODO(), where, options.Find().SetProjection(bson.M{"gamedetailedlogid": 1})) + if err != nil { + logger.Logger.Errorf("find player gamedetailedlogid get err: %v", err) + return 0, 0, err + } + for cur.TryNext(context.TODO()) { + var vv struct{ Gamedetailedlogid string } + if err = cur.Decode(&vv); err != nil { + logger.Logger.Errorf("find player gamedetailedlogid decode err: %v", err) + cur.Close(context.Background()) + return 0, 0, err + } + // 查询游戏时长 + var res2 struct{ Gametiming int } + r := c2.FindOne(context.TODO(), bson.M{"logid": vv.Gamedetailedlogid}, options.FindOne().SetProjection(bson.M{"gametiming": 1})) + if r.Err() != nil && !errors.Is(r.Err(), mongo.ErrNoDocuments) { + logger.Logger.Errorf("find game time get err: %v", err) + cur.Close(context.Background()) + return 0, 0, err + } + if err := r.Decode(&res2); err != nil { + logger.Logger.Errorf("find game time decode err: %v", err) + cur.Close(context.Background()) + return 0, 0, err + } + ret += res2.Gametiming + total++ + } + cur.Close(context.Background()) + } + + return ret, total, nil +} + +// NewPlayerGameTimeAvg 新用户平均游戏时长 +// 新用户平均游戏时长(不算大厅时间):当天注册的玩家在房间中的总时长/当天注册总人数 +// 返回 参与人数,游戏时长 +func NewPlayerGameTimeAvg(plt string, startTime, endTime string, gamefreeid int) (int, int, error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return 0, 0, fmt.Errorf("time format error") + } + ids, err := GetNewPayerIds(plt, startTime, endTime) + if err != nil { + return 0, 0, err + } + if len(ids) == 0 { + return 0, 0, nil + } + a, _, err := NewPlayerGameTime(plt, ids, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + if len(ids) == 0 { + return 0, 0, nil + } + + b, err := PlayingGameCount(plt, ids, startTime, endTime, gamefreeid) + if err != nil { + return 0, 0, err + } + if b == 0 { + return 0, 0, nil + } + return b, a, err +} diff --git a/statistics/task/task/rechargeoffline.go b/statistics/task/task/rechargeoffline.go new file mode 100644 index 0000000..fe31c2d --- /dev/null +++ b/statistics/task/task/rechargeoffline.go @@ -0,0 +1,62 @@ +package task + +import ( + "context" + "fmt" + "go.mongodb.org/mongo-driver/mongo/options" + + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/game/common" + mymongo "mongo.games.com/goserver/core/mongox" +) + +type RechargeOfflineData struct { + Snid int32 + Coin int64 +} + +func OfflineCoin(plt string, startTime, endTime string) (res []*RechargeOfflineData, err error) { + s, e := common.StrRFC3339TimeToTime(startTime), common.StrRFC3339TimeToTime(endTime) + if s.IsZero() || e.IsZero() { + return nil, fmt.Errorf("time format error") + } + c, err := mymongo.GetLogCollection(plt, "log_dbshop") + if err != nil { + return nil, err + } + cur, err := c.Find(context.TODO(), bson.M{"ts": bson.M{"$gte": s.Unix(), "$lt": e.Unix()}, "consume": 3, "state": 1}) + if err != nil { + return nil, err + } + defer cur.Close(context.Background()) + + var list []struct{ Snid int32 } + if err = cur.All(context.Background(), &list); err != nil { + return nil, err + } + + snids := map[int32]struct{}{} + + for _, v := range list { + if _, ok := snids[v.Snid]; ok { + continue + } + snids[v.Snid] = struct{}{} + + // 最后金币数量 + c, err := mymongo.GetLogCollection(plt, "log_coinex") + if err != nil { + return nil, err + } + one := c.FindOne(context.TODO(), bson.M{"snid": v.Snid, "cointype": 0, "ts": bson.M{"$lt": e.Unix()}}, options.FindOne().SetSort(bson.M{"ts": -1})) + if one.Err() != nil { + return nil, one.Err() + } + var data struct{ Restcount int64 } + if err = one.Decode(&data); err != nil { + return nil, err + } + res = append(res, &RechargeOfflineData{Snid: v.Snid, Coin: data.Restcount}) + } + return +} diff --git a/statistics/task/task/robotwin.go b/statistics/task/task/robotwin.go new file mode 100644 index 0000000..37fa8cf --- /dev/null +++ b/statistics/task/task/robotwin.go @@ -0,0 +1,138 @@ +package task + +import ( + "encoding/json" + "go.mongodb.org/mongo-driver/bson" + "mongo.games.com/goserver/core/logger" + "sort" +) + +// RobotWinRate 机器人胜利 +// 返回 玩家胜利局数,总局数 +func RobotWinRate(plt string, startTime, endTime string, gamefreeid int) (a, b int, err error) { + err = GameDetailFunc(plt, startTime, endTime, gamefreeid, func(data bson.M) error { + isPlayerWin, to := GameDetailRobot(data) + if isPlayerWin { + a++ + } + b += to + return nil + }) + return +} + +func GameDetailRobot(data bson.M) (isPlayerWin bool, to int) { + if data == nil { + return + } + gameid := data["gameid"].(int32) + gamefreeid := data["gamefreeid"].(int32) + logger.Logger.Tracef("GameDetailRobot gameid:%d, gamefreeid:%d", gameid, gamefreeid) + + detail := data["gamedetailednote"] + if detail == nil { + return + } + + raw := new(RabbitMQDataRaw) + if err := json.Unmarshal([]byte(detail.(string)), raw); err != nil { + logger.Logger.Errorf("GameDetailRobot Unmarshal 1 error:%v %v", err, gameid) + return + } + + switch gameid { + case 207, 208, 209, 210, 240, 241, 242, 243, 244, 245, 246, 247: // tienlen + data := new(TienLenType) + b, err := json.Marshal(raw.Data) + if err != nil { + logger.Logger.Errorf("GameDetailCount Marshal error:%v %v", err, gameid) + return + } + if err := json.Unmarshal(b, data); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 2 error:%v %v", err, gameid) + return + } + + var has, hasPlayer bool + for _, v := range data.PlayerData { + if v.IsRob { + has = true + } + if !v.IsRob { + hasPlayer = true + } + } + if !has || !hasPlayer { + // 没有机器人 + return + } + + sort.Slice(data.PlayerData, func(i, j int) bool { + a, b := data.PlayerData[i].BillCoin+data.PlayerData[i].BillTaxCoin, data.PlayerData[j].BillCoin+data.PlayerData[j].BillTaxCoin + if a != b { + return a > b + } + if data.PlayerData[i].IsRob != data.PlayerData[j].IsRob { + return !data.PlayerData[i].IsRob + } + return data.PlayerData[i].UserId < data.PlayerData[j].UserId + }) + + for k, v := range data.PlayerData { + if !v.IsRob && v.BillCoin > 0 && k <= 1 { + isPlayerWin = true + break + } + } + + to = 1 + + case 211, 212, 213, 214: + data := new(ThirteenWaterType) + b, err := json.Marshal(raw.Data) + if err != nil { + logger.Logger.Errorf("GameDetailCount Marshal error:%v %v", err, gameid) + return + } + if err := json.Unmarshal(b, data); err != nil { + logger.Logger.Errorf("GameDetailCount Unmarshal 2 error:%v %v", err, gameid) + return + } + + var has, hasPlayer bool + for _, v := range data.PlayerData { + if v.IsRob { + has = true + } + if !v.IsRob { + hasPlayer = true + } + } + if !has || !hasPlayer { + // 没有机器人 + return + } + + sort.Slice(data.PlayerData, func(i, j int) bool { + a, b := data.PlayerData[i].AllScore, data.PlayerData[j].AllScore + if a != b { + return a > b + } + if data.PlayerData[i].IsRob != data.PlayerData[j].IsRob { + return !data.PlayerData[i].IsRob + } + return data.PlayerData[i].UserId < data.PlayerData[j].UserId + }) + + for k, v := range data.PlayerData { + if !v.IsRob && v.AllScore > 0 && k <= 1 { + isPlayerWin = true + break + } + } + + to = 1 + } + + return +} diff --git a/tools/upload/config.json b/tools/upload/config.json index b3c35ad..62d98ff 100644 --- a/tools/upload/config.json +++ b/tools/upload/config.json @@ -3,5 +3,6 @@ "Passwd": "123456", "Addr": "127.0.0.1", "RemoteDir": "/root/win88", - "LocalDir": "D:\\trunk\\src\\mongo.games.com\\game" + "LocalDir": "D:\\trunk\\src\\mongo.games.com\\game", + "PPK": "C:\\Users\\dell\\Downloads\\beta.ppk" } \ No newline at end of file diff --git a/worldsrv/friendmgr.go b/worldsrv/friendmgr.go index 4a8e394..c10caea 100644 --- a/worldsrv/friendmgr.go +++ b/worldsrv/friendmgr.go @@ -511,7 +511,7 @@ func (this *FriendMgr) FriendApply(p *Player, destP *model.BindFriend) { // p 同意者 // destP 申请者 func (this *FriendMgr) FriendAgree(p *Player, destP *model.BindFriend) { - var applyList []int32 + var applyList, meApplyList []int32 SendToClick := func(retCode friend.OpResultCode, self ...bool) { pack := &friend.SCFriendOp{ OpCode: proto.Int32(OpTypeAgree), @@ -534,6 +534,10 @@ func (this *FriendMgr) FriendAgree(p *Player, destP *model.BindFriend) { RoleId: int32(roleId), } p.SendToClient(int(friend.FriendPacketID_PACKET_SCFriendOp), pack) + if meApplyList != nil { + p.ApplyList = meApplyList + this.SendApplyList(p) + } } else { destPs := PlayerMgrSington.GetPlayerBySnId(destP.SnId) if destPs != nil && destPs.IsOnLine() { @@ -608,52 +612,73 @@ func (this *FriendMgr) FriendAgree(p *Player, destP *model.BindFriend) { } } - ret, err := model.QueryFriendApplyBySnid(p.Platform, p.SnId) - if err != nil { - return friend.OpResultCode_OPRC_Error - } - // 维护申请放和被申请方的申请列表 - //查看是否在申请列表 - if ret != nil { - if ret.ApplySnids != nil { - for i, as := range ret.ApplySnids { - if as.SnId == destP.SnId { - // 删除被申请者的申请列表 - ret.ApplySnids = append(ret.ApplySnids[:i], ret.ApplySnids[i+1:]...) - model.UpsertFriendApply(p.Platform, p.SnId, ret) - - // 删除发起方的申请列表 - data, err := model.QueryFriendApplyListBySnid(p.Platform, destP.SnId) - if err != nil { - logger.Logger.Errorf("QueryFriendApplyListBySnid err:%v", err) - } else { - if data == nil { - data = model.NewApplyList(destP.SnId) - } - for k, v := range data.List { - if v == p.SnId { - data.List = append(data.List[:k], data.List[k+1:]...) - model.UpsertApplyList(p.Platform, data) - applyList = data.List - break - } - } - } - - // 保存好友关系 - if friendDB != nil { - friendDB.BindFriend = append(friendDB.BindFriend, &model.BindFriend{ - SnId: p.SnId, - CreateTime: time.Now().Unix(), - }) - model.UpsertFriend(friendDB) - } - return nil + // 删除申请者的申请列表 + delApplyListFunc := func(plt string, snid int32, applySnid int32) friend.OpResultCode { + // 删除被申请者的申请列表 + list1, err := model.QueryFriendApplyBySnid(plt, snid) + if err != nil { + logger.Logger.Errorf("QueryFriendApplyBySnid %v error: %v", snid, err) + return friend.OpResultCode_OPRC_Error + } + if list1 != nil { + k := 0 + for k < len(list1.ApplySnids) { + if list1.ApplySnids[k].SnId == applySnid { + list1.ApplySnids = append(list1.ApplySnids[:k], list1.ApplySnids[k+1:]...) + model.UpsertFriendApply(plt, snid, list1) + } else { + k++ } } } + // 删除发起方的申请列表 + list2, err := model.QueryFriendApplyListBySnid(plt, applySnid) + if err != nil { + logger.Logger.Errorf("QueryFriendApplyListBySnid %v error: %v", applySnid, err) + return friend.OpResultCode_OPRC_Error + } + if list2 != nil { + k := 0 + for k < len(list2.List) { + if list2.List[k] == snid { + list2.List = append(list2.List[:k], list2.List[k+1:]...) + model.UpsertApplyList(plt, list2) + } else { + k++ + } + } + } + + if applySnid == destP.SnId && list2 != nil { + applyList = list2.List + } + + if applySnid == p.SnId && list2 != nil { + meApplyList = list2.List + } + + return friend.OpResultCode_OPRC_Sucess } - return friend.OpResultCode_OPRC_Error + + //查看是否在申请列表 + code := delApplyListFunc(p.Platform, p.SnId, destP.SnId) + if code != friend.OpResultCode_OPRC_Sucess { + return code + } + code = delApplyListFunc(p.Platform, destP.SnId, p.SnId) + if code != friend.OpResultCode_OPRC_Sucess { + return code + } + // 保存好友关系 + if friendDB != nil { + friendDB.BindFriend = append(friendDB.BindFriend, &model.BindFriend{ + SnId: p.SnId, + CreateTime: time.Now().Unix(), + }) + model.UpsertFriend(friendDB) + } + + return nil }), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) { if data != nil { logger.Logger.Error("FriendAgree data:", data) diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index c14348e..772d847 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -113,6 +113,10 @@ func (this *WelfareMgr) GetReliefFund(p *Player, isVideo bool) { mq.Write(log) logger.Logger.Tracef("NewReliefFundLogEx WriteLog snid: %v Coin:%v", p.SnId, pack.Coin) } + if !p.IsRob { + mq.Write(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, + model.SystemFreeGive_GiveType_ReliefFund, model.SystemFreeGive_CoinType_Coin, coin)) + } } } logger.Logger.Tracef("GetReliefFund snid: %v pack: %v", p.SnId, pack) @@ -1114,7 +1118,7 @@ func (this *WelfareMgr) BlindBoxInfo(p *Player, bid int32) { if cyc == 1 || blindBox.Cycle == model.WelfareOpen { p.WelfData.BlindBoxId = 0 } - } // == 1代表当日循环 + } // == 1代表当日循环 if p.WelfData.BlindBoxId == 0 { // 未领取过发随机Date idx := bid diff --git a/xlsx/DB_GameFree.xlsx b/xlsx/DB_GameFree.xlsx index 2e8f155..b7c8e83 100644 Binary files a/xlsx/DB_GameFree.xlsx and b/xlsx/DB_GameFree.xlsx differ diff --git a/xlsx/DB_GameRule.xlsx b/xlsx/DB_GameRule.xlsx index 1d7b71f..1c38755 100644 Binary files a/xlsx/DB_GameRule.xlsx and b/xlsx/DB_GameRule.xlsx differ