no message
This commit is contained in:
parent
6161d2da1c
commit
ecb9c17920
|
@ -22,6 +22,7 @@ const (
|
||||||
TransType_MatchSceneChange = 1013
|
TransType_MatchSceneChange = 1013
|
||||||
TransType_MiniGameAddCoin = 1014
|
TransType_MiniGameAddCoin = 1014
|
||||||
TransType_ServerCtrl = 1015
|
TransType_ServerCtrl = 1015
|
||||||
|
TranType_AddItem = 1016 // 道具修改
|
||||||
)
|
)
|
||||||
|
|
||||||
type M2GWebTrascate struct {
|
type M2GWebTrascate struct {
|
||||||
|
|
|
@ -1691,15 +1691,15 @@ func (this *CSPlayerVIPBuyPacketFactory) CreatePacket() interface{} {
|
||||||
|
|
||||||
func (this *CSPlayerVIPBuyHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
func (this *CSPlayerVIPBuyHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
logger.Logger.Trace("CSVIPBuy Process recv ", data)
|
logger.Logger.Trace("CSVIPBuy Process recv ", data)
|
||||||
if msg, ok := data.(*player_proto.CSVIPBuy); ok {
|
//if msg, ok := data.(*player_proto.CSVIPBuy); ok {
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
// p := PlayerMgrSington.GetPlayer(sid)
|
||||||
if p == nil {
|
// if p == nil {
|
||||||
logger.Logger.Warn("CSPlayerVIPBuyHandler p == nil")
|
// logger.Logger.Warn("CSPlayerVIPBuyHandler p == nil")
|
||||||
return nil
|
// return nil
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
p.SCVIPBuy(int64(msg.GetMoney()))
|
// p.SCVIPBuy(int64(msg.GetMoney()))
|
||||||
}
|
//}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1723,7 +1723,6 @@ func (this *CSPlayerVIPInfoHandler) Process(s *netlib.Session, packetid int, dat
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
p.GetVIPLevel()
|
p.GetVIPLevel()
|
||||||
p.SCVIPInfo()
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ import (
|
||||||
"mongo.games.com/game/protocol/rankmatch"
|
"mongo.games.com/game/protocol/rankmatch"
|
||||||
serverproto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
shopproto "mongo.games.com/game/protocol/shop"
|
shopproto "mongo.games.com/game/protocol/shop"
|
||||||
webapiproto "mongo.games.com/game/protocol/webapi"
|
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
"mongo.games.com/game/worldsrv/internal"
|
"mongo.games.com/game/worldsrv/internal"
|
||||||
)
|
)
|
||||||
|
@ -1110,9 +1109,8 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
}
|
}
|
||||||
return gift
|
return gift
|
||||||
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
|
}), task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
|
||||||
attach_msg, ok := data.(*model.Message)
|
attachMsg, ok := data.(*model.Message)
|
||||||
dirtyCoin := int64(0)
|
if ok && attachMsg != nil {
|
||||||
if ok && attach_msg != nil {
|
|
||||||
msg.AttachState = model.MSGATTACHSTATE_GOT
|
msg.AttachState = model.MSGATTACHSTATE_GOT
|
||||||
notifyClient := true
|
notifyClient := true
|
||||||
var remark string
|
var remark string
|
||||||
|
@ -1157,29 +1155,24 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
case model.MSGTYPE_ITEM:
|
case model.MSGTYPE_ITEM:
|
||||||
remark = "领取道具"
|
remark = "领取道具"
|
||||||
gainWay = common.GainWay_MAIL_MTEM
|
gainWay = common.GainWay_MAIL_MTEM
|
||||||
dirtyCoin = msg.Coin
|
|
||||||
addItem()
|
addItem()
|
||||||
case model.MSGTYPE_IOSINSTALLSTABLE:
|
case model.MSGTYPE_IOSINSTALLSTABLE:
|
||||||
remark = "IOS下载稳定版本"
|
remark = "IOS下载稳定版本"
|
||||||
gainWay = common.GainWay_IOSINSTALLSTABLE
|
gainWay = common.GainWay_IOSINSTALLSTABLE
|
||||||
dirtyCoin = msg.Coin
|
|
||||||
case model.MSGTYPE_GIFT:
|
case model.MSGTYPE_GIFT:
|
||||||
remark = "礼物"
|
remark = "礼物"
|
||||||
case model.MSGTYPE_GOLDCOMERANK:
|
case model.MSGTYPE_GOLDCOMERANK:
|
||||||
remark = "财神降临奖励"
|
remark = "财神降临奖励"
|
||||||
gainWay = common.GainWay_GoldCome
|
gainWay = common.GainWay_GoldCome
|
||||||
notifyClient = false
|
notifyClient = false
|
||||||
dirtyCoin = msg.Coin
|
|
||||||
case model.MSGTYPE_RANDCOIN:
|
case model.MSGTYPE_RANDCOIN:
|
||||||
remark = "红包雨"
|
remark = "红包雨"
|
||||||
gainWay = common.GainWay_OnlineRandCoin
|
gainWay = common.GainWay_OnlineRandCoin
|
||||||
notifyClient = false
|
notifyClient = false
|
||||||
dirtyCoin = msg.Coin
|
|
||||||
case model.MSGTYPE_REBATE:
|
case model.MSGTYPE_REBATE:
|
||||||
remark = "流水返利"
|
remark = "流水返利"
|
||||||
gainWay = common.GainWay_RebateTask
|
gainWay = common.GainWay_RebateTask
|
||||||
notifyClient = false
|
notifyClient = false
|
||||||
dirtyCoin = msg.Coin
|
|
||||||
//邮件领取 添加日志
|
//邮件领取 添加日志
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
return model.InsertRebateLog(this.Platform, &model.Rebate{
|
return model.InsertRebateLog(this.Platform, &model.Rebate{
|
||||||
|
@ -1227,8 +1220,6 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
}
|
}
|
||||||
if msg.Coin > 0 {
|
if msg.Coin > 0 {
|
||||||
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
|
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
|
||||||
//增加泥码
|
|
||||||
this.AddDirtyCoin(0, dirtyCoin)
|
|
||||||
//俱乐部获取不算系统赠送
|
//俱乐部获取不算系统赠送
|
||||||
if msg.MType != model.MSGTYPE_ClubGet {
|
if msg.MType != model.MSGTYPE_ClubGet {
|
||||||
this.ReportSystemGiveEvent(int32(msg.Coin), gainWay, notifyClient) //邮件附件算是系统赠送
|
this.ReportSystemGiveEvent(int32(msg.Coin), gainWay, notifyClient) //邮件附件算是系统赠送
|
||||||
|
@ -1891,45 +1882,6 @@ func (this *Player) AddCoinAsync(num, add int64, gainWay int32, oper, remark str
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// 增加泥码
|
|
||||||
func (this *Player) AddDirtyCoin(paycoin, givecoin int64) {
|
|
||||||
if this.IsRob {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//if cfg, ok := ProfitControlMgrSington.GetCfg(this.Platform); ok && cfg != nil && paycoin >= 0 {
|
|
||||||
// //洗码折算率=(玩家剩余泥码*洗码折算率+期望营收)/(充值额+赠送额+泥码余额)
|
|
||||||
// this.RecalcuWashingCoinConvRate(cfg.Rate, paycoin, givecoin)
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//this.DirtyCoin += paycoin + givecoin
|
|
||||||
//if this.DirtyCoin < 0 {
|
|
||||||
// this.DirtyCoin = 0
|
|
||||||
//}
|
|
||||||
this.dirty = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 洗码
|
|
||||||
func (this *Player) WashingCoin(coin int64) int64 {
|
|
||||||
if this.IsRob {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
if coin <= 0 {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
//if this.DirtyCoin > coin {
|
|
||||||
// this.DirtyCoin -= coin
|
|
||||||
// this.dirty = true
|
|
||||||
// return coin
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
////剩余多少泥码,清洗多少
|
|
||||||
//coin = this.DirtyCoin
|
|
||||||
//this.DirtyCoin = 0
|
|
||||||
return coin
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *Player) AddTicket(num int64, gainWay int32, oper, remark string) {
|
func (this *Player) AddTicket(num int64, gainWay int32, oper, remark string) {
|
||||||
if num == 0 {
|
if num == 0 {
|
||||||
return
|
return
|
||||||
|
@ -3497,17 +3449,17 @@ func (this *Player) SendShowRed(showType hallproto.ShowRedCode, showChild, isSho
|
||||||
this.SendToClient(int(hallproto.HallPacketID_PACKET_SC_SHOWRED), pack)
|
this.SendToClient(int(hallproto.HallPacketID_PACKET_SC_SHOWRED), pack)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) SCVIPBuy(buy int64) {
|
//func (this *Player) SCVIPBuy(buy int64) {
|
||||||
//buy *= 10000
|
// //buy *= 10000
|
||||||
//this.AddMoneyPayTotal(buy)
|
// //this.AddMoneyPayTotal(buy)
|
||||||
//this.GetVIPLevel(0) // 更新下vip等级
|
// //this.GetVIPLevel(0) // 更新下vip等级
|
||||||
pack := &playerproto.SCVIPBuy{
|
// pack := &playerproto.SCVIPBuy{
|
||||||
OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
|
// OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
|
||||||
}
|
// }
|
||||||
pack.TolVipExp, pack.Money = this.GetCurrentVIPExp() // 获取经验会更新vip等级
|
// pack.TolVipExp, pack.Money = this.GetCurrentVIPExp() // 获取经验会更新vip等级
|
||||||
pack.Vip = this.VIP
|
// pack.Vip = this.VIP
|
||||||
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPBUY), pack)
|
// this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPBUY), pack)
|
||||||
}
|
//}
|
||||||
|
|
||||||
func (this *Player) SCVIPInfo() {
|
func (this *Player) SCVIPInfo() {
|
||||||
if this.IsRob {
|
if this.IsRob {
|
||||||
|
@ -3581,7 +3533,7 @@ func (this *Player) SCVIPInfo() {
|
||||||
pack.List = append(pack.List, data)
|
pack.List = append(pack.List, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
pack.TolVipExp, pack.Money = this.GetCurrentVIPExp(vips)
|
pack.TolVipExp, pack.Money = this.GetCurrentVIPExp()
|
||||||
pack.Vip = this.VIP
|
pack.Vip = this.VIP
|
||||||
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
|
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
|
||||||
}
|
}
|
||||||
|
@ -3710,17 +3662,12 @@ func (this *Player) VIPDraw(id, vip int32) {
|
||||||
|
|
||||||
// GetCurrentVIPExp 更新vip等级
|
// GetCurrentVIPExp 更新vip等级
|
||||||
// 返回当前经验和升级需要经验
|
// 返回当前经验和升级需要经验
|
||||||
func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp int64, money int64) {
|
func (this *Player) GetCurrentVIPExp() (exp int64, money int64) {
|
||||||
var vips *webapiproto.VIPcfgDataList
|
vips := VipMgrSington.GetVIPcfg(this.Platform)
|
||||||
if len(vipcfg) == 0 {
|
|
||||||
vips = VipMgrSington.GetVIPcfg(this.Platform)
|
|
||||||
} else {
|
|
||||||
vips = vipcfg[0]
|
|
||||||
}
|
|
||||||
exp = int64(float64(this.MoneyPayTotal) * vips.MoneyRatio)
|
exp = int64(float64(this.MoneyPayTotal) * vips.MoneyRatio)
|
||||||
tolexp := int32(0)
|
tolexp := int32(0)
|
||||||
oldVipLevel := this.VIP
|
oldVipLevel := this.VIP
|
||||||
if vips != nil && this.MoneyPayTotal != 0 {
|
if this.MoneyPayTotal != 0 {
|
||||||
allExp := int64(float64(this.MoneyPayTotal) * vips.MoneyRatio)
|
allExp := int64(float64(this.MoneyPayTotal) * vips.MoneyRatio)
|
||||||
for _, v := range vips.List {
|
for _, v := range vips.List {
|
||||||
tolexp = v.VipEx
|
tolexp = v.VipEx
|
||||||
|
@ -3737,10 +3684,7 @@ func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp
|
||||||
money = 0
|
money = 0
|
||||||
}
|
}
|
||||||
if oldVipLevel != this.VIP {
|
if oldVipLevel != this.VIP {
|
||||||
//玩家VIP升级
|
this.GetVIPLevel()
|
||||||
this.SCVIPInfo()
|
|
||||||
PetMgrSington.CheckSkinRed(this)
|
|
||||||
logger.Logger.Trace("VIP升级!")
|
|
||||||
}
|
}
|
||||||
return // 默认
|
return // 默认
|
||||||
}
|
}
|
||||||
|
@ -3763,15 +3707,16 @@ func (this *Player) GetVIPLevel() int32 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var b bool
|
var b bool
|
||||||
if vip != this.VIP {
|
if vip != this.VIP {
|
||||||
this.dirty = true
|
this.dirty = true
|
||||||
b = true
|
b = true
|
||||||
//玩家VIP升级
|
|
||||||
this.SCVIPInfo()
|
|
||||||
logger.Logger.Trace("VIP升级!")
|
logger.Logger.Trace("VIP升级!")
|
||||||
}
|
}
|
||||||
this.VIP = vip
|
this.VIP = vip
|
||||||
|
//玩家VIP升级
|
||||||
|
this.SCVIPInfo()
|
||||||
if b {
|
if b {
|
||||||
PetMgrSington.CheckSkinRed(this)
|
PetMgrSington.CheckSkinRed(this)
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue