Compare commits

..

No commits in common. "7a0500c5eb12c6ea2f77a38ca978207348666a91" and "cdd855bfb22900e77cd8742dcdcaf96eb960796d" have entirely different histories.

35 changed files with 2228 additions and 2653 deletions

Binary file not shown.

Binary file not shown.

View File

@ -4,11 +4,11 @@
"Id": 1,
"Order": 1,
"ActivityType": 1,
"TaskType": 7,
"TaskType": 1,
"TargetTimes": 1,
"FinishTimes": 1,
"Award": {
"100001": 500000,
"100001": 50000,
"100004": 5
},
"Position": [

View File

@ -9,6 +9,7 @@ call shell/gen_go.bat
call shell/update_public.bat
git add .
git add public
git commit -m "update develop"
git checkout release
@ -16,7 +17,7 @@ git checkout release
git merge develop
git add .
git reset public
git add public
git commit -m "update release"
set CGO_ENABLED=0

View File

@ -33,5 +33,4 @@ const (
ETCDKEY_ChannelSwitch = "/game/channel/switch" // 渠道开关
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
ETCDKEY_Item = "/game/item" // 道具列表
)

View File

@ -261,18 +261,16 @@ func CSRoomEvent(s *netlib.Session, packetid int, data interface{}, sid int64) e
case 2: // 互动表情
var totalCoin int64
for _, v := range msg.GetParam() {
item := srvdata.GameItemMgr.Get(p.Platform, v)
if item != nil {
switch item.GetType() {
case common.ItemTypeInteract:
totalCoin += item.GetNum()
}
item := srvdata.PBDB_GameItemMgr.GetData(v)
switch item.GetType() {
case common.ItemTypeInteract:
totalCoin += item.GetNum()
}
}
if p.GetCoin() >= totalCoin {
for _, v := range msg.GetParam() {
item := srvdata.GameItemMgr.Get(p.Platform, v)
if item != nil && item.GetNum() > 0 {
item := srvdata.PBDB_GameItemMgr.GetData(v)
if item.GetNum() > 0 {
p.AddCoin(-item.GetNum(), common.GainWay_Interact, base.SyncFlag_ToClient|base.SyncFlag_Broadcast, "system", "互动表情")
}
}

View File

@ -2164,7 +2164,7 @@ func (this *Scene) TryBillExGameDrop(p *Player) {
for id, num := range realDrop {
remark := fmt.Sprintf("游戏掉落%v", id)
pack.Items[id] = proto.Int32(num)
itemData := srvdata.GameItemMgr.Get(p.Platform, id)
itemData := srvdata.PBDB_GameItemMgr.GetData(id)
if itemData != nil {
//logType 0获得 1消耗
log := model.NewItemLogEx(model.ItemParam{
@ -2208,7 +2208,7 @@ func (this *Scene) DropCollectBox(p *Player) {
if n < int(data.GetRate()) {
pack := &player.SCGameExDropItems{}
pack.Items = make(map[int32]int32)
itemData := srvdata.GameItemMgr.Get(p.Platform, common.ItemIDCollectBox)
itemData := srvdata.PBDB_GameItemMgr.GetData(common.ItemIDCollectBox)
if itemData != nil {
p.Items[itemData.Id] = p.Items[itemData.Id] + 1
pack.Items = map[int32]int32{itemData.Id: 1}

View File

@ -2047,7 +2047,7 @@ func (this *TienLenSceneData) SendFirstGiveTimeItem(p *base.Player) {
if !p.PlayerData.IsTakeExpireItem {
itemID := int32(60001)
itemData := srvdata.GameItemMgr.Get(p.Platform, itemID)
itemData := srvdata.PBDB_GameItemMgr.GetData(itemID)
if itemData == nil {
return
}

View File

@ -123,8 +123,6 @@ type AllConfig struct {
*webapi.ActPermitConfig
PermitStartTs int64 // 开始时间戳
PermitEndTs int64 // 结束时间戳
// 道具配置
*webapi.ItemConfig
}
type GlobalConfig struct {

View File

@ -24,7 +24,6 @@ type ItemLog struct {
TypeId int32 // 变化类型
GameId int32 // 游戏id,游戏中获得时有值
GameFreeId int32 // 场次id,游戏中获得时有值
Cost []*ItemInfo // 消耗的道具
}
func NewItemLog() *ItemLog {
@ -33,17 +32,16 @@ func NewItemLog() *ItemLog {
}
type ItemParam struct {
Platform string // 平台
SnId int32 // 玩家id
LogType int32 // 记录类型 0.获取 1.消耗
ItemId int32 // 道具id
ItemName string // 道具名称
Count int64 // 个数
Remark string // 备注
TypeId int32 // 变化类型
GameId int64 // 游戏id,游戏中获得时有值
GameFreeId int64 // 场次id,游戏中获得时有值
Cost []*ItemInfo // 消耗的道具
Platform string // 平台
SnId int32 // 玩家id
LogType int32 // 记录类型 0.获取 1.消耗
ItemId int32 // 道具id
ItemName string // 道具名称
Count int64 // 个数
Remark string // 备注
TypeId int32 // 变化类型
GameId int64 // 游戏id,游戏中获得时有值
GameFreeId int64 // 场次id,游戏中获得时有值
}
func NewItemLogEx(param ItemParam) *ItemLog {
@ -59,6 +57,5 @@ func NewItemLogEx(param ItemParam) *ItemLog {
itemLog.TypeId = param.TypeId
itemLog.GameId = int32(param.GameId)
itemLog.GameFreeId = int32(param.GameFreeId)
itemLog.Cost = param.Cost
return itemLog
}

View File

@ -113,10 +113,6 @@ const (
SystemFreeGive_GiveType_PermitAward // 赛季通行证奖励
SystemFreeGive_GiveType_TaskPermit // 赛季通行证任务奖励
SystemFreeGive_GiveType_TaskPermitRank // 赛季通行证排名奖励
SystemFreeGive_PhoneLottery // 手机积分抽奖奖励
SystemFreeGive_PhoneLotterySwap // 手机积分兑换奖励
SystemFreeGive_CollectBox // 开启卡片礼盒奖励
SystemFreeGive_CollectBoxSwap // 卡片礼盒兑换奖励
)
const (
SystemFreeGive_CoinType_Coin int32 = iota //金币

View File

@ -52,3 +52,34 @@ func GeneratePhoneLottery(snid int32, platform string, items string, lotteryType
params["Ts"] = strconv.Itoa(int(time.Now().Unix()))
return NewRabbitMQData(mq.BackPhoneLottery, params)
}
//type PlayerGameEntryEvent struct {
// RecordId string //游戏记录ID
// SnId int32 //用户ID
// Platform int32 //平台
// OS int //0 Windows 1 Android 2 iOS
// GameId int //游戏id
// ModeId int //游戏模式
// Time int64 //入场时间 RFC3339
// Id int32 //游戏id
//}
// GenerateEnterEvent 玩家或观众进场事件
//func GenerateEnterEvent(recordId string, snId int32, platform, os string, gameId, modeId int, gameFreeId int32) *RabbitMQData {
// m := &PlayerGameEntryEvent{
// RecordId: recordId,
// SnId: snId,
// GameId: gameId,
// ModeId: modeId,
// Time: time.Now().Unix(),
// Id: gameFreeId,
// }
// pf, err := strconv.Atoi(platform)
// if err != nil {
// logger.Error(err)
// return nil
// }
// m.Platform = int32(pf)
// m.OS = common.DeviceNum[os]
// return NewRabbitMQData(string(MqNameEnterEvent), m)
//}

File diff suppressed because it is too large Load Diff

View File

@ -2,8 +2,6 @@ syntax = "proto3";
package player;
option go_package = "mongo.games.com/game/protocol/player";
import "mongo.games.com/game/protocol/server/pbdata.proto";
//
enum OpResultCode {
OPRC_Sucess = 0; //
@ -211,7 +209,6 @@ enum PlayerPacketID {
PACKET_SCExchangeChannel = 2826; //
PACKET_CSSMSConfig = 2827; //
PACKET_SCSMSConfig = 2828; //
PACKET_SCItem = 2830; //
}
//
@ -1213,9 +1210,4 @@ message SCSMSConfig{
message SMSInfo{
int32 Id = 1;
string SmsName = 2;
}
// PACKET_SCItem
message SCItem{
repeated server.DB_GameItem Items = 1; //
}

File diff suppressed because it is too large Load Diff

View File

@ -879,8 +879,6 @@ message DB_GameItem {
int32 Entity = 17;
string Icon = 18;
}
message DB_GameItemArray {

View File

@ -6636,62 +6636,6 @@ func (x *ActPermitConfig) GetConfigs() []*PermitChannelConfig {
return nil
}
// etcd /game/item
type ItemConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台
Items []*server.DB_GameItem `protobuf:"bytes,2,rep,name=Items,proto3" json:"Items,omitempty"` // 道具列表
}
func (x *ItemConfig) Reset() {
*x = ItemConfig{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[66]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ItemConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ItemConfig) ProtoMessage() {}
func (x *ItemConfig) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[66]
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 ItemConfig.ProtoReflect.Descriptor instead.
func (*ItemConfig) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{66}
}
func (x *ItemConfig) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *ItemConfig) GetItems() []*server.DB_GameItem {
if x != nil {
return x.Items
}
return nil
}
var File_common_proto protoreflect.FileDescriptor
var file_common_proto_rawDesc = []byte{
@ -7765,15 +7709,10 @@ var file_common_proto_rawDesc = []byte{
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e,
0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x43, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x73, 0x22, 0x53, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x29, 0x0a,
0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x44, 0x42, 0x5f, 0x47, 0x61, 0x6d, 0x65, 0x49, 0x74, 0x65,
0x6d, 0x52, 0x05, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x42, 0x26, 0x5a, 0x24, 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, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x67, 0x73, 0x42, 0x26, 0x5a, 0x24, 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, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
@ -7788,7 +7727,7 @@ func file_common_proto_rawDescGZIP() []byte {
return file_common_proto_rawDescData
}
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 73)
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 72)
var file_common_proto_goTypes = []interface{}{
(*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting
(*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting
@ -7856,35 +7795,33 @@ var file_common_proto_goTypes = []interface{}{
(*PermitRankConfig)(nil), // 63: webapi.PermitRankConfig
(*PermitChannelConfig)(nil), // 64: webapi.PermitChannelConfig
(*ActPermitConfig)(nil), // 65: webapi.ActPermitConfig
(*ItemConfig)(nil), // 66: webapi.ItemConfig
nil, // 67: webapi.Platform.BindTelRewardEntry
nil, // 68: webapi.PlayerData.RankScoreEntry
nil, // 69: webapi.ItemShop.AwardEntry
nil, // 70: webapi.VIPcfg.AwardEntry
nil, // 71: webapi.VIPcfg.Privilege7Entry
nil, // 72: webapi.ActInviteConfig.PayScoreEntry
(*server.DB_GameFree)(nil), // 73: server.DB_GameFree
(*server.DB_GameItem)(nil), // 74: server.DB_GameItem
nil, // 66: webapi.Platform.BindTelRewardEntry
nil, // 67: webapi.PlayerData.RankScoreEntry
nil, // 68: webapi.ItemShop.AwardEntry
nil, // 69: webapi.VIPcfg.AwardEntry
nil, // 70: webapi.VIPcfg.Privilege7Entry
nil, // 71: webapi.ActInviteConfig.PayScoreEntry
(*server.DB_GameFree)(nil), // 72: server.DB_GameFree
}
var file_common_proto_depIdxs = []int32{
2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch
3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig
4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame
67, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
66, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus
73, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
72, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree
0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting
1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting
1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting
73, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
68, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
72, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
67, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
29, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo
20, // 13: webapi.OnlineReport.GameCount:type_name -> webapi.OnlineGameCnt
22, // 14: webapi.CommonNoticeList.List:type_name -> webapi.CommonNotice
25, // 15: webapi.ExchangeShop.ExType:type_name -> webapi.ExchangeType
24, // 16: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop
69, // 17: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
68, // 17: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
27, // 18: webapi.ItemShopList.List:type_name -> webapi.ItemShop
29, // 19: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo
30, // 20: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward
@ -7905,12 +7842,12 @@ var file_common_proto_depIdxs = []int32{
35, // 35: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate
45, // 36: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree
45, // 37: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree
70, // 38: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
71, // 39: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
69, // 38: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
70, // 39: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
48, // 40: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg
35, // 41: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate
52, // 42: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig
72, // 43: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
71, // 43: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
59, // 44: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward
59, // 45: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward
59, // 46: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward
@ -7923,12 +7860,11 @@ var file_common_proto_depIdxs = []int32{
62, // 53: webapi.PermitChannelConfig.ExchangeConfig:type_name -> webapi.PermitExchangeConfig
63, // 54: webapi.PermitChannelConfig.RankConfig:type_name -> webapi.PermitRankConfig
64, // 55: webapi.ActPermitConfig.Configs:type_name -> webapi.PermitChannelConfig
74, // 56: webapi.ItemConfig.Items:type_name -> server.DB_GameItem
57, // [57:57] is the sub-list for method output_type
57, // [57:57] is the sub-list for method input_type
57, // [57:57] is the sub-list for extension type_name
57, // [57:57] is the sub-list for extension extendee
0, // [0:57] is the sub-list for field type_name
56, // [56:56] is the sub-list for method output_type
56, // [56:56] is the sub-list for method input_type
56, // [56:56] is the sub-list for extension type_name
56, // [56:56] is the sub-list for extension extendee
0, // [0:56] is the sub-list for field type_name
}
func init() { file_common_proto_init() }
@ -8729,18 +8665,6 @@ func file_common_proto_init() {
return nil
}
}
file_common_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ItemConfig); 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{
@ -8748,7 +8672,7 @@ func file_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 73,
NumMessages: 72,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -735,10 +735,4 @@ message ActPermitConfig{
int64 StartTs = 2; //
int32 Days = 3; //
repeated PermitChannelConfig Configs = 4; //
}
// etcd /game/item
message ItemConfig {
string Platform = 1; //
repeated server.DB_GameItem Items = 2; //
}

2
public

@ -1 +1 @@
Subproject commit 7fba2cfaa48724a929e7b393ec9951b6bee61545
Subproject commit 1979cd52fb471bf87bce124133da8d9996ffa3e4

View File

@ -1,69 +0,0 @@
package srvdata
import (
"mongo.games.com/game/protocol/server"
"mongo.games.com/game/protocol/webapi"
)
func init() {
DataMgr.RegisterLoader("DB_GameItem.dat", GameItemMgr)
}
var GameItemMgr = &GameItem{
Data: make(map[int32]*server.DB_GameItem),
Items: make(map[string]map[int32]*server.DB_GameItem),
AllItems: make(map[string][]*server.DB_GameItem),
}
type GameItem struct {
Data map[int32]*server.DB_GameItem // 配置表
Items map[string]map[int32]*server.DB_GameItem // 后台动态配置
AllItems map[string][]*server.DB_GameItem
}
func (m *GameItem) Load(fileFullPath string) error {
m.Data = make(map[int32]*server.DB_GameItem)
m.AllItems = make(map[string][]*server.DB_GameItem)
for _, v := range PBDB_GameItemMgr.Datas.GetArr() {
m.Data[v.GetId()] = v
}
return nil
}
func (m *GameItem) Reload(fileFullPath string) error {
return m.Load(fileFullPath)
}
func (m *GameItem) SetConfig(config *webapi.ItemConfig) {
if config != nil && len(config.GetItems()) > 0 {
m.AllItems = make(map[string][]*server.DB_GameItem)
m.Items[config.GetPlatform()] = make(map[int32]*server.DB_GameItem)
for _, vv := range config.GetItems() {
m.Items[config.GetPlatform()][vv.GetId()] = vv
}
}
}
func (m *GameItem) Get(platform string, id int32) *server.DB_GameItem {
if v, ok := m.Data[id]; ok {
return v
}
if v, ok := m.Items[platform]; ok {
if v, ok := v[id]; ok {
return v
}
}
return nil
}
func (m *GameItem) GetArr(platform string) []*server.DB_GameItem {
if len(m.AllItems[platform]) == 0 {
for _, v := range m.Data {
m.AllItems[platform] = append(m.AllItems[platform], v)
}
for _, v := range m.Items[platform] {
m.AllItems[platform] = append(m.AllItems[platform], v)
}
}
return m.AllItems[platform]
}

View File

@ -34,7 +34,7 @@ func CSBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) err
pack := &bag.SCBagInfo{RetCode: bag.OpResultCode_OPRC_Sucess, BagNumMax: BagItemMax}
if bagInfo != nil {
for _, v := range bagInfo.BagItem {
item := srvdata.GameItemMgr.Get(p.Platform, v.ItemId)
item := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if item != nil && v.ItemNum > 0 && (tp <= 0 || item.GetType() == tp) /*&& (nowLocation == -1 || (nowLocation < len(item.ShowLocation) && item.ShowLocation[nowLocation] == 1))*/ {
pack.Infos = append(pack.Infos, &bag.ItemInfo{
ItemId: v.ItemId,
@ -154,20 +154,6 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
ObtainTime: v.ObtainTime,
})
}
if gainWay == common.GainWay_Collect {
for _, v := range items {
tp1 := int32(-1)
if v.ItemId == common.ItemIDCoin {
tp1 = model.SystemFreeGive_CoinType_Coin
} else if v.ItemId == common.ItemIDDiamond {
tp1 = model.SystemFreeGive_CoinType_Diamond
}
if !p.IsRob && tp1 >= 0 {
LogChannelSingleton.WriteMQData(
model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_CollectBox, tp1, v.ItemNum))
}
}
}
}
}
@ -300,7 +286,7 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
}
case ItemCanExchange:
logger.Logger.Trace("道具兑换", msg.ItemId)
itemInfo := srvdata.GameItemMgr.Get(p.Platform, msg.ItemId)
itemInfo := srvdata.PBDB_GameItemMgr.GetData(msg.ItemId)
if itemInfo == nil || itemInfo.Type != common.ItemTypeChange {
pack.RetCode = bag.OpResultCode_OPRC_NotChange
send()
@ -399,7 +385,7 @@ func CSPropExchange(s *netlib.Session, packetid int, data interface{}, sid int64
send(bag.OpResultCode_OPRC_UseUp)
return nil
}
info := srvdata.GameItemMgr.Get(p.Platform, int32(k))
info := srvdata.PBDB_GameItemMgr.GetData(int32(k))
if info != nil {
costItems = append(costItems, &Item{
ItemId: int32(k),
@ -409,7 +395,7 @@ func CSPropExchange(s *netlib.Session, packetid int, data interface{}, sid int64
}
}
for k, v := range info.GetGain() {
info := srvdata.GameItemMgr.Get(p.Platform, int32(k))
info := srvdata.PBDB_GameItemMgr.GetData(int32(k))
if info != nil {
items = append(items, &Item{
ItemId: int32(k),
@ -429,17 +415,6 @@ func CSPropExchange(s *netlib.Session, packetid int, data interface{}, sid int64
ItemId: v.ItemId,
ItemNum: v.ItemNum,
})
tp1 := int32(-1)
if v.ItemId == common.ItemIDCoin {
tp1 = model.SystemFreeGive_CoinType_Coin
} else if v.ItemId == common.ItemIDDiamond {
tp1 = model.SystemFreeGive_CoinType_Diamond
}
if !p.IsRob && tp1 >= 0 {
LogChannelSingleton.WriteMQData(
model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_CollectBoxSwap, tp1, v.ItemNum))
}
}
send(bag.OpResultCode_OPRC_Sucess)

View File

@ -193,18 +193,6 @@ func (this *CSPhoneLotteryHandler) Process(s *netlib.Session, packetid int, data
return err
}
LogChannelSingleton.WriteMQData(model.GeneratePhoneLottery(p.SnId, p.Platform, string(jsonData), 1, 0, 0, 0))
for _, v := range items {
tp1 := int32(-1)
if v.ItemId == common.ItemIDCoin {
tp1 = model.SystemFreeGive_CoinType_Coin
} else if v.ItemId == common.ItemIDDiamond {
tp1 = model.SystemFreeGive_CoinType_Diamond
}
if !p.IsRob && tp1 >= 0 {
LogChannelSingleton.WriteMQData(
model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_PhoneLottery, tp1, v.ItemNum))
}
}
}
return nil
}

View File

@ -166,16 +166,16 @@ func init() {
if !p.IsRob && !scene.IsTestScene() {
// 同步背包数据
diffItems := []*Item{}
dbItemArr := srvdata.GameItemMgr.GetArr(p.Platform)
dbItemArr := srvdata.PBDB_GameItemMgr.Datas.Arr
if dbItemArr != nil {
items := msg.GetItems()
if items != nil {
for _, dbItem := range dbItemArr {
if itemNum, exist := items[dbItem.Id]; exist {
oldItem := BagMgrSingleton.GetItem(p.SnId, dbItem.Id)
diffNum := itemNum
diffNum := int64(itemNum)
if oldItem != nil {
diffNum = itemNum - oldItem.ItemNum
diffNum = int64(itemNum) - oldItem.ItemNum
}
if diffNum != 0 {
item := &Item{

View File

@ -1029,14 +1029,13 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
var items []*Item
var costItems []*Item
var cost, gain []model.AwardItem
var cost1 []*model.ItemInfo
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.GameItemMgr.Get(p.Platform, v.GetItemId())
info := srvdata.PBDB_GameItemMgr.GetData(v.GetItemId())
if info != nil {
costItems = append(costItems, &Item{
ItemId: v.GetItemId(),
@ -1047,14 +1046,10 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
Id: v.GetItemId(),
Num: v.GetItemNum(),
})
cost1 = append(cost1, &model.ItemInfo{
ItemId: v.GetItemId(),
ItemNum: v.GetItemNum(),
})
}
}
for _, v := range exchangeConfig.GetGain() {
info := srvdata.GameItemMgr.Get(p.Platform, v.GetItemId())
info := srvdata.PBDB_GameItemMgr.GetData(v.GetItemId())
if info != nil {
items = append(items, &Item{
ItemId: v.GetItemId(),
@ -1069,22 +1064,10 @@ func CSPermitExchange(s *netlib.Session, packetid int, data interface{}, sid int
}
// 扣除背包物品
for _, item := range costItems {
BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0,
common.GainWayPermitExchangeCost, "system", "赛季通行证兑换消耗", 0, 0, false)
BagMgrSingleton.AddItem(p, int64(item.ItemId), -item.ItemNum, 0, common.GainWayPermitExchangeCost, "system", "赛季通行证兑换消耗", 0, 0, false)
}
// 增加背包物品
BagMgrSingleton.AddItemsV2(&ItemParam{
P: p,
Change: items,
Cost: cost1,
Add: 0,
GainWay: common.GainWayPermitExchangeGain,
Operator: "system",
Remark: "赛季通行证兑换获得",
gameId: 0,
gameFreeId: 0,
noLog: false,
})
BagMgrSingleton.AddItems(p, items, 0, common.GainWayPermitExchangeGain, "system", "赛季通行证兑换获得", 0, 0, false)
p.WelfData.PermitExchange[msg.GetId()] = append(p.WelfData.PermitExchange[msg.GetId()], now.Unix())
// 兑换记录
LogChannelSingleton.WriteLog(&model.BackendPermitExchange{

View File

@ -99,7 +99,7 @@ func (this *BagMgr) GetItem(snid, itemId int32) *Item {
ItemId: itemId,
}
f := func() {
itemX := srvdata.GameItemMgr.Get(p.Platform, itemId)
itemX := srvdata.PBDB_GameItemMgr.GetData(itemId)
if itemX != nil {
item.Name = itemX.Name
//item.ShowLocation = itemX.ShowLocation
@ -139,27 +139,6 @@ func (this *BagMgr) GetItem(snid, itemId int32) *Item {
return item
}
type ItemParam struct {
P *Player
Change []*Item // 道具变化数量
Cost []*model.ItemInfo // 获得道具时消耗的道具数量
Add int64 // 加成数量
GainWay int32 // 记录类型
Operator, Remark string // 操作人,备注
gameId, gameFreeId int64 // 游戏id,场次id
noLog bool // 是否不记录日志
}
type AddItemParam struct {
Cost []*model.ItemInfo // 获得道具时消耗的道具数量
}
func (this *BagMgr) AddItemsV2(args *ItemParam) (*BagInfo, bag.OpResultCode, bool) {
return this.AddItems(args.P, args.Change, args.Add, args.GainWay, args.Operator, args.Remark, args.gameId, args.gameFreeId, args.noLog, AddItemParam{
Cost: args.Cost,
})
}
// AddItems 给玩家背包添加道具
// add 加成数量
// gainWay 记录类型
@ -168,21 +147,15 @@ func (this *BagMgr) AddItemsV2(args *ItemParam) (*BagInfo, bag.OpResultCode, boo
// gameId 游戏id
// gameFreeId 场次id
// noLog 是否不记录日志
// Deprecated: use [ AddItemsV2 ] instead
func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int32, operator, remark string,
gameId, gameFreeId int64, noLog bool, params ...AddItemParam) (*BagInfo, bag.OpResultCode, bool) {
var cost []*model.ItemInfo
if len(params) > 0 {
cost = params[0].Cost
}
gameId, gameFreeId int64, noLog bool) (*BagInfo, bag.OpResultCode, bool) {
longItem := this.GetItem(p.SnId, common.ItemIDPermit)
var items []*Item
for _, v := range addItems {
if v == nil || v.ItemNum == 0 {
continue
}
item := srvdata.GameItemMgr.Get(p.Platform, v.ItemId)
item := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
switch item.Type {
case common.ItemTypeCoin:
//增加金币
@ -243,7 +216,7 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
continue
}
item := srvdata.GameItemMgr.Get(p.Platform, v.ItemId)
item := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if item == nil {
code = bag.OpResultCode_OPRC_IdErr
return newBagInfo, code, false
@ -261,7 +234,7 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
continue
}
item := srvdata.GameItemMgr.Get(p.Platform, v.ItemId)
item := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if item == nil {
code = bag.OpResultCode_OPRC_IdErr
continue
@ -305,7 +278,6 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
TypeId: gainWay,
GameId: gameId,
GameFreeId: gameFreeId,
Cost: cost,
})
if log != nil {
LogChannelSingleton.WriteLog(log)
@ -368,10 +340,9 @@ func (this *BagMgr) AddItems(p *Player, addItems []*Item, add int64, gainWay int
}
// Deprecated: use [ AddItemsV2 ] instead
func (this *BagMgr) AddItem(p *Player, itemId, itemNum int64, add int64, gainWay int32, operator, remark string,
gameId, gameFreeId int64, noLog bool, params ...AddItemParam) (*BagInfo, bag.OpResultCode, bool) {
return this.AddItems(p, []*Item{{ItemId: int32(itemId), ItemNum: itemNum}}, add, gainWay, operator, remark, gameId, gameFreeId, noLog, params...)
gameId, gameFreeId int64, noLog bool) (*BagInfo, bag.OpResultCode, bool) {
return this.AddItems(p, []*Item{{ItemId: int32(itemId), ItemNum: itemNum}}, add, gainWay, operator, remark, gameId, gameFreeId, noLog)
}
func (this *BagMgr) AddItemsOffline(platform string, snid int32, addItems []*Item, gainWay int32, operator, remark string,
@ -403,7 +374,7 @@ func (this *BagMgr) AddItemsOffline(platform string, snid int32, addItems []*Ite
return
}
for _, v := range addItems {
itemData := srvdata.GameItemMgr.Get(platform, v.ItemId)
itemData := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if itemData == nil {
continue
}
@ -687,7 +658,7 @@ func (this *BagMgr) Callback(player any, ret *internal.PlayerLoadReplay) {
BagItem: make(map[int32]*Item),
}
for k, bi := range bagInfo.BagItem {
item := srvdata.GameItemMgr.Get(ret.Platform, bi.ItemId)
item := srvdata.PBDB_GameItemMgr.GetData(bi.ItemId)
if item != nil {
if bi.ItemNum > 0 {
newBagInfo.BagItem[k] = &Item{

View File

@ -18,9 +18,7 @@ import (
hallproto "mongo.games.com/game/protocol/gamehall"
loginproto "mongo.games.com/game/protocol/login"
playerproto "mongo.games.com/game/protocol/player"
serverproto "mongo.games.com/game/protocol/server"
"mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
)
func init() {
@ -78,8 +76,6 @@ func init() {
etcd.Register(etcd.ETCDKEY_ACT_Invite, webapi.ActInviteConfig{}, platformConfigEvent)
// 赛季通行证
etcd.Register(etcd.ETCDKEY_ACT_Permit, webapi.ActPermitConfig{}, platformConfigEvent)
// 道具列表
etcd.Register(etcd.ETCDKEY_Item, webapi.ItemConfig{}, platformConfigEvent)
}
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -267,44 +263,6 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
f()
}
case *webapi.ItemConfig:
PlatformMgrSingleton.GetConfig(config.Platform).ItemConfig = config
srvdata.GameItemMgr.SetConfig(config)
if !isInit {
var items []*serverproto.DB_GameItem
for _, v := range config.GetItems() {
items = append(items, &serverproto.DB_GameItem{
Id: v.GetId(),
Name: v.GetName(),
ShowLocation: v.GetShowLocation(),
Classify: v.GetClassify(),
Type: v.GetType(),
Effect0: v.GetEffect0(),
Effect: v.GetEffect(),
SaleType: v.GetSaleType(),
SaleGold: v.GetSaleGold(),
Composition: v.GetComposition(),
CompositionMax: v.GetCompositionMax(),
Time: v.GetTime(),
Location: v.GetLocation(),
Describe: v.GetDescribe(),
Num: v.GetNum(),
Value: v.GetValue(),
Entity: v.GetEntity(),
Icon: v.GetIcon(),
})
}
if len(items) > 0 {
for _, v := range PlayerMgrSington.playerOfPlatform[config.Platform] {
if v != nil && v.IsOnLine() {
v.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCItem), &playerproto.SCItem{
Items: items,
})
}
}
}
}
default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
}

View File

@ -27,14 +27,14 @@ import (
"mongo.games.com/game/model"
"mongo.games.com/game/proto"
"mongo.games.com/game/protocol/bag"
hallproto "mongo.games.com/game/protocol/gamehall"
loginproto "mongo.games.com/game/protocol/login"
msgproto "mongo.games.com/game/protocol/message"
playerproto "mongo.games.com/game/protocol/player"
hall_proto "mongo.games.com/game/protocol/gamehall"
login_proto "mongo.games.com/game/protocol/login"
msg_proto "mongo.games.com/game/protocol/message"
player_proto "mongo.games.com/game/protocol/player"
"mongo.games.com/game/protocol/rankmatch"
serverproto "mongo.games.com/game/protocol/server"
shopproto "mongo.games.com/game/protocol/shop"
webapiproto "mongo.games.com/game/protocol/webapi"
server_proto "mongo.games.com/game/protocol/server"
shop_proto "mongo.games.com/game/protocol/shop"
webapi_proto "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/srvdata"
"mongo.games.com/game/worldsrv/internal"
)
@ -373,7 +373,6 @@ func (this *Player) OnLogined() {
this.SendToRepSrv(this.PlayerData)
//红点检测
this.CheckShowRed()
this.SCItems()
TaskSubjectSingleton.Touch(common.TaskTypeLogin, &TaskData{SnId: this.SnId, Num: 1}) // 登录游戏
@ -400,14 +399,14 @@ func (this *Player) OnRehold() {
gateSid = sessionId.Get()
}
}
pack := &serverproto.WGPlayerRehold{
pack := &server_proto.WGPlayerRehold{
Id: proto.Int32(this.SnId),
Sid: proto.Int64(this.sid),
SceneId: proto.Int(this.scene.sceneId),
GateSid: proto.Int64(gateSid),
}
proto.SetDefaults(pack)
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_PLAYERREHOLD), pack)
this.SendToGame(int(server_proto.SSPacketID_PACKET_WG_PLAYERREHOLD), pack)
logger.Logger.Tracef("WG PlayerRehold: %v", pack)
//}
gameid = this.scene.gameId
@ -518,7 +517,7 @@ func (this *Player) RandRobotExData() {
// SendGameConfig 玩家断线重连时,获取玩家所有游戏的配置信息
func (this *Player) SendGameConfig(gameId int32, plf, chl string) {
pack := &hallproto.SCGetGameConfig{
pack := &hall_proto.SCGetGameConfig{
GameId: gameId,
}
@ -527,7 +526,7 @@ func (this *Player) SendGameConfig(gameId int32, plf, chl string) {
if v.Status && PlatformMgrSingleton.GetGlobalConfig().GameStatus[v.DbGameFree.Id] {
if v.DbGameFree.GetGameRule() != 0 && v.DbGameFree.GetGameId() == gameId {
// 场次配置
lgc := &hallproto.GameConfig1{
lgc := &hall_proto.GameConfig1{
LogicId: proto.Int32(v.DbGameFree.Id),
LimitCoin: proto.Int64(v.DbGameFree.GetLimitCoin()),
MaxCoinLimit: proto.Int64(v.DbGameFree.GetMaxCoinLimit()),
@ -557,14 +556,14 @@ func (this *Player) SendGameConfig(gameId int32, plf, chl string) {
if srvdata.GameFreeMgr.IsGameDif(gameId, common.GameDifChess) {
cfg := ChessRankMgrSington.GetChessRankConfig(this.GetPlatform().Name, gameId)
for _, v := range cfg.GetDatas() {
pack.ChessRanks = append(pack.ChessRanks, &hallproto.ChessRankInfo{
pack.ChessRanks = append(pack.ChessRanks, &hall_proto.ChessRankInfo{
Score: v.Score,
Name: v.Name,
})
}
}
this.SendToClient(int(hallproto.GameHallPacketID_PACKET_SC_GETGAMECONFIG), pack)
this.SendToClient(int(hall_proto.GameHallPacketID_PACKET_SC_GETGAMECONFIG), pack)
logger.Logger.Tracef("SendGameConfig:%v", pack)
}
@ -664,7 +663,7 @@ func (this *Player) LoadMessage(lastLogoutTime int64, isFirstLogin, isSkipWeek b
}
func (this *Player) SendMessage(showId int64) {
pack := &msgproto.SCMessageList{}
pack := &msg_proto.SCMessageList{}
if len(this.msgs) != 0 {
for _, msg := range this.msgs {
@ -682,7 +681,7 @@ func (this *Player) SendMessage(showId int64) {
// logger.Logger.Error("player: ", this.SnId, " not find gift : ", msg.GiftId)
// }
//}
pack.Msgs = append(pack.Msgs, &msgproto.MessageData{
pack.Msgs = append(pack.Msgs, &msg_proto.MessageData{
Id: proto.String(msg.Id.Hex()),
Title: proto.String(msg.Title),
Content: proto.String(msg.Content),
@ -705,7 +704,7 @@ func (this *Player) SendMessage(showId int64) {
proto.SetDefaults(pack)
}
//nil的msg需要发给前端便于覆盖前一个玩家的信息
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_MESSAGELIST), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_MESSAGELIST), pack)
}
func (this *Player) ReadMessage(id string) {
@ -719,11 +718,11 @@ func (this *Player) ReadMessage(id string) {
}),
task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
if data == nil {
pack := &msgproto.SCMessageRead{
pack := &msg_proto.SCMessageRead{
Id: proto.String(id),
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_MESSAGEREAD), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_MESSAGEREAD), pack)
}
}), "ReadMessage").StartByFixExecutor("logic_message")
}
@ -733,12 +732,12 @@ func (this *Player) ReadMessage(id string) {
func (this *Player) WebDelMessage(id string) {
if msg, exist := this.msgs[id]; exist {
if msg.State != model.MSGSTATE_REMOVEED { // 未删除状态通知客户端
pack := &msgproto.SCMessageDel{
pack := &msg_proto.SCMessageDel{
Id: id,
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_MESSAGEDEL), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_MESSAGEDEL), pack)
}
//删除此邮件
delete(this.msgs, id)
@ -760,12 +759,12 @@ func (this *Player) DelMessage(id string, del int32) bool {
}),
task.CompleteNotifyWrapper(func(data interface{}, tt task.Task) {
if data == nil {
pack := &msgproto.SCMessageDel{
pack := &msg_proto.SCMessageDel{
Id: id,
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_MESSAGEDEL), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_MESSAGEDEL), pack)
msg.State = model.MSGSTATE_REMOVEED
//删除此邮件
@ -794,7 +793,7 @@ func (this *Player) MessageShowRed() {
}
}
for showId := range msgMap {
this.SendShowRed(hallproto.ShowRedCode_Mail, int32(showId), 1)
this.SendShowRed(hall_proto.ShowRedCode_Mail, int32(showId), 1)
}
}
@ -912,7 +911,7 @@ func (this *Player) AddMessage(msg *model.Message) {
msgMap[msg.ShowId] = 1
}
for showId := range msgMap {
this.SendShowRed(hallproto.ShowRedCode_Mail, int32(showId), 1)
this.SendShowRed(hall_proto.ShowRedCode_Mail, int32(showId), 1)
}
}
}
@ -1154,11 +1153,11 @@ func (this *Player) GetMessageAttach(id string) {
}
if _, code, _ := BagMgrSingleton.AddItems(this, items, 0, gainWay, "mail", remark, 0, 0, false); code != bag.OpResultCode_OPRC_Sucess { // 领取失败
logger.Logger.Errorf("CSPlayerSettingHandler AddItems err", code)
pack := &msgproto.SCGetMessageAttach{
pack := &msg_proto.SCGetMessageAttach{
Id: proto.String(""),
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
}
this.dirty = true
}
@ -1271,11 +1270,11 @@ func (this *Player) GetMessageAttach(id string) {
}
}
}
pack := &msgproto.SCGetMessageAttach{
pack := &msg_proto.SCGetMessageAttach{
Id: proto.String(id),
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
}
}), "GetMessageAttach").StartByFixExecutor("logic_message")
}
@ -1318,7 +1317,7 @@ func (this *Player) GetMessageAttachs(ids []string) {
}
}
pack := &msgproto.SCGetMessageAttach{
pack := &msg_proto.SCGetMessageAttach{
// Id: proto.String(id),
}
@ -1452,7 +1451,7 @@ func (this *Player) GetMessageAttachs(ids []string) {
}
proto.SetDefaults(pack)
this.SendToClient(int(msgproto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
}
}), "GetMessageAttach").StartByFixExecutor("logic_message")
@ -1471,12 +1470,12 @@ func (this *Player) GetMessageByGiftId(id string) *model.Message {
func (this *Player) Kickout(reason int32) {
if this.IsOnLine() {
logger.Logger.Trace("(this *Player) Kickout()", this.SnId)
scDisconnect := &loginproto.SSDisconnect{
scDisconnect := &login_proto.SSDisconnect{
SessionId: proto.Int64(this.sid),
Type: proto.Int32(reason),
}
proto.SetDefaults(scDisconnect)
this.SendToClient(int(loginproto.GatePacketID_PACKET_SS_DICONNECT), scDisconnect)
this.SendToClient(int(login_proto.GatePacketID_PACKET_SS_DICONNECT), scDisconnect)
LoginStateMgrSington.LogoutBySid(this.sid)
this.DropLine()
@ -1518,12 +1517,12 @@ func (this *Player) DropLine() {
this.PlayerData.LastLogoutTime = time.Now().Local()
FriendMgrSington.UpdateLogoutTime(this.Platform, this.SnId)
if this.scene != nil && this.scene.gameSess != nil {
pack := &serverproto.WGPlayerDropLine{
pack := &server_proto.WGPlayerDropLine{
Id: proto.Int32(this.SnId),
SceneId: proto.Int(this.scene.sceneId),
}
proto.SetDefaults(pack)
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_PLAYERDROPLINE), pack)
this.SendToGame(int(server_proto.SSPacketID_PACKET_WG_PLAYERDROPLINE), pack)
}
PlayerMgrSington.DroplinePlayer(this)
this.sid = 0
@ -1545,11 +1544,11 @@ func (this *Player) Logout() {
// 在线奖励:累计在线时长
//this.OnlineRewardAddUpOnlineDuration()
scLogout := &loginproto.SCLogout{
OpRetCode: loginproto.OpResultCode_OPRC_Sucess,
scLogout := &login_proto.SCLogout{
OpRetCode: login_proto.OpResultCode_OPRC_Sucess,
}
proto.SetDefaults(scLogout)
this.SendToClient(int(loginproto.LoginPacketID_PACKET_SC_LOGOUT), scLogout)
this.SendToClient(int(login_proto.LoginPacketID_PACKET_SC_LOGOUT), scLogout)
this.SetOffline()
this.LastLogoutTime = time.Now().Local()
FriendMgrSington.UpdateLogoutTime(this.Platform, this.SnId)
@ -1728,10 +1727,10 @@ func (this *Player) UnmarshalData(data []byte, scene *Scene) {
this.dirty = true
}
func (this *Player) MarshalIParam() []*serverproto.PlayerIParam {
var params []*serverproto.PlayerIParam
func (this *Player) MarshalIParam() []*server_proto.PlayerIParam {
var params []*server_proto.PlayerIParam
for i, v := range this.Iparams {
params = append(params, &serverproto.PlayerIParam{
params = append(params, &server_proto.PlayerIParam{
ParamId: proto.Int(i),
IntVal: proto.Int64(v),
})
@ -1739,16 +1738,16 @@ func (this *Player) MarshalIParam() []*serverproto.PlayerIParam {
return params
}
func (this *Player) UnmarshalIParam(params []*serverproto.PlayerIParam) {
func (this *Player) UnmarshalIParam(params []*server_proto.PlayerIParam) {
for _, p := range params {
this.Iparams[int(p.GetParamId())] = p.GetIntVal()
}
}
func (this *Player) MarshalSParam() []*serverproto.PlayerSParam {
var params []*serverproto.PlayerSParam
func (this *Player) MarshalSParam() []*server_proto.PlayerSParam {
var params []*server_proto.PlayerSParam
for i, v := range this.sparams {
params = append(params, &serverproto.PlayerSParam{
params = append(params, &server_proto.PlayerSParam{
ParamId: proto.Int(i),
StrVal: proto.String(v),
})
@ -1756,16 +1755,16 @@ func (this *Player) MarshalSParam() []*serverproto.PlayerSParam {
return params
}
func (this *Player) UnmarshalSParam(params []*serverproto.PlayerSParam) {
func (this *Player) UnmarshalSParam(params []*server_proto.PlayerSParam) {
for _, p := range params {
this.sparams[int(p.GetParamId())] = p.GetStrVal()
}
}
func (this *Player) MarshalCParam() []*serverproto.PlayerCParam {
var params []*serverproto.PlayerCParam
func (this *Player) MarshalCParam() []*server_proto.PlayerCParam {
var params []*server_proto.PlayerCParam
for k, v := range this.cparams {
params = append(params, &serverproto.PlayerCParam{
params = append(params, &server_proto.PlayerCParam{
StrKey: proto.String(k),
StrVal: proto.String(v),
})
@ -1914,14 +1913,10 @@ func (this *Player) AddDiamond(num, add int64, gainWay int32, oper, remark strin
} else {
this.Diamond += num
}
switch gainWay {
case common.GainWay_MatchSignup: // 排除的
default:
TaskSubjectSingleton.Touch(common.TaskTypeCostDiamond, &TaskData{
SnId: this.SnId,
Num: -num,
})
}
TaskSubjectSingleton.Touch(common.TaskTypeCostDiamond, &TaskData{
SnId: this.SnId,
Num: -num,
})
}
this.SendDiffData()
@ -2397,36 +2392,36 @@ func (this *Player) GetIP() string {
return this.Ip
}
func (this *Player) CreateScene(sceneId, gameId, gameMode, sceneMode int, numOfGames int32, params []int64, dbGameFree *serverproto.DB_GameFree) (*Scene, hallproto.OpResultCode_Game) {
func (this *Player) CreateScene(sceneId, gameId, gameMode, sceneMode int, numOfGames int32, params []int64, dbGameFree *server_proto.DB_GameFree) (*Scene, hall_proto.OpResultCode_Game) {
gs := GameSessMgrSington.GetMinLoadSess(gameId)
if gs == nil {
logger.Logger.Warnf("(this *Player) EnterScene %v, %v GameSessMgrSington.GetMinLoadSess() = nil ", this.SnId, gameId)
return nil, hallproto.OpResultCode_Game_OPRC_SceneServerMaintain_Game
return nil, hall_proto.OpResultCode_Game_OPRC_SceneServerMaintain_Game
}
s := SceneMgrSingleton.CreateScene(0, this.SnId, sceneId, gameId, gameMode, sceneMode, 1, numOfGames, params, gs, this.GetPlatform(), 0, dbGameFree, dbGameFree.GetId())
if s == nil {
logger.Logger.Tracef("(this *Player) EnterScene %v, SceneMgrSingleton.CreateScene() = nil ", this.SnId)
return nil, hallproto.OpResultCode_Game_OPRC_Error_Game
return nil, hall_proto.OpResultCode_Game_OPRC_Error_Game
}
return s, hallproto.OpResultCode_Game_OPRC_Sucess_Game
return s, hall_proto.OpResultCode_Game_OPRC_Sucess_Game
}
func (this *Player) CreateLocalGameScene(sceneId, gameId, gameSite, sceneMode, playerNum int, params []int64,
dbGameFree *serverproto.DB_GameFree, baseScore, groupId int32) (*Scene, hallproto.OpResultCode_Game) {
dbGameFree *server_proto.DB_GameFree, baseScore, groupId int32) (*Scene, hall_proto.OpResultCode_Game) {
gs := GameSessMgrSington.GetMinLoadSess(gameId)
if gs == nil {
logger.Logger.Warnf("(this *Player) CreateLocalGameScene %v, %v GameSessMgrSington.GetMinLoadSess() = nil ", this.SnId, gameId)
return nil, hallproto.OpResultCode_Game_OPRC_SceneServerMaintain_Game
return nil, hall_proto.OpResultCode_Game_OPRC_SceneServerMaintain_Game
}
s := SceneMgrSingleton.CreateLocalGameScene(this.SnId, sceneId, gameId, gameSite, sceneMode, 1, params, gs,
this.GetPlatform(), playerNum, dbGameFree, baseScore, groupId, dbGameFree.GetId())
if s == nil {
logger.Logger.Tracef("(this *Player) EnterScene %v, SceneMgrSingleton.CreateScene() = nil ", this.SnId)
return nil, hallproto.OpResultCode_Game_OPRC_Error_Game
return nil, hall_proto.OpResultCode_Game_OPRC_Error_Game
}
return s, hallproto.OpResultCode_Game_OPRC_Sucess_Game
return s, hall_proto.OpResultCode_Game_OPRC_Sucess_Game
}
func (this *Player) ReturnScene(isLoaded bool) *Scene {
@ -2440,7 +2435,7 @@ func (this *Player) ReturnScene(isLoaded bool) *Scene {
return nil
}
pack := &serverproto.WGPlayerReturn{
pack := &server_proto.WGPlayerReturn{
PlayerId: proto.Int32(this.SnId),
IsLoaded: proto.Bool(isLoaded),
RoomId: proto.Int(this.scene.sceneId),
@ -2450,7 +2445,7 @@ func (this *Player) ReturnScene(isLoaded bool) *Scene {
pack.EnterTs = proto.Int64(ctx.enterTs)
}
proto.SetDefaults(pack)
if this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_PLAYERRETURN), pack) {
if this.SendToGame(int(server_proto.SSPacketID_PACKET_WG_PLAYERRETURN), pack) {
//比赛场返场检查
//MatchMgrSington.OnPlayerReturnScene(this.scene, this)
return this.scene
@ -2484,7 +2479,7 @@ func (this *Player) AddMoneyPayTotal(amount int64) {
func (this *Player) SendDiffData() {
this.UpdateVip()
var dirty bool
pack := &playerproto.SCPlayerDataUpdate{}
pack := &player_proto.SCPlayerDataUpdate{}
pack.UpdateField = 0
//金币
if this.diffData.Coin != this.Coin {
@ -2586,7 +2581,7 @@ func (this *Player) SendDiffData() {
if dirty {
FriendMgrSington.UpdateInfo(this.Platform, this.SnId)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PLAYERDATAUPDATE), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PLAYERDATAUPDATE), pack)
logger.Logger.Trace("(this *Player) SendDiffData() ", pack)
}
}
@ -2969,9 +2964,9 @@ func (this *Player) GetPromoterKey() (string, error) {
func (this *Player) SendPlayerInfo() {
this.UpdateVip()
scPlayerData := &playerproto.SCPlayerData{
OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
Data: &playerproto.PlayerData{
scPlayerData := &player_proto.SCPlayerData{
OpRetCode: player_proto.OpResultCode_OPRC_Sucess,
Data: &player_proto.PlayerData{
AccId: proto.String(this.AccountId), //账号ID
Platform: proto.String(this.Platform), //平台
Channel: proto.String(this.Channel), //渠道
@ -3055,14 +3050,14 @@ func (this *Player) SendPlayerInfo() {
if endTime == 0 {
continue
}
weekInfo := playerproto.WeekInfo{
weekInfo := player_proto.WeekInfo{
Id: id,
WeekCardTime: endTime,
WeekCardAward: this.WeekCardAward[id],
}
scPlayerData.Data.WeekCard = append(scPlayerData.Data.WeekCard, &weekInfo)
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PLAYERDATA), scPlayerData)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PLAYERDATA), scPlayerData)
logger.Logger.Tracef("Send SCPlayerData %v", scPlayerData)
if !this.IsRob {
@ -3277,13 +3272,13 @@ func ReportSystemGiveEvent(pd *model.PlayerData, amount, tag int32, notifyClient
player := PlayerMgrSington.GetPlayerBySnId(pd.SnId)
if player != nil {
//通知客户端
sendPack := &shopproto.SCNotifyGiveCoinInfo{
sendPack := &shop_proto.SCNotifyGiveCoinInfo{
GiveCoin: proto.Int64(int64(amount)),
GiveTag: proto.Int32(tag),
}
proto.SetDefaults(sendPack)
player.SendToClient(int(shopproto.SPacketID_SHOP_SC_GIVECOIN_INFO), sendPack)
player.SendToClient(int(shop_proto.SPacketID_SHOP_SC_GIVECOIN_INFO), sendPack)
}
}
}
@ -3308,7 +3303,7 @@ func (this *Player) ReportBankRuptcy(gameid, gamemode, gamefreeid int32) {
//}
}
func (this *Player) CheckType(gameid, gamefreeId int32) *serverproto.DB_PlayerType {
func (this *Player) CheckType(gameid, gamefreeId int32) *server_proto.DB_PlayerType {
types := srvdata.PlayerTypeMgrSington.GetPlayerType(gamefreeId)
cnt := len(types)
if cnt > 0 {
@ -3405,14 +3400,14 @@ func (this *Player) AddPayCoinLog(coin int64, coinType int32, oper string) {
// 充值回调
func (this *Player) SendPlayerRechargeAnswer(coin int64) {
if this.Tel == "" {
pack := &playerproto.SCPlayerRechargeAnswer{
pack := &player_proto.SCPlayerRechargeAnswer{
OpParam: proto.Int64(1),
AddCoin: proto.Int64(coin),
Coin: proto.Int64(this.Coin),
SafeBoxCoin: proto.Int64(this.SafeBoxCoin),
}
proto.SetDefaults(pack)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PLAYERRECHARGEANSWER), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PLAYERRECHARGEANSWER), pack)
}
}
@ -3464,12 +3459,12 @@ func (this *Player) SendPlayerRechargeAnswer(coin int64) {
//}
func (this *Player) SyncSafeBoxCoinToGame() {
pack := &serverproto.WGSyncPlayerSafeBoxCoin{
pack := &server_proto.WGSyncPlayerSafeBoxCoin{
SnId: proto.Int32(this.SnId),
SafeBoxCoin: proto.Int64(this.SafeBoxCoin),
}
proto.SetDefaults(pack)
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_SyncPlayerSafeBoxCoin), pack)
this.SendToGame(int(server_proto.SSPacketID_PACKET_WG_SyncPlayerSafeBoxCoin), pack)
}
//func (this *Player) GetDgHboPlayerName(plt *Platform) (string, string) {
@ -3523,12 +3518,12 @@ func OnPlayerPay(pd *model.PlayerData, coin int64) {
buf, err := pd.GetPlayerDataEncoder()
if err == nil {
pack := &serverproto.WTPlayerPay{
pack := &server_proto.WTPlayerPay{
AddCoin: proto.Int64(coin),
PlayerData: buf.Bytes(),
}
proto.SetDefaults(pack)
common.SendToActThrSrv(int(serverproto.SSPacketID_PACKET_WT_PLAYERPAY), pack)
common.SendToActThrSrv(int(server_proto.SSPacketID_PACKET_WT_PLAYERPAY), pack)
}
//ActFPayMgrSington.OnPlayerPay(pd.SnId, pd.Platform, coin)
@ -3546,12 +3541,12 @@ func (this *Player) SendPlatformCanUsePromoterBind() {
}
}
pack := &playerproto.SCBindPromoterState{
pack := &player_proto.SCBindPromoterState{
BindState: proto.Int32(state),
}
proto.SetDefaults(pack)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_BINDPROMOTERSTATE), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_BINDPROMOTERSTATE), pack)
}
func (this *Player) RedirectByGame(packetid int, rawpack interface{}) bool {
@ -3566,13 +3561,13 @@ func (this *Player) RedirectByGame(packetid int, rawpack interface{}) bool {
data, err := netlib.MarshalPacket(packetid, rawpack)
if err == nil {
pack := &serverproto.SSRedirectToPlayer{
pack := &server_proto.SSRedirectToPlayer{
SnId: proto.Int32(this.SnId),
PacketId: proto.Int(packetid),
Data: data,
}
proto.SetDefaults(pack)
return this.SendToGame(int(serverproto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), pack)
return this.SendToGame(int(server_proto.SSPacketID_PACKET_SS_REDIRECTTOPLAYER), pack)
}
return false
}
@ -3585,12 +3580,12 @@ func (this *Player) SyncPlayerDataToGateSrv(pd *model.PlayerData) {
if err != nil {
logger.Logger.Info("(this *Player) UpdateToGateSrv gob.Marshal error", err)
} else {
pack := &serverproto.WRPlayerData{
pack := &server_proto.WRPlayerData{
Sid: this.sid,
PlayerData: buf.Bytes(),
}
proto.SetDefaults(pack)
this.gateSess.Send(int(serverproto.SSPacketID_PACKET_WR_PlayerData), pack)
this.gateSess.Send(int(server_proto.SSPacketID_PACKET_WR_PlayerData), pack)
}
}
@ -3598,26 +3593,26 @@ func (this *Player) BindGroupTag(tags []string) {
if this.gateSess == nil {
return
}
pack := &serverproto.SGBindGroupTag{
pack := &server_proto.SGBindGroupTag{
Sid: proto.Int64(this.sid),
Code: serverproto.SGBindGroupTag_OpCode_Add,
Code: server_proto.SGBindGroupTag_OpCode_Add,
Tags: tags,
}
proto.SetDefaults(pack)
this.gateSess.Send(int(serverproto.SSPacketID_PACKET_SG_BINDGROUPTAG), pack)
this.gateSess.Send(int(server_proto.SSPacketID_PACKET_SG_BINDGROUPTAG), pack)
}
func (this *Player) UnBindGroupTag(tags []string) {
if this.gateSess == nil {
return
}
pack := &serverproto.SGBindGroupTag{
pack := &server_proto.SGBindGroupTag{
Sid: proto.Int64(this.sid),
Code: serverproto.SGBindGroupTag_OpCode_Del,
Code: server_proto.SGBindGroupTag_OpCode_Del,
Tags: tags,
}
proto.SetDefaults(pack)
this.gateSess.Send(int(serverproto.SSPacketID_PACKET_SG_BINDGROUPTAG), pack)
this.gateSess.Send(int(server_proto.SSPacketID_PACKET_SG_BINDGROUPTAG), pack)
}
func (this *Player) TryRetrieveLostGameCoin(sceneid int) {
@ -3663,9 +3658,9 @@ func (this *Player) SyncGameCoin(sceneid int, enterts int64) {
this.SendDiffData()
}), "GetCoinWALBySnidAndInGameAndGreaterTs").Start()
}
func (this *Player) SendShowRed(showType hallproto.ShowRedCode, showChild, isShow int32) {
pack := &hallproto.SCShowRed{
ShowRed: &hallproto.ShowRed{
func (this *Player) SendShowRed(showType hall_proto.ShowRedCode, showChild, isShow int32) {
pack := &hall_proto.SCShowRed{
ShowRed: &hall_proto.ShowRed{
ShowType: showType,
ShowChild: proto.Int32(showChild),
IsShow: proto.Int32(isShow),
@ -3673,19 +3668,19 @@ func (this *Player) SendShowRed(showType hallproto.ShowRedCode, showChild, isSho
}
proto.SetDefaults(pack)
logger.Logger.Trace("SCShowRed:", pack)
this.SendToClient(int(hallproto.HallPacketID_PACKET_SC_SHOWRED), pack)
this.SendToClient(int(hall_proto.HallPacketID_PACKET_SC_SHOWRED), pack)
}
func (this *Player) SCVIPBuy(buy int64) {
//buy *= 10000
//this.AddMoneyPayTotal(buy)
//this.GetVIPLevel(0) // 更新下vip等级
pack := &playerproto.SCVIPBuy{
OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
pack := &player_proto.SCVIPBuy{
OpRetCode: player_proto.OpResultCode_OPRC_Sucess,
}
pack.TolVipExp, pack.Money = this.GetCurrentVIPExp() // 获取经验会更新vip等级
pack.Vip = this.VIP
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPBUY), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_VIPBUY), pack)
}
func (this *Player) SCVIPInfo() {
@ -3693,15 +3688,15 @@ func (this *Player) SCVIPInfo() {
return
}
pack := &playerproto.SCVIPInfo{
OpRetCode: playerproto.OpResultCode_OPRC_Error,
pack := &player_proto.SCVIPInfo{
OpRetCode: player_proto.OpResultCode_OPRC_Error,
}
vips := VipMgrSington.GetVIPcfg(this.Platform)
if vips != nil {
pack.MoneyRatio = int32(vips.MoneyRatio)
for _, cfg := range vips.List {
data := &playerproto.VIPcfg{
data := &player_proto.VIPcfg{
VipId: cfg.VipId,
VipEx: cfg.VipEx,
Price: cfg.Price,
@ -3719,13 +3714,13 @@ func (this *Player) SCVIPInfo() {
MatchFreeTimes: cfg.MatchFreeTimes,
}
for itemId, itemNum := range cfg.Award {
data.Item = append(data.Item, &playerproto.ItemInfo{
data.Item = append(data.Item, &player_proto.ItemInfo{
ItemId: int32(itemId),
ItemNum: itemNum,
})
}
for itemId, itemNum := range cfg.Privilege7 {
data.Privilege7 = append(data.Privilege7, &playerproto.ItemInfo{
data.Privilege7 = append(data.Privilege7, &player_proto.ItemInfo{
ItemId: int32(itemId),
ItemNum: itemNum,
})
@ -3746,11 +3741,11 @@ func (this *Player) SCVIPInfo() {
pack.TolVipExp, pack.Money = this.GetCurrentVIPExp(vips)
pack.Vip = this.VIP
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
//WelfareMgrSington.MonitorWelfData(this)
//pack.VipId = append(pack.VipId, this.WelfData.VIPGift...)
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_VIPINFO), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_VIPINFO), pack)
}
func (this *Player) GetVIPExpByPay(payTotal int32) int32 {
vips := VipMgrSington.GetVIPcfg(this.Platform)
@ -3758,12 +3753,12 @@ func (this *Player) GetVIPExpByPay(payTotal int32) int32 {
}
func (this *Player) VIPDraw(id int32) {
//WelfareMgrSington.MonitorWelfData(this)
pack := &playerproto.SCVIPDraw{
pack := &player_proto.SCVIPDraw{
Id: id,
OpRetCode: playerproto.OpResultCode_OPRC_Error,
OpRetCode: player_proto.OpResultCode_OPRC_Error,
}
if id != 0 {
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
return
}
if this.WelfData.VIPBag == nil {
@ -3772,7 +3767,7 @@ func (this *Player) VIPDraw(id int32) {
if innerMap, ok := this.WelfData.VIPBag[this.VIP]; ok {
if _, ok := innerMap[0]; ok {
logger.Logger.Trace("VIPDraw VIP is repeat id%v ", id)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
return
}
} else {
@ -3783,7 +3778,7 @@ func (this *Player) VIPDraw(id int32) {
if vips != nil {
for _, data := range vips.List {
if data.VipId == this.VIP {
pack.OpRetCode = playerproto.OpResultCode_OPRC_Sucess
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
this.WelfData.VIPBag[this.VIP][0] = 1
//金币数量
money := data.Privilege1[0]
@ -3809,12 +3804,12 @@ func (this *Player) VIPDraw(id int32) {
}
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
}
func (this *Player) GetCurrentVIPExp(vipcfg ...*webapiproto.VIPcfgDataList) (exp int64, money int64) {
var vips *webapiproto.VIPcfgDataList
func (this *Player) GetCurrentVIPExp(vipcfg ...*webapi_proto.VIPcfgDataList) (exp int64, money int64) {
var vips *webapi_proto.VIPcfgDataList
if len(vipcfg) == 0 {
vips = VipMgrSington.GetVIPcfg(this.Platform)
} else {
@ -3918,7 +3913,7 @@ func (this *Player) GetPayGoodsInfo() {
case ShopPageBackend:
logger.Logger.Tracef("GetPayGoodsInfo ShopPageBackend %+v", *info)
default:
var itemInfo []*playerproto.PayItem
var itemInfo []*player_proto.PayItem
var items []*Item
if len(info.Amount) > 0 {
this.AddCoin(int64(info.Amount[0]), 0, info.GainWay, "Callback_login", info.Remark)
@ -3928,7 +3923,7 @@ func (this *Player) GetPayGoodsInfo() {
if info.ItemInfo != nil {
for _, v := range info.ItemInfo {
items = append(items, &Item{ItemId: v.ItemId, ItemNum: v.ItemNum})
itemInfo = append(itemInfo, &playerproto.PayItem{
itemInfo = append(itemInfo, &player_proto.PayItem{
ItemId: v.ItemId,
ItemNum: v.ItemNum,
})
@ -3980,12 +3975,12 @@ func (this *Player) GetPayGoodsInfo() {
BagMgrSingleton.AddItems(this, items, 0, info.GainWay, info.Operator, info.Remark, 0, 0, false)
PayGoodsInfo := &playerproto.SCPayGoodsInfo{
PayGoodsInfo := &player_proto.SCPayGoodsInfo{
Gold: info.Amount,
Item: itemInfo,
}
proto.SetDefaults(PayGoodsInfo)
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PAYGOODSINFO), PayGoodsInfo)
}
if info.ConsumeNum > 0 {
TaskSubjectSingleton.Touch(common.TaskTypePay, &TaskData{
@ -4000,7 +3995,7 @@ func (this *Player) GetPayGoodsInfo() {
}
func (this *Player) SendJackPotInit() {
var pack = &hallproto.SCHundredSceneGetGameJackpot{}
var pack = &hall_proto.SCHundredSceneGetGameJackpot{}
gameFreeIds := []int32{
3010001, 3010002, 3010003, 3010004,
3020001, 3020002, 3020003, 3020004,
@ -4010,7 +4005,7 @@ func (this *Player) SendJackPotInit() {
for _, id := range gameFreeIds {
data := srvdata.PBDB_GameFreeMgr.GetData(id)
if data != nil && len(data.Jackpot) > 0 {
jpfi := &hallproto.GameJackpotFundInfo{
jpfi := &hall_proto.GameJackpotFundInfo{
GameFreeId: proto.Int32(data.Id),
JackPotFund: proto.Int64(int64(data.BaseScore * data.Jackpot[0])),
}
@ -4018,7 +4013,7 @@ func (this *Player) SendJackPotInit() {
}
}
if len(pack.GameJackpotFund) > 0 {
this.SendToClient(int(hallproto.HundredScenePacketID_PACKET_SC_GAMEJACKPOT), pack)
this.SendToClient(int(hall_proto.HundredScenePacketID_PACKET_SC_GAMEJACKPOT), pack)
}
}
@ -4155,11 +4150,11 @@ func (this *Player) SendPlayerCoin() {
func (this *Player) UnPlayerPowerEx(power int64) {
logger.Logger.Tracef("解锁炮倍 当前最大解锁炮倍:%v,要解锁的炮倍:%v", this.UnMaxPower, power)
if this.UnPlayerPower(power) {
pack := &playerproto.SCPlayerUnPower{
pack := &player_proto.SCPlayerUnPower{
UnMaxpower: power,
}
this.UnMaxPower = power
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PlayerUnPower), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PlayerUnPower), pack)
logger.Logger.Tracef("通知客户端解锁最大炮倍,snid = %v,power = %v", this.SnId, power)
}
}
@ -4183,10 +4178,10 @@ func (this *Player) ItemUnPlayerPowerListEx(itemId int32) {
if this.UnPlayerPowerList(powerId) {
//通知客户端解锁炮台
pack := &playerproto.SCPlayerUnPowerList{
pack := &player_proto.SCPlayerUnPowerList{
UnPowerList: powerId,
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PlayerUnPowerList), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PlayerUnPowerList), pack)
logger.Logger.Trace("通知客户端解锁炮台 snid = %v,解锁的炮台:%v,当前已有的炮台 = %v", this.SnId, powerId, this.PowerList)
}
}
@ -4199,10 +4194,10 @@ func (this *Player) UnPlayerPowerListEx(powerId int32) {
}
if this.UnPlayerPowerList(powerId) {
//通知客户端解锁炮台
pack := &playerproto.SCPlayerUnPowerList{
pack := &player_proto.SCPlayerUnPowerList{
UnPowerList: powerId,
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PlayerUnPowerList), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PlayerUnPowerList), pack)
logger.Logger.Trace("通知客户端解锁炮台 snid = %v,解锁的炮台:%v,当前已有的炮台 = %v", this.SnId, powerId, this.PowerList)
}
}
@ -4219,12 +4214,12 @@ func (this *Player) UpdatePlayerVipBag(shopId int32) {
}
this.WelfData.VIPBag[shopInfo.VipLevel][shopInfo.Id] = shopInfo.Type
logger.Logger.Tracef("玩家购买VIP商品成功,更新购买状态snid = %v shopId = %v,VIP = %v", this.SnId, shopInfo.Id, shopInfo.VipLevel)
pack := &playerproto.SCVIPDraw{
pack := &player_proto.SCVIPDraw{
Id: shopInfo.Type,
Vip: shopInfo.VipLevel,
OpRetCode: playerproto.OpResultCode_OPRC_Sucess,
OpRetCode: player_proto.OpResultCode_OPRC_Sucess,
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_DRAWVIPGIFT), pack)
//VIP金币礼包&VIP固定礼包统计数据
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
var item []model.ItemInfo
@ -4368,10 +4363,10 @@ func (this *Player) addLotteryCount(count int32) {
this.LotteryCount = math.MaxInt32
}
//通知客户端
pack := &playerproto.SCPhoneLotteryCount{
pack := &player_proto.SCPhoneLotteryCount{
Count: this.LotteryCount,
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SC_PhoneLotteryCount), pack)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SC_PhoneLotteryCount), pack)
}
@ -4615,7 +4610,7 @@ func (this *Player) GetWeekCardAwary(id int32) {
logger.Logger.Trace("周卡已过期,不能领取!")
return
}
ret := &playerproto.SCGetWeekCardAwary{}
ret := &player_proto.SCGetWeekCardAwary{}
if !this.WeekCardAward[id] {
//获取周卡奖励
items := data.GetDayRewards()
@ -4623,7 +4618,7 @@ func (this *Player) GetWeekCardAwary(id int32) {
for itemId, itemNum := range items {
item := &Item{ItemId: int32(itemId), ItemNum: itemNum, ObtainTime: time.Now().Unix()}
addItem = append(addItem, item)
itemInfo := &playerproto.PayItem{}
itemInfo := &player_proto.PayItem{}
itemInfo.ItemId = int32(itemId)
itemInfo.ItemNum = itemNum
ret.Items = append(ret.Items, itemInfo)
@ -4633,13 +4628,13 @@ func (this *Player) GetWeekCardAwary(id int32) {
this.WeekCardAward[id] = true
ret.WeekCardAward = this.WeekCardAward[id]
}
info := &playerproto.WeekInfo{
info := &player_proto.WeekInfo{
Id: id,
WeekCardTime: this.WeekCardTime[id],
WeekCardAward: this.WeekCardAward[id],
}
ret.WeekCard = info
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCGetWeekCardAwary), ret)
this.SendToClient(int(player_proto.PlayerPacketID_PACKET_SCGetWeekCardAwary), ret)
return
}
@ -4673,7 +4668,7 @@ func (this *Player) AddItemRecExpireTime(itemId int32, num, add int64, gainWay i
if num != 0 /*&& !async*/ {
this.dirty = true
if num > 0 {
itemData := srvdata.GameItemMgr.Get(this.Platform, itemId)
itemData := srvdata.PBDB_GameItemMgr.GetData(itemId)
if itemData == nil {
return
}
@ -4689,14 +4684,14 @@ func (this *Player) AddItemRecExpireTime(itemId int32, num, add int64, gainWay i
}
if this.scene != nil && this.scene.gameSess != nil {
msg := &serverproto.WGBuyRecTimeItem{
msg := &server_proto.WGBuyRecTimeItem{
SnId: this.SnId,
ExpireTime: this.ItemRecExpireTime,
Diamond: this.Diamond,
}
proto.SetDefaults(msg)
this.SendToGame(int(serverproto.SSPacketID_PACKET_WG_BUYRECTIMEITEM), msg)
this.SendToGame(int(server_proto.SSPacketID_PACKET_WG_BUYRECTIMEITEM), msg)
}
}
@ -4716,38 +4711,3 @@ func (this *Player) GetIsPermit() bool {
}
return false
}
func (this *Player) SCItems() {
cfg := PlatformMgrSingleton.GetConfig(this.Platform).ItemConfig
if cfg == nil {
return
}
var items []*serverproto.DB_GameItem
for _, v := range cfg.GetItems() {
items = append(items, &serverproto.DB_GameItem{
Id: v.GetId(),
Name: v.GetName(),
ShowLocation: v.GetShowLocation(),
Classify: v.GetClassify(),
Type: v.GetType(),
Effect0: v.GetEffect0(),
Effect: v.GetEffect(),
SaleType: v.GetSaleType(),
SaleGold: v.GetSaleGold(),
Composition: v.GetComposition(),
CompositionMax: v.GetCompositionMax(),
Time: v.GetTime(),
Location: v.GetLocation(),
Describe: v.GetDescribe(),
Num: v.GetNum(),
Value: v.GetValue(),
Entity: v.GetEntity(),
Icon: v.GetIcon(),
})
}
pack := &playerproto.SCItem{
Items: items,
}
this.SendToClient(int(playerproto.PlayerPacketID_PACKET_SCItem), pack)
logger.Logger.Tracef("SCItem: %v", pack)
}

View File

@ -515,7 +515,7 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
}
// 道具
dbItemArr := srvdata.GameItemMgr.GetArr(p.Platform)
dbItemArr := srvdata.PBDB_GameItemMgr.Datas.Arr
if dbItemArr != nil {
msg.Items = make(map[int32]int64)
for _, dbItem := range dbItemArr {

View File

@ -576,18 +576,6 @@ func (this *ShopMgr) createPhoneScore(p *Player, shopInfo *model.ShopInfo, costN
if err == nil {
LogChannelSingleton.WriteMQData(model.GeneratePhoneLottery(p.SnId, p.Platform, string(jsonData), 2, 0, 0, int(costNum)))
}
for _, v := range items {
tp1 := int32(-1)
if v.ItemId == common.ItemIDCoin {
tp1 = model.SystemFreeGive_CoinType_Coin
} else if v.ItemId == common.ItemIDDiamond {
tp1 = model.SystemFreeGive_CoinType_Diamond
}
if !p.IsRob && tp1 >= 0 {
LogChannelSingleton.WriteMQData(
model.GenerateSystemFreeGive(p.SnId, p.Name, p.Platform, p.Channel, model.SystemFreeGive_PhoneLotterySwap, tp1, v.ItemNum))
}
}
}
}

View File

@ -199,12 +199,11 @@ func (t *TaskHandle) AllTask(id int, data any) {
// 通知变更
if !IsTaskReward(p, v.Id) {
item := &taskproto.TaskData{
Id: v.Id,
N: p.WelfData.Task[v.Id].N,
TargetN: v.TargetTimes,
Status: 0,
Reward: v.Award,
TaskType: v.TaskType,
Id: v.Id,
N: p.WelfData.Task[v.Id].N,
TargetN: v.TargetTimes,
Status: 0,
Reward: v.Award,
}
if item.N > item.TargetN {
item.N = item.TargetN

View File

@ -732,12 +732,6 @@ func (this *Tournament) Start(platform string, tmId int32) {
GameFreeID: tm.dbGameFree.GetId(),
Num: 1,
})
if matchInfo.GetSignupCostDiamond() > 0 {
TaskSubjectSingleton.Touch(common.TaskTypeCostDiamond, &TaskData{
SnId: v.SnId,
Num: matchInfo.GetSignupCostDiamond(),
})
}
}
this.signupPlayers[platform][tmId].signup = make(map[int32]*TmPlayer)
}
@ -1219,7 +1213,7 @@ func (this *Tournament) sendPromotionInfo(mc *PlayerMatchContext, sortId int64,
wg := new(sync.WaitGroup)
if pack.GetRankAward() != nil {
for _, v := range pack.GetRankAward().GetItemInfo() {
data := srvdata.GameItemMgr.Get(mc.p.Platform, v.ItemId)
data := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if data != nil && data.GetType() == common.ItemTypePhoneCode {
has = true
item := v // 并发需要复制

View File

@ -3927,7 +3927,7 @@ func init() {
award.Diamond = msg.GetAward().Diamond
if msg.GetAward().GetItemId() != nil {
for _, item := range msg.GetAward().ItemId {
if v := srvdata.GameItemMgr.Get(msg.Platform, item.ItemId); item != nil {
if v := srvdata.PBDB_GameItemMgr.GetData(item.ItemId); item != nil {
if item.ItemNum == 0 {
pack.Tag = webapiproto.TagCode_JYB_DATA_ERROR
pack.Msg = "ItemNum failed"
@ -4026,7 +4026,7 @@ func init() {
return common.ResponseTag_ParamError, pack
}
//cdata := ShopMgrSington.GetExchangeData(msg.GoodsId)
item := srvdata.GameItemMgr.Get(platform, VCard)
item := srvdata.PBDB_GameItemMgr.GetData(VCard)
if item == nil {
pack.Tag = webapiproto.TagCode_FAILED
pack.Msg = "item is nil"
@ -4458,7 +4458,7 @@ func getPlayerDataParam(param *playerDataParam) *model.WebPlayerDataParam {
if param.Items == nil {
b := BagMgrSingleton.GetBagInfo(param.P.SnId)
for _, v := range b.BagItem {
e := srvdata.GameItemMgr.Get(param.P.Platform, v.ItemId)
e := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if e == nil || v.ItemNum <= 0 {
continue
}
@ -4476,7 +4476,7 @@ func getPlayerDataParam(param *playerDataParam) *model.WebPlayerDataParam {
}
} else {
for _, v := range param.Items.BagItem {
e := srvdata.GameItemMgr.Get(param.P.Platform, v.ItemId)
e := srvdata.PBDB_GameItemMgr.GetData(v.ItemId)
if e == nil || v.ItemNum <= 0 {
continue
}

View File

@ -840,7 +840,6 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
}
typeId := addUpDate2Type[0].Id
addUpDate2Num := addUpDate2Type[0].Num
var cost []*model.ItemInfo
if typeId == 1 {
Num += 1
//看广告任务
@ -856,10 +855,6 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
p.AddDiamond(int64(-addUpDate2Num), 0, common.GainWaySign7Con, "system", "累计签到进阶奖励钻石消耗")
logger.Logger.Trace("累计签到进阶奖励扣除钻石uid = ", p.SnId)
EndTime = -1
cost = append(cost, &model.ItemInfo{
ItemId: common.ItemIDDiamond,
ItemNum: int64(addUpDate2Num),
})
}
p.WelfData.Sign7.Addup2Data[day] = make(map[int32]int64)
p.WelfData.Sign7.Addup2Data[day][Num+1] = EndTime
@ -878,18 +873,7 @@ func (this *WelfareMgr) GetAddUp2Award(p *Player, day int32) {
items = append(items, item)
}
}
BagMgrSingleton.AddItemsV2(&ItemParam{
P: p,
Change: items,
Cost: cost,
Add: 0,
GainWay: common.GainWaySign7Add,
Operator: "system",
Remark: "累计签到进阶奖励获得",
gameId: 0,
gameFreeId: 0,
noLog: false,
})
BagMgrSingleton.AddItems(p, items, 0, common.GainWaySign7Add, "system", "累计签到进阶奖励获得", 0, 0, false)
}
//通知客户端
this.UpdateAddUp2Date(p, Num, day, EndTime)

Binary file not shown.

Binary file not shown.