Compare commits
2 Commits
4d9fee9b11
...
cc4125fee5
Author | SHA1 | Date |
---|---|---|
|
cc4125fee5 | |
|
2e6928f317 |
|
@ -3,11 +3,6 @@ package model
|
|||
import "time"
|
||||
import "github.com/globalsign/mgo/bson"
|
||||
|
||||
// 破产次数统计
|
||||
var (
|
||||
BankruptLogCollName = "log_bankrupt"
|
||||
)
|
||||
|
||||
// 破产次数统计
|
||||
type BankruptLog struct {
|
||||
LogId bson.ObjectId `bson:"_id"`
|
||||
|
|
|
@ -3,16 +3,12 @@ package model
|
|||
import "time"
|
||||
import "github.com/globalsign/mgo/bson"
|
||||
|
||||
// 破产金领取详情
|
||||
var (
|
||||
ReliefFundLogCollName = "log_relieffund"
|
||||
)
|
||||
|
||||
// 破产金领取详情
|
||||
type ReliefFundLog struct {
|
||||
LogId bson.ObjectId `bson:"_id"`
|
||||
SnId int32 //玩家id
|
||||
Platform string //平台名称
|
||||
Channel string // 渠道
|
||||
|
||||
CreateTime int64 // 注册时间
|
||||
Ts int64 // 领取时间
|
||||
|
@ -26,10 +22,11 @@ func NewReliefFundLog() *ReliefFundLog {
|
|||
return log
|
||||
}
|
||||
|
||||
func NewReliefFundLogEx(snid int32, gettype, cointype int32, getamount, createtime int64, platform string) *ReliefFundLog {
|
||||
func NewReliefFundLogEx(snid int32, gettype, cointype int32, getamount, createtime int64, platform, channel string) *ReliefFundLog {
|
||||
cl := NewReliefFundLog()
|
||||
cl.SnId = snid
|
||||
cl.Platform = platform
|
||||
cl.Channel = channel
|
||||
|
||||
now := time.Now()
|
||||
cl.Ts = now.Unix()
|
||||
|
|
|
@ -54,5 +54,5 @@ func SendEmote(s *netlib.Session, p IPlayer, arr []int) {
|
|||
Param: []int32{int32(e)},
|
||||
}
|
||||
|
||||
DelaySendSecond(s, int(gamehall.GameHallPacketID_PACKET_CSRoomEvent), pack, 2, 3)
|
||||
DelaySendSecond(s, int(gamehall.GameHallPacketID_PACKET_CSRoomEvent), pack, 3, 5)
|
||||
}
|
||||
|
|
|
@ -47,6 +47,13 @@ func (sm *SceneMgr) GetSceneDBGameFree(sceneId, gamefreeId int32) *server_proto.
|
|||
return srvdata.PBDB_GameFreeMgr.GetData(gamefreeId)
|
||||
}
|
||||
|
||||
func (sm *SceneMgr) IsFreeMode(sceneId int32) bool {
|
||||
if data, exist := sm.sceneDBGameFree[sceneId]; exist {
|
||||
return data.GetFreeMode() == 1
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
// / Module Implement [beg]
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -20,6 +20,15 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func SendEmote(s *netlib.Session, scene *TienLenScene, p *TienLenPlayer, arr []int, tp int) {
|
||||
if !base.SceneMgrSingleton.IsFreeMode(scene.GetRoomId()) && !scene.IsMatchScene() {
|
||||
if p.EmoteTimes[tp] == 0 {
|
||||
base.SendEmote(s, p, arr)
|
||||
}
|
||||
p.EmoteTimes[tp]++
|
||||
}
|
||||
}
|
||||
|
||||
type SCTienLenRoomInfoPacketFactory struct {
|
||||
}
|
||||
|
||||
|
@ -95,7 +104,7 @@ func (this *SCTienLenPlayerOpHandler) Process(s *netlib.Session, packid int, pac
|
|||
if lastPlayer != nil && lastPlayer.IsRobot() && me.SnId != lastPlayer.GetSnId() &&
|
||||
(tienlen.IsTwo(scene.LastCards) || tienlen.IsBomb(scene.LastCards, !common.IsTienLenYuLe(int(scene.GetGameId())))) {
|
||||
// 机器人出2/炸弹被压制
|
||||
base.SendEmote(base.PlayerMgrSingleton.GetPlayerSession(scene.LastOpSnid), lastPlayer, base.Emote1)
|
||||
SendEmote(base.PlayerMgrSingleton.GetPlayerSession(scene.LastOpSnid), scene, lastPlayer.(*TienLenPlayer), base.Emote1, 1)
|
||||
}
|
||||
scene.LastCards = delC
|
||||
scene.LastOpSnid = me.SnId
|
||||
|
@ -105,7 +114,7 @@ func (this *SCTienLenPlayerOpHandler) Process(s *netlib.Session, packid int, pac
|
|||
if me.PassTimes >= 2 {
|
||||
me.PassTimes = 0
|
||||
// 机器人过牌两次
|
||||
base.SendEmote(s, me, base.Emote2)
|
||||
SendEmote(s, scene, me, base.Emote2, 2)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -461,7 +470,7 @@ func (this *SCTienLenCurOpPosHandler) Process(s *netlib.Session, packid int, pac
|
|||
minS = notExDelayminS
|
||||
maxS = notExDelaymaxS
|
||||
if scene.FirstWinSnid == 0 {
|
||||
base.SendEmote(s, p, base.Emote5)
|
||||
SendEmote(s, scene, me, base.Emote5, 5)
|
||||
scene.FirstWinSnid = me.SnId
|
||||
}
|
||||
}
|
||||
|
@ -628,9 +637,9 @@ func SCRoomEvent(s *netlib.Session, packid int, pack interface{}) error {
|
|||
|
||||
switch msg.Param[0] {
|
||||
case common.ItemIDBucket, common.ItemIDSlippers:
|
||||
base.SendEmote(s, p, base.Emote3)
|
||||
SendEmote(s, scene, p.(*TienLenPlayer), base.Emote3, 3)
|
||||
case common.ItemIDLike, common.ItemIDCoffee:
|
||||
base.SendEmote(s, p, base.Emote4)
|
||||
SendEmote(s, scene, p.(*TienLenPlayer), base.Emote4, 3)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -14,10 +14,14 @@ type TienLenPlayer struct {
|
|||
*proto_tienlen.TienLenPlayerData
|
||||
data *tienlenApi.PredictRequest
|
||||
PassTimes int
|
||||
EmoteTimes map[int]int // 事件触发次数
|
||||
}
|
||||
|
||||
func NewTienLenPlayer(data *proto_tienlen.TienLenPlayerData) *TienLenPlayer {
|
||||
p := &TienLenPlayer{TienLenPlayerData: data}
|
||||
p := &TienLenPlayer{
|
||||
TienLenPlayerData: data,
|
||||
EmoteTimes: make(map[int]int),
|
||||
}
|
||||
p.Init()
|
||||
return p
|
||||
}
|
||||
|
@ -28,6 +32,7 @@ func (p *TienLenPlayer) Init() {
|
|||
|
||||
func (p *TienLenPlayer) Clear() {
|
||||
p.PassTimes = 0
|
||||
p.EmoteTimes = make(map[int]int)
|
||||
}
|
||||
|
||||
func (p *TienLenPlayer) MarkFlag(flag int32) {
|
||||
|
|
|
@ -111,7 +111,7 @@ func (this *WelfareMgr) GetReliefFund(p *Player, isVideo bool) {
|
|||
getType = model.SystemFreeGive_GiveType_ShopAd
|
||||
}
|
||||
|
||||
log := model.NewReliefFundLogEx(p.SnId, getType, model.SystemFreeGive_CoinType_Coin, coin, p.CreateTime.Unix(), p.Platform)
|
||||
log := model.NewReliefFundLogEx(p.SnId, getType, model.SystemFreeGive_CoinType_Coin, coin, p.CreateTime.Unix(), p.Platform, p.Channel)
|
||||
if log != nil {
|
||||
LogChannelSingleton.WriteLog(log)
|
||||
logger.Logger.Tracef("NewReliefFundLogEx WriteLog snid: %v Coin:%v", p.SnId, pack.Coin)
|
||||
|
|
Loading…
Reference in New Issue