过滤rabbitmq机器人消息

This commit is contained in:
sk 2024-04-17 09:15:07 +08:00
parent 3cb5aeac44
commit 4702c2d8bb
9 changed files with 74 additions and 28 deletions

View File

@ -1308,6 +1308,8 @@ func (this *StateBilled) OnLeave(s *base.Scene) {
}
}
sceneEx.PlayerBackup = make(map[int32]*PlayerData)
if s.CheckNeedDestroy() {
sceneEx.SceneDestroy(true)
}

View File

@ -1407,7 +1407,9 @@ 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 {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(pi.SnId, pi.Name, pi.Platform, model.SystemFreeGive_GiveType_NewPlayer, model.SystemFreeGive_CoinType_Coin, int64(model.GameParamData.NewPlayerCoin)))
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)))
}
log := model.NewCoinLogEx(&model.CoinLogParam{
Platform: pi.Platform,
SnID: pi.SnId,

View File

@ -238,12 +238,16 @@ func CSRMAward(s *netlib.Session, packetId int, data interface{}, sid int64) err
case v.Id <= 0:
case v.Id == 1: //金币
p.AddCoin(int64(v.Num), 0, common.GainWay_RankMatch, "system", "段位奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform,
model.SystemFreeGive_GiveType_RankMatch, model.SystemFreeGive_CoinType_Coin, int64(v.Num)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform,
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", "段位奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform,
model.SystemFreeGive_GiveType_RankMatch, model.SystemFreeGive_CoinType_Diamond, int64(v.Num)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform,
model.SystemFreeGive_GiveType_RankMatch, model.SystemFreeGive_CoinType_Diamond, int64(v.Num)))
}
default:
//道具
item := &Item{

View File

@ -370,10 +370,14 @@ func (this *CSTMSeasonAwardHandler) Process(s *netlib.Session, packetid int, dat
switch v.AwardType1 {
case 1: //金币
p.AddCoin(int64(v.Number1), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number1)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number1)))
}
case 2: //钻石
p.AddDiamond(int64(v.Number1), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number1)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number1)))
}
case 3: //道具
item := &Item{
ItemId: v.AwardId1,
@ -390,10 +394,14 @@ func (this *CSTMSeasonAwardHandler) Process(s *netlib.Session, packetid int, dat
switch v.AwardType2 {
case 1: //金币
p.AddCoin(int64(v.Number2), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number2)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number2)))
}
case 2: //钻石
p.AddDiamond(int64(v.Number2), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number2)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number2)))
}
case 3: //道具
item := &Item{
ItemId: v.AwardId2,
@ -410,10 +418,14 @@ func (this *CSTMSeasonAwardHandler) Process(s *netlib.Session, packetid int, dat
switch v.AwardType3 {
case 1: //金币
p.AddCoin(int64(v.Number3), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number3)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Coin, int64(v.Number3)))
}
case 2: //钻石
p.AddDiamond(int64(v.Number3), 0, common.GainWay_MatchSeason, "system", "赛季奖励")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number3)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_MatchSeason, model.SystemFreeGive_CoinType_Diamond, int64(v.Number3)))
}
case 3: //道具
item := &Item{
ItemId: v.AwardId3,

View File

@ -363,11 +363,15 @@ func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs)
}
if jyb.Award.Coin > 0 {
p.AddCoin(jyb.Award.Coin, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Coin, int64(jyb.Award.Coin)))
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)))
}
}
if jyb.Award.Diamond > 0 {
p.AddDiamond(jyb.Award.Diamond, 0, common.GainWay_ActJybAward, "system", "礼包码兑换")
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ActJybAward, model.SystemFreeGive_CoinType_Diamond, int64(jyb.Award.Diamond)))
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)))
}
}
p.dirty = true
pack.GainItem.Coin = jyb.Award.Coin

View File

@ -1237,8 +1237,10 @@ func (this *Player) GetMessageAttach(id string) {
}
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
if msg.Oper == 0 { //系统赠送
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
if !this.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
}
}
}
if msg.Ticket > 0 {
@ -1252,8 +1254,10 @@ func (this *Player) GetMessageAttach(id string) {
if msg.Diamond > 0 {
this.AddDiamond(msg.Diamond, 0, gainWay, msg.Id.Hex(), remark)
if msg.Oper == 0 { //系统赠送
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
if !this.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
}
}
}
pack := &msg_proto.SCGetMessageAttach{
@ -1420,8 +1424,10 @@ func (this *Player) GetMessageAttachs(ids []string) {
}
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
if msg.Oper == 0 { //系统赠送
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
if !this.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Coin, int64(msg.Coin)))
}
}
}
if msg.Ticket > 0 {
@ -1435,8 +1441,10 @@ func (this *Player) GetMessageAttachs(ids []string) {
if msg.Diamond > 0 {
this.AddDiamond(msg.Diamond, 0, gainWay, msg.Id.Hex(), remark)
if msg.Oper == 0 { //系统赠送
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
if !this.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, model.SystemFreeGive_GiveType_MailSystemGive,
model.SystemFreeGive_CoinType_Diamond, int64(msg.Diamond)))
}
}
}

View File

@ -649,7 +649,9 @@ func (this *ShopMgr) PayAway(shopInfo *ShopInfo, p *Player, vipShopId, position
amount[shopInfo.Type-1] = int32(addTotal)
p.AddCoin(addTotal, 0, common.GainWay_Shop_Buy, "system", shopName)
if shopInfo.Ad > 0 { //观看广告
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Coin, addTotal))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Coin, addTotal))
}
}
// 记录钻石兑换金币的金币数量,个人水池调控使用
if shopInfo.ConstType == ShopConsumeDiamond && shopInfo.Ad <= 0 && costNum > 0 {
@ -664,7 +666,9 @@ func (this *ShopMgr) PayAway(shopInfo *ShopInfo, p *Player, vipShopId, position
amount[shopInfo.Type-1] = int32(addTotal)
p.AddDiamond(addTotal, 0, common.GainWay_Shop_Buy, "system", shopName)
if shopInfo.Ad > 0 { //观看广告
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Diamond, addTotal))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, model.SystemFreeGive_GiveType_ShopAd, model.SystemFreeGive_CoinType_Diamond, addTotal))
}
}
case ShopTypeItem:
//增加道具

View File

@ -128,7 +128,9 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
err := model.UpdatePlayerCoin(playerData.Platform, playerData.SnId, playerData.Coin+int64(model.GameParamData.NewPlayerCoin), 0, 0, time.Now().Unix(), time.Now().Unix(), 0, playerData.ShopID)
if err == nil {
// 新号赠送日志
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_NewPlayer, model.SystemFreeGive_CoinType_Coin, int64(model.GameParamData.NewPlayerCoin)))
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)))
}
// 帐变记录
log := model.NewCoinLogEx(&model.CoinLogParam{
Platform: playerData.Platform,
@ -156,7 +158,9 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
if err == nil {
// 金币
if coin > 0 {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Coin, coin))
if !playerData.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Coin, coin))
}
// 帐变记录
log := model.NewCoinLogEx(&model.CoinLogParam{
Platform: playerData.Platform,
@ -178,7 +182,9 @@ func (t *TaskLogin) Call(o *basic.Object) interface{} {
}
// 钻石
if diamond > 0 {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Diamond, diamond))
if !playerData.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(playerData.SnId, playerData.Name, playerData.Platform, model.SystemFreeGive_GiveType_BindTel, model.SystemFreeGive_CoinType_Diamond, diamond))
}
// 帐变记录
log := model.NewCoinLogEx(&model.CoinLogParam{
Platform: playerData.Platform,

View File

@ -570,7 +570,9 @@ func DrawWelfareDate(dates []*webapi_proto.WelfareDate, p *Player, gainWay int32
}
}
if giveType != -1 {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, giveType, model.SystemFreeGive_CoinType_Coin, int64(coin)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, giveType, model.SystemFreeGive_CoinType_Coin, int64(coin)))
}
}
case 2: //钻石
p.AddDiamond(int64(v.Grade), 0, gainWay, oper, remark)
@ -588,7 +590,9 @@ func DrawWelfareDate(dates []*webapi_proto.WelfareDate, p *Player, gainWay int32
}
}
if giveType != -1 {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, giveType, model.SystemFreeGive_CoinType_Diamond, int64(v.Grade)))
if !p.IsRob {
LogChannelSingleton.WriteMQData(model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, giveType, model.SystemFreeGive_CoinType_Diamond, int64(v.Grade)))
}
}
case 3: //道具
if v.Grade > 0 {