Merge branch 'develop' into sk
This commit is contained in:
commit
2c48adeca7
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -64,10 +64,10 @@ func (svc *DbShopLogSvc) UpdateDbShopState(args *model.DbShopLogArgs, ret *bool)
|
||||||
logger.Logger.Error("UpdateDbShopState == nil")
|
logger.Logger.Error("UpdateDbShopState == nil")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
logger.Logger.Trace("DbShopLogSvc.UpdateDbShopState")
|
logger.Logger.Info("DbShopLogSvc.UpdateDbShopState", args.Log.LogId)
|
||||||
err = clog.UpdateId(args.Log.LogId, bson.M{"$set": bson.M{"state": args.Log.State}})
|
err = clog.UpdateId(args.Log.LogId, bson.M{"$set": bson.M{"state": args.Log.State}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Logger.Error("DbShopLogSvc.UpdateDbShopState error:", err)
|
logger.Logger.Error("DbShopLogSvc.UpdateDbShopState error:", err, "LogId = ", args.Log.LogId)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
*ret = true
|
*ret = true
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"mongo.games.com/game/dbproxy/mongo"
|
"mongo.games.com/game/dbproxy/mongo"
|
||||||
"mongo.games.com/game/mgrsrv/api"
|
"mongo.games.com/game/mgrsrv/api"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
|
"mongo.games.com/game/webapi"
|
||||||
"mongo.games.com/goserver/core/basic"
|
"mongo.games.com/goserver/core/basic"
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
@ -119,6 +120,8 @@ func init() {
|
||||||
gob.Register(map[string]*model.APITransactStats{})
|
gob.Register(map[string]*model.APITransactStats{})
|
||||||
gob.Register(api.ApiStats{}) // 这里依赖了mgrsrv的结构体,会导致mgrsrv初始化,最好是把结构体放到一个公共包里,不要两个不相关的程序有直接依赖
|
gob.Register(api.ApiStats{}) // 这里依赖了mgrsrv的结构体,会导致mgrsrv初始化,最好是把结构体放到一个公共包里,不要两个不相关的程序有直接依赖
|
||||||
gob.Register(map[string]api.ApiStats{})
|
gob.Register(map[string]api.ApiStats{})
|
||||||
|
gob.Register(webapi.ApiStats{})
|
||||||
|
gob.Register(map[string]webapi.ApiStats{})
|
||||||
gob.Register(mgo.Stats{})
|
gob.Register(mgo.Stats{})
|
||||||
gob.Register(profile.TimeElement{})
|
gob.Register(profile.TimeElement{})
|
||||||
gob.Register(map[string]profile.TimeElement{})
|
gob.Register(map[string]profile.TimeElement{})
|
||||||
|
|
|
@ -42,8 +42,8 @@ const (
|
||||||
ETCDKEY_MACHINE = "/game/machine_config" //娃娃机配置
|
ETCDKEY_MACHINE = "/game/machine_config" //娃娃机配置
|
||||||
ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众
|
ETCDKEY_MatchAudience = "/game/match_audience" //比赛观众
|
||||||
ETCDKEY_Spirit = "/game/spirit" // 小精灵配置
|
ETCDKEY_Spirit = "/game/spirit" // 小精灵配置
|
||||||
ETCDKEY_RoomType = "/game/room_type" // 房间类型配置
|
ETCDKEY_RoomType = "/game/room_type/" // 房间类型配置
|
||||||
ETCDKEY_RoomConfig = "/game/room_config" // 房间配置
|
ETCDKEY_RoomConfig = "/game/room_config/" // 房间配置
|
||||||
ETCDKEY_RoomConfigSystem = "/game/room_system" // 系统房间配置
|
ETCDKEY_RoomConfigSystem = "/game/room_system" // 系统房间配置
|
||||||
ETCDKEY_ClientUpgrade = "/game/client_upgrade" // 客户端升级奖励配置
|
ETCDKEY_ClientUpgrade = "/game/client_upgrade" // 客户端升级奖励配置
|
||||||
ETCDKEY_PopUpWindow = "/game/PopUpWindowConfig" //弹窗配置
|
ETCDKEY_PopUpWindow = "/game/PopUpWindowConfig" //弹窗配置
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
rawproto "google.golang.org/protobuf/proto"
|
rawproto "google.golang.org/protobuf/proto"
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
@ -641,15 +642,15 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
var gameTimes, gameFreeTimes int64
|
var gameTimes, gameFreeTimes int64
|
||||||
data, ok := this.GDatas[this.scene.KeyGamefreeId]
|
data, ok := this.GDatas[this.scene.KeyGamefreeId]
|
||||||
if ok {
|
if ok {
|
||||||
gameFirstTime = data.FirstTime
|
gameFreeFirstTime = data.FirstTime
|
||||||
gameTimes = data.Statics.GameTimes
|
gameFreeTimes = data.Statics.GameTimes
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录玩家 首次参与该游戏时间 游戏次数(不区分场次)
|
// 记录玩家 首次参与该游戏时间 游戏次数(不区分场次)
|
||||||
dataGame, ok := this.GDatas[this.scene.KeyGameId]
|
dataGame, ok := this.GDatas[this.scene.KeyGameId]
|
||||||
if ok {
|
if ok {
|
||||||
gameFreeFirstTime = dataGame.FirstTime
|
gameFirstTime = dataGame.FirstTime
|
||||||
gameFreeTimes = dataGame.Statics.GameTimes
|
gameTimes = dataGame.Statics.GameTimes
|
||||||
}
|
}
|
||||||
|
|
||||||
isNew := int32(0)
|
isNew := int32(0)
|
||||||
|
@ -668,12 +669,13 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
var ret ReportGameEventOnly
|
var ret ReportGameEventOnly
|
||||||
ret.Param = param
|
ret.Param = param
|
||||||
log := &model.PlayerGameRecEvent{
|
log := &model.PlayerGameRecEvent{
|
||||||
|
Id: primitive.NewObjectID().Hex(),
|
||||||
Platform: this.Platform,
|
Platform: this.Platform,
|
||||||
RecordId: this.scene.GetRecordId(),
|
RecordId: this.scene.GetRecordId(),
|
||||||
SnId: this.GetSnId(),
|
SnId: this.GetSnId(),
|
||||||
Channel: this.Channel,
|
Channel: this.Channel,
|
||||||
ChannelId: this.ChannelId,
|
ChannelId: this.ChannelId,
|
||||||
City: this.City,
|
//City: this.City,
|
||||||
OS: this.DeviceOS,
|
OS: this.DeviceOS,
|
||||||
GameId: this.scene.GameId,
|
GameId: this.scene.GameId,
|
||||||
ModeId: this.scene.GameMode,
|
ModeId: this.scene.GameMode,
|
||||||
|
@ -686,12 +688,12 @@ func (this *Player) ReportGameEvent(param *ReportGameEventParam) *ReportGameEven
|
||||||
IsNew: isNew,
|
IsNew: isNew,
|
||||||
GameFreeID: this.scene.GetGameFreeId(),
|
GameFreeID: this.scene.GetGameFreeId(),
|
||||||
GamingTime: int32(param.GameTime),
|
GamingTime: int32(param.GameTime),
|
||||||
FirstTime: gameFirstTime.Unix(),
|
FirstTime: gameFreeFirstTime.Unix(),
|
||||||
PlayTimes: gameTimes,
|
PlayTimes: gameFreeTimes,
|
||||||
FirstGameTime: gameFreeFirstTime.Unix(),
|
FirstGameTime: gameFirstTime.Unix(),
|
||||||
PlayGameTimes: gameFreeTimes,
|
PlayGameTimes: gameTimes,
|
||||||
LastLoginTime: this.LastLoginTime.Unix(),
|
LastLoginTime: this.LastLoginTime.Unix(),
|
||||||
DeviceId: this.DeviceId,
|
//DeviceId: this.DeviceId,
|
||||||
}
|
}
|
||||||
if param.OnlyLog {
|
if param.OnlyLog {
|
||||||
ret.Log = append(ret.Log, log)
|
ret.Log = append(ret.Log, log)
|
||||||
|
|
|
@ -409,6 +409,12 @@ func (this *SceneStateStartFortuneDragon) OnPlayerOp(s *base.Scene, p *base.Play
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s.SetGameNowTime(time.Now())
|
s.SetGameNowTime(time.Now())
|
||||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||||
|
|
||||||
|
data.BetSizeIndex = playerEx.BetSizeIndex
|
||||||
|
data.BetLevelIndex = playerEx.BetLevelIndex
|
||||||
|
data.LinesIndex = playerEx.BetLineIndex
|
||||||
|
//data.BaseBetIndex = 1
|
||||||
|
|
||||||
data.Results[0].BetMode = playerEx.BetMode
|
data.Results[0].BetMode = playerEx.BetMode
|
||||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
//logger.Logger.Trace("=====================AddCoin=====TotalBet===", -data.TotalBet)
|
//logger.Logger.Trace("=====================AddCoin=====TotalBet===", -data.TotalBet)
|
||||||
|
|
|
@ -407,6 +407,12 @@ func (this *SceneStateStartFortuneMouse) OnPlayerOp(s *base.Scene, p *base.Playe
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s.SetGameNowTime(time.Now())
|
s.SetGameNowTime(time.Now())
|
||||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||||
|
|
||||||
|
data.BetSizeIndex = playerEx.BetSizeIndex
|
||||||
|
data.BetLevelIndex = playerEx.BetLevelIndex
|
||||||
|
data.LinesIndex = playerEx.BetLineIndex
|
||||||
|
//data.BaseBetIndex = 1
|
||||||
|
|
||||||
var respinStatus int
|
var respinStatus int
|
||||||
if data.Results[0].ArrSpins[0].Special != nil {
|
if data.Results[0].ArrSpins[0].Special != nil {
|
||||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||||
|
@ -518,7 +524,7 @@ func FortuneMouseAndSaveLog(sceneEx *FortuneMouseSceneData, playerEx *FortuneMou
|
||||||
json.Unmarshal(sp, &spinLock)
|
json.Unmarshal(sp, &spinLock)
|
||||||
respinStatus = spinLock.ReSpinStatus
|
respinStatus = spinLock.ReSpinStatus
|
||||||
}
|
}
|
||||||
if respinStatus == 0 || respinStatus == 1 {
|
if respinStatus != 0 && respinStatus != 1 {
|
||||||
data.TotalBet = 0
|
data.TotalBet = 0
|
||||||
}
|
}
|
||||||
info, err := model.MarshalGameNoteByROLL(data)
|
info, err := model.MarshalGameNoteByROLL(data)
|
||||||
|
|
|
@ -407,6 +407,12 @@ func (this *SceneStateStartFortuneOx) OnPlayerOp(s *base.Scene, p *base.Player,
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s.SetGameNowTime(time.Now())
|
s.SetGameNowTime(time.Now())
|
||||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||||
|
|
||||||
|
data.BetSizeIndex = playerEx.BetSizeIndex
|
||||||
|
data.BetLevelIndex = playerEx.BetLevelIndex
|
||||||
|
data.LinesIndex = playerEx.BetLineIndex
|
||||||
|
//data.BaseBetIndex = 1
|
||||||
|
|
||||||
var respinStatus int
|
var respinStatus int
|
||||||
if data.Results[0].ArrSpins[0].Special != nil {
|
if data.Results[0].ArrSpins[0].Special != nil {
|
||||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||||
|
@ -521,7 +527,6 @@ func FortuneOxAndSaveLog(sceneEx *FortuneOxSceneData, playerEx *FortuneOxPlayerD
|
||||||
if respinStatus != 0 && respinStatus != 1 {
|
if respinStatus != 0 && respinStatus != 1 {
|
||||||
data.TotalBet = 0
|
data.TotalBet = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
info, err := model.MarshalGameNoteByROLL(data)
|
info, err := model.MarshalGameNoteByROLL(data)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logid, _ := model.AutoIncGameLogId()
|
logid, _ := model.AutoIncGameLogId()
|
||||||
|
|
|
@ -407,6 +407,12 @@ func (this *SceneStateStartFortuneRabbit) OnPlayerOp(s *base.Scene, p *base.Play
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s.SetGameNowTime(time.Now())
|
s.SetGameNowTime(time.Now())
|
||||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||||
|
|
||||||
|
data.BetSizeIndex = playerEx.BetSizeIndex
|
||||||
|
data.BetLevelIndex = playerEx.BetLevelIndex
|
||||||
|
data.LinesIndex = playerEx.BetLineIndex
|
||||||
|
//data.BaseBetIndex = 1
|
||||||
|
|
||||||
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
//第一次触发或者正常模式
|
//第一次触发或者正常模式
|
||||||
//logger.Logger.Trace("=============addcoin1111 ", -data.TotalBet)
|
//logger.Logger.Trace("=============addcoin1111 ", -data.TotalBet)
|
||||||
|
|
|
@ -407,6 +407,12 @@ func (this *SceneStateStartFortuneTiger) OnPlayerOp(s *base.Scene, p *base.Playe
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s.SetGameNowTime(time.Now())
|
s.SetGameNowTime(time.Now())
|
||||||
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||||
|
|
||||||
|
data.BetSizeIndex = playerEx.BetSizeIndex
|
||||||
|
data.BetLevelIndex = playerEx.BetLevelIndex
|
||||||
|
data.LinesIndex = playerEx.BetLineIndex
|
||||||
|
//data.BaseBetIndex = 1
|
||||||
|
|
||||||
var respinStatus int
|
var respinStatus int
|
||||||
if data.Results[0].ArrSpins[0].Special != nil {
|
if data.Results[0].ArrSpins[0].Special != nil {
|
||||||
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
sp, _ := json.Marshal(data.Results[0].ArrSpins[0].Special)
|
||||||
|
@ -511,7 +517,14 @@ func (this *ScenePolicyFortuneTiger) GetSceneState(s *base.Scene, stateid int) b
|
||||||
func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTigerPlayerData, data assemble.GameEnd) {
|
func FortuneTigerAndSaveLog(sceneEx *FortuneTigerSceneData, playerEx *FortuneTigerPlayerData, data assemble.GameEnd) {
|
||||||
if !playerEx.IsRob {
|
if !playerEx.IsRob {
|
||||||
data.SnId = playerEx.SnId
|
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
|
data.TotalBet = 0
|
||||||
}
|
}
|
||||||
info, err := model.MarshalGameNoteByROLL(data)
|
info, err := model.MarshalGameNoteByROLL(data)
|
||||||
|
|
|
@ -34,6 +34,7 @@ type GameEnd struct {
|
||||||
BetSizeIndex int64 `json:"bet_size_index"` //选中的单注下标
|
BetSizeIndex int64 `json:"bet_size_index"` //选中的单注下标
|
||||||
BetLevelIndex int64 `json:"bet_level_index"` //选中的等级下标
|
BetLevelIndex int64 `json:"bet_level_index"` //选中的等级下标
|
||||||
LinesIndex int64 `json:"lines_index"` //选中的线数下标
|
LinesIndex int64 `json:"lines_index"` //选中的线数下标
|
||||||
|
BaseBetIndex int64 `json:"base_bet_index"` //选中的下注基数下标
|
||||||
TotalBet float64 `json:"total_bet"` //下注
|
TotalBet float64 `json:"total_bet"` //下注
|
||||||
BetBeforeCoin float64 `json:"bet_before_coin"` //下注前
|
BetBeforeCoin float64 `json:"bet_before_coin"` //下注前
|
||||||
BetAfterCoin float64 `json:"bet_after_coin"` //下注后
|
BetAfterCoin float64 `json:"bet_after_coin"` //下注后
|
||||||
|
|
Binary file not shown.
|
@ -10,79 +10,79 @@ func init() {
|
||||||
FortuneMouseBetBetChangeList = map[int64]*structs.FortuneMouseBetBetChangeList{
|
FortuneMouseBetBetChangeList = map[int64]*structs.FortuneMouseBetBetChangeList{
|
||||||
0: {
|
0: {
|
||||||
Index: 0,
|
Index: 0,
|
||||||
BetChangeList: 0.15,
|
BetChangeList: 150000,
|
||||||
BetSizeIndex: 0,
|
BetSizeIndex: 0,
|
||||||
BetLevelIndex: 0,
|
BetLevelIndex: 0,
|
||||||
},
|
},
|
||||||
1: {
|
1: {
|
||||||
Index: 1,
|
Index: 1,
|
||||||
BetChangeList: 0.3,
|
BetChangeList: 300000,
|
||||||
BetSizeIndex: 0,
|
BetSizeIndex: 0,
|
||||||
BetLevelIndex: 1,
|
BetLevelIndex: 1,
|
||||||
},
|
},
|
||||||
2: {
|
2: {
|
||||||
Index: 2,
|
Index: 2,
|
||||||
BetChangeList: 0.45,
|
BetChangeList: 450000,
|
||||||
BetSizeIndex: 0,
|
BetSizeIndex: 0,
|
||||||
BetLevelIndex: 2,
|
BetLevelIndex: 2,
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
Index: 3,
|
Index: 3,
|
||||||
BetChangeList: 0.5,
|
BetChangeList: 500000,
|
||||||
BetSizeIndex: 1,
|
BetSizeIndex: 1,
|
||||||
BetLevelIndex: 0,
|
BetLevelIndex: 0,
|
||||||
},
|
},
|
||||||
4: {
|
4: {
|
||||||
Index: 4,
|
Index: 4,
|
||||||
BetChangeList: 0.75,
|
BetChangeList: 750000,
|
||||||
BetSizeIndex: 0,
|
BetSizeIndex: 0,
|
||||||
BetLevelIndex: 4,
|
BetLevelIndex: 4,
|
||||||
},
|
},
|
||||||
5: {
|
5: {
|
||||||
Index: 5,
|
Index: 5,
|
||||||
BetChangeList: 1.5,
|
BetChangeList: 1500000,
|
||||||
BetSizeIndex: 0,
|
BetSizeIndex: 0,
|
||||||
BetLevelIndex: 9,
|
BetLevelIndex: 9,
|
||||||
},
|
},
|
||||||
6: {
|
6: {
|
||||||
Index: 6,
|
Index: 6,
|
||||||
BetChangeList: 2.5,
|
BetChangeList: 2500000,
|
||||||
BetSizeIndex: 1,
|
BetSizeIndex: 1,
|
||||||
BetLevelIndex: 4,
|
BetLevelIndex: 4,
|
||||||
},
|
},
|
||||||
7: {
|
7: {
|
||||||
Index: 7,
|
Index: 7,
|
||||||
BetChangeList: 4.5,
|
BetChangeList: 4500000,
|
||||||
BetSizeIndex: 3,
|
BetSizeIndex: 3,
|
||||||
BetLevelIndex: 0,
|
BetLevelIndex: 0,
|
||||||
},
|
},
|
||||||
8: {
|
8: {
|
||||||
Index: 8,
|
Index: 8,
|
||||||
BetChangeList: 5,
|
BetChangeList: 5000000,
|
||||||
BetSizeIndex: 1,
|
BetSizeIndex: 1,
|
||||||
BetLevelIndex: 9,
|
BetLevelIndex: 9,
|
||||||
},
|
},
|
||||||
9: {
|
9: {
|
||||||
Index: 9,
|
Index: 9,
|
||||||
BetChangeList: 7.5,
|
BetChangeList: 7500000,
|
||||||
BetSizeIndex: 2,
|
BetSizeIndex: 2,
|
||||||
BetLevelIndex: 4,
|
BetLevelIndex: 4,
|
||||||
},
|
},
|
||||||
10: {
|
10: {
|
||||||
Index: 10,
|
Index: 10,
|
||||||
BetChangeList: 15,
|
BetChangeList: 15000000,
|
||||||
BetSizeIndex: 2,
|
BetSizeIndex: 2,
|
||||||
BetLevelIndex: 9,
|
BetLevelIndex: 9,
|
||||||
},
|
},
|
||||||
11: {
|
11: {
|
||||||
Index: 11,
|
Index: 11,
|
||||||
BetChangeList: 22.5,
|
BetChangeList: 22500000,
|
||||||
BetSizeIndex: 3,
|
BetSizeIndex: 3,
|
||||||
BetLevelIndex: 4,
|
BetLevelIndex: 4,
|
||||||
},
|
},
|
||||||
12: {
|
12: {
|
||||||
Index: 12,
|
Index: 12,
|
||||||
BetChangeList: 45,
|
BetChangeList: 45000000,
|
||||||
BetSizeIndex: 3,
|
BetSizeIndex: 3,
|
||||||
BetLevelIndex: 9,
|
BetLevelIndex: 9,
|
||||||
},
|
},
|
||||||
|
@ -142,19 +142,19 @@ func init() {
|
||||||
FortuneMouseBetBetSize = map[int64]*structs.FortuneMouseBetBetSize{
|
FortuneMouseBetBetSize = map[int64]*structs.FortuneMouseBetBetSize{
|
||||||
0: {
|
0: {
|
||||||
Index: 0,
|
Index: 0,
|
||||||
BetSize: 300,
|
BetSize: 300000000,
|
||||||
},
|
},
|
||||||
1: {
|
1: {
|
||||||
Index: 1,
|
Index: 1,
|
||||||
BetSize: 1000,
|
BetSize: 1000000000,
|
||||||
},
|
},
|
||||||
2: {
|
2: {
|
||||||
Index: 2,
|
Index: 2,
|
||||||
BetSize: 3000,
|
BetSize: 3000000000,
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
Index: 3,
|
Index: 3,
|
||||||
BetSize: 9000,
|
BetSize: 9000000000,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -245,33 +245,35 @@ func CreatePlayerLoginEvent(snid int32, channel, promoter, platform, city, os, i
|
||||||
|
|
||||||
// 玩家游戏记录
|
// 玩家游戏记录
|
||||||
type PlayerGameRecEvent struct {
|
type PlayerGameRecEvent struct {
|
||||||
|
Id string //id
|
||||||
RecordId string //游戏记录ID
|
RecordId string //游戏记录ID
|
||||||
SnId int32 //用户ID
|
SnId int32 //用户ID
|
||||||
Channel string //包类型
|
Channel string //包类型
|
||||||
Promoter string //推广
|
|
||||||
Platform string //平台
|
Platform string //平台
|
||||||
City string //城市
|
|
||||||
OS string //操作系统
|
OS string //操作系统
|
||||||
TelephonePromoter int32 //电销标记
|
|
||||||
GameId int32 //游戏id
|
GameId int32 //游戏id
|
||||||
ModeId int32 //游戏模式
|
ModeId int32 //游戏模式
|
||||||
Tax int64 //税收
|
Tax int64 //税收
|
||||||
Amount int64 //金币变化(正值为赢;负值为输)
|
Amount int64 //金币变化,税后(正值为赢;负值为输)
|
||||||
CreateTime int64 //创建时间
|
CreateTime int64 //创建时间
|
||||||
CreateDayTime int64 //账号创建时间0点
|
CreateDayTime int64 //账号创建时间0点
|
||||||
ValidBet int64 //有效下注数量
|
|
||||||
ValidFlow int64 //有效流水数量
|
|
||||||
Out int64 //产出
|
Out int64 //产出
|
||||||
In int64 //投入
|
In int64 //投入
|
||||||
IsNew int32 //是否是新人
|
IsNew int32 //是否是新人
|
||||||
GameFreeID int32 //游戏freeid
|
GameFreeID int32 //游戏freeid
|
||||||
GamingTime int32 //游戏开始到玩家结算的时长 单位:秒
|
GamingTime int32 //游戏开始到玩家结算的时长 单位:秒
|
||||||
|
|
||||||
|
GameDif int32 // 游戏分组
|
||||||
|
FirstGameDifTime int64 // 首次游戏分组时间
|
||||||
|
GameDifTimes int64 // 游戏分组游戏次数
|
||||||
|
|
||||||
FirstTime int64 //首次玩该场次游戏时间
|
FirstTime int64 //首次玩该场次游戏时间
|
||||||
PlayTimes int64 //该场次游戏次数
|
PlayTimes int64 //该场次游戏次数
|
||||||
|
|
||||||
FirstGameTime int64 //首次玩游戏时间
|
FirstGameTime int64 //首次玩游戏时间
|
||||||
PlayGameTimes int64 //该游戏总次数
|
PlayGameTimes int64 //该游戏总次数
|
||||||
|
|
||||||
LastLoginTime int64 //最后登录时间
|
LastLoginTime int64 //最后登录时间
|
||||||
DeviceId string //设备id
|
|
||||||
ChannelId string //推广渠道id
|
ChannelId string //推广渠道id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -839,6 +839,8 @@ message DB_GameFree {
|
||||||
|
|
||||||
int32 IsCustom = 73;
|
int32 IsCustom = 73;
|
||||||
|
|
||||||
|
string GameName = 74;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message DB_GameFreeArray {
|
message DB_GameFreeArray {
|
||||||
|
|
|
@ -99,6 +99,7 @@ func SCPlayerFlag(s *netlib.Session, packetid int, data interface{}) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新房间里玩家的状态
|
||||||
if scene, ok := GetScene(s).(IScene); ok && scene != nil {
|
if scene, ok := GetScene(s).(IScene); ok && scene != nil {
|
||||||
p := scene.GetPlayerBySnid(msg.GetPlayerId())
|
p := scene.GetPlayerBySnid(msg.GetPlayerId())
|
||||||
if p != nil {
|
if p != nil {
|
|
@ -52,6 +52,7 @@ func SCDestroyRoom(s *netlib.Session, packid int, pack interface{}) error {
|
||||||
|
|
||||||
if msg.GetOpRetCode() == gamehallproto.OpResultCode_Game_OPRC_Sucess_Game {
|
if msg.GetOpRetCode() == gamehallproto.OpResultCode_Game_OPRC_Sucess_Game {
|
||||||
cleanRoomState(s)
|
cleanRoomState(s)
|
||||||
|
SceneMgrSingleton.DelScene(msg.GetRoomId())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,19 @@ import (
|
||||||
登录及机器人账号更新
|
登录及机器人账号更新
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
common.RegisterClockFunc(&common.ClockFunc{
|
||||||
|
OnHourTimerFunc: func() {
|
||||||
|
ClientMgrSingleton.AccountReplace()
|
||||||
|
|
||||||
|
logger.Logger.Info(ClientMgrSingleton.GetState())
|
||||||
|
},
|
||||||
|
OnDayTimerFunc: func() {
|
||||||
|
ClientMgrSingleton.AccountDeletePolicy()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
var ClientMgrSingleton = &ClientMgr{
|
var ClientMgrSingleton = &ClientMgr{
|
||||||
sessionPool: make(map[string]*netlib.Session),
|
sessionPool: make(map[string]*netlib.Session),
|
||||||
Running: true,
|
Running: true,
|
||||||
|
@ -97,13 +110,17 @@ func (this *ClientMgr) UnRegisterSession(acc string) {
|
||||||
delete(this.sessionPool, acc)
|
delete(this.sessionPool, acc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ClientMgr) HourChange() {
|
// AccountReplace 账号替换
|
||||||
|
func (this *ClientMgr) AccountReplace() {
|
||||||
fileModify := false
|
fileModify := false
|
||||||
eventArr := this.CycleTimeEvent[time.Now().Hour()]
|
eventArr := this.CycleTimeEvent[time.Now().Hour()]
|
||||||
for _, event := range eventArr {
|
for _, event := range eventArr {
|
||||||
accChan[event.newAcc] = true //使用新的账号
|
accChan[event.newAcc] = true //使用新的账号
|
||||||
cfg := NewSessionConfig()
|
|
||||||
netlib.Connect(cfg) //创建新的连接
|
//创建新的连接
|
||||||
|
NewSession()
|
||||||
|
|
||||||
|
// 关闭旧的连接
|
||||||
if session, ok := this.sessionPool[event.oldAcc]; ok && session != nil {
|
if session, ok := this.sessionPool[event.oldAcc]; ok && session != nil {
|
||||||
//删除旧有账号数据
|
//删除旧有账号数据
|
||||||
pack := &serverproto.RWAccountInvalid{
|
pack := &serverproto.RWAccountInvalid{
|
||||||
|
@ -115,6 +132,7 @@ func (this *ClientMgr) HourChange() {
|
||||||
//关闭连接
|
//关闭连接
|
||||||
session.Close()
|
session.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
//更新本地账号数据信息
|
//更新本地账号数据信息
|
||||||
for key, value := range accPool {
|
for key, value := range accPool {
|
||||||
if value.Acc == event.oldAcc {
|
if value.Acc == event.oldAcc {
|
||||||
|
@ -143,7 +161,8 @@ func (this *ClientMgr) HourChange() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ClientMgr) DayChange() {
|
// AccountDeletePolicy 账号删除策略
|
||||||
|
func (this *ClientMgr) AccountDeletePolicy() {
|
||||||
invalidCount := 0 //过期账号数量
|
invalidCount := 0 //过期账号数量
|
||||||
updateLimit := len(accPool) * model.GameParamData.InvalidRobotAccRate / 100 //可更新的账号数量
|
updateLimit := len(accPool) * model.GameParamData.InvalidRobotAccRate / 100 //可更新的账号数量
|
||||||
invalidAccs := []InvalidAcc{}
|
invalidAccs := []InvalidAcc{}
|
||||||
|
@ -182,3 +201,23 @@ func (this *ClientMgr) DayChange() {
|
||||||
this.CycleTimeEvent[timePoint] = eventArr
|
this.CycleTimeEvent[timePoint] = eventArr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ClientState struct {
|
||||||
|
SessionNum int
|
||||||
|
Event map[int]int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ClientState) String() string {
|
||||||
|
return fmt.Sprintf("ClientMgrState 连接总数:%v, 每小时账号替换数量:%v", c.SessionNum, c.Event)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *ClientMgr) GetState() *ClientState {
|
||||||
|
ret := &ClientState{
|
||||||
|
SessionNum: len(this.sessionPool),
|
||||||
|
Event: make(map[int]int),
|
||||||
|
}
|
||||||
|
for k, v := range this.CycleTimeEvent {
|
||||||
|
ret.Event[k] = len(v)
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
|
@ -1,90 +0,0 @@
|
||||||
package base
|
|
||||||
|
|
||||||
import (
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"mongo.games.com/goserver/core/module"
|
|
||||||
)
|
|
||||||
|
|
||||||
/*
|
|
||||||
计时器
|
|
||||||
*/
|
|
||||||
|
|
||||||
var ClockMgrSingleton = &ClockMgr{
|
|
||||||
LastHour: -1,
|
|
||||||
LastDay: -1,
|
|
||||||
}
|
|
||||||
|
|
||||||
type ClockMgr struct {
|
|
||||||
LastTime time.Time
|
|
||||||
LastMonth time.Month
|
|
||||||
LastWeek int
|
|
||||||
LastDay int
|
|
||||||
LastHour int
|
|
||||||
LastMini int
|
|
||||||
LastSec int
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ClockMgr) ModuleName() string {
|
|
||||||
return "ClockMgr"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ClockMgr) Init() {
|
|
||||||
tNow := time.Now().Local()
|
|
||||||
this.LastTime = tNow
|
|
||||||
_, this.LastMonth, this.LastDay = tNow.Date()
|
|
||||||
this.LastHour, this.LastMini, this.LastSec = tNow.Hour(), tNow.Minute(), tNow.Second()
|
|
||||||
_, this.LastWeek = tNow.ISOWeek()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ClockMgr) Update() {
|
|
||||||
tNow := time.Now().Local()
|
|
||||||
sec := tNow.Second()
|
|
||||||
if sec != this.LastSec {
|
|
||||||
this.LastSec = sec
|
|
||||||
// 秒
|
|
||||||
PlayerMgrSingleton.OnSecondTimer()
|
|
||||||
|
|
||||||
min := tNow.Minute()
|
|
||||||
if min != this.LastMini {
|
|
||||||
this.LastMini = min
|
|
||||||
// 分
|
|
||||||
PlayerMgrSingleton.OnMiniTimer()
|
|
||||||
|
|
||||||
hour := tNow.Hour()
|
|
||||||
if hour != this.LastHour {
|
|
||||||
// 时
|
|
||||||
ClientMgrSingleton.HourChange()
|
|
||||||
|
|
||||||
this.LastHour = hour
|
|
||||||
day := tNow.Day()
|
|
||||||
if day != this.LastDay {
|
|
||||||
// 天
|
|
||||||
ClientMgrSingleton.DayChange()
|
|
||||||
|
|
||||||
this.LastDay = day
|
|
||||||
_, week := tNow.ISOWeek()
|
|
||||||
if week != this.LastWeek {
|
|
||||||
// 周
|
|
||||||
|
|
||||||
this.LastWeek = week
|
|
||||||
}
|
|
||||||
month := tNow.Month()
|
|
||||||
if month != this.LastMonth {
|
|
||||||
// 月
|
|
||||||
|
|
||||||
this.LastMonth = month
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ClockMgr) Shutdown() {
|
|
||||||
module.UnregisteModule(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
module.RegisteModule(ClockMgrSingleton, time.Millisecond*500, 0)
|
|
||||||
}
|
|
|
@ -18,12 +18,19 @@ var (
|
||||||
WaitConnectSessions []*netlib.SessionConfig
|
WaitConnectSessions []*netlib.SessionConfig
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewSessionConfig() *netlib.SessionConfig {
|
// NewSession 新建session
|
||||||
BenchMarkModule.idx++
|
// id 连接id, 默认自动分配
|
||||||
|
func NewSession(id ...int) {
|
||||||
cfg := Config.Connects
|
cfg := Config.Connects
|
||||||
|
if len(id) > 0 && id[0] > 0 {
|
||||||
|
cfg.Id = id[0]
|
||||||
|
} else {
|
||||||
|
BenchMarkModule.idx++
|
||||||
cfg.Id = BenchMarkModule.idx
|
cfg.Id = BenchMarkModule.idx
|
||||||
|
}
|
||||||
cfg.Init()
|
cfg.Init()
|
||||||
return &cfg
|
logger.Logger.Info("waite connect session id=", cfg.Id)
|
||||||
|
WaitConnectSessions = append(WaitConnectSessions, &cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
type BenchMark struct {
|
type BenchMark struct {
|
||||||
|
@ -37,9 +44,7 @@ func (m *BenchMark) ModuleName() string {
|
||||||
func (m *BenchMark) Init() {
|
func (m *BenchMark) Init() {
|
||||||
m.idx = RobotSessionStartId
|
m.idx = RobotSessionStartId
|
||||||
for i := 0; i < Config.Count; i++ {
|
for i := 0; i < Config.Count; i++ {
|
||||||
cfg := NewSessionConfig()
|
NewSession()
|
||||||
logger.Logger.Info("waite connect session id=", cfg.Id)
|
|
||||||
WaitConnectSessions = append(WaitConnectSessions, cfg)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,10 +62,7 @@ func (g *GateSessionHandler) OnSessionClosed(s *netlib.Session) {
|
||||||
StopSessionPingTimer(s)
|
StopSessionPingTimer(s)
|
||||||
if reconnect {
|
if reconnect {
|
||||||
logger.Logger.Infof("账号重连 sessionID:%v account:%v", s.Id, accIdParam)
|
logger.Logger.Infof("账号重连 sessionID:%v account:%v", s.Id, accIdParam)
|
||||||
cfg := Config.Connects
|
NewSession(s.GetSessionConfig().Id)
|
||||||
cfg.Id = s.GetSessionConfig().Id
|
|
||||||
cfg.Init()
|
|
||||||
WaitConnectSessions = append(WaitConnectSessions, &cfg)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ type AccountData struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// 待使用的账号,将要建立连接
|
// 待登录的账号,将要建立连接
|
||||||
accChan = make(map[string]bool)
|
accChan = make(map[string]bool)
|
||||||
// 账号池,当前正在使用的机器人
|
// 账号池,当前正在使用的机器人账号
|
||||||
accPool []*AccountData
|
accPool []*AccountData
|
||||||
)
|
)
|
||||||
var accountFileName = "robotaccount.json"
|
var accountFileName = "robotaccount.json"
|
||||||
|
|
|
@ -1,16 +1,32 @@
|
||||||
package base
|
package base
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
|
||||||
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
hall_proto "mongo.games.com/game/protocol/gamehall"
|
hall_proto "mongo.games.com/game/protocol/gamehall"
|
||||||
player_proto "mongo.games.com/game/protocol/player"
|
player_proto "mongo.games.com/game/protocol/player"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
common.RegisterClockFunc(&common.ClockFunc{
|
||||||
|
OnSecTimerFunc: func() {
|
||||||
|
PlayerMgrSingleton.OnSecondTimer()
|
||||||
|
},
|
||||||
|
OnMiniTimerFunc: func() {
|
||||||
|
PlayerMgrSingleton.OnMiniTimer()
|
||||||
|
},
|
||||||
|
OnHourTimerFunc: func() {
|
||||||
|
logger.Logger.Info(PlayerMgrSingleton.GetState())
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
var PlayerMgrSingleton = &PlayerMgr{
|
var PlayerMgrSingleton = &PlayerMgr{
|
||||||
playersMapSnId: make(map[int32]*player_proto.SCPlayerData),
|
playersMapSnId: make(map[int32]*player_proto.SCPlayerData),
|
||||||
playersSession: make(map[int32]*netlib.Session),
|
playersSession: make(map[int32]*netlib.Session),
|
||||||
|
@ -161,3 +177,22 @@ func (pm *PlayerMgr) OnSecondTimer() {
|
||||||
func (pm *PlayerMgr) OnMiniTimer() {
|
func (pm *PlayerMgr) OnMiniTimer() {
|
||||||
pm.ProcessCheckRobotNum()
|
pm.ProcessCheckRobotNum()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PlayerMgrState struct {
|
||||||
|
PlayerNum int
|
||||||
|
NormalSessionNum int
|
||||||
|
MatchSessionNum int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PlayerMgrState) String() string {
|
||||||
|
return fmt.Sprintf("PlayerMgrState 玩家总数:%v, 普通场连接数:%v, 比赛场连接数:%v", p.PlayerNum, p.NormalSessionNum, p.MatchSessionNum)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (pm *PlayerMgr) GetState() *PlayerMgrState {
|
||||||
|
ret := &PlayerMgrState{
|
||||||
|
PlayerNum: len(pm.playersMapSnId),
|
||||||
|
NormalSessionNum: len(pm.playersSession),
|
||||||
|
MatchSessionNum: len(pm.playersMatchSession),
|
||||||
|
}
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
|
@ -1,14 +1,27 @@
|
||||||
package base
|
package base
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/module"
|
"mongo.games.com/goserver/core/module"
|
||||||
|
|
||||||
|
"mongo.games.com/game/common"
|
||||||
server_proto "mongo.games.com/game/protocol/server"
|
server_proto "mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
module.RegisteModule(SceneMgrSingleton, time.Millisecond*100, 0)
|
||||||
|
|
||||||
|
common.RegisterClockFunc(&common.ClockFunc{
|
||||||
|
OnHourTimerFunc: func() {
|
||||||
|
logger.Logger.Info(SceneMgrSingleton.GetState())
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
var SceneMgrSingleton = &SceneMgr{
|
var SceneMgrSingleton = &SceneMgr{
|
||||||
Scenes: make(map[int32]IScene),
|
Scenes: make(map[int32]IScene),
|
||||||
sceneDBGameFree: make(map[int32]*server_proto.DB_GameFree),
|
sceneDBGameFree: make(map[int32]*server_proto.DB_GameFree),
|
||||||
|
@ -47,6 +60,7 @@ func (sm *SceneMgr) GetSceneDBGameFree(sceneId, gamefreeId int32) *server_proto.
|
||||||
return srvdata.PBDB_GameFreeMgr.GetData(gamefreeId)
|
return srvdata.PBDB_GameFreeMgr.GetData(gamefreeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsFreeMode 是否是自由桌
|
||||||
func (sm *SceneMgr) IsFreeMode(sceneId int32) bool {
|
func (sm *SceneMgr) IsFreeMode(sceneId int32) bool {
|
||||||
if data, exist := sm.sceneDBGameFree[sceneId]; exist {
|
if data, exist := sm.sceneDBGameFree[sceneId]; exist {
|
||||||
return data.GetFreeMode() == 1
|
return data.GetFreeMode() == 1
|
||||||
|
@ -54,6 +68,22 @@ func (sm *SceneMgr) IsFreeMode(sceneId int32) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SceneMgrState struct {
|
||||||
|
Num map[int32]int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *SceneMgrState) String() string {
|
||||||
|
return fmt.Sprintf("SceneMgrState 每个游戏的房间数量 [游戏id:房间数量]: %v", s.Num)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sm *SceneMgr) GetState() *SceneMgrState {
|
||||||
|
m := make(map[int32]int)
|
||||||
|
for _, v := range sm.Scenes {
|
||||||
|
m[v.GetGameId()]++
|
||||||
|
}
|
||||||
|
return &SceneMgrState{Num: m}
|
||||||
|
}
|
||||||
|
|
||||||
// //////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////
|
||||||
// / Module Implement [beg]
|
// / Module Implement [beg]
|
||||||
// //////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////
|
||||||
|
@ -74,7 +104,3 @@ func (sm *SceneMgr) ModuleName() string {
|
||||||
func (sm *SceneMgr) Shutdown() {
|
func (sm *SceneMgr) Shutdown() {
|
||||||
module.UnregisteModule(sm)
|
module.UnregisteModule(sm)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
|
||||||
module.RegisteModule(SceneMgrSingleton, time.Millisecond*100, 0)
|
|
||||||
}
|
|
||||||
|
|
|
@ -1310,8 +1310,6 @@ func (this *Player) UnmarshalData(data []byte, scene *Scene) {
|
||||||
this.PlayerData.TotalFlow = pd.TotalFlow
|
this.PlayerData.TotalFlow = pd.TotalFlow
|
||||||
if this.WelfData != nil && this.WelfData.PigBank != nil && pd.WelfData != nil && pd.WelfData.PigBank != nil {
|
if this.WelfData != nil && this.WelfData.PigBank != nil && pd.WelfData != nil && pd.WelfData.PigBank != nil {
|
||||||
this.WelfData.PigBank.BankCoin = pd.WelfData.PigBank.BankCoin
|
this.WelfData.PigBank.BankCoin = pd.WelfData.PigBank.BankCoin
|
||||||
this.WelfData.PigBank.TakeTimes = pd.WelfData.PigBank.TakeTimes
|
|
||||||
this.WelfData.PigBank.DayBuyTimes = pd.WelfData.PigBank.DayBuyTimes
|
|
||||||
}
|
}
|
||||||
this.ItemRecExpireTime = pd.ItemRecExpireTime
|
this.ItemRecExpireTime = pd.ItemRecExpireTime
|
||||||
this.IsTakeExpireItem = pd.IsTakeExpireItem
|
this.IsTakeExpireItem = pd.IsTakeExpireItem
|
||||||
|
|
|
@ -341,7 +341,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
||||||
//离场金币
|
//离场金币
|
||||||
leaverng := this.dbGameFree.GetRobotLimitCoin()
|
leaverng := this.dbGameFree.GetRobotLimitCoin()
|
||||||
if len(leaverng) >= 2 {
|
if len(leaverng) >= 2 {
|
||||||
leaveCoin = leaverng[0] + rand.Int63n(leaverng[1]-leaverng[0])
|
leaveCoin = int64(common.RandInt(int(leaverng[0]), int(leaverng[1])))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ type SceneMgr struct {
|
||||||
matchAutoId int // 比赛场房间号
|
matchAutoId int // 比赛场房间号
|
||||||
coinSceneAutoId int // 金币场房间号
|
coinSceneAutoId int // 金币场房间号
|
||||||
hundredSceneAutoId int // 百人场房间号
|
hundredSceneAutoId int // 百人场房间号
|
||||||
|
|
||||||
password map[string]struct{} // 密码
|
password map[string]struct{} // 密码
|
||||||
pushList map[int]struct{} // 已经推荐过的房间列表
|
pushList map[int]struct{} // 已经推荐过的房间列表
|
||||||
lastPushSceneId int // 最后推荐的房间id
|
lastPushSceneId int // 最后推荐的房间id
|
||||||
|
|
|
@ -2212,10 +2212,10 @@ func init() {
|
||||||
|
|
||||||
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/pay/CallbackPayment", WebAPIHandlerWrapper(
|
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/pay/CallbackPayment", WebAPIHandlerWrapper(
|
||||||
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
||||||
logger.Logger.Tracef("api /api/pay/CallbackPayment")
|
|
||||||
msg := &webapiproto.ASCallbackPayment{}
|
msg := &webapiproto.ASCallbackPayment{}
|
||||||
pack := &webapiproto.SACallbackPayment{}
|
pack := &webapiproto.SACallbackPayment{}
|
||||||
err := proto.Unmarshal(params, msg)
|
err := proto.Unmarshal(params, msg)
|
||||||
|
logger.Logger.Info("api /api/pay/CallbackPayment msg = ", msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pack.Tag = webapiproto.TagCode_FAILED
|
pack.Tag = webapiproto.TagCode_FAILED
|
||||||
pack.Msg = "数据序列化失败" + err.Error()
|
pack.Msg = "数据序列化失败" + err.Error()
|
||||||
|
@ -2258,7 +2258,7 @@ func init() {
|
||||||
state = msg.GetState()
|
state = msg.GetState()
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(info.SnId)
|
player := PlayerMgrSington.GetPlayerBySnId(info.SnId)
|
||||||
if player == nil {
|
if player == nil {
|
||||||
if info.State == 1 {
|
if msg.State == 1 {
|
||||||
state = 3
|
state = 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue