Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop

This commit is contained in:
sk 2024-09-19 18:36:04 +08:00
commit d9d78d2f13
14 changed files with 1095 additions and 476 deletions

View File

@ -314,9 +314,10 @@ const (
GainWayRoomCost = 106 //房费消耗
GainWayRoomGain = 107 //房卡场获得
GainWayItemShop = 108 // 交易市场道具交易
GainWayClawdoorCostItem = 109 // 娃娃机上分扣道具
GainWayClawdollCostItem = 109 // 娃娃机上分扣道具
GainWayItemShopChangeDoll = 110 // 商城兑换娃娃
GainWayItemBagChangeDoll = 111 // 背包内兑换娃娃
GainWayClawdollCatch = 112 // 娃娃机抓取到娃娃获取卡
)
// 后台选择 金币变化类型 的充值 类型id号起始
@ -567,7 +568,6 @@ const (
ItemIDVCard = 30001 // v卡
ItemIDJCard = 30002 // 金券
ItemDiamondScore = 100012 //钻石积分
ItemDollCard = 40004 // 娃娃卡积分
)
func ToItemId(id int32) int32 {
@ -598,7 +598,6 @@ const (
ItemTypeObjective = 16 // 目标类道具
ItemTypeChange = 17 // 兑换话费
ItemTypeSkinChip = 22 // 皮肤碎片
ItemTypeDoll = 26 //娃娃兑换
)
func GetKeyNoviceGameId(gameId int) string {
@ -852,9 +851,3 @@ type NotifyType int // 通知类型
const (
NotifyPrivateRoomList NotifyType = 1 // 私人房间列表
)
// SCPlayerCoinChange 中数值类型
const (
PlayerChangeTypeCoin = 0 // 金币
PlayerChangeTypeNum = 1 // 积分
)

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

@ -75,5 +75,7 @@ const (
)
const (
ClawDoorItemID = 40003
ClawDollItemID = 40003
ClawDollGiveItemID = 74004
ClawDollCostItemCount = 2
)

View File

@ -73,12 +73,19 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
return nil
}
playerEx, ok := p.ExtraData.(*PlayerEx)
if !ok {
return nil
}
switch msg.TypeId {
case 1:
logger.Logger.Tracef("ClawDoll OnPlayerOp payCoin response, SnId= %v", p.SnId)
if msg.Result == 1 {
logger.Logger.Tracef("上分成功snid = %v", msg.Snid)
playerEx.CostPlayCoin(2)
sceneEx.playingSnid = p.SnId
//发送向前移动指令
@ -99,6 +106,9 @@ func MSDollMachineoCoinResultHandler(session *netlib.Session, packetId int, data
case 2:
if msg.Result == 1 {
// 获得娃娃卡
playerEx.CatchCardClawdoll(1)
logger.Logger.Tracef("下抓成功snid = %v", msg.Snid)
} else {
logger.Logger.Tracef("下抓失败snid = %v", msg.Snid)
@ -179,6 +189,52 @@ func (h *CSGetTokenHandler) Process(s *netlib.Session, packetid int, data interf
return nil
}
type CSDollConfigPacketFactory struct {
}
type CSDollConfigHandler struct {
}
func (f *CSDollConfigPacketFactory) CreatePacket() interface{} {
pack := &clawdoll.CSCLAWDOLLConfig{}
return pack
}
func (h *CSDollConfigHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Tracef("CSDollConfigHandler")
if _, ok := data.(*clawdoll.CSCLAWDOLLConfig); ok {
p := base.PlayerMgrSington.GetPlayer(sid)
if p == nil {
logger.Logger.Warn("CSDollConfigHandler p == nil")
return nil
}
scene := p.GetScene()
if scene == nil {
return nil
}
sceneEx, ok := scene.ExtraData.(*SceneEx)
if !ok {
return nil
}
machineId := scene.GetDBGameFree().GetId() % 6080000
machineInfo := sceneEx.GetMachineServerInfo(machineId, p.Platform)
if machineInfo == nil {
logger.Logger.Warn("CSDollConfigHandler machineId = %v not found", machineId)
return nil
}
pack := &clawdoll.SCCLAWDOLLConfig{
IconAddr: machineInfo.IconAddr,
CostItemNum: machineInfo.CostItemNum,
ItemId: machineInfo.ItemId,
ItemNum: machineInfo.ItemNum,
GameId: scene.GetDBGameFree().GetId(),
}
p.SendToClient(int(clawdoll.CLAWDOLLPacketID_PACKET_SC_DollConfig), pack)
}
return nil
}
func init() {
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_PLAYEROP), &CSPlayerOpHandler{})
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_PLAYEROP), &CSPlayerOpPacketFactory{})
@ -186,4 +242,7 @@ func init() {
//客户端请求token
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_GETTOKEN), &CSGetTokenHandler{})
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_GETTOKEN), &CSGetTokenPacketFactory{})
//客户端请求配置信息
common.RegisterHandler(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_DollConfig), &CSDollConfigHandler{})
netlib.RegisterFactory(int(clawdoll.CLAWDOLLPacketID_PACKET_CS_DollConfig), &CSDollConfigPacketFactory{})
}

View File

@ -42,10 +42,10 @@ func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
// 能否投币
func (this *PlayerEx) CanPayCoin() bool {
itemID := int32(rule.ClawDoorItemID)
itemID := int32(rule.ClawDollItemID)
itemCount := this.GetItemCount(itemID)
if itemCount < 1 {
return true
if itemCount < rule.ClawDollCostItemCount {
return false
}
itemData := srvdata.GameItemMgr.Get(this.Platform, itemID)
@ -70,11 +70,11 @@ func (this *PlayerEx) CostPlayCoin(count int32) bool {
var items []*model.Item
itemData := srvdata.GameItemMgr.Get(this.Platform, rule.ClawDoorItemID)
itemData := srvdata.GameItemMgr.Get(this.Platform, rule.ClawDollItemID)
if itemData != nil {
items = append(items, &model.Item{
ItemId: rule.ClawDoorItemID,
ItemNum: -1,
ItemId: rule.ClawDollItemID,
ItemNum: int64(count),
})
}
@ -92,7 +92,7 @@ func (this *PlayerEx) CostPlayCoin(count int32) bool {
this.AddItems(&model.AddItemParam{
P: this.PlayerData,
Change: items,
GainWay: common.GainWayClawdoorCostItem,
GainWay: common.GainWayClawdollCostItem,
Operator: "system",
Remark: "娃娃机上分扣除道具",
GameId: int64(sceneEx.GameId),
@ -102,6 +102,42 @@ func (this *PlayerEx) CostPlayCoin(count int32) bool {
return true
}
// 抓取到娃娃获得娃娃
func (this *PlayerEx) CatchCardClawdoll(count int32) bool {
var items []*model.Item
itemData := srvdata.GameItemMgr.Get(this.Platform, rule.ClawDollGiveItemID)
if itemData != nil {
items = append(items, &model.Item{
ItemId: rule.ClawDollGiveItemID,
ItemNum: int64(count),
})
}
s := this.GetScene()
if s == nil {
logger.Logger.Warn("CatchCardClawdoll p.scene == nil")
return false
}
sceneEx, ok := s.ExtraData.(*SceneEx)
if !ok {
return false
}
this.AddItems(&model.AddItemParam{
P: this.PlayerData,
Change: items,
GainWay: common.GainWayClawdollCatch,
Operator: "system",
Remark: "娃娃机抓取到娃娃获得娃娃卡",
GameId: int64(sceneEx.GameId),
GameFreeId: int64(sceneEx.GetGameFreeId()),
})
return true
}
// 能否移动
func (this *PlayerEx) CanMove() bool {

View File

@ -12,13 +12,13 @@ type BagChangeDollLog struct {
Snid int32 //用户id
ItemId int32
ItemNum int32
UserName string //姓名
UserTel string //手机号
Addr string //地址
State int32 //状态 0.默认 1.成功 2.失败 3.未发货准备发货
Remark string //备注信息
CreateTs time.Time //订单生成时间
OpTs time.Time //订单最后操作时间
UserName string //姓名
UserTel string //手机号
Addr string //地址
State int32 //状态 0.默认 1.成功 2.失败 3.未发货准备发货
Remark string //备注信息
CreateTs int64 //订单生成时间
OpTs int64 //订单最后操作时间
Ts int64
}
@ -44,8 +44,8 @@ func NewDbBagChangeDoll(platform string, snid, itemId, itemNum int32, state int3
UserTel: userTel,
Addr: addr,
Remark: remark,
CreateTs: t,
OpTs: t,
CreateTs: t.Unix(),
OpTs: t.Unix(),
Ts: t.Unix(),
}
}

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
}

View File

@ -38,6 +38,8 @@ const (
CLAWDOLLPacketID_PACKET_CS_WAITPLAYERS CLAWDOLLPacketID = 5611 // 获取等待玩家信息 (客户->服务)
CLAWDOLLPacketID_PACKET_SC_WAITPLAYERS CLAWDOLLPacketID = 5612 // 获取等待玩家信息 (服务->客户)
CLAWDOLLPacketID_PACKET_SC_PLAYINGINFO CLAWDOLLPacketID = 5613 // 正在控制娃娃机的玩家信息 (服务->客户)
CLAWDOLLPacketID_PACKET_CS_DollConfig CLAWDOLLPacketID = 5614 //获取娃娃机配置信息
CLAWDOLLPacketID_PACKET_SC_DollConfig CLAWDOLLPacketID = 5615 //返回娃娃机配置信息
)
// Enum value maps for CLAWDOLLPacketID.
@ -57,6 +59,8 @@ var (
5611: "PACKET_CS_WAITPLAYERS",
5612: "PACKET_SC_WAITPLAYERS",
5613: "PACKET_SC_PLAYINGINFO",
5614: "PACKET_CS_DollConfig",
5615: "PACKET_SC_DollConfig",
}
CLAWDOLLPacketID_value = map[string]int32{
"PACKET_ZERO": 0,
@ -73,6 +77,8 @@ var (
"PACKET_CS_WAITPLAYERS": 5611,
"PACKET_SC_WAITPLAYERS": 5612,
"PACKET_SC_PLAYINGINFO": 5613,
"PACKET_CS_DollConfig": 5614,
"PACKET_SC_DollConfig": 5615,
}
)
@ -1074,6 +1080,123 @@ func (x *CLAWDOLLPlayerDigestInfo) GetStat() int32 {
return 0
}
type CSCLAWDOLLConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *CSCLAWDOLLConfig) Reset() {
*x = CSCLAWDOLLConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_clawdoll_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CSCLAWDOLLConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CSCLAWDOLLConfig) ProtoMessage() {}
func (x *CSCLAWDOLLConfig) ProtoReflect() protoreflect.Message {
mi := &file_clawdoll_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CSCLAWDOLLConfig.ProtoReflect.Descriptor instead.
func (*CSCLAWDOLLConfig) Descriptor() ([]byte, []int) {
return file_clawdoll_proto_rawDescGZIP(), []int{13}
}
type SCCLAWDOLLConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
IconAddr string `protobuf:"bytes,1,opt,name=IconAddr,proto3" json:"IconAddr,omitempty"` //图片地址
CostItemNum int32 `protobuf:"varint,2,opt,name=CostItemNum,proto3" json:"CostItemNum,omitempty"` //消耗道具数量
ItemId int32 `protobuf:"varint,3,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //获得道具ID
ItemNum int32 `protobuf:"varint,4,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` //获得道具数量
GameId int32 `protobuf:"varint,5,opt,name=GameId,proto3" json:"GameId,omitempty"`
}
func (x *SCCLAWDOLLConfig) Reset() {
*x = SCCLAWDOLLConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_clawdoll_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCCLAWDOLLConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCCLAWDOLLConfig) ProtoMessage() {}
func (x *SCCLAWDOLLConfig) ProtoReflect() protoreflect.Message {
mi := &file_clawdoll_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SCCLAWDOLLConfig.ProtoReflect.Descriptor instead.
func (*SCCLAWDOLLConfig) Descriptor() ([]byte, []int) {
return file_clawdoll_proto_rawDescGZIP(), []int{14}
}
func (x *SCCLAWDOLLConfig) GetIconAddr() string {
if x != nil {
return x.IconAddr
}
return ""
}
func (x *SCCLAWDOLLConfig) GetCostItemNum() int32 {
if x != nil {
return x.CostItemNum
}
return 0
}
func (x *SCCLAWDOLLConfig) GetItemId() int32 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *SCCLAWDOLLConfig) GetItemNum() int32 {
if x != nil {
return x.ItemNum
}
return 0
}
func (x *SCCLAWDOLLConfig) GetGameId() int32 {
if x != nil {
return x.GameId
}
return 0
}
var File_clawdoll_proto protoreflect.FileDescriptor
var file_clawdoll_proto_rawDesc = []byte{
@ -1183,40 +1306,55 @@ var file_clawdoll_proto_rawDesc = []byte{
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x48, 0x65, 0x61, 0x64, 0x55, 0x72, 0x6c,
0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x74, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x53, 0x74, 0x61, 0x74, 0x2a, 0xfd, 0x02, 0x0a, 0x10, 0x43, 0x4c, 0x41,
0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x0f, 0x0a,
0x0b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17,
0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d,
0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe1, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x43, 0x53, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2, 0x2b,
0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c,
0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe3, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54, 0x45,
0x10, 0xe4, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43,
0x5f, 0x47, 0x41, 0x4d, 0x45, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xe5, 0x2b, 0x12, 0x1a,
0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79,
0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65,
0x61, 0x76, 0x65, 0x10, 0xe7, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54,
0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe8,
0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x47,
0x45, 0x54, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0xe9, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x54, 0x4f, 0x4b, 0x45,
0x4e, 0x10, 0xea, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43,
0x53, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xeb, 0x2b,
0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x57, 0x41,
0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xec, 0x2b, 0x12, 0x1a, 0x0a, 0x15,
0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x49, 0x4e,
0x47, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xed, 0x2b, 0x2a, 0x64, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43,
0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50,
0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50,
0x52, 0x43, 0x5f, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68,
0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x41, 0x6c,
0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x10, 0x03, 0x42, 0x28,
0x5a, 0x26, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f,
0x63, 0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x28, 0x05, 0x52, 0x04, 0x53, 0x74, 0x61, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x53, 0x43, 0x4c,
0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x9a, 0x01, 0x0a,
0x10, 0x53, 0x43, 0x43, 0x4c, 0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x63, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x49, 0x63, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x12, 0x20, 0x0a,
0x0b, 0x43, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x0b, 0x43, 0x6f, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x12,
0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e,
0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75,
0x6d, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
0x05, 0x52, 0x06, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x64, 0x2a, 0xb3, 0x03, 0x0a, 0x10, 0x43, 0x4c,
0x41, 0x57, 0x44, 0x4f, 0x4c, 0x4c, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x0f,
0x0a, 0x0b, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12,
0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f,
0x4d, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xe1, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe2,
0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50,
0x4c, 0x41, 0x59, 0x45, 0x52, 0x4f, 0x50, 0x10, 0xe3, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x52, 0x4f, 0x4f, 0x4d, 0x53, 0x54, 0x41, 0x54,
0x45, 0x10, 0xe4, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
0x43, 0x5f, 0x47, 0x41, 0x4d, 0x45, 0x42, 0x49, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0xe5, 0x2b, 0x12,
0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61,
0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xe6, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c,
0x65, 0x61, 0x76, 0x65, 0x10, 0xe7, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45,
0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x49, 0x4e, 0x46, 0x4f, 0x10,
0xe8, 0x2b, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f,
0x47, 0x45, 0x54, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x10, 0xe9, 0x2b, 0x12, 0x18, 0x0a, 0x13, 0x50,
0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x53, 0x45, 0x4e, 0x44, 0x54, 0x4f, 0x4b,
0x45, 0x4e, 0x10, 0xea, 0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f,
0x43, 0x53, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xeb,
0x2b, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x57,
0x41, 0x49, 0x54, 0x50, 0x4c, 0x41, 0x59, 0x45, 0x52, 0x53, 0x10, 0xec, 0x2b, 0x12, 0x1a, 0x0a,
0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x5f, 0x50, 0x4c, 0x41, 0x59, 0x49,
0x4e, 0x47, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0xed, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43,
0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x5f, 0x44, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x10, 0xee, 0x2b, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53,
0x43, 0x5f, 0x44, 0x6f, 0x6c, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x10, 0xef, 0x2b, 0x2a,
0x64, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12,
0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10,
0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10,
0x01, 0x12, 0x16, 0x0a, 0x12, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x43, 0x6f, 0x69, 0x6e, 0x4e, 0x6f,
0x74, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x50, 0x52,
0x43, 0x5f, 0x50, 0x6f, 0x73, 0x41, 0x6c, 0x52, 0x65, 0x61, 0x64, 0x79, 0x50, 0x6c, 0x61, 0x79,
0x69, 0x6e, 0x67, 0x10, 0x03, 0x42, 0x28, 0x5a, 0x26, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67,
0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6c, 0x61, 0x77, 0x64, 0x6f, 0x6c, 0x6c, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -1232,7 +1370,7 @@ func file_clawdoll_proto_rawDescGZIP() []byte {
}
var file_clawdoll_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_clawdoll_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
var file_clawdoll_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_clawdoll_proto_goTypes = []interface{}{
(CLAWDOLLPacketID)(0), // 0: clawdoll.CLAWDOLLPacketID
(OpResultCode)(0), // 1: clawdoll.OpResultCode
@ -1249,6 +1387,8 @@ var file_clawdoll_proto_goTypes = []interface{}{
(*SCCLAWDOLLSendToken)(nil), // 12: clawdoll.SCCLAWDOLLSendToken
(*CLAWDOLLWaitPlayers)(nil), // 13: clawdoll.CLAWDOLLWaitPlayers
(*CLAWDOLLPlayerDigestInfo)(nil), // 14: clawdoll.CLAWDOLLPlayerDigestInfo
(*CSCLAWDOLLConfig)(nil), // 15: clawdoll.CSCLAWDOLLConfig
(*SCCLAWDOLLConfig)(nil), // 16: clawdoll.SCCLAWDOLLConfig
}
var file_clawdoll_proto_depIdxs = []int32{
2, // 0: clawdoll.SCCLAWDOLLRoomInfo.Players:type_name -> clawdoll.CLAWDOLLPlayerData
@ -1424,6 +1564,30 @@ func file_clawdoll_proto_init() {
return nil
}
}
file_clawdoll_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSCLAWDOLLConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_clawdoll_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCCLAWDOLLConfig); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -1431,7 +1595,7 @@ func file_clawdoll_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_clawdoll_proto_rawDesc,
NumEnums: 2,
NumMessages: 13,
NumMessages: 15,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -18,6 +18,8 @@ enum CLAWDOLLPacketID {
PACKET_CS_WAITPLAYERS = 5611; // ->
PACKET_SC_WAITPLAYERS = 5612; // ->
PACKET_SC_PLAYINGINFO = 5613; // ->
PACKET_CS_DollConfig = 5614; //
PACKET_SC_DollConfig = 5615; //
}
//
@ -132,3 +134,12 @@ message CLAWDOLLPlayerDigestInfo {
string Name = 4; //
int32 Stat = 5; // 0 5:
}
message CSCLAWDOLLConfig{
}
message SCCLAWDOLLConfig{
string IconAddr =1; //
int32 CostItemNum = 2; //
int32 ItemId = 3; //ID
int32 ItemNum = 4;//
int32 GameId = 5;
}

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;//
}
//
@ -1368,4 +1370,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

@ -3,6 +3,7 @@ package main
import (
"fmt"
"math/rand"
"strconv"
"time"
"mongo.games.com/goserver/core/basic"
@ -579,8 +580,8 @@ func CSDollChangeLog(s *netlib.Session, packetid int, data interface{}, sid int6
info.UserName = log.UserName
info.UserTel = log.UserTel
info.Addr = log.Addr
info.CreateTs = log.CreateTs.String()
info.OpTs = log.OpTs.String()
info.CreateTs = strconv.FormatInt(log.CreateTs, 10)
info.OpTs = strconv.FormatInt(log.OpTs, 10)
info.Remark = log.Remark
pack.Info = append(pack.Info, info)
}

View File

@ -3162,6 +3162,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)
@ -3195,4 +3236,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

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