Compare commits
2 Commits
78d6a109fe
...
83cfbe6381
Author | SHA1 | Date |
---|---|---|
|
83cfbe6381 | |
|
aaf15d2b3d |
Binary file not shown.
|
@ -801,7 +801,7 @@
|
|||
1,
|
||||
0
|
||||
],
|
||||
"Type": 13,
|
||||
"Type": 19,
|
||||
"Effect0": [
|
||||
0,
|
||||
0,
|
||||
|
|
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -75,6 +75,7 @@ type PlayerDiffData struct {
|
|||
RankScore map[int32]int64 // 排位积分
|
||||
PhoneScore int64 //手机积分
|
||||
InviteScore int64 // 邀请积分
|
||||
Long int64 // 龙币
|
||||
}
|
||||
|
||||
type PlayerBaseData struct {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -318,6 +318,7 @@ message PlayerData {
|
|||
int32 Age = 47; // 年龄
|
||||
repeated WeekInfo WeekCard = 48;//周卡
|
||||
repeated int32 RequestAddFriend = 49;//请求添加好友信息
|
||||
int64 Long = 50; // 龙币
|
||||
}
|
||||
|
||||
//周卡数据
|
||||
|
@ -360,6 +361,7 @@ message SCPlayerDataUpdate {
|
|||
map<int32,int64> RankScore = 12; // 排位积分
|
||||
int64 PhoneScore = 13; //手机积分
|
||||
int64 InviteScore = 14; // 邀请积分
|
||||
int64 Long = 15; // 龙币
|
||||
}
|
||||
|
||||
//获取第三方玩家信息
|
||||
|
|
2
public
2
public
|
@ -1 +1 @@
|
|||
Subproject commit 8c59aeb37871428f135c6423cde777c09ad0e3f0
|
||||
Subproject commit 63eadb869736b9d3e16c993cd99675c0e0de638c
|
|
@ -595,7 +595,7 @@ func CSPermitInfo(s *netlib.Session, packetid int, data interface{}, sid int64)
|
|||
pack := &welfare.SCPermitInfo{
|
||||
Exp: exp,
|
||||
Level: level,
|
||||
Timestamp: []int64{startTs, endTs},
|
||||
Timestamp: []int64{startTs, endTs - 1},
|
||||
IsPermit: p.GetIsPermit(),
|
||||
RefreshTs: common.GetDayNextStartTs(time.Now().Unix()),
|
||||
}
|
||||
|
@ -698,13 +698,12 @@ func CSPermitAward(s *netlib.Session, packetid int, data interface{}, sid int64)
|
|||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
now := time.Now()
|
||||
if startTs == 0 || endTs == 0 || now.Unix() < startTs || now.Unix() >= endTs {
|
||||
logger.Logger.Errorf("CSPermitAward not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
pack := &welfare.SCPermitAward{
|
||||
OpRetCode: welfare.OpResultCode_OPRC_Sucess,
|
||||
Tp: msg.GetTp(),
|
||||
|
@ -777,8 +776,8 @@ func CSPermitAward(s *netlib.Session, packetid int, data interface{}, sid int64)
|
|||
p.WelfData.PermitAward[v.GetRank()*1000] = now.Unix()
|
||||
}
|
||||
} else {
|
||||
if v.GetRank() == msg.GetId() {
|
||||
if IsPermitCanReward(p, v.GetRank()*1000) {
|
||||
if v.GetRank()*1000 == msg.GetId() {
|
||||
if IsPermitCanReward(p, msg.GetId()) {
|
||||
for _, vv := range v.GetAward2() {
|
||||
pack.Award2 = append(pack.Award2, &welfare.PropInfo{
|
||||
ItemId: vv.GetItemId(),
|
||||
|
@ -978,13 +977,12 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
|
|||
}
|
||||
startTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitStartTs
|
||||
endTs := PlatformMgrSingleton.GetConfig(p.Platform).PermitEndTs
|
||||
if startTs == 0 || endTs == 0 {
|
||||
now := time.Now()
|
||||
if startTs == 0 || endTs == 0 || now.Unix() < startTs || now.Unix() >= endTs {
|
||||
logger.Logger.Errorf("CSPermitExchange not startTs %v", p.SnId)
|
||||
return nil
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
isExchange, code := GetPermitCanExchange(p, msg.GetId())
|
||||
pack := &welfare.SCPermitExchange{
|
||||
OpRetCode: welfare.OpResultCode_OPRC_Sucess,
|
||||
|
@ -1020,26 +1018,26 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
|
|||
// 检查背包是否足够
|
||||
var items []*Item
|
||||
var costItems []*Item
|
||||
for k, v := range exchangeConfig.GetCost() {
|
||||
item := BagMgrSingleton.GetItem(p.SnId, int32(k))
|
||||
for _, v := range exchangeConfig.GetCost() {
|
||||
item := BagMgrSingleton.GetItem(p.SnId, v.GetItemId())
|
||||
if item == nil || item.ItemNum < v.GetItemNum() {
|
||||
send(welfare.OpResultCode_OPRC_ErrCost)
|
||||
return nil
|
||||
}
|
||||
info := srvdata.PBDB_GameItemMgr.GetData(int32(k))
|
||||
info := srvdata.PBDB_GameItemMgr.GetData(v.GetItemId())
|
||||
if info != nil {
|
||||
costItems = append(costItems, &Item{
|
||||
ItemId: int32(k),
|
||||
ItemId: v.GetItemId(),
|
||||
ItemNum: v.GetItemNum(),
|
||||
Name: info.Name,
|
||||
})
|
||||
}
|
||||
}
|
||||
for k, v := range exchangeConfig.GetGain() {
|
||||
info := srvdata.PBDB_GameItemMgr.GetData(int32(k))
|
||||
for _, v := range exchangeConfig.GetGain() {
|
||||
info := srvdata.PBDB_GameItemMgr.GetData(v.GetItemId())
|
||||
if info != nil {
|
||||
items = append(items, &Item{
|
||||
ItemId: int32(k),
|
||||
ItemId: v.GetItemId(),
|
||||
ItemNum: v.GetItemNum(),
|
||||
Name: info.Name,
|
||||
})
|
||||
|
@ -1055,11 +1053,7 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
|
|||
}
|
||||
}
|
||||
|
||||
if !isExchange {
|
||||
pack.OpRetCode = welfare.OpResultCode_OPRC_Error
|
||||
}
|
||||
p.SendToClient(int(welfare.SPacketID_PACKET_SCPermitExchange), pack)
|
||||
logger.Logger.Tracef("SCPermitExchange: %v", pack)
|
||||
send(welfare.OpResultCode_OPRC_Sucess)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -314,6 +314,9 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
|
|||
})
|
||||
}
|
||||
}
|
||||
if v == common.ItemIDLong {
|
||||
p.SendDiffData()
|
||||
}
|
||||
}
|
||||
|
||||
if code != bag.OpResultCode_OPRC_Sucess {
|
||||
|
|
211
worldsrv/etcd.go
211
worldsrv/etcd.go
|
@ -207,6 +207,112 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
|||
case *webapi.ActInviteConfig:
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).ActInviteConfig = config
|
||||
case *webapi.ActPermitConfig:
|
||||
// test
|
||||
actConfig := &webapi.ActPermitConfig{
|
||||
Platform: "1",
|
||||
StartTs: 1719646575,
|
||||
Days: 7,
|
||||
}
|
||||
channelConfig := webapi.PermitChannelConfig{
|
||||
Channel: "Official",
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
channelConfig.LevelConfig = append(channelConfig.LevelConfig, &webapi.PermitLevelConfig{
|
||||
Rank: int32(i + 1),
|
||||
Score: int64((i + 1) * 100),
|
||||
Award1: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
},
|
||||
Award2: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDLong,
|
||||
ItemNum: 100,
|
||||
},
|
||||
{
|
||||
ItemId: common.ItemIDDiamond,
|
||||
ItemNum: 100,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
itemId := []int32{100001, 100002, 10001, 20001, 20002, 20003}
|
||||
for i := 0; i < 10; i++ {
|
||||
level := 0
|
||||
if common.RandInt(0, 3) == 0 {
|
||||
level = common.RandInt(1, 101)
|
||||
}
|
||||
channelConfig.ExchangeConfig = append(channelConfig.ExchangeConfig, &webapi.PermitExchangeConfig{
|
||||
Id: int32(i + 1),
|
||||
SortId: int32(100 - i),
|
||||
Gain: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: itemId[common.RandInt(len(itemId))],
|
||||
ItemNum: 1,
|
||||
},
|
||||
},
|
||||
Cost: []*webapi.ItemInfo{{
|
||||
ItemId: common.ItemIDLong,
|
||||
ItemNum: int64(common.RandInt(50, 101)),
|
||||
}},
|
||||
IsPermit: common.RandInt(0, 3) == 0,
|
||||
Level: int64(level),
|
||||
Times: int64(common.RandInt(0, 5)),
|
||||
IsShow: common.RandInt(0, 4) != 0,
|
||||
})
|
||||
}
|
||||
rankN := 1
|
||||
for i := 0; i < 3; i++ {
|
||||
sub := common.RandInt(0, 3)
|
||||
items := []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
}
|
||||
if common.RandInt(2) == 0 {
|
||||
items = append(items, &webapi.ItemInfo{
|
||||
ItemId: common.ItemIDDiamond,
|
||||
ItemNum: 100,
|
||||
})
|
||||
}
|
||||
channelConfig.RankConfig = append(channelConfig.RankConfig, &webapi.PermitRankConfig{
|
||||
Start: int32(rankN),
|
||||
End: int32(rankN + sub),
|
||||
ItemId: items,
|
||||
})
|
||||
rankN = rankN + sub + 1
|
||||
}
|
||||
|
||||
actConfig.Configs = append(actConfig.Configs, &channelConfig)
|
||||
webConfig := channelConfig
|
||||
webConfig.Channel = "Web"
|
||||
actConfig.Configs = append(actConfig.Configs, &webConfig)
|
||||
googleConfig := channelConfig
|
||||
googleConfig.Channel = "GooglePlay"
|
||||
actConfig.Configs = append(actConfig.Configs, &googleConfig)
|
||||
PlatformMgrSingleton.GetConfig("1").ActPermitConfig = actConfig
|
||||
PlatformMgrSingleton.GetConfig("1").PermitStartTs = common.GetDayStartTs(1719646575)
|
||||
PlatformMgrSingleton.GetConfig("1").PermitEndTs = common.GetDayStartTs(1719646575) + int64(actConfig.GetDays()*24*3600)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
b, err := json.Marshal(&model.PermitStartTs{
|
||||
StartTs: common.GetDayStartTs(1719646575),
|
||||
EndTs: common.GetDayStartTs(1719646575) + int64(actConfig.GetDays()*24*3600),
|
||||
})
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("permit startts save error: %v", err)
|
||||
} else {
|
||||
err := model.UptStrKVGameData(common.PermitStartTsKey+"1", string(b))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("permit startts update error:%v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}), nil).StartByExecutor("permit_start_ts")
|
||||
logger.Logger.Tracef("==> PermitConfig: %v ", actConfig)
|
||||
// test
|
||||
break
|
||||
PlatformMgrSingleton.GetConfig(config.Platform).ActPermitConfig = config
|
||||
st := new(model.PermitStartTs)
|
||||
|
@ -251,112 +357,7 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
|
|||
default:
|
||||
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
|
||||
}
|
||||
// test
|
||||
actConfig := &webapi.ActPermitConfig{
|
||||
Platform: "1",
|
||||
StartTs: 1719646575,
|
||||
Days: 7,
|
||||
}
|
||||
channelConfig := webapi.PermitChannelConfig{
|
||||
Channel: "Official",
|
||||
}
|
||||
for i := 0; i < 100; i++ {
|
||||
channelConfig.LevelConfig = append(channelConfig.LevelConfig, &webapi.PermitLevelConfig{
|
||||
Rank: int32(i + 1),
|
||||
Score: int64((i + 1) * 100),
|
||||
Award1: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
},
|
||||
Award2: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDLong,
|
||||
ItemNum: 100,
|
||||
},
|
||||
{
|
||||
ItemId: common.ItemIDDiamond,
|
||||
ItemNum: 100,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
itemId := []int32{100001, 100002, 10001, 20001, 20002, 20003}
|
||||
for i := 0; i < 10; i++ {
|
||||
level := 0
|
||||
if common.RandInt(0, 3) == 0 {
|
||||
level = common.RandInt(1, 101)
|
||||
}
|
||||
channelConfig.ExchangeConfig = append(channelConfig.ExchangeConfig, &webapi.PermitExchangeConfig{
|
||||
Id: int32(i + 1),
|
||||
SortId: int32(100 - i),
|
||||
Gain: []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: itemId[common.RandInt(len(itemId))],
|
||||
ItemNum: 1,
|
||||
},
|
||||
},
|
||||
Cost: []*webapi.ItemInfo{{
|
||||
ItemId: common.ItemIDLong,
|
||||
ItemNum: int64(common.RandInt(50, 101)),
|
||||
}},
|
||||
IsPermit: common.RandInt(0, 3) == 0,
|
||||
Level: int64(level),
|
||||
Times: int64(common.RandInt(0, 5)),
|
||||
IsShow: common.RandInt(0, 4) != 0,
|
||||
})
|
||||
}
|
||||
rankN := 1
|
||||
for i := 0; i < 3; i++ {
|
||||
sub := common.RandInt(0, 3)
|
||||
items := []*webapi.ItemInfo{
|
||||
{
|
||||
ItemId: common.ItemIDCoin,
|
||||
ItemNum: 100,
|
||||
},
|
||||
}
|
||||
if common.RandInt(2) == 0 {
|
||||
items = append(items, &webapi.ItemInfo{
|
||||
ItemId: common.ItemIDDiamond,
|
||||
ItemNum: 100,
|
||||
})
|
||||
}
|
||||
channelConfig.RankConfig = append(channelConfig.RankConfig, &webapi.PermitRankConfig{
|
||||
Start: int32(rankN),
|
||||
End: int32(rankN + sub),
|
||||
ItemId: items,
|
||||
})
|
||||
rankN = rankN + sub + 1
|
||||
}
|
||||
|
||||
actConfig.Configs = append(actConfig.Configs, &channelConfig)
|
||||
webConfig := channelConfig
|
||||
webConfig.Channel = "Web"
|
||||
actConfig.Configs = append(actConfig.Configs, &webConfig)
|
||||
googleConfig := channelConfig
|
||||
googleConfig.Channel = "GooglePlay"
|
||||
actConfig.Configs = append(actConfig.Configs, &googleConfig)
|
||||
PlatformMgrSingleton.GetConfig("1").ActPermitConfig = actConfig
|
||||
PlatformMgrSingleton.GetConfig("1").PermitStartTs = common.GetDayStartTs(1719646575)
|
||||
PlatformMgrSingleton.GetConfig("1").PermitEndTs = common.GetDayStartTs(1719646575) + int64(actConfig.GetDays()*24*3600)
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
b, err := json.Marshal(&model.PermitStartTs{
|
||||
StartTs: common.GetDayStartTs(1719646575),
|
||||
EndTs: common.GetDayStartTs(1719646575) + int64(actConfig.GetDays()*24*3600),
|
||||
})
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("permit startts save error: %v", err)
|
||||
} else {
|
||||
err := model.UptStrKVGameData(common.PermitStartTsKey+"1", string(b))
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("permit startts update error:%v", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}), nil).StartByExecutor("permit_start_ts")
|
||||
logger.Logger.Tracef("==> PermitConfig: %v ", actConfig)
|
||||
// test
|
||||
}
|
||||
|
||||
func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
|
||||
|
|
|
@ -27,11 +27,12 @@ func (r *PermitMgr) OnDayTimer() {
|
|||
logger.Logger.Info("(this *PermitMgr) OnDayTimer")
|
||||
now := time.Now()
|
||||
for _, v := range PlatformMgrSingleton.GetPlatforms() {
|
||||
pl := PlatformMgrSingleton.GetConfig(v.IdStr).ActPermitConfig
|
||||
platform := v.IdStr
|
||||
pl := PlatformMgrSingleton.GetConfig(platform).ActPermitConfig
|
||||
if pl == nil {
|
||||
continue
|
||||
}
|
||||
b := model.GetStrKVGameData(common.PermitStartTsKey + v.IdStr)
|
||||
b := model.GetStrKVGameData(common.PermitStartTsKey + platform)
|
||||
if b == "" {
|
||||
logger.Logger.Errorf("(this *PermitMgr) OnDayTimer GetStrKVGameData not found")
|
||||
continue
|
||||
|
@ -41,6 +42,7 @@ func (r *PermitMgr) OnDayTimer() {
|
|||
logger.Logger.Errorf("(this *PermitMgr) OnDayTimer json.Unmarshal err:%v", err)
|
||||
continue
|
||||
}
|
||||
logger.Logger.Tracef("(this *PermitMgr) OnDayTimer se:%+v now:%v", *se, now)
|
||||
if se.StartTs <= now.Unix() && now.Unix() < se.EndTs {
|
||||
// 在活动内
|
||||
continue
|
||||
|
@ -57,18 +59,18 @@ func (r *PermitMgr) OnDayTimer() {
|
|||
var players []*model.PlayerBaseInfo
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
list, err = model.FindPlayerPermitList(&model.FindPlayerPermitListArgs{
|
||||
Platform: v.IdStr,
|
||||
Platform: platform,
|
||||
StartTs: startTs,
|
||||
})
|
||||
for _, vv := range list.List {
|
||||
player := PlayerMgrSington.GetPlayerBySnId(vv.SnId)
|
||||
if player != nil {
|
||||
players = append(players, &model.PlayerBaseInfo{
|
||||
SnId: 0,
|
||||
SnId: player.SnId,
|
||||
LastChannel: player.LastChannel,
|
||||
})
|
||||
} else {
|
||||
baseInfo := model.GetPlayerBaseInfo(v.IdStr, vv.SnId)
|
||||
baseInfo := model.GetPlayerBaseInfo(platform, vv.SnId)
|
||||
players = append(players, baseInfo)
|
||||
}
|
||||
}
|
||||
|
@ -83,8 +85,9 @@ func (r *PermitMgr) OnDayTimer() {
|
|||
logger.Logger.Errorf("PermitMgr OnDayTimer FindPlayerPermitList player is nil %v", list.List[k].SnId)
|
||||
continue
|
||||
}
|
||||
curPlayer := player
|
||||
// 发送奖励
|
||||
cfg := PlatformMgrSingleton.GetPermitConfig(v.IdStr, player.LastChannel).GetRankConfig()
|
||||
cfg := PlatformMgrSingleton.GetPermitConfig(platform, player.LastChannel).GetRankConfig()
|
||||
rank := k + 1
|
||||
for _, rankInfo := range cfg {
|
||||
var has bool
|
||||
|
@ -99,21 +102,22 @@ func (r *PermitMgr) OnDayTimer() {
|
|||
if len(items) == 0 {
|
||||
break
|
||||
}
|
||||
logger.Logger.Infof("PermitMgr rank award snid:%v rank:%v", player.SnId, rank)
|
||||
// 发邮件
|
||||
var newMsg *model.Message
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
title := i18n.Tr("languages", "PermitAwardTitle")
|
||||
content := i18n.Tr("languages", "PermitAward", []int{rank, rank, rank, rank})
|
||||
newMsg = model.NewMessage("", 0, "", player.SnId, model.MSGTYPE_RANK_REWARD,
|
||||
title, content, 0, 0, model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", items, v.IdStr, model.HallTienlen, nil)
|
||||
err := model.InsertMessage(v.IdStr, newMsg)
|
||||
newMsg = model.NewMessage("", 0, "", curPlayer.SnId, model.MSGTYPE_RANK_REWARD,
|
||||
title, content, 0, 0, model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", items, platform, model.HallTienlen, nil)
|
||||
err := model.InsertMessage(platform, newMsg)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("发送邮件失败 snid:%v err:%v", player.SnId, err)
|
||||
logger.Logger.Errorf("发送邮件失败 snid:%v err:%v", curPlayer.SnId, err)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}), task.CompleteNotifyWrapper(func(i interface{}, t task.Task) {
|
||||
p := PlayerMgrSington.GetPlayerBySnId(player.SnId)
|
||||
p := PlayerMgrSington.GetPlayerBySnId(curPlayer.SnId)
|
||||
if p != nil {
|
||||
p.AddMessage(newMsg)
|
||||
}
|
||||
|
@ -135,15 +139,15 @@ func (r *PermitMgr) OnDayTimer() {
|
|||
se.StartTs = common.GetDayStartTs(now.Unix())
|
||||
se.EndTs = se.StartTs + int64(pl.Days*24*3600)
|
||||
}
|
||||
PlatformMgrSingleton.GetConfig(v.IdStr).PermitStartTs = se.StartTs
|
||||
PlatformMgrSingleton.GetConfig(v.IdStr).PermitEndTs = se.EndTs
|
||||
PlatformMgrSingleton.GetConfig(platform).PermitStartTs = se.StartTs
|
||||
PlatformMgrSingleton.GetConfig(platform).PermitEndTs = se.EndTs
|
||||
b, err := json.Marshal(se)
|
||||
if err != nil {
|
||||
logger.Logger.Errorf("(this *PermitMgr) OnDayTimer json.Marshal err:%v", err)
|
||||
continue
|
||||
}
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
model.UptStrKVGameData(common.PermitStartTsKey+v.IdStr, string(b))
|
||||
model.UptStrKVGameData(common.PermitStartTsKey+platform, string(b))
|
||||
return nil
|
||||
}), nil).StartByExecutor("permit_start_ts")
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ const (
|
|||
UpdateField_RankScore
|
||||
UpdateField_PhoneScore
|
||||
UpdateField_InviteScore
|
||||
UpdateField_Long
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -2269,6 +2270,10 @@ func (this *Player) ResetPermit() {
|
|||
permitStartTs := PlatformMgrSingleton.GetConfig(this.Platform).PermitStartTs
|
||||
if (this.PermitStartTs == 0 || this.PermitStartTs < permitStartTs) && permitStartTs > 0 {
|
||||
this.PermitStartTs = permitStartTs
|
||||
this.Permit = time.Time{}
|
||||
this.WelfData.PermitAward = make(map[int32]int64)
|
||||
this.WelfData.PermitExchange = make(map[int32][]int64)
|
||||
this.dirty = true
|
||||
// 清理数据
|
||||
bag := BagMgrSingleton.GetBagInfo(this.SnId)
|
||||
if bag != nil {
|
||||
|
@ -2281,13 +2286,10 @@ func (this *Player) ResetPermit() {
|
|||
ItemNum: model.GameParamData.PermitInitScore,
|
||||
ObtainTime: time.Now().Unix(),
|
||||
}
|
||||
this.Permit = time.Now()
|
||||
}
|
||||
}
|
||||
}
|
||||
this.Permit = time.Time{}
|
||||
this.WelfData.PermitAward = make(map[int32]int64)
|
||||
this.WelfData.PermitExchange = make(map[int32][]int64)
|
||||
this.dirty = true
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2557,6 +2559,14 @@ func (this *Player) SendDiffData() {
|
|||
if len(pack.RankScore) == 0 {
|
||||
pack.RankScore = nil
|
||||
}
|
||||
// 龙币
|
||||
itemLong := BagMgrSingleton.GetItem(this.SnId, common.ItemIDLong)
|
||||
if itemLong != nil && this.diffData.Long != itemLong.ItemNum {
|
||||
dirty = true
|
||||
pack.Long = proto.Int64(itemLong.ItemNum)
|
||||
this.diffData.Long = itemLong.ItemNum
|
||||
pack.UpdateField += UpdateField_Long
|
||||
}
|
||||
|
||||
if dirty {
|
||||
FriendMgrSington.UpdateInfo(this.Platform, this.SnId)
|
||||
|
@ -2996,10 +3006,12 @@ func (this *Player) SendPlayerInfo() {
|
|||
scPlayerData.Data.ReliefFundTimes = this.WelfData.ReliefFundTimes
|
||||
}
|
||||
if item := BagMgrSingleton.GetItem(this.SnId, VCard); item != nil {
|
||||
scPlayerData.Data.VCoin = int64(item.ItemNum) //V卡
|
||||
|
||||
scPlayerData.Data.VCoin = item.ItemNum //V卡
|
||||
}
|
||||
// 龙币
|
||||
if item := BagMgrSingleton.GetItem(this.SnId, common.ItemIDLong); item != nil {
|
||||
scPlayerData.Data.Long = item.ItemNum
|
||||
}
|
||||
|
||||
// 排位积分
|
||||
scPlayerData.Data.RankScore = RankMgrSingleton.GetPlayerRankScore(this.SnId)
|
||||
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue