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