娃娃机娃娃卡获取明细

This commit is contained in:
kxdd 2024-09-19 18:22:36 +08:00
parent e7e08755a4
commit be57df77a1
9 changed files with 4639 additions and 1469 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -113,6 +113,17 @@ func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes)
return err
}
func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *[]model.CoinWAL) (err error) {
cond := bson.M{"snid": args.Snid, "typeid": common.GainWayClawdollCostItem}
c := ItemLogsCollection(args.Platform)
if c == nil {
return
}
err = c.Find(cond).All(&ret)
return
}
func init() {
rpc.Register(new(ItemLogSvc))
}

View File

@ -11,6 +11,7 @@ import (
var (
ItemLogDBName = "log"
ItemLogCollName = "log_itemlog"
ClawDollItemIds = []int32{40003, 40004, 80001, 80002}
)
type ItemLog struct {
@ -118,3 +119,37 @@ func UpdateItemState(param *UpdateParam) error {
return err
}
type ClawdollItemLogReq struct {
Platform string
Snid int32 // 玩家id
ItemIds []int32 // 道具id
}
func GetClawdollItemLog(plt string, snid int32) (logs []ItemLog, err error) {
if rpcCli == nil {
logger.Logger.Error("model.GetClawdollItemLog rpcCli == nil")
return
}
args := &ClawdollItemLogReq{
Platform: plt,
Snid: snid,
}
args.ItemIds = append(args.ItemIds, ClawDollItemIds...)
var ret []ItemLog
//var ret ClawdollItemLogRet
err = rpcCli.CallWithTimeout("ItemLogSvc.GetClawdollItemLog", args, &ret, time.Second*30)
if err != nil {
logger.Logger.Warnf("GetClawdollItemLog err:%v", err)
return
}
logs = ret
return
}

File diff suppressed because it is too large Load Diff

View File

@ -232,6 +232,8 @@ enum PlayerPacketID {
PACKET_SCUpdateAttribute = 2841;//
PACKET_SCGuideConfig = 2842;//
PACKET_SCDataConfig = 2843;//
PACKET_CSClawdollItemLog = 2844;//
PACKET_SCClawdollItemLog = 2845;//
}
//
@ -344,7 +346,6 @@ message PlayerData {
int32 UseSkinId = 50; // id
string ChannelID = 51; // ID
int32 GuideStep = 52; // ; 0-1
int64 ClawdollCard = 53; //
}
//
@ -1368,4 +1369,23 @@ message Config{
//PACKET_SCDataConfig
message SCDataConfig{
repeated Config Cfg = 1;
}
}
//
//PACKET_CSClawdollItemLog
message CSClawdollItemLog{
int32 typeId = 1; //1- 2-
}
//PACKET_SCClawdollItemLog
message SCClawdollItemLog{
int32 typeId = 1; //1- 2-
repeated ClawdollItemLogData ItemLogs = 2;
}
message ClawdollItemLogData{
int32 ItemLogType = 1; //
int32 ItemId = 2; //ID
int64 Num = 3; //
int64 Time = 4; //
}

View File

@ -3156,6 +3156,47 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
return nil
}
// 获取获奖记录
func CSClawdollItemLog(s *netlib.Session, packetId int, data interface{}, sid int64) error {
logger.Logger.Tracef("CSClawdollItemLog Process %v", data)
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
return nil
}
msg, ok := data.(*player_proto.CSClawdollItemLog)
if !ok {
return nil
}
ret := &player_proto.SCClawdollItemLog{}
ret.TypeId = msg.TypeId
var err error
var ItemUseLogs []model.ItemLog
//娃娃机道具使用日志
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
ItemUseLogs, err = model.GetClawdollItemLog(p.Platform, p.SnId)
return err
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
for _, logInfo := range ItemUseLogs {
infoData := &player_proto.ClawdollItemLogData{}
infoData.ItemId = logInfo.ItemId
infoData.Time = logInfo.CreateTs
infoData.Num = logInfo.Count
infoData.ItemLogType = logInfo.LogType
ret.ItemLogs = append(ret.ItemLogs, infoData)
}
p.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCClawdollItemLog), ret)
logger.Logger.Tracef("SCClawdollItemLog:%v", ret)
}), "GetClawdollItemLog").Start()
return nil
}
func init() {
// 用户信息
common.Register(int(player_proto.PlayerPacketID_PACKET_CS_PLAYERDATA), player_proto.CSPlayerData{}, CSPlayerData)
@ -3189,4 +3230,6 @@ func init() {
common.Register(int(player_proto.PlayerPacketID_PACKET_CSPopUpWindowsConfig), player_proto.CSPopUpWindowsConfig{}, CSPopUpWindowsConfig)
// 更新属性;新手引导阶段
common.Register(int(player_proto.PlayerPacketID_PACKET_CSUpdateAttribute), player_proto.CSUpdateAttribute{}, CSUpdateAttribute)
//娃娃卡道具记录
common.Register(int(player_proto.PlayerPacketID_PACKET_CSClawdollItemLog), player_proto.CSClawdollItemLog{}, CSClawdollItemLog)
}

View File

@ -3001,10 +3001,6 @@ func (this *Player) SendPlayerInfo() {
scPlayerData.Data.VCoin = item.ItemNum //V卡
}
if item := BagMgrSingleton.GetItem(this.SnId, common.ItemIDClawdoll); item != nil {
scPlayerData.Data.ClawdollCard = item.ItemNum //娃娃卡
}
// 排位积分
scPlayerData.Data.RankScore = RankMgrSingleton.GetPlayerRankScore(this.SnId)

Binary file not shown.