拉霸数据统计
This commit is contained in:
parent
ec635783c4
commit
77fbd7dfba
|
@ -583,8 +583,12 @@ func (this *SceneStateAvengersStart) OnPlayerOp(s *base.Scene, p *base.Player, o
|
|||
playerEx.taxCoin = spinRes.TotalTaxScore
|
||||
playerEx.AddServiceFee(playerEx.taxCoin)
|
||||
}
|
||||
p.StaticsLaba(sceneEx.KeyGameId, sceneEx.KeyGamefreeId, totalBetValue, totalWinScore+spinRes.BonusGame.GetTotalPrizeValue()+spinRes.TotalTaxScore)
|
||||
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: totalWinScore + spinRes.BonusGame.GetTotalPrizeValue() + spinRes.TotalTaxScore,
|
||||
GainTax: spinRes.TotalTaxScore,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
this.OnPlayerSToCOp(s, p, playerEx.Pos, opcode, avengers.OpResultCode_OPRC_Sucess, append(params[:1], playerEx.betLines...))
|
||||
|
||||
//免费次数
|
||||
|
@ -904,11 +908,10 @@ func AvengersCheckAndSaveLog(sceneEx *AvengersSceneData, playerEx *AvengersPlaye
|
|||
//统计金币变动
|
||||
//log1
|
||||
logger.Logger.Trace("AvengersCheckAndSaveLog Save ", playerEx.SnId)
|
||||
//changeCoin := playerEx.Coin - playerEx.StartCoin
|
||||
changeCoin := playerEx.winCoin - playerEx.taxCoin - playerEx.CurrentBet
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
// playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
|
||||
//log2
|
||||
playerEx.RollGameType.BaseResult.ChangeCoin = changeCoin
|
||||
|
@ -967,15 +970,8 @@ func AvengersCheckAndSaveLog(sceneEx *AvengersSceneData, playerEx *AvengersPlaye
|
|||
Bet: proto.Int64(playerEx.CurrentBet),
|
||||
Gain: proto.Int64(playerEx.RollGameType.BaseResult.ChangeCoin),
|
||||
Tax: proto.Int64(playerEx.taxCoin),
|
||||
OtherTax: 0,
|
||||
Coin: proto.Int64(playerEx.GetCoin()),
|
||||
FlowCoin: 0,
|
||||
Lottery: 0,
|
||||
Kind: 0,
|
||||
Card: nil,
|
||||
GameCoinTs: proto.Int64(playerEx.GameCoinTs),
|
||||
WBGain: 0,
|
||||
WinState: 0,
|
||||
}
|
||||
gwPlayerBet := &server.GWPlayerData{
|
||||
SceneId: proto.Int(sceneEx.SceneId),
|
||||
|
|
|
@ -119,7 +119,8 @@ func (this *CoinPoolManager) SplitKey(key string) (gameFreeId, groupId int32, pl
|
|||
|
||||
// AddProfitPool 增加收益池
|
||||
func (this *CoinPoolManager) AddProfitPool(key string, coin int64) bool {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return false
|
||||
}
|
||||
|
||||
|
@ -199,7 +200,8 @@ func (this *CoinPoolManager) getNoviceCoinPoolCoin(key string) int64 {
|
|||
// 减少调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) popCoin(key string, coin int64) (bool, int64) {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return false, 0
|
||||
}
|
||||
|
||||
|
@ -231,7 +233,8 @@ func (this *CoinPoolManager) popCoin(key string, coin int64) (bool, int64) {
|
|||
// 减少调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) popNoviceCoin(key string, coin int64) (bool, int64) {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return false, 0
|
||||
}
|
||||
|
||||
|
@ -263,7 +266,8 @@ func (this *CoinPoolManager) popNoviceCoin(key string, coin int64) (bool, int64)
|
|||
// 增加调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) pushCoin(key string, coin int64) int64 {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -289,7 +293,8 @@ func (this *CoinPoolManager) pushCoin(key string, coin int64) int64 {
|
|||
// 增加调控池水位
|
||||
// 返回当前水位
|
||||
func (this *CoinPoolManager) pushNoviceCoin(key string, coin int64) int64 {
|
||||
if this.getCoinPoolSetting(key).GetSwitch() == 1 {
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -319,16 +324,19 @@ func (this *CoinPoolManager) PopCoin(gameFreeId, groupId int32, platform string,
|
|||
}
|
||||
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return true
|
||||
}
|
||||
|
||||
poolVal := coin
|
||||
if coin < 0 { //负值为收益
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting != nil && setting.GetSwitch() == 0 {
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, -profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, -profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
}
|
||||
ok, _ := this.popCoin(key, poolVal)
|
||||
|
@ -343,7 +351,7 @@ func (this *CoinPoolManager) PopCoin(gameFreeId, groupId int32, platform string,
|
|||
if ok {
|
||||
poolCoin, ok := poolValue.(int64)
|
||||
if ok {
|
||||
if int64(setting.GetLowerLimit()) > poolCoin {
|
||||
if setting.GetLowerLimit() > poolCoin {
|
||||
WarningCoinPool(Warning_CoinPoolLow, gameFreeId)
|
||||
}
|
||||
|
||||
|
@ -364,17 +372,21 @@ func (this *CoinPoolManager) PushCoin(gameFreeId, groupId int32, platform string
|
|||
if coin == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return
|
||||
}
|
||||
|
||||
poolVal := coin
|
||||
if coin > 0 { //处理收益池
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting != nil && setting.GetSwitch() == 0 {
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -509,6 +521,7 @@ func (this *CoinPoolManager) GetCoinPoolSettingByGame(platform string, gameId, g
|
|||
LowerOddsMax: setting.GetLowerOddsMax(),
|
||||
ProfitRate: setting.GetProfitRate(),
|
||||
InitNoviceValue: setting.GetInitNoviceValue(),
|
||||
CtrlRate: setting.GetCtrlRate(),
|
||||
|
||||
ResetTime: setting.GetResetTime(),
|
||||
Switch: setting.GetSwitch(),
|
||||
|
@ -516,6 +529,7 @@ func (this *CoinPoolManager) GetCoinPoolSettingByGame(platform string, gameId, g
|
|||
CoinValue: this.GetCoin(id, platform, groupId), // 当前水位
|
||||
ProfitPool: this.GetProfitPoolCoin(id, platform, groupId), // 收益池水位
|
||||
NoviceCoinValue: this.GetNoviceCoin(id, platform, groupId), // 新手池水位
|
||||
|
||||
}
|
||||
settings = append(settings, s)
|
||||
}
|
||||
|
@ -741,17 +755,21 @@ func (this *CoinPoolManager) PushCoinNovice(gameFreeId, groupId int32, platform
|
|||
if coin == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return
|
||||
}
|
||||
|
||||
poolVal := coin
|
||||
if coin > 0 { //处理收益池
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting != nil && setting.GetSwitch() == 0 {
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -766,16 +784,19 @@ func (this *CoinPoolManager) PopCoinNovice(gameFreeId, groupId int32, platform s
|
|||
}
|
||||
|
||||
key := this.GenKey(gameFreeId, platform, groupId)
|
||||
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting == nil || setting.GetSwitch() == 1 {
|
||||
return true
|
||||
}
|
||||
|
||||
poolVal := coin
|
||||
if coin < 0 { //负值为收益
|
||||
setting := this.getCoinPoolSetting(key)
|
||||
if setting != nil && setting.GetSwitch() == 0 {
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, -profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
rate := this.GetProfitRate(setting)
|
||||
if rate != 0 { //负值也生效???
|
||||
profit := coin * int64(rate) / 1000
|
||||
this.AddProfitPool(key, -profit)
|
||||
poolVal = coin - profit
|
||||
}
|
||||
}
|
||||
ok, _ := this.popNoviceCoin(key, poolVal)
|
||||
|
|
|
@ -867,88 +867,6 @@ func (this *Player) Statics(keyGameId string, keyGameFreeId string, gain int64,
|
|||
////}
|
||||
}
|
||||
|
||||
// 拉霸游戏 一局一条
|
||||
func (this *Player) StaticsLaba(keyGameId string, keyGameFreeId string, totalIn, totalOut int64) {
|
||||
if this.scene == nil || this.scene.Testing { //测试场|自建房和机器人不统计
|
||||
return
|
||||
}
|
||||
if totalIn < 0 || totalOut < 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if this.IsRob && !this.scene.IsRobFightGame() {
|
||||
return
|
||||
}
|
||||
|
||||
if this.TodayGameData == nil {
|
||||
this.TodayGameData = &model.PlayerGameCtrlData{}
|
||||
}
|
||||
if this.TodayGameData.CtrlData == nil {
|
||||
this.TodayGameData.CtrlData = make(map[string]*model.PlayerGameStatics)
|
||||
}
|
||||
|
||||
statics := make([]*model.PlayerGameStatics, 0, 4)
|
||||
//当天数据统计
|
||||
//按场次分
|
||||
if data, ok := this.TodayGameData.CtrlData[keyGameFreeId]; ok {
|
||||
statics = append(statics, data)
|
||||
} else {
|
||||
gs := model.NewPlayerGameStatics()
|
||||
this.TodayGameData.CtrlData[keyGameFreeId] = gs
|
||||
statics = append(statics, gs)
|
||||
}
|
||||
//按游戏分
|
||||
if data, ok := this.TodayGameData.CtrlData[keyGameId]; ok {
|
||||
statics = append(statics, data)
|
||||
} else {
|
||||
data = model.NewPlayerGameStatics()
|
||||
this.TodayGameData.CtrlData[keyGameId] = data
|
||||
statics = append(statics, data)
|
||||
}
|
||||
|
||||
//按游戏场次进行的统计
|
||||
if data, ok := this.GDatas[keyGameFreeId]; ok {
|
||||
statics = append(statics, &data.Statics)
|
||||
} else {
|
||||
data = &model.PlayerGameInfo{FirstTime: time.Now(), Statics: *model.NewPlayerGameStatics()}
|
||||
this.GDatas[keyGameFreeId] = data
|
||||
statics = append(statics, &data.Statics)
|
||||
}
|
||||
if data, ok := this.GDatas[keyGameId]; ok {
|
||||
statics = append(statics, &data.Statics)
|
||||
} else {
|
||||
data = &model.PlayerGameInfo{FirstTime: time.Now(), Statics: *model.NewPlayerGameStatics()}
|
||||
this.GDatas[keyGameId] = data
|
||||
statics = append(statics, &data.Statics)
|
||||
}
|
||||
gain := totalOut - totalIn
|
||||
for _, data := range statics {
|
||||
if data != nil {
|
||||
data.TotalIn += totalIn
|
||||
data.TotalOut += totalOut
|
||||
data.GameTimes++
|
||||
if gain > 0 {
|
||||
data.WinGameTimes++
|
||||
} else if gain < 0 {
|
||||
data.LoseGameTimes++
|
||||
} else {
|
||||
data.DrawGameTimes++
|
||||
}
|
||||
}
|
||||
}
|
||||
//玩家身上元数据
|
||||
this.GameTimes++
|
||||
if gain > 0 {
|
||||
this.winTimes++
|
||||
this.WinTimes++
|
||||
} else if gain < 0 {
|
||||
this.lostTimes++
|
||||
this.FailTimes++
|
||||
} else {
|
||||
this.DrawTimes++
|
||||
}
|
||||
}
|
||||
|
||||
//func (this *Player) CheckType(gamefreeId, gameId int32) *server.DB_PlayerType {
|
||||
// types := srvdata.PlayerTypeMgrSington.GetPlayerType(gamefreeId)
|
||||
// cnt := len(types)
|
||||
|
@ -1441,7 +1359,6 @@ func (this *Player) AddPlayerExp(exp int64) bool {
|
|||
if this.Exp > int64(maxExp) {
|
||||
this.Exp = int64(maxExp)
|
||||
}
|
||||
|
||||
//oldLevel := this.Level
|
||||
//获取等级
|
||||
for _, playerExp := range srvdata.PBDB_PlayerExpMgr.Datas.Arr {
|
||||
|
@ -1451,9 +1368,6 @@ func (this *Player) AddPlayerExp(exp int64) bool {
|
|||
break
|
||||
}
|
||||
}
|
||||
//升级
|
||||
//if this.Level != oldLevel {
|
||||
////通知客户端
|
||||
pack := &player.SCPlayerUpLevel{
|
||||
Level: this.Level,
|
||||
Exp: this.Exp,
|
||||
|
@ -1461,8 +1375,6 @@ func (this *Player) AddPlayerExp(exp int64) bool {
|
|||
//通知客户端玩家提升等级
|
||||
this.SendToClient(int(player.PlayerPacketID_PACKET_SC_PlayerUpLevel), pack)
|
||||
return true
|
||||
//}
|
||||
return false
|
||||
}
|
||||
|
||||
// 解锁炮倍
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package base
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
rawproto "google.golang.org/protobuf/proto"
|
||||
|
@ -1725,13 +1723,6 @@ func GetSaveGamePlayerListLogParam(platform, channel, promoter, packageTag, logi
|
|||
}
|
||||
}
|
||||
|
||||
func IsFishGame(gameId int) bool {
|
||||
if gameId == common.GameId_HFishing || gameId == common.GameId_TFishing {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
func (this *Scene) SaveFriendRecord(snid int32, isWin int32, billCoin int64, baseScore int32) {
|
||||
if this.SceneMode == common.SceneMode_Private {
|
||||
return
|
||||
|
@ -2034,6 +2025,7 @@ func (this *Scene) RobotLeaveHundred() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) RandInt(args ...int) int {
|
||||
switch len(args) {
|
||||
case 0:
|
||||
|
@ -2079,208 +2071,6 @@ func (this *Scene) GetRecordId() string {
|
|||
return fmt.Sprintf("%d%d%v%d", this.GameId, this.SceneId, this.GameNowTime.Format(ReplayIdTf), this.NumOfGames)
|
||||
}
|
||||
|
||||
//func (this *Scene) TryUseMatchNextBaseData() {
|
||||
// data := this.matchChgData
|
||||
// if data != nil {
|
||||
// this.matchChgData = nil
|
||||
// this.SetParamEx(common.PARAMEX_MATCH_BASESCORE, data.NextBaseScore)
|
||||
// this.SetParamEx(common.PARAMEX_MATCH_OUTSCORE, data.NextOutScore)
|
||||
// this.DbGameFree.BaseScore = proto.Int32(data.NextBaseScore)
|
||||
// //同步给玩家
|
||||
// pack := &match.SCMatchBaseScoreChange{
|
||||
// MatchId: proto.Int32(this.GetParamEx(common.PARAMEX_MATCH_COPYID)),
|
||||
// BaseScore: proto.Int32(data.NextBaseScore),
|
||||
// OutScore: proto.Int32(data.NextOutScore),
|
||||
// }
|
||||
// proto.SetDefaults(pack)
|
||||
// this.Broadcast(int(match.MatchPacketID_PACKET_SC_MATCH_BASESCORECHANGE), pack, 0)
|
||||
// }
|
||||
//}
|
||||
|
||||
// ///////////////////////////////////////////////////////////////////
|
||||
func (this *Scene) resultHistoryRemove(n int) {
|
||||
var i int
|
||||
for ; i < len(this.resultHistory); i++ {
|
||||
for j := 1; j < len(this.resultHistory[i]); j++ {
|
||||
if this.resultHistory[i][j] == n {
|
||||
this.resultHistory[i] = append(this.resultHistory[i][:j], this.resultHistory[i][j+1:]...)
|
||||
if len(this.resultHistory[i]) <= 1 {
|
||||
this.resultHistory = append(this.resultHistory[:i], this.resultHistory[i+1:]...)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) GetResultHistoryResult(n int) int {
|
||||
for i := 0; i < len(this.resultHistory); i++ {
|
||||
for j := 1; j < len(this.resultHistory[i]); j++ {
|
||||
if this.resultHistory[i][j] == n {
|
||||
return this.resultHistory[i][0]
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
func (this *Scene) GetResult() int {
|
||||
return this.results[this.LoopNum]
|
||||
}
|
||||
func (this *Scene) resultCheck() {
|
||||
logger.Logger.Tracef("历史记录: %v\n调控配置: %v", this.resultHistory, this.results)
|
||||
for i := 0; i < len(this.resultHistory); i++ {
|
||||
m := this.resultHistory[i][0]
|
||||
for j := 1; j < len(this.resultHistory[i]); j++ {
|
||||
if this.results[this.resultHistory[i][j]] != m {
|
||||
logger.Logger.Errorf("不匹配 局数:%d 配置结果:%d 历史记录的结果:%d",
|
||||
this.resultHistory[i][j], this.results[this.resultHistory[i][j]], m)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) AddLoopNum() {
|
||||
//defer this.resultCheck()
|
||||
// 维护 resultHistory
|
||||
this.resultHistoryRemove(this.LoopNum)
|
||||
|
||||
this.results[this.LoopNum] = common.DefaultResult
|
||||
this.LoopNum++
|
||||
if this.LoopNum == common.MaxLoopNum {
|
||||
this.LoopNum = 0
|
||||
}
|
||||
}
|
||||
func (this *Scene) ProtoResults() []*server.EResult {
|
||||
ret := []*server.EResult{}
|
||||
for i := 0; i < len(this.resultHistory); i++ {
|
||||
if len(this.resultHistory[i]) <= 1 {
|
||||
continue
|
||||
}
|
||||
temp := new(server.EResult)
|
||||
temp.Result = proto.Int(this.resultHistory[i][0])
|
||||
buf := bytes.NewBufferString("")
|
||||
buf.WriteString(fmt.Sprint(this.resultHistory[i][1]))
|
||||
for j := 2; j < len(this.resultHistory[i]); j++ {
|
||||
buf.WriteString(fmt.Sprint(",", this.resultHistory[i][j]))
|
||||
}
|
||||
temp.Index = proto.String(buf.String())
|
||||
ret = append(ret, temp)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func (this *Scene) ParserResults(str, user string) {
|
||||
for _, v := range strings.Split(strings.TrimSpace(str), ",") {
|
||||
ns := strings.Split(v, ":")
|
||||
if len(ns) != 2 {
|
||||
continue
|
||||
}
|
||||
i, err := strconv.Atoi(ns[0])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
n, err := strconv.Atoi(ns[1])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if n < 0 || n >= len(this.results) {
|
||||
continue
|
||||
}
|
||||
this.results[i] = n
|
||||
}
|
||||
this.WebUser = user
|
||||
}
|
||||
|
||||
// ParserResults1 只能解析一种控制结果的设置
|
||||
func (this *Scene) ParserResults1(str, user string) *server.GWRoomResults {
|
||||
// 维护 resultHistory
|
||||
ret := &server.GWRoomResults{
|
||||
Code: proto.Int(0),
|
||||
}
|
||||
|
||||
arr := strings.Split(strings.TrimSpace(str), ",")
|
||||
if len(arr) == 0 {
|
||||
ret.Code = proto.Int(3)
|
||||
ret.Msg = proto.String("参数错误")
|
||||
return ret
|
||||
}
|
||||
ns := strings.Split(arr[0], ":")
|
||||
if len(ns) != 2 {
|
||||
ret.Code = proto.Int(3)
|
||||
ret.Msg = proto.String("参数错误")
|
||||
return ret
|
||||
}
|
||||
n, err := strconv.Atoi(ns[1])
|
||||
if err != nil {
|
||||
ret.Code = proto.Int(3)
|
||||
ret.Msg = proto.String("参数错误")
|
||||
return ret
|
||||
}
|
||||
|
||||
//logger.Logger.Tracef("控牌设置历史 %s", str)
|
||||
//defer this.resultCheck()
|
||||
|
||||
var is []int
|
||||
if n == common.DefaultResult {
|
||||
for _, v := range arr {
|
||||
ns := strings.Split(v, ":")
|
||||
if len(ns) != 2 {
|
||||
continue
|
||||
}
|
||||
// 局数
|
||||
i, err := strconv.Atoi(ns[0])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if i < 0 || i >= len(this.results) {
|
||||
ret.Code = proto.Int(2)
|
||||
ret.Msg = proto.String(fmt.Sprintf("局数错误 第%d局", i))
|
||||
return ret
|
||||
}
|
||||
is = append(is, i)
|
||||
}
|
||||
for _, v := range is {
|
||||
this.resultHistoryRemove(v)
|
||||
this.results[v] = common.DefaultResult
|
||||
}
|
||||
this.WebUser = user
|
||||
return ret
|
||||
}
|
||||
|
||||
// 设置
|
||||
indexes := []int{n}
|
||||
for _, v := range arr {
|
||||
ns := strings.Split(v, ":")
|
||||
if len(ns) != 2 {
|
||||
continue
|
||||
}
|
||||
// 局数
|
||||
i, err := strconv.Atoi(ns[0])
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if i < 0 || i >= len(this.results) {
|
||||
ret.Code = proto.Int(2)
|
||||
ret.Msg = proto.String(fmt.Sprintf("局数错误 第%d局", i))
|
||||
return ret
|
||||
}
|
||||
if this.results[i] != common.DefaultResult {
|
||||
ret.Code = proto.Int(1)
|
||||
ret.Msg = proto.String(fmt.Sprintf("重复设置第%d局", i))
|
||||
return ret
|
||||
}
|
||||
is = append(is, i)
|
||||
}
|
||||
|
||||
for _, v := range is {
|
||||
this.results[v] = n
|
||||
indexes = append(indexes, v)
|
||||
}
|
||||
this.resultHistory = append(this.resultHistory, indexes)
|
||||
this.WebUser = user
|
||||
return ret
|
||||
}
|
||||
|
||||
func (this *Scene) RandTakeCoin(p *Player) (takeCoin, leaveCoin, gameTimes int64) {
|
||||
if p.IsRob && p.IsLocal {
|
||||
dbGameFree := this.DbGameFree
|
||||
|
@ -2554,9 +2344,9 @@ func (this *Scene) SyncPlayerDatas(param *PlayerDataParam) int64 {
|
|||
|
||||
type StaticParam struct {
|
||||
SnId int32 // 玩家id
|
||||
Gain int64 // 赢取金币(税后)
|
||||
Gain int64 // 输赢金币(税后)
|
||||
GainTax int64 // 赢取金币时的税收
|
||||
IsAddTimes bool // 是否记录游戏次数
|
||||
IsAddTimes bool // 是否统计游戏次数
|
||||
HasRobotGaming bool // 是否有机器人玩本局游戏
|
||||
WinState int32 // 输赢状态 1 赢 2 输 3 和
|
||||
}
|
||||
|
@ -2567,6 +2357,7 @@ func (this *Scene) IsControl(hasRobotGaming bool) bool {
|
|||
}
|
||||
|
||||
// Statistics 玩家游戏数据统计
|
||||
// 包含水池统计,黑白名单统计,新手调控统计,个人水池统计
|
||||
func (this *Scene) Statistics(param *StaticParam) {
|
||||
if param == nil {
|
||||
return
|
||||
|
@ -2637,7 +2428,6 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
p.TodayGameData.CtrlData[keyGameId] = data
|
||||
statics = append(statics, data)
|
||||
}
|
||||
|
||||
// 按场次分
|
||||
if data, ok := p.GDatas[keyGameFreeId]; ok {
|
||||
if data.FirstTime.IsZero() {
|
||||
|
@ -2754,9 +2544,13 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
}
|
||||
|
||||
// 玩家身上元数据
|
||||
p.GameTimes++
|
||||
if param.IsAddTimes {
|
||||
p.GameTimes++
|
||||
}
|
||||
if param.Gain > 0 {
|
||||
p.WinTimes++
|
||||
if param.IsAddTimes {
|
||||
p.WinTimes++
|
||||
}
|
||||
p.WinCoin += totalOut
|
||||
p.TaxCoin += param.GainTax
|
||||
if isPlayerPool && common.IsPlayerPool(this.GameId) {
|
||||
|
@ -2764,13 +2558,17 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
p.PlayerTax += param.GainTax
|
||||
}
|
||||
} else if param.Gain < 0 {
|
||||
p.FailTimes++
|
||||
if param.IsAddTimes {
|
||||
p.FailTimes++
|
||||
}
|
||||
p.FailCoin += totalIn
|
||||
if isPlayerPool && common.IsPlayerPool(this.GameId) {
|
||||
p.TotalIn += totalIn
|
||||
}
|
||||
} else {
|
||||
p.DrawTimes++
|
||||
if param.IsAddTimes {
|
||||
p.DrawTimes++
|
||||
}
|
||||
}
|
||||
|
||||
// 水池统计
|
||||
|
@ -2787,27 +2585,129 @@ func (this *Scene) Statistics(param *StaticParam) {
|
|||
}
|
||||
}
|
||||
|
||||
type StaticLabaParam struct {
|
||||
SnId int32 // 玩家id
|
||||
Gain int64 // 输赢金币(税后)
|
||||
GainTax int64 // 赢取金币时的税收
|
||||
IsAddTimes bool // 是否统计游戏次数
|
||||
}
|
||||
|
||||
// StaticsLaba 拉霸游戏数据统计,一次下注记录一次
|
||||
// 不含水池统计,黑白名单统计,在游戏中另外处理
|
||||
func (this *Scene) StaticsLaba(param *StaticLabaParam) {
|
||||
if param == nil {
|
||||
return
|
||||
}
|
||||
p := this.GetPlayer(param.SnId)
|
||||
if p == nil || p.IsRob {
|
||||
return
|
||||
}
|
||||
|
||||
// 比赛场,私人房不统计
|
||||
if this.IsMatchScene() || this.IsPrivateScene() {
|
||||
return
|
||||
}
|
||||
|
||||
var totalIn int64
|
||||
var totalOut int64
|
||||
now := time.Now()
|
||||
if param.Gain > 0 {
|
||||
totalOut = param.Gain + param.GainTax
|
||||
} else {
|
||||
totalIn = -param.Gain
|
||||
}
|
||||
|
||||
var statics []*model.PlayerGameStatics
|
||||
keyGameId := strconv.Itoa(this.GetGameId())
|
||||
keyGameFreeId := strconv.Itoa(int(this.GetGameFreeId()))
|
||||
// 当天数据统计
|
||||
// 按场次分
|
||||
if data, ok := p.TodayGameData.CtrlData[keyGameFreeId]; ok {
|
||||
statics = append(statics, data)
|
||||
} else {
|
||||
gs := model.NewPlayerGameStatics()
|
||||
p.TodayGameData.CtrlData[keyGameFreeId] = gs
|
||||
statics = append(statics, gs)
|
||||
}
|
||||
// 按游戏分
|
||||
if data, ok := p.TodayGameData.CtrlData[keyGameId]; ok {
|
||||
statics = append(statics, data)
|
||||
} else {
|
||||
data = model.NewPlayerGameStatics()
|
||||
p.TodayGameData.CtrlData[keyGameId] = data
|
||||
statics = append(statics, data)
|
||||
}
|
||||
// 按场次分
|
||||
if data, ok := p.GDatas[keyGameFreeId]; ok {
|
||||
if data.FirstTime.IsZero() {
|
||||
data.FirstTime = now
|
||||
}
|
||||
statics = append(statics, &data.Statics)
|
||||
} else {
|
||||
data = &model.PlayerGameInfo{FirstTime: now}
|
||||
p.GDatas[keyGameFreeId] = data
|
||||
statics = append(statics, &data.Statics)
|
||||
}
|
||||
// 按游戏分
|
||||
if data, ok := p.GDatas[keyGameId]; ok {
|
||||
if data.FirstTime.IsZero() {
|
||||
data.FirstTime = now
|
||||
}
|
||||
statics = append(statics, &data.Statics)
|
||||
} else {
|
||||
data = &model.PlayerGameInfo{FirstTime: now}
|
||||
p.GDatas[keyGameId] = data
|
||||
statics = append(statics, &data.Statics)
|
||||
}
|
||||
|
||||
for _, data := range statics {
|
||||
if data != nil {
|
||||
data.TotalIn += totalIn
|
||||
data.TotalOut += totalOut
|
||||
data.Tax += param.GainTax
|
||||
if param.IsAddTimes {
|
||||
data.GameTimes++
|
||||
if param.Gain > 0 {
|
||||
data.WinGameTimes++
|
||||
data.WinGameTimesNum++
|
||||
data.LoseGameTimesNum = 0
|
||||
} else if param.Gain < 0 {
|
||||
data.LoseGameTimes++
|
||||
data.LoseGameTimesNum++
|
||||
data.WinGameTimesNum = 0
|
||||
} else {
|
||||
data.DrawGameTimes++
|
||||
data.WinGameTimesNum = 0
|
||||
data.LoseGameTimesNum = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 玩家身上元数据
|
||||
if param.IsAddTimes {
|
||||
p.GameTimes++
|
||||
}
|
||||
if param.Gain > 0 {
|
||||
if param.IsAddTimes {
|
||||
p.WinTimes++
|
||||
}
|
||||
p.WinCoin += totalOut
|
||||
p.TaxCoin += param.GainTax
|
||||
} else if param.Gain < 0 {
|
||||
if param.IsAddTimes {
|
||||
p.FailTimes++
|
||||
}
|
||||
p.FailCoin += totalIn
|
||||
} else {
|
||||
if param.IsAddTimes {
|
||||
p.DrawTimes++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (this *Scene) TryRelease() {
|
||||
if !this.IsMatchScene() && this.realPlayerNum == 0 {
|
||||
this.Destroy(true)
|
||||
}
|
||||
}
|
||||
|
||||
//type PlayerGamePoolParam struct {
|
||||
// SnId int32
|
||||
// HasRobotGaming bool // 是否有机器人玩本局游戏
|
||||
// Gain int64 // 普通非黑白,非新手,非机器人的玩家输赢总额,需要扣税后的值(赢分扣税)
|
||||
//}
|
||||
|
||||
// PushGamePool 将普通非黑白,新手,机器人的玩家输赢金额放入场次水池
|
||||
//func (this *Scene) PushGamePool(param *PlayerGamePoolParam) {
|
||||
// if this.IsMatchScene() || this.IsPrivateScene() || (this.IsFreePublic() && !param.HasRobotGaming) {
|
||||
// return
|
||||
// }
|
||||
// p := this.GetPlayer(param.SnId)
|
||||
// _, isNovice := p.NoviceOdds(this.GameId)
|
||||
// if p == nil || p.IsRob || p.WBLevel != 0 || isNovice {
|
||||
// return
|
||||
// }
|
||||
// CoinPoolMgr.PushCoin(this.GetGameFreeId(), this.GroupId, this.Platform, -param.Gain)
|
||||
//}
|
||||
|
|
|
@ -430,18 +430,18 @@ func (this *SceneStateCaiShenStart) OnPlayerOp(s *base.Scene, p *base.Player, op
|
|||
//水池设置
|
||||
coinPoolSetting := base.CoinPoolMgr.GetCoinPoolSetting(sceneEx.Platform, sceneEx.GetGameFreeId(), sceneEx.GroupId)
|
||||
//baseRate := coinPoolSetting.GetBaseRate() //基础赔率
|
||||
ctroRate := 500 //调节赔率 暗税系数
|
||||
jackpotRate := ctroRate //奖池系数
|
||||
ctroRate := coinPoolSetting.GetCtrlRate() //调节赔率 暗税系数
|
||||
jackpotRate := ctroRate //奖池系数
|
||||
logger.Logger.Tracef("CaiShenRates [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, taxRate, ctroRate)
|
||||
|
||||
playerEx.IsFNovice(sceneEx.KeyGameId)
|
||||
isFoolPlayer := false
|
||||
isFoolPlayer := playerEx.IsFoolPlayer[sceneEx.KeyGameId]
|
||||
var gamePoolCoin int64
|
||||
//if isFoolPlayer {
|
||||
// gamePoolCoin = base.CoinPoolMgr.GetNoviceCoinPool(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//}
|
||||
if isFoolPlayer {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetNoviceCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
}
|
||||
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
|
||||
|
||||
// 奖池参数
|
||||
|
@ -483,7 +483,7 @@ func (this *SceneStateCaiShenStart) OnPlayerOp(s *base.Scene, p *base.Player, op
|
|||
var slotDataIsOk bool
|
||||
for {
|
||||
var symbolType rule.Symbol
|
||||
if gamePoolCoin < int64(coinPoolSetting.GetLowerLimit()) { // userInfo.prizeFund < limit * roomId
|
||||
if gamePoolCoin < coinPoolSetting.GetLowerLimit() { // userInfo.prizeFund < limit * roomId
|
||||
symbolType = rule.SYMBOL1
|
||||
} else {
|
||||
symbolType = rule.SYMBOL2
|
||||
|
@ -569,8 +569,12 @@ func (this *SceneStateCaiShenStart) OnPlayerOp(s *base.Scene, p *base.Player, op
|
|||
playerEx.taxCoin = spinRes.TotalTaxScore
|
||||
playerEx.AddServiceFee(playerEx.taxCoin)
|
||||
}
|
||||
p.StaticsLaba(sceneEx.KeyGameId, sceneEx.KeyGamefreeId, totalBetValue, totalWinScore+spinRes.BonusGame.GetTotalPrizeValue()+spinRes.TotalTaxScore)
|
||||
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: totalWinScore + spinRes.BonusGame.GetTotalPrizeValue() - totalBetValue,
|
||||
GainTax: spinRes.TotalTaxScore,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
this.OnPlayerSToCOp(s, p, playerEx.Pos, opcode, caishen.OpResultCode_OPRC_Sucess, append(params[:1], playerEx.betLines...))
|
||||
|
||||
//免费次数
|
||||
|
@ -995,8 +999,8 @@ func CaiShenCheckAndSaveLog(sceneEx *CaiShenSceneData, playerEx *CaiShenPlayerDa
|
|||
//changeCoin := playerEx.Coin - playerEx.StartCoin
|
||||
changeCoin := playerEx.winCoin - playerEx.taxCoin - playerEx.CurrentBet
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
// playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
|
||||
//log2
|
||||
playerEx.RollGameType.BaseResult.ChangeCoin = changeCoin
|
||||
|
@ -1055,15 +1059,8 @@ func CaiShenCheckAndSaveLog(sceneEx *CaiShenSceneData, playerEx *CaiShenPlayerDa
|
|||
Bet: proto.Int64(playerEx.CurrentBet),
|
||||
Gain: proto.Int64(playerEx.RollGameType.BaseResult.ChangeCoin),
|
||||
Tax: proto.Int64(playerEx.taxCoin),
|
||||
OtherTax: 0,
|
||||
Coin: proto.Int64(playerEx.GetCoin()),
|
||||
FlowCoin: 0,
|
||||
Lottery: 0,
|
||||
Kind: 0,
|
||||
Card: nil,
|
||||
GameCoinTs: proto.Int64(playerEx.GameCoinTs),
|
||||
WBGain: 0,
|
||||
WinState: 0,
|
||||
}
|
||||
gwPlayerBet := &server.GWPlayerData{
|
||||
SceneId: proto.Int(sceneEx.SceneId),
|
||||
|
|
|
@ -419,17 +419,17 @@ func (this *SceneStateEasterIslandStart) OnPlayerOp(s *base.Scene, p *base.Playe
|
|||
taxRate = 500
|
||||
}
|
||||
coinPoolSetting := base.CoinPoolMgr.GetCoinPoolSetting(sceneEx.Platform, sceneEx.GetGameFreeId(), sceneEx.GroupId)
|
||||
ctroRate := 500 //调节赔率 暗税系数
|
||||
ctroRate := coinPoolSetting.GetCtrlRate() //调节赔率 暗税系数
|
||||
logger.Logger.Tracef("EasterIslandRates [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, taxRate, ctroRate)
|
||||
|
||||
playerEx.IsFNovice(sceneEx.KeyGameId)
|
||||
isFoolPlayer := false
|
||||
isFoolPlayer := playerEx.IsFoolPlayer[sceneEx.KeyGameId]
|
||||
var gamePoolCoin int64
|
||||
//if isFoolPlayer {
|
||||
// gamePoolCoin = base.CoinPoolMgr.GetNoviceCoinPool(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//}
|
||||
if isFoolPlayer {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetNoviceCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
}
|
||||
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
|
||||
jackpotParams := sceneEx.DbGameFree.GetJackpot() // 奖池参数
|
||||
var jackpotInit = int64(jackpotParams[rule.EL_JACKPOT_InitJackpot] * sceneEx.DbGameFree.GetBaseScore()) //奖池初始值
|
||||
|
@ -466,7 +466,7 @@ func (this *SceneStateEasterIslandStart) OnPlayerOp(s *base.Scene, p *base.Playe
|
|||
var slotDataIsOk bool
|
||||
for {
|
||||
var symbolType rule.Symbol
|
||||
if gamePoolCoin < int64(coinPoolSetting.GetLowerLimit()) { // userInfo.prizeFund < limit * roomId
|
||||
if gamePoolCoin < coinPoolSetting.GetLowerLimit() { // userInfo.prizeFund < limit * roomId
|
||||
symbolType = rule.SYMBOL1
|
||||
} else {
|
||||
symbolType = rule.SYMBOL2
|
||||
|
@ -547,8 +547,12 @@ func (this *SceneStateEasterIslandStart) OnPlayerOp(s *base.Scene, p *base.Playe
|
|||
playerEx.taxCoin = spinRes.TotalTaxScore
|
||||
playerEx.AddServiceFee(playerEx.taxCoin)
|
||||
}
|
||||
p.StaticsLaba(sceneEx.KeyGameId, sceneEx.KeyGamefreeId, totalBetValue, totalWinScore+spinRes.BonusGame.GetTotalPrizeValue()+spinRes.TotalTaxScore)
|
||||
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: totalWinScore + spinRes.BonusGame.GetTotalPrizeValue() - totalBetValue,
|
||||
GainTax: spinRes.TotalTaxScore,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
this.OnPlayerSToCOp(s, p, playerEx.Pos, opcode, easterisland.OpResultCode_OPRC_Sucess, append(params[:1], playerEx.betLines...))
|
||||
|
||||
var isFreeFlag bool
|
||||
|
@ -864,8 +868,8 @@ func EasterIslandCheckAndSaveLog(sceneEx *EasterIslandSceneData, playerEx *Easte
|
|||
//changeCoin := playerEx.Coin - playerEx.StartCoin
|
||||
changeCoin := playerEx.winCoin - playerEx.taxCoin - playerEx.CurrentBet
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
// playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
|
||||
//log2
|
||||
playerEx.RollGameType.BaseResult.ChangeCoin = changeCoin
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package fishing
|
||||
|
||||
import (
|
||||
"math"
|
||||
"mongo.games.com/game/common"
|
||||
"mongo.games.com/game/gamerule/fishing"
|
||||
"mongo.games.com/game/gamesrv/base"
|
||||
|
@ -99,8 +98,8 @@ func (this *ScenePolicyFishing) OnPlayerLeave(s *base.Scene, p *base.Player, rea
|
|||
if playerEx.GetCurrentCoin() == 0 {
|
||||
playerEx.SetCurrentCoin(playerEx.GetTakeCoin())
|
||||
}
|
||||
playerEx.SaveSceneCoinLog(playerEx.GetCurrentCoin(), int64(playerEx.CoinCache-playerEx.GetCurrentCoin()),
|
||||
playerEx.GetCoin(), 0, int64(math.Floor(playerEx.taxCoin+0.5)), playerEx.winCoin, 0, 0)
|
||||
//playerEx.SaveSceneCoinLog(playerEx.GetCurrentCoin(), int64(playerEx.CoinCache-playerEx.GetCurrentCoin()),
|
||||
// playerEx.GetCoin(), 0, int64(math.Floor(playerEx.taxCoin+0.5)), playerEx.winCoin, 0, 0)
|
||||
playerEx.SetCurrentCoin(playerEx.GetCoin())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -397,7 +397,7 @@ func (this *SceneStateIceAgeStart) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
|||
//水池设置
|
||||
coinPoolSetting := base.GetCoinPoolMgr().GetCoinPoolSetting(sceneEx.GetPlatform(), sceneEx.GetGameFreeId(), sceneEx.GetGroupId())
|
||||
//baseRate := coinPoolSetting.GetBaseRate() //基础赔率
|
||||
ctroRate := 500 //调节赔率 暗税系数
|
||||
ctroRate := coinPoolSetting.GetCtrlRate() //调节赔率 暗税系数
|
||||
//if baseRate >= 10000 || baseRate <= 0 || ctroRate < 0 || ctroRate >= 1000 || baseRate+ctroRate > 9900 {
|
||||
// logger.Logger.Warnf("IceAgeErrorBaseRate [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, baseRate, ctroRate)
|
||||
// baseRate = 9700
|
||||
|
@ -408,13 +408,13 @@ func (this *SceneStateIceAgeStart) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
|||
logger.Logger.Tracef("IceAgeRates [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, taxRate, ctroRate)
|
||||
|
||||
playerEx.IsFNovice(sceneEx.KeyGameId)
|
||||
isFoolPlayer := false
|
||||
isFoolPlayer := playerEx.IsFoolPlayer[sceneEx.KeyGameId]
|
||||
var gamePoolCoin int64
|
||||
//if isFoolPlayer {
|
||||
// gamePoolCoin = base.CoinPoolMgr.GetNoviceCoinPool(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//}
|
||||
if isFoolPlayer {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetNoviceCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
}
|
||||
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
|
||||
|
||||
var jackpotParam = sceneEx.GetDBGameFree().GetJackpot() // 奖池参数
|
||||
|
@ -579,7 +579,12 @@ func (this *SceneStateIceAgeStart) OnPlayerOp(s *base.Scene, p *base.Player, opc
|
|||
playerEx.taxCoin = spinRes.TotalTaxScore
|
||||
playerEx.AddServiceFee(playerEx.taxCoin)
|
||||
}
|
||||
p.StaticsLaba(sceneEx.KeyGameId, sceneEx.KeyGamefreeId, totalBetValue, spinRes.TotalPrizeLine+spinRes.TotalPrizeBonus+spinRes.TotalTaxScore)
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: spinRes.TotalPrizeLine + spinRes.TotalPrizeBonus - totalBetValue,
|
||||
GainTax: spinRes.TotalTaxScore,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
|
||||
var isFreeFlag bool
|
||||
//免费次数
|
||||
|
@ -913,8 +918,8 @@ func IceAgeCheckAndSaveLog(sceneEx *IceAgeSceneData, playerEx *IceAgePlayerData)
|
|||
//changeCoin := playerEx.GetCoin() - playerEx.GetStartCoin()
|
||||
changeCoin := playerEx.winCoin - playerEx.taxCoin - playerEx.CurrentBet
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
playerEx.GetCoin(), playerEx.GetCurrentBet(), playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
// playerEx.GetCoin(), playerEx.GetCurrentBet(), playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
|
||||
//log2
|
||||
playerEx.RollGameType.BaseResult.ChangeCoin = changeCoin
|
||||
|
|
|
@ -440,13 +440,16 @@ func (s *RichBlessedSceneData) SendPlayerBet(p *RichBlessedPlayerData) {
|
|||
betCoin = 0
|
||||
}
|
||||
playerBet := &server.PlayerData{
|
||||
SnId: proto.Int32(p.SnId),
|
||||
Bet: proto.Int64(betCoin),
|
||||
Gain: proto.Int64(p.Coin - p.startCoin),
|
||||
Tax: proto.Int64(p.taxCoin),
|
||||
SnId: proto.Int32(p.SnId),
|
||||
Bet: proto.Int64(betCoin),
|
||||
Gain: proto.Int64(p.Coin - p.startCoin),
|
||||
Tax: proto.Int64(p.taxCoin),
|
||||
Coin: p.Coin,
|
||||
GameCoinTs: p.GameCoinTs,
|
||||
}
|
||||
gwPlayerBet := &server.GWPlayerData{
|
||||
GameFreeId: proto.Int32(s.DbGameFree.GetId()),
|
||||
SceneId: int32(s.SceneId),
|
||||
}
|
||||
gwPlayerBet.Datas = append(gwPlayerBet.Datas, playerBet)
|
||||
s.SyncPlayerDatas(&base.PlayerDataParam{
|
||||
|
|
|
@ -1126,14 +1126,6 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
|
||||
// 本局下注才记录
|
||||
if sceneEx.logic.IsCurRoundBet(playerEx.CurBetData) {
|
||||
sceneEx.Statistics(&base.StaticParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: playerEx.gainCoin,
|
||||
GainTax: playerEx.taxCoin,
|
||||
IsAddTimes: true,
|
||||
HasRobotGaming: sceneEx.robotNum > 0,
|
||||
})
|
||||
|
||||
logger.Logger.Trace("SmallRocketSaveLog Save ", playerEx.SnId)
|
||||
|
||||
TotalBetValue := sceneEx.logic.GetRoundBetCoin(playerEx.CurBetData)
|
||||
|
@ -1142,7 +1134,13 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
changeCoin := playerEx.gainCoin - playerEx.taxCoin - int64(TotalBetValue)
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
|
||||
playerEx.SaveSceneCoinLog(startCoin, changeCoin, playerEx.GetCoin(), int64(TotalBetValue), playerEx.taxCoin, playerEx.gainCoin, 0, 0)
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: changeCoin,
|
||||
GainTax: playerEx.taxCoin,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin, playerEx.GetCoin(), int64(TotalBetValue), playerEx.taxCoin, playerEx.gainCoin, 0, 0)
|
||||
|
||||
//GainTotalBetVal := sceneEx.logic.GetRoundGainCoin(playerEx.betData, )
|
||||
LogBaseResult := model.SmallRocketBaseResultType{}
|
||||
|
@ -1211,23 +1209,21 @@ func (this *StateBilled) OnEnter(s *base.Scene) {
|
|||
// 提前离开的
|
||||
for _, playerEx := range sceneEx.PlayerBackup {
|
||||
if playerEx != nil && playerEx.isBilled {
|
||||
if sceneEx.logic.IsCurRoundBet(playerEx.CurBetData) {
|
||||
sceneEx.Statistics(&base.StaticParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: playerEx.gainCoin,
|
||||
GainTax: playerEx.taxCoin,
|
||||
IsAddTimes: true,
|
||||
HasRobotGaming: sceneEx.robotNum > 0,
|
||||
})
|
||||
}
|
||||
|
||||
TotalBetValue := sceneEx.logic.GetRoundBetCoin(playerEx.CurBetData)
|
||||
|
||||
// 统计金币变动
|
||||
changeCoin := playerEx.gainCoin - playerEx.taxCoin - int64(TotalBetValue)
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
|
||||
// playerEx.SaveSceneCoinLog(startCoin, changeCoin, playerEx.Coin, int64(TotalBetValue), playerEx.taxCoin, playerEx.gainCoin, 0, 0)
|
||||
if sceneEx.logic.IsCurRoundBet(playerEx.CurBetData) {
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: changeCoin,
|
||||
GainTax: playerEx.taxCoin,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
}
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin, playerEx.Coin, int64(TotalBetValue), playerEx.taxCoin, playerEx.gainCoin, 0, 0)
|
||||
|
||||
LogBaseResult := model.SmallRocketBaseResultType{}
|
||||
LogBaseResult.RoomId = int32(sceneEx.GetSceneId())
|
||||
|
|
|
@ -395,18 +395,18 @@ func (this *SceneStateTamQuocStart) OnPlayerOp(s *base.Scene, p *base.Player, op
|
|||
}
|
||||
//水池设置
|
||||
coinPoolSetting := base.CoinPoolMgr.GetCoinPoolSetting(sceneEx.Platform, sceneEx.GetGameFreeId(), sceneEx.GroupId)
|
||||
ctroRate := 500 //调节赔率 暗税系数
|
||||
jackpotRate := ctroRate //奖池系数
|
||||
ctroRate := coinPoolSetting.GetCtrlRate() //调节赔率 暗税系数
|
||||
jackpotRate := ctroRate //奖池系数
|
||||
logger.Logger.Tracef("TamQuocRates [%v][%v][%v][%v][%v]", sceneEx.GetGameFreeId(), playerEx.SnId, playerEx.spinID, taxRate, ctroRate)
|
||||
|
||||
playerEx.IsFNovice(sceneEx.KeyGameId)
|
||||
isFoolPlayer := false
|
||||
isFoolPlayer := playerEx.IsFoolPlayer[sceneEx.KeyGameId]
|
||||
var gamePoolCoin int64
|
||||
//if isFoolPlayer {
|
||||
// gamePoolCoin = base.CoinPoolMgr.GetNoviceCoinPool(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
//}
|
||||
if isFoolPlayer {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetNoviceCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
} else {
|
||||
gamePoolCoin = base.CoinPoolMgr.GetCoin(sceneEx.GetGameFreeId(), sceneEx.Platform, sceneEx.GroupId) // 当前水池金额
|
||||
}
|
||||
prizeFund := gamePoolCoin - sceneEx.jackpot.VirtualJK // 除去奖池的水池剩余金额
|
||||
|
||||
// 奖池参数
|
||||
|
@ -442,7 +442,7 @@ func (this *SceneStateTamQuocStart) OnPlayerOp(s *base.Scene, p *base.Player, op
|
|||
}
|
||||
|
||||
var symbolType rule.Symbol
|
||||
if gamePoolCoin <= int64(coinPoolSetting.GetLowerLimit()) { // 水池不足
|
||||
if gamePoolCoin <= coinPoolSetting.GetLowerLimit() { // 水池不足
|
||||
symbolType = rule.SYMBOL1
|
||||
} else {
|
||||
symbolType = rule.SYMBOL2
|
||||
|
@ -553,7 +553,12 @@ func (this *SceneStateTamQuocStart) OnPlayerOp(s *base.Scene, p *base.Player, op
|
|||
playerEx.taxCoin = spinRes.TotalTaxScore
|
||||
playerEx.AddServiceFee(playerEx.taxCoin)
|
||||
}
|
||||
p.StaticsLaba(sceneEx.KeyGameId, sceneEx.KeyGamefreeId, totalBetValue, totalWinScore+spinRes.BonusGame.GetTotalPrizeValue()+spinRes.TotalTaxScore)
|
||||
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||
SnId: playerEx.SnId,
|
||||
Gain: totalWinScore + spinRes.BonusGame.GetTotalPrizeValue() - totalBetValue,
|
||||
GainTax: spinRes.TotalTaxScore,
|
||||
IsAddTimes: true,
|
||||
})
|
||||
|
||||
this.OnPlayerSToCOp(s, p, playerEx.Pos, opcode, tamquoc.OpResultCode_OPRC_Sucess, append(params[:1], playerEx.betLines...))
|
||||
|
||||
|
@ -749,8 +754,8 @@ func TamQuocCheckAndSaveLog(sceneEx *TamQuocSceneData, playerEx *TamQuocPlayerDa
|
|||
//changeCoin := playerEx.Coin - playerEx.StartCoin
|
||||
changeCoin := playerEx.winCoin - playerEx.taxCoin - playerEx.CurrentBet
|
||||
startCoin := playerEx.Coin - changeCoin
|
||||
playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
//playerEx.SaveSceneCoinLog(startCoin, changeCoin,
|
||||
// playerEx.Coin, playerEx.CurrentBet, playerEx.taxCoin, playerEx.winCoin, playerEx.jackpotWinCoin, playerEx.smallGameWinCoin)
|
||||
|
||||
//log2
|
||||
playerEx.RollGameType.BaseResult.ChangeCoin = changeCoin
|
||||
|
|
|
@ -26,9 +26,10 @@ func GenerateGameEvent(o *PlayerGameRecEvent) *RabbitMQData {
|
|||
}
|
||||
|
||||
// GenerateSystemFreeGive 系统免费赠送
|
||||
func GenerateSystemFreeGive(snid int32, name, platform string, givetype, cointype int32, count int64) *RabbitMQData {
|
||||
func GenerateSystemFreeGive(snid int32, name, platform, channel string, givetype, cointype int32, count int64) *RabbitMQData {
|
||||
params := make(map[string]string)
|
||||
params["snid"] = strconv.Itoa(int(snid))
|
||||
params["Channel"] = channel
|
||||
params["name"] = name
|
||||
params["platform"] = platform
|
||||
params["givetype"] = strconv.Itoa(int(givetype)) //0创号赠送 1签到赠送(转盘、签到、累签) 2商城观看视频赠送 3破产补助 4vip领取
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -593,22 +593,17 @@ message GWPlayerForceLeave{
|
|||
|
||||
//PACKET_GW_PLAYERDATA
|
||||
message PlayerData {
|
||||
int32 SnId = 1;//玩家id
|
||||
int64 Bet = 2;//下注额(有效下注)
|
||||
int64 Gain = 3;//输赢额,税后
|
||||
int64 Tax = 4;// Gain的税收
|
||||
int64 OtherTax = 5;//其他税收(比如:俱乐部额外扣税)
|
||||
int64 Coin = 6;//当前身上余额
|
||||
int64 FlowCoin = 7;//流水
|
||||
int64 Lottery = 8;//彩金池增加金额
|
||||
int32 Kind = 9;//牌型
|
||||
repeated int32 Card = 10;//手牌
|
||||
int64 GameCoinTs = 11;//最后帐变时间戳
|
||||
int64 WBGain = 12; // 黑白名单输赢统计
|
||||
int32 WinState = 13; // 1:赢 2:输 3:和
|
||||
int32 SnId = 1; // 玩家id
|
||||
int64 Bet = 2; // 下注额
|
||||
int64 Gain = 3; // 输赢额,税后
|
||||
int64 Tax = 4; // Gain的税收
|
||||
int64 Coin = 5; // 当前身上余额
|
||||
int64 GameCoinTs = 6; // 最后帐变时间戳
|
||||
int64 WBGain = 7; // 黑白名单输赢统计, 发送端可以忽略
|
||||
int32 WinState = 8; // 1:赢 2:输 3:和, 用Gain区分不了输赢的游戏必传这个参数,否则可以忽略
|
||||
}
|
||||
message GWPlayerData {
|
||||
repeated PlayerData Datas = 1;// 玩家下数据
|
||||
repeated PlayerData Datas = 1;// 玩家数据
|
||||
int32 GameFreeId = 2;//游戏场次id
|
||||
int32 SceneId = 4; //房间id
|
||||
}
|
||||
|
|
|
@ -1408,7 +1408,7 @@ func (this *CSPlayerRegisterHandler) Process(s *netlib.Session, packetid int, da
|
|||
err2 := model.UpdatePlayerCoin(pi.Platform, pi.SnId, pi.Coin+int64(model.GameParamData.NewPlayerCoin), 0, 0, time.Now().Unix(), time.Now().Unix(), 0, pi.ShopID)
|
||||
if err2 == nil {
|
||||
if !pi.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(pi.SnId, pi.Name, pi.Platform, model.SystemFreeGive_GiveType_NewPlayer, model.SystemFreeGive_CoinType_Coin, int64(model.GameParamData.NewPlayerCoin)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(pi.SnId, pi.Name, pi.Platform, pi.Channel, model.SystemFreeGive_GiveType_NewPlayer, model.SystemFreeGive_CoinType_Coin, int64(model.GameParamData.NewPlayerCoin)))
|
||||
}
|
||||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
Platform: pi.Platform,
|
||||
|
|
|
@ -239,13 +239,13 @@ func CSRMAward(s *netlib.Session, packetId int, data interface{}, sid int64) err
|
|||
case v.Id == 1: //金币
|
||||
p.AddCoin(int64(v.Num), 0, common.GainWay_RankMatch, "system", "段位奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform,
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel,
|
||||
model.SystemFreeGive_GiveType_RankMatch, model.SystemFreeGive_CoinType_Coin, int64(v.Num)))
|
||||
}
|
||||
case v.Id == 2: //钻石
|
||||
p.AddDiamond(int64(v.Num), 0, common.GainWay_RankMatch, "system", "段位奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform,
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel,
|
||||
model.SystemFreeGive_GiveType_RankMatch, model.SystemFreeGive_CoinType_Diamond, int64(v.Num)))
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -371,12 +371,12 @@ func (this *CSTMSeasonAwardHandler) Process(s *netlib.Session, packetid int, dat
|
|||
case 1: //金币
|
||||
p.AddCoin(int64(v.Number1), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number1)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number1)))
|
||||
}
|
||||
case 2: //钻石
|
||||
p.AddDiamond(int64(v.Number1), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number1)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number1)))
|
||||
}
|
||||
case 3: //道具
|
||||
item := &Item{
|
||||
|
@ -395,12 +395,12 @@ func (this *CSTMSeasonAwardHandler) Process(s *netlib.Session, packetid int, dat
|
|||
case 1: //金币
|
||||
p.AddCoin(int64(v.Number2), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number2)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number2)))
|
||||
}
|
||||
case 2: //钻石
|
||||
p.AddDiamond(int64(v.Number2), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number2)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number2)))
|
||||
}
|
||||
case 3: //道具
|
||||
item := &Item{
|
||||
|
@ -419,12 +419,12 @@ func (this *CSTMSeasonAwardHandler) Process(s *netlib.Session, packetid int, dat
|
|||
case 1: //金币
|
||||
p.AddCoin(int64(v.Number3), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number3)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number3)))
|
||||
}
|
||||
case 2: //钻石
|
||||
p.AddDiamond(int64(v.Number3), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number3)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number3)))
|
||||
}
|
||||
case 3: //道具
|
||||
item := &Item{
|
||||
|
|
|
@ -364,13 +364,13 @@ func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs)
|
|||
if jyb.Award.Coin > 0 {
|
||||
p.AddCoin(jyb.Award.Coin, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Coin, int64(jyb.Award.Coin)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Coin, int64(jyb.Award.Coin)))
|
||||
}
|
||||
}
|
||||
if jyb.Award.Diamond > 0 {
|
||||
p.AddDiamond(jyb.Award.Diamond, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Diamond, int64(jyb.Award.Diamond)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Diamond, int64(jyb.Award.Diamond)))
|
||||
}
|
||||
}
|
||||
p.dirty = true
|
||||
|
|
|
@ -1234,7 +1234,7 @@ func (this *Player) GetMessageAttach(id string) {
|
|||
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
|
||||
if msg.Oper == 0 { //系统赠送
|
||||
if !this.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
|
||||
}
|
||||
}
|
||||
|
@ -1251,7 +1251,7 @@ func (this *Player) GetMessageAttach(id string) {
|
|||
this.AddDiamond(msg.Diamond, 0, gainWay, msg.Id.Hex(), remark)
|
||||
if msg.Oper == 0 { //系统赠送
|
||||
if !this.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
|
||||
}
|
||||
}
|
||||
|
@ -1421,7 +1421,7 @@ func (this *Player) GetMessageAttachs(ids []string) {
|
|||
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
|
||||
if msg.Oper == 0 { //系统赠送
|
||||
if !this.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
|
||||
}
|
||||
}
|
||||
|
@ -1438,7 +1438,7 @@ func (this *Player) GetMessageAttachs(ids []string) {
|
|||
this.AddDiamond(msg.Diamond, 0, gainWay, msg.Id.Hex(), remark)
|
||||
if msg.Oper == 0 { //系统赠送
|
||||
if !this.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, model.SystemFreeGive_GiveType_MailSystemGive,
|
||||
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -568,7 +568,7 @@ func (this *ShopMgr) PayAway(shopInfo *model.ShopInfo, p *Player, vipShopId, pos
|
|||
p.AddCoin(addTotal, 0, common.GainWay_Shop_Buy, "system", shopName)
|
||||
if shopInfo.Ad > 0 { //观看广告
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Coin, addTotal))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Coin, addTotal))
|
||||
}
|
||||
}
|
||||
// 记录钻石兑换金币的金币数量,个人水池调控使用
|
||||
|
@ -585,7 +585,7 @@ func (this *ShopMgr) PayAway(shopInfo *model.ShopInfo, p *Player, vipShopId, pos
|
|||
p.AddDiamond(addTotal, 0, common.GainWay_Shop_Buy, "system", shopName)
|
||||
if shopInfo.Ad > 0 { //观看广告
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Diamond, addTotal))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Diamond, addTotal))
|
||||
}
|
||||
}
|
||||
case ShopTypeItem:
|
||||
|
|
|
@ -129,7 +129,7 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
|
|||
if err == nil {
|
||||
// 新号赠送日志
|
||||
if !playerData.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_NewPlayer, model.SystemFreeGive_CoinType_Coin, int64(model.GameParamData.NewPlayerCoin)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, playerData.Channel, model.SystemFreeGive_GiveType_NewPlayer, model.SystemFreeGive_CoinType_Coin, int64(model.GameParamData.NewPlayerCoin)))
|
||||
}
|
||||
// 帐变记录
|
||||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
|
@ -159,7 +159,7 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
|
|||
// 金币
|
||||
if coin > 0 {
|
||||
if !playerData.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Coin, coin))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, playerData.Channel, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Coin, coin))
|
||||
}
|
||||
// 帐变记录
|
||||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
|
@ -183,7 +183,7 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
|
|||
// 钻石
|
||||
if diamond > 0 {
|
||||
if !playerData.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Diamond, diamond))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, playerData.Channel, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Diamond, diamond))
|
||||
}
|
||||
// 帐变记录
|
||||
log := model.NewCoinLogEx(&model.CoinLogParam{
|
||||
|
|
|
@ -534,7 +534,7 @@ func DrawWelfareDate(dates []*webapi_proto.WelfareDate, p *Player, gainWay int32
|
|||
}
|
||||
if giveType != -1 {
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, giveType, model.SystemFreeGive_CoinType_Coin, int64(coin)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, giveType, model.SystemFreeGive_CoinType_Coin, int64(coin)))
|
||||
}
|
||||
}
|
||||
case 2: //钻石
|
||||
|
@ -554,7 +554,7 @@ func DrawWelfareDate(dates []*webapi_proto.WelfareDate, p *Player, gainWay int32
|
|||
}
|
||||
if giveType != -1 {
|
||||
if !p.IsRob {
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, giveType, model.SystemFreeGive_CoinType_Diamond, int64(v.Grade)))
|
||||
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, giveType, model.SystemFreeGive_CoinType_Diamond, int64(v.Grade)))
|
||||
}
|
||||
}
|
||||
case 3: //道具
|
||||
|
|
Loading…
Reference in New Issue