客户端升级奖励

This commit is contained in:
sk 2024-10-10 15:26:39 +08:00
parent 03c6852edd
commit 4c4af75a76
22 changed files with 845 additions and 170 deletions

View File

@ -9,5 +9,7 @@
"MatchAwardTitle": "{\"zh\":\"话费充值兑换码\",\"vi\":\"Mã nạp tiền ĐT\",\"en\":\"Phone recharge code\",\"kh\":\"កូដបញ្ចូលទូរស័ព្ទ\"}", "MatchAwardTitle": "{\"zh\":\"话费充值兑换码\",\"vi\":\"Mã nạp tiền ĐT\",\"en\":\"Phone recharge code\",\"kh\":\"កូដបញ្ចូលទូរស័ព្ទ\"}",
"MatchAward": "{\"zh\":\"恭喜您获得电话预付卡“%v$”话费充值奖励,兑换码:%v,请尽快使用\",\"vi\":\"Chúc mừng bạn đã nhận được Thẻ trả trước ĐT “%v$” phần thưởng nạp tiền tín dụng ĐT, mã đổi thưởng %v xin sử dụng ngay lập tức\",\"en\":\"Congratulations, you have received the phone prepaid card “%v$” mobile credit top-up reward, redemption code: %v please use it immediately.\",\"kh\":\"សូមអបអរសាទរ អ្នកទទួលបានរង្វាន់កាតបញ្ចូលទូរស័ព្ទ កាតទូរស័ព្ទបង់ប្រាក់ជាមុន “%v$”លេខកូដដោះដូរ %v សូមប្រើវាភ្លាមៗ\"}", "MatchAward": "{\"zh\":\"恭喜您获得电话预付卡“%v$”话费充值奖励,兑换码:%v,请尽快使用\",\"vi\":\"Chúc mừng bạn đã nhận được Thẻ trả trước ĐT “%v$” phần thưởng nạp tiền tín dụng ĐT, mã đổi thưởng %v xin sử dụng ngay lập tức\",\"en\":\"Congratulations, you have received the phone prepaid card “%v$” mobile credit top-up reward, redemption code: %v please use it immediately.\",\"kh\":\"សូមអបអរសាទរ អ្នកទទួលបានរង្វាន់កាតបញ្ចូលទូរស័ព្ទ កាតទូរស័ព្ទបង់ប្រាក់ជាមុន “%v$”លេខកូដដោះដូរ %v សូមប្រើវាភ្លាមៗ\"}",
"PermitAwardTitle": "{\"zh\":\"通行证排行奖励\",\"vi\":\"Vượt qua phần thưởng xếp hạng\",\"en\":\"Pass Ranking Rewards\",\"kh\":\"រង្វាន់ចំណាត់ថ្នាក់ឆ្លងកាត់\"}", "PermitAwardTitle": "{\"zh\":\"通行证排行奖励\",\"vi\":\"Vượt qua phần thưởng xếp hạng\",\"en\":\"Pass Ranking Rewards\",\"kh\":\"រង្វាន់ចំណាត់ថ្នាក់ឆ្លងកាត់\"}",
"PermitAward": "{\"zh\":\"恭喜您在上个赛季通行证排行中名次达到%v名排行奖励已发放请查收\",\"vi\":\"Chúc mừng bạn đã đạt được %v trong bảng xếp hạng vượt qua. Phần thưởng xếp hạng đã được phân phối, vui lòng kiểm tra.\",\"en\":\"Congratulations on reaching %vth place in the pass ranking. Ranking rewards have been issued. Please check.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈានដល់ចំណាត់ថ្នាក់ទី %v ក្នុងចំណាត់ថ្នាក់ឆ្លងកាត់។ រង្វាន់ចំណាត់ថ្នាក់ត្រូវបានចេញ។ សូមត្រួតពិនិត្យ។\"}" "PermitAward": "{\"zh\":\"恭喜您在上个赛季通行证排行中名次达到%v名排行奖励已发放请查收\",\"vi\":\"Chúc mừng bạn đã đạt được %v trong bảng xếp hạng vượt qua. Phần thưởng xếp hạng đã được phân phối, vui lòng kiểm tra.\",\"en\":\"Congratulations on reaching %vth place in the pass ranking. Ranking rewards have been issued. Please check.\",\"kh\":\"សូមអបអរសាទរចំពោះការឈានដល់ចំណាត់ថ្នាក់ទី %v ក្នុងចំណាត់ថ្នាក់ឆ្លងកាត់។ រង្វាន់ចំណាត់ថ្នាក់ត្រូវបានចេញ។ សូមត្រួតពិនិត្យ។\"}",
"UpgradeTitle": "{\"zh\":\"更新奖励\",\"vi\":\"\",\"en\":\"\",\"kh\":\"\"}",
"Upgrade": "{\"zh\":\"感谢您更新客户端,更新奖励已发放至附近,请注意查收\",\"vi\":\"\",\"en\":\"\",\"kh\":\"\"}"
} }

View File

@ -20,7 +20,11 @@ func LoginLogsCollection(plt string) *mongo.Collection {
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"logtype"}, Background: true, Sparse: true}) c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"logtype"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"ip"}, Background: true, Sparse: true}) c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"ip"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"time"}, Background: true, Sparse: true}) c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"time"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"-time"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true}) c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"appchannel"}, Background: true, Sparse: true})
c_loginlogrec.EnsureIndex(mgo.Index{Key: []string{"clientver"}, Background: true, Sparse: true})
} }
return c_loginlogrec return c_loginlogrec
} }

View File

@ -45,4 +45,5 @@ const (
ETCDKEY_RoomType = "/game/room_type" // 房间类型配置 ETCDKEY_RoomType = "/game/room_type" // 房间类型配置
ETCDKEY_RoomConfig = "/game/room_config" // 房间配置 ETCDKEY_RoomConfig = "/game/room_config" // 房间配置
ETCDKEY_RoomConfigSystem = "/game/room_system" // 系统房间配置 ETCDKEY_RoomConfigSystem = "/game/room_system" // 系统房间配置
ETCDKEY_ClientUpgrade = "/game/client_upgrade" // 客户端升级奖励配置
) )

View File

@ -152,6 +152,8 @@ type AllConfig struct {
RoomTypeMap map[int32][]*webapi.RoomConfig // key: 房间类型id:房间配置 RoomTypeMap map[int32][]*webapi.RoomConfig // key: 房间类型id:房间配置
// 系统房间配置 // 系统房间配置
RoomConfigSystem map[int32]*webapi.RoomConfigSystem RoomConfigSystem map[int32]*webapi.RoomConfigSystem
// 客户端升级奖励配置
*webapi.ClientUpgrade
} }
type GlobalConfig struct { type GlobalConfig struct {

View File

@ -91,6 +91,7 @@ type GameParam struct {
UseAdminPassword bool // 是否使用管理员密码 UseAdminPassword bool // 是否使用管理员密码
CloseCustomRoomCreate bool // 关闭自定义房间创建 CloseCustomRoomCreate bool // 关闭自定义房间创建
ClientVersion int32 // 客户端版本号 ClientVersion int32 // 客户端版本号
ClientVersionChannel []string // 客户端版本号包渠道
} }
var GameParamPath = "../data/gameparam.json" var GameParamPath = "../data/gameparam.json"

View File

@ -55,11 +55,12 @@ type LoginLog struct {
BuildVersion string BuildVersion string
AppChannel string AppChannel string
DeviceOS string DeviceOS string
ClientVer int32
} }
func NewLoginLog(snId, logType int32, tel, ip, platform, channel, promoter, packageId, city string, func NewLoginLog(snId, logType int32, tel, ip, platform, channel, promoter, packageId, city string,
clog *ClientLoginInfo, totalCoin int64, gameId, lastGameId int, clog *ClientLoginInfo, totalCoin int64, gameId, lastGameId int,
DeviceName, PackageName, AppVersion, BuildVersion, AppChannel, channelId string) *LoginLog { DeviceName, PackageName, AppVersion, BuildVersion, AppChannel, channelId string, clientVer int32) *LoginLog {
now := time.Now() now := time.Now()
cl := &LoginLog{LogId: bson.NewObjectId()} cl := &LoginLog{LogId: bson.NewObjectId()}
cl.SnId = snId cl.SnId = snId
@ -95,6 +96,7 @@ func NewLoginLog(snId, logType int32, tel, ip, platform, channel, promoter, pack
cl.AppVersion = AppVersion cl.AppVersion = AppVersion
cl.BuildVersion = BuildVersion cl.BuildVersion = BuildVersion
cl.AppChannel = AppChannel cl.AppChannel = AppChannel
cl.ClientVer = clientVer
return cl return cl
} }

View File

@ -73,14 +73,14 @@ type Message struct {
CreatTs int64 //创建时间戳 CreatTs int64 //创建时间戳
AttachState int32 //附件状态 AttachState int32 //附件状态
GiftId string // GiftId string //
Params []int32 //额外参数 Params []int64 //额外参数
Platform string //平台信息 Platform string //平台信息
ShowId int64 //区分主子游戏大厅 ShowId int64 //区分主子游戏大厅
Channel []string //渠道 Channel []string //渠道
} }
func NewMessage(pid string, srcId int32, srcName string, snid, mType int32, title, content string, coin, diamond int64, func NewMessage(pid string, srcId int32, srcName string, snid, mType int32, title, content string, coin, diamond int64,
state int32, addTime int64, attachState int32, giftId string, params []int32, platform string, showId int64, channel []string) *Message { state int32, addTime int64, attachState int32, giftId string, params []int64, platform string, showId int64, channel []string) *Message {
if srcName == "" { if srcName == "" {
srcName = "{\"zh\":\"系统\",\"vi\":\"GM\",\"en\":\"GM\",\"kh\":\"GM\"}" srcName = "{\"zh\":\"系统\",\"vi\":\"GM\",\"en\":\"GM\",\"kh\":\"GM\"}"
} }
@ -110,7 +110,7 @@ func NewMessage(pid string, srcId int32, srcName string, snid, mType int32, titl
return msg return msg
} }
func NewMessageByPlayer(pid string, oper, srcId int32, srcName string, snid, mType int32, title, content string, coin, diamond int64, func NewMessageByPlayer(pid string, oper, srcId int32, srcName string, snid, mType int32, title, content string, coin, diamond int64,
state int32, addTime int64, attachState int32, giftId string, params []int32, platform string, showId int64) *Message { state int32, addTime int64, attachState int32, giftId string, params []int64, platform string, showId int64) *Message {
msg := &Message{ msg := &Message{
Id: bson.NewObjectId(), Id: bson.NewObjectId(),

View File

@ -75,6 +75,10 @@
- 2580~2599 - 2580~2599
- 2900~2999 - 2900~2999
### upgrade.proto
- 3100~3199
## gamesrv ## gamesrv
### fish ### fish

View File

@ -0,0 +1,360 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1-devel
// protoc v3.19.4
// source: upgrade.proto
package upgrade
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PacketID int32
const (
// 3100~3199
PacketID_PacketID_Zero PacketID = 0
PacketID_PACKET_CSClientUpgrades PacketID = 3100
PacketID_PACKET_SCClientUpgrades PacketID = 3101
)
// Enum value maps for PacketID.
var (
PacketID_name = map[int32]string{
0: "PacketID_Zero",
3100: "PACKET_CSClientUpgrades",
3101: "PACKET_SCClientUpgrades",
}
PacketID_value = map[string]int32{
"PacketID_Zero": 0,
"PACKET_CSClientUpgrades": 3100,
"PACKET_SCClientUpgrades": 3101,
}
)
func (x PacketID) Enum() *PacketID {
p := new(PacketID)
*p = x
return p
}
func (x PacketID) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PacketID) Descriptor() protoreflect.EnumDescriptor {
return file_upgrade_proto_enumTypes[0].Descriptor()
}
func (PacketID) Type() protoreflect.EnumType {
return &file_upgrade_proto_enumTypes[0]
}
func (x PacketID) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PacketID.Descriptor instead.
func (PacketID) EnumDescriptor() ([]byte, []int) {
return file_upgrade_proto_rawDescGZIP(), []int{0}
}
type PropInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ItemId int32 `protobuf:"varint,1,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //物品ID
ItemNum int64 `protobuf:"varint,2,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` //物品数量
}
func (x *PropInfo) Reset() {
*x = PropInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_upgrade_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PropInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PropInfo) ProtoMessage() {}
func (x *PropInfo) ProtoReflect() protoreflect.Message {
mi := &file_upgrade_proto_msgTypes[0]
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 PropInfo.ProtoReflect.Descriptor instead.
func (*PropInfo) Descriptor() ([]byte, []int) {
return file_upgrade_proto_rawDescGZIP(), []int{0}
}
func (x *PropInfo) GetItemId() int32 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *PropInfo) GetItemNum() int64 {
if x != nil {
return x.ItemNum
}
return 0
}
// 客户端升级奖励
//PACKET_CSClientUpgrades
type CSClientUpgrades struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *CSClientUpgrades) Reset() {
*x = CSClientUpgrades{}
if protoimpl.UnsafeEnabled {
mi := &file_upgrade_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CSClientUpgrades) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CSClientUpgrades) ProtoMessage() {}
func (x *CSClientUpgrades) ProtoReflect() protoreflect.Message {
mi := &file_upgrade_proto_msgTypes[1]
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 CSClientUpgrades.ProtoReflect.Descriptor instead.
func (*CSClientUpgrades) Descriptor() ([]byte, []int) {
return file_upgrade_proto_rawDescGZIP(), []int{1}
}
//PACKET_SCClientUpgrades
type SCClientUpgrades struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
On bool `protobuf:"varint,1,opt,name=On,proto3" json:"On,omitempty"` // 是否开启
OnForce bool `protobuf:"varint,2,opt,name=OnForce,proto3" json:"OnForce,omitempty"` // 是否强制升级(没有关闭按钮)
Award []*PropInfo `protobuf:"bytes,3,rep,name=Award,proto3" json:"Award,omitempty"` // 奖励
Version int32 `protobuf:"varint,4,opt,name=Version,proto3" json:"Version,omitempty"` // 版本号
}
func (x *SCClientUpgrades) Reset() {
*x = SCClientUpgrades{}
if protoimpl.UnsafeEnabled {
mi := &file_upgrade_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SCClientUpgrades) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SCClientUpgrades) ProtoMessage() {}
func (x *SCClientUpgrades) ProtoReflect() protoreflect.Message {
mi := &file_upgrade_proto_msgTypes[2]
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 SCClientUpgrades.ProtoReflect.Descriptor instead.
func (*SCClientUpgrades) Descriptor() ([]byte, []int) {
return file_upgrade_proto_rawDescGZIP(), []int{2}
}
func (x *SCClientUpgrades) GetOn() bool {
if x != nil {
return x.On
}
return false
}
func (x *SCClientUpgrades) GetOnForce() bool {
if x != nil {
return x.OnForce
}
return false
}
func (x *SCClientUpgrades) GetAward() []*PropInfo {
if x != nil {
return x.Award
}
return nil
}
func (x *SCClientUpgrades) GetVersion() int32 {
if x != nil {
return x.Version
}
return 0
}
var File_upgrade_proto protoreflect.FileDescriptor
var file_upgrade_proto_rawDesc = []byte{
0x0a, 0x0d, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x22, 0x3c, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x49,
0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x53, 0x43, 0x6c, 0x69, 0x65,
0x6e, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x73, 0x22, 0x7f, 0x0a, 0x10, 0x53, 0x43,
0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x73, 0x12, 0x0e,
0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x4f, 0x6e, 0x12, 0x18,
0x0a, 0x07, 0x4f, 0x6e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52,
0x07, 0x4f, 0x6e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x41, 0x77, 0x61, 0x72,
0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64,
0x65, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x41, 0x77, 0x61, 0x72,
0x64, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01,
0x28, 0x05, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0x59, 0x0a, 0x08, 0x50,
0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x61, 0x63, 0x6b, 0x65,
0x74, 0x49, 0x44, 0x5f, 0x5a, 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41,
0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67,
0x72, 0x61, 0x64, 0x65, 0x73, 0x10, 0x9c, 0x18, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b,
0x45, 0x54, 0x5f, 0x53, 0x43, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61,
0x64, 0x65, 0x73, 0x10, 0x9d, 0x18, 0x42, 0x27, 0x5a, 0x25, 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, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_upgrade_proto_rawDescOnce sync.Once
file_upgrade_proto_rawDescData = file_upgrade_proto_rawDesc
)
func file_upgrade_proto_rawDescGZIP() []byte {
file_upgrade_proto_rawDescOnce.Do(func() {
file_upgrade_proto_rawDescData = protoimpl.X.CompressGZIP(file_upgrade_proto_rawDescData)
})
return file_upgrade_proto_rawDescData
}
var file_upgrade_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_upgrade_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_upgrade_proto_goTypes = []interface{}{
(PacketID)(0), // 0: upgrade.PacketID
(*PropInfo)(nil), // 1: upgrade.PropInfo
(*CSClientUpgrades)(nil), // 2: upgrade.CSClientUpgrades
(*SCClientUpgrades)(nil), // 3: upgrade.SCClientUpgrades
}
var file_upgrade_proto_depIdxs = []int32{
1, // 0: upgrade.SCClientUpgrades.Award:type_name -> upgrade.PropInfo
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_upgrade_proto_init() }
func file_upgrade_proto_init() {
if File_upgrade_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_upgrade_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PropInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_upgrade_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CSClientUpgrades); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_upgrade_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SCClientUpgrades); 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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_upgrade_proto_rawDesc,
NumEnums: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_upgrade_proto_goTypes,
DependencyIndexes: file_upgrade_proto_depIdxs,
EnumInfos: file_upgrade_proto_enumTypes,
MessageInfos: file_upgrade_proto_msgTypes,
}.Build()
File_upgrade_proto = out.File
file_upgrade_proto_rawDesc = nil
file_upgrade_proto_goTypes = nil
file_upgrade_proto_depIdxs = nil
}

View File

@ -0,0 +1,27 @@
syntax = "proto3";
package upgrade;
option go_package = "mongo.games.com/game/protocol/upgrade";
enum PacketID {
// 3100~3199
PacketID_Zero = 0;
PACKET_CSClientUpgrades = 3100;
PACKET_SCClientUpgrades = 3101;
}
message PropInfo{
int32 ItemId = 1;//ID
int64 ItemNum = 2;//
}
//
//PACKET_CSClientUpgrades
message CSClientUpgrades{
}
//PACKET_SCClientUpgrades
message SCClientUpgrades{
bool On = 1; //
bool OnForce = 2; // ()
repeated PropInfo Award = 3; //
int32 Version = 4; //
}

View File

@ -8921,6 +8921,78 @@ func (x *RoomConfigSystem) GetOn() int32 {
return 0 return 0
} }
// etcd /game/client_upgrade
type ClientUpgrade struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Platform string `protobuf:"bytes,1,opt,name=Platform,proto3" json:"Platform,omitempty"` // 平台
On int32 `protobuf:"varint,2,opt,name=On,proto3" json:"On,omitempty"` // 开关 1开启 2关闭
OnForce int32 `protobuf:"varint,3,opt,name=OnForce,proto3" json:"OnForce,omitempty"` // 强制升级开关 1开启 2关闭
Reward []*ItemInfo `protobuf:"bytes,4,rep,name=Reward,proto3" json:"Reward,omitempty"` // 奖励
}
func (x *ClientUpgrade) Reset() {
*x = ClientUpgrade{}
if protoimpl.UnsafeEnabled {
mi := &file_common_proto_msgTypes[93]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ClientUpgrade) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ClientUpgrade) ProtoMessage() {}
func (x *ClientUpgrade) ProtoReflect() protoreflect.Message {
mi := &file_common_proto_msgTypes[93]
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 ClientUpgrade.ProtoReflect.Descriptor instead.
func (*ClientUpgrade) Descriptor() ([]byte, []int) {
return file_common_proto_rawDescGZIP(), []int{93}
}
func (x *ClientUpgrade) GetPlatform() string {
if x != nil {
return x.Platform
}
return ""
}
func (x *ClientUpgrade) GetOn() int32 {
if x != nil {
return x.On
}
return 0
}
func (x *ClientUpgrade) GetOnForce() int32 {
if x != nil {
return x.OnForce
}
return 0
}
func (x *ClientUpgrade) GetReward() []*ItemInfo {
if x != nil {
return x.Reward
}
return nil
}
var File_common_proto protoreflect.FileDescriptor var File_common_proto protoreflect.FileDescriptor
var file_common_proto_rawDesc = []byte{ var file_common_proto_rawDesc = []byte{
@ -10319,10 +10391,18 @@ var file_common_proto_rawDesc = []byte{
0x26, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x26, 0x0a, 0x0e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x72, 0x65, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x41, 0x75, 0x74, 0x6f, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x0e, 0x20, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x0e, 0x20,
0x01, 0x28, 0x05, 0x52, 0x02, 0x4f, 0x6e, 0x42, 0x26, 0x5a, 0x24, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x01, 0x28, 0x05, 0x52, 0x02, 0x4f, 0x6e, 0x22, 0x7f, 0x0a, 0x0d, 0x43, 0x6c, 0x69, 0x65, 0x6e,
0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x74, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x62, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x02, 0x4f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x6e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x4f, 0x6e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x12, 0x28,
0x0a, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
0x2e, 0x77, 0x65, 0x62, 0x61, 0x70, 0x69, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x06, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 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 ( var (
@ -10337,7 +10417,7 @@ func file_common_proto_rawDescGZIP() []byte {
return file_common_proto_rawDescData return file_common_proto_rawDescData
} }
var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 103) var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 104)
var file_common_proto_goTypes = []interface{}{ var file_common_proto_goTypes = []interface{}{
(*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting (*MysqlDbSetting)(nil), // 0: webapi.MysqlDbSetting
(*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting (*MongoDbSetting)(nil), // 1: webapi.MongoDbSetting
@ -10432,32 +10512,33 @@ var file_common_proto_goTypes = []interface{}{
(*RoomType)(nil), // 90: webapi.RoomType (*RoomType)(nil), // 90: webapi.RoomType
(*RoomConfig)(nil), // 91: webapi.RoomConfig (*RoomConfig)(nil), // 91: webapi.RoomConfig
(*RoomConfigSystem)(nil), // 92: webapi.RoomConfigSystem (*RoomConfigSystem)(nil), // 92: webapi.RoomConfigSystem
nil, // 93: webapi.Platform.BindTelRewardEntry (*ClientUpgrade)(nil), // 93: webapi.ClientUpgrade
nil, // 94: webapi.PlayerData.RankScoreEntry nil, // 94: webapi.Platform.BindTelRewardEntry
nil, // 95: webapi.ItemShop.AwardEntry nil, // 95: webapi.PlayerData.RankScoreEntry
nil, // 96: webapi.VIPcfg.AwardEntry nil, // 96: webapi.ItemShop.AwardEntry
nil, // 97: webapi.VIPcfg.Privilege1Entry nil, // 97: webapi.VIPcfg.AwardEntry
nil, // 98: webapi.VIPcfg.Privilege7Entry nil, // 98: webapi.VIPcfg.Privilege1Entry
nil, // 99: webapi.VIPcfg.Privilege9Entry nil, // 99: webapi.VIPcfg.Privilege7Entry
nil, // 100: webapi.ActInviteConfig.PayScoreEntry nil, // 100: webapi.VIPcfg.Privilege9Entry
nil, // 101: webapi.SkinLevel.UpItemEntry nil, // 101: webapi.ActInviteConfig.PayScoreEntry
nil, // 102: webapi.SkinItem.UnlockParamEntry nil, // 102: webapi.SkinLevel.UpItemEntry
(*server.DB_GameFree)(nil), // 103: server.DB_GameFree nil, // 103: webapi.SkinItem.UnlockParamEntry
(*server.DB_GameItem)(nil), // 104: server.DB_GameItem (*server.DB_GameFree)(nil), // 104: server.DB_GameFree
(*server.DB_GameItem)(nil), // 105: server.DB_GameItem
} }
var file_common_proto_depIdxs = []int32{ var file_common_proto_depIdxs = []int32{
2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch 2, // 0: webapi.Platform.Leaderboard:type_name -> webapi.RankSwitch
3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig 3, // 1: webapi.Platform.ClubConfig:type_name -> webapi.ClubConfig
4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame 4, // 2: webapi.Platform.ThirdGameMerchant:type_name -> webapi.ThirdGame
93, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry 94, // 3: webapi.Platform.BindTelReward:type_name -> webapi.Platform.BindTelRewardEntry
6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus 6, // 4: webapi.GameConfigGlobal.GameStatus:type_name -> webapi.GameStatus
103, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree 104, // 5: webapi.GameFree.DbGameFree:type_name -> server.DB_GameFree
8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree 8, // 6: webapi.PlatformGameConfig.DbGameFrees:type_name -> webapi.GameFree
0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting 0, // 7: webapi.PlatformDbConfig.Mysql:type_name -> webapi.MysqlDbSetting
1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting 1, // 8: webapi.PlatformDbConfig.MongoDb:type_name -> webapi.MongoDbSetting
1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting 1, // 9: webapi.PlatformDbConfig.MongoDbLog:type_name -> webapi.MongoDbSetting
103, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree 104, // 10: webapi.GameConfigGroup.DbGameFree:type_name -> server.DB_GameFree
94, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry 95, // 11: webapi.PlayerData.RankScore:type_name -> webapi.PlayerData.RankScoreEntry
32, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo 32, // 12: webapi.PlayerData.Items:type_name -> webapi.ItemInfo
14, // 13: webapi.PlayerData.RoleUnlockList:type_name -> webapi.ModInfo 14, // 13: webapi.PlayerData.RoleUnlockList:type_name -> webapi.ModInfo
14, // 14: webapi.PlayerData.PetUnlockList:type_name -> webapi.ModInfo 14, // 14: webapi.PlayerData.PetUnlockList:type_name -> webapi.ModInfo
@ -10470,7 +10551,7 @@ var file_common_proto_depIdxs = []int32{
32, // 21: webapi.ExchangeShop.Items:type_name -> webapi.ItemInfo 32, // 21: webapi.ExchangeShop.Items:type_name -> webapi.ItemInfo
25, // 22: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop 25, // 22: webapi.ExchangeShopList.List:type_name -> webapi.ExchangeShop
29, // 23: webapi.ExchangeShopList.Weight:type_name -> webapi.ShopWeight 29, // 23: webapi.ExchangeShopList.Weight:type_name -> webapi.ShopWeight
95, // 24: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry 96, // 24: webapi.ItemShop.Award:type_name -> webapi.ItemShop.AwardEntry
30, // 25: webapi.ItemShopList.List:type_name -> webapi.ItemShop 30, // 25: webapi.ItemShopList.List:type_name -> webapi.ItemShop
32, // 26: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo 32, // 26: webapi.MatchInfoAward.ItemId:type_name -> webapi.ItemInfo
33, // 27: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward 33, // 27: webapi.GameMatchDate.Award:type_name -> webapi.MatchInfoAward
@ -10491,14 +10572,14 @@ var file_common_proto_depIdxs = []int32{
38, // 42: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate 38, // 42: webapi.WelfareSpree.Item:type_name -> webapi.WelfareDate
48, // 43: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree 48, // 43: webapi.WelfareFirstPayDataList.List:type_name -> webapi.WelfareSpree
48, // 44: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree 48, // 44: webapi.WelfareContinuousPayDataList.List:type_name -> webapi.WelfareSpree
96, // 45: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry 97, // 45: webapi.VIPcfg.Award:type_name -> webapi.VIPcfg.AwardEntry
97, // 46: webapi.VIPcfg.Privilege1:type_name -> webapi.VIPcfg.Privilege1Entry 98, // 46: webapi.VIPcfg.Privilege1:type_name -> webapi.VIPcfg.Privilege1Entry
98, // 47: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry 99, // 47: webapi.VIPcfg.Privilege7:type_name -> webapi.VIPcfg.Privilege7Entry
99, // 48: webapi.VIPcfg.Privilege9:type_name -> webapi.VIPcfg.Privilege9Entry 100, // 48: webapi.VIPcfg.Privilege9:type_name -> webapi.VIPcfg.Privilege9Entry
51, // 49: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg 51, // 49: webapi.VIPcfgDataList.List:type_name -> webapi.VIPcfg
38, // 50: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate 38, // 50: webapi.ChessRankConfig.Item:type_name -> webapi.WelfareDate
55, // 51: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig 55, // 51: webapi.ChessRankcfgData.Datas:type_name -> webapi.ChessRankConfig
100, // 52: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry 101, // 52: webapi.ActInviteConfig.PayScore:type_name -> webapi.ActInviteConfig.PayScoreEntry
62, // 53: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward 62, // 53: webapi.ActInviteConfig.Awards1:type_name -> webapi.RankAward
62, // 54: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward 62, // 54: webapi.ActInviteConfig.Awards2:type_name -> webapi.RankAward
62, // 55: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward 62, // 55: webapi.ActInviteConfig.Awards3:type_name -> webapi.RankAward
@ -10515,12 +10596,12 @@ var file_common_proto_depIdxs = []int32{
69, // 66: webapi.DiamondLotteryData.Info:type_name -> webapi.DiamondLotteryInfo 69, // 66: webapi.DiamondLotteryData.Info:type_name -> webapi.DiamondLotteryInfo
70, // 67: webapi.DiamondLotteryData.Players:type_name -> webapi.DiamondLotteryPlayers 70, // 67: webapi.DiamondLotteryData.Players:type_name -> webapi.DiamondLotteryPlayers
72, // 68: webapi.DiamondLotteryConfig.LotteryData:type_name -> webapi.DiamondLotteryData 72, // 68: webapi.DiamondLotteryConfig.LotteryData:type_name -> webapi.DiamondLotteryData
104, // 69: webapi.ItemConfig.Items:type_name -> server.DB_GameItem 105, // 69: webapi.ItemConfig.Items:type_name -> server.DB_GameItem
32, // 70: webapi.RankAwardInfo.Item:type_name -> webapi.ItemInfo 32, // 70: webapi.RankAwardInfo.Item:type_name -> webapi.ItemInfo
75, // 71: webapi.RankTypeInfo.Award:type_name -> webapi.RankAwardInfo 75, // 71: webapi.RankTypeInfo.Award:type_name -> webapi.RankAwardInfo
76, // 72: webapi.RankTypeConfig.Info:type_name -> webapi.RankTypeInfo 76, // 72: webapi.RankTypeConfig.Info:type_name -> webapi.RankTypeInfo
101, // 73: webapi.SkinLevel.UpItem:type_name -> webapi.SkinLevel.UpItemEntry 102, // 73: webapi.SkinLevel.UpItem:type_name -> webapi.SkinLevel.UpItemEntry
102, // 74: webapi.SkinItem.UnlockParam:type_name -> webapi.SkinItem.UnlockParamEntry 103, // 74: webapi.SkinItem.UnlockParam:type_name -> webapi.SkinItem.UnlockParamEntry
78, // 75: webapi.SkinItem.Levels:type_name -> webapi.SkinLevel 78, // 75: webapi.SkinItem.Levels:type_name -> webapi.SkinLevel
79, // 76: webapi.SkinConfig.Items:type_name -> webapi.SkinItem 79, // 76: webapi.SkinConfig.Items:type_name -> webapi.SkinItem
82, // 77: webapi.AwardLogConfig.AwardLog:type_name -> webapi.AwardLogData 82, // 77: webapi.AwardLogConfig.AwardLog:type_name -> webapi.AwardLogData
@ -10529,11 +10610,12 @@ var file_common_proto_depIdxs = []int32{
87, // 80: webapi.MachineConfig.Info:type_name -> webapi.MachineInfo 87, // 80: webapi.MachineConfig.Info:type_name -> webapi.MachineInfo
32, // 81: webapi.RoomConfig.Cost:type_name -> webapi.ItemInfo 32, // 81: webapi.RoomConfig.Cost:type_name -> webapi.ItemInfo
32, // 82: webapi.RoomConfig.Reward:type_name -> webapi.ItemInfo 32, // 82: webapi.RoomConfig.Reward:type_name -> webapi.ItemInfo
83, // [83:83] is the sub-list for method output_type 32, // 83: webapi.ClientUpgrade.Reward:type_name -> webapi.ItemInfo
83, // [83:83] is the sub-list for method input_type 84, // [84:84] is the sub-list for method output_type
83, // [83:83] is the sub-list for extension type_name 84, // [84:84] is the sub-list for method input_type
83, // [83:83] is the sub-list for extension extendee 84, // [84:84] is the sub-list for extension type_name
0, // [0:83] is the sub-list for field type_name 84, // [84:84] is the sub-list for extension extendee
0, // [0:84] is the sub-list for field type_name
} }
func init() { file_common_proto_init() } func init() { file_common_proto_init() }
@ -11658,6 +11740,18 @@ func file_common_proto_init() {
return nil return nil
} }
} }
file_common_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ClientUpgrade); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -11665,7 +11759,7 @@ func file_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_common_proto_rawDesc, RawDescriptor: file_common_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 103, NumMessages: 104,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -90,7 +90,7 @@ message Platform {
bool IsCanUserBindPromoter = 33; //广 bool IsCanUserBindPromoter = 33; //广
int32 UserBindPromoterPrize = 34; // int32 UserBindPromoterPrize = 34; //
string MerchantKey = 35;// string MerchantKey = 35;//
map<int32,int64> BindTelReward = 36; // id map<int32, int64> BindTelReward = 36; // id
} }
// //
@ -190,7 +190,7 @@ message PlayerData{
int64 PlayerPoolUpper = 41; // int64 PlayerPoolUpper = 41; //
int64 PlayerPoolLower = 42; // int64 PlayerPoolLower = 42; //
int64 PlayerPoolRate = 43; // int64 PlayerPoolRate = 43; //
map<int64,int64> RankScore = 44; // 1 tienlen排位积分 map<int64, int64> RankScore = 44; // 1 tienlen排位积分
int64 RoleAdded = 45;// int64 RoleAdded = 45;//
int64 VipAdded = 46;//VIP加成 int64 VipAdded = 46;//VIP加成
int64 VipExp = 47;//VIP经验 int64 VipExp = 47;//VIP经验
@ -298,7 +298,7 @@ message CoinPoolSetting{
int32 LowerOddsMax = 12; // 线 int32 LowerOddsMax = 12; // 线
int32 ProfitRate = 13;// int32 ProfitRate = 13;//
int64 ResetTime = 14; // int64 ResetTime = 14; //
int32 Switch =15; // 0 1 int32 Switch = 15; // 0 1
int64 CoinValue = 16; // int64 CoinValue = 16; //
int64 ProfitPool = 17; // int64 ProfitPool = 17; //
int32 CtrlRate = 18; // int32 CtrlRate = 18; //
@ -364,8 +364,8 @@ message CommonNotice {
int32 CategoryType = 9; int32 CategoryType = 9;
string ImgUrl = 10; string ImgUrl = 10;
int32 NoticeId = 11; int32 NoticeId = 11;
int32 IsLoop=12; int32 IsLoop = 12;
int32 LoopTime=13; int32 LoopTime = 13;
repeated string OnChannelName = 14; repeated string OnChannelName = 14;
string Url = 15; string Url = 15;
} }
@ -390,15 +390,15 @@ message ExchangeShop {
int32 NotVipDayMaxLimit = 13;//VIP每日限购 int32 NotVipDayMaxLimit = 13;//VIP每日限购
int32 VipShopLimit = 14;//VIP限购总数 int32 VipShopLimit = 14;//VIP限购总数
int32 NotVipShopLimit = 15;//VIP限购总数 int32 NotVipShopLimit = 15;//VIP限购总数
int32 ShopType = 16; // int32 ShopType = 16; //
repeated TelChargeData TelData = 17; repeated TelChargeData TelData = 17;
repeated ItemInfo Items = 18; repeated ItemInfo Items = 18;
} }
message TelChargeData{ message TelChargeData{
int32 Id = 1; int32 Id = 1;
string Name = 2; string Name = 2;
string Url = 3; string Url = 3;
} }
// //
@ -406,7 +406,7 @@ message ExchangeType{
int32 Price = 1; // V卡数量 int32 Price = 1; // V卡数量
int32 JPrice = 2; // int32 JPrice = 2; //
int32 Cash = 3; // int32 Cash = 3; //
int32 DPrice = 4; // int32 DPrice = 4; //
int32 Id = 5; // int32 Id = 5; //
} }
@ -418,11 +418,11 @@ message ExchangeShopList{
} }
message ShopWeight{ message ShopWeight{
int32 ShopType = 1; int32 ShopType = 1;
int32 Weight = 2; int32 Weight = 2;
string Name = 3; string Name = 3;
int32 IsShow = 4; int32 IsShow = 4;
repeated int32 Location = 5; // repeated int32 Location = 5; //
} }
@ -444,8 +444,8 @@ message ItemShop {
int32 Amount = 15; // int32 Amount = 15; //
int32 ConstType = 16; // 1 2 3 4 int32 ConstType = 16; // 1 2 3 4
repeated int32 CostArea = 17; // repeated int32 CostArea = 17; //
map<int64,int64> Award = 18; // map<int64, int64> Award = 18; //
int32 VipLevel =19; //Vip等级限制 int32 VipLevel = 19; //Vip等级限制
int32 Ratio = 20; // int32 Ratio = 20; //
int32 EndTime = 21; // int32 EndTime = 21; //
bool FirstSwitch = 22; // bool FirstSwitch = 22; //
@ -499,7 +499,7 @@ message GameMatchDate {
repeated string OnChannelName = 23; // repeated string OnChannelName = 23; //
int32 CardType = 24; // int32 CardType = 24; //
int32 ShowId = 25; // int32 ShowId = 25; //
int32 AwardNum = 26; // int32 AwardNum = 26; //
int32 AudienceSwitch = 27; // 1 2 int32 AudienceSwitch = 27; // 1 2
} }
@ -624,23 +624,23 @@ message WelfareContinuousPayDataList{
message VIPcfg { message VIPcfg {
int32 VipId = 1; // int32 VipId = 1; //
map<int64,int64> Award = 2; // map<int64, int64> Award = 2; //
int32 VipEx = 3; // VIP经验 int32 VipEx = 3; // VIP经验
int64 Price = 4; // int64 Price = 4; //
map<int64,int64> Privilege1 = 5; //1 VIP比赛场免费次数 map<int64, int64> Privilege1 = 5; //1 VIP比赛场免费次数
repeated int32 Privilege2 = 6; // 0 1 repeated int32 Privilege2 = 6; // 0 1
repeated int32 Privilege3 = 7; repeated int32 Privilege3 = 7;
int32 Privilege4 = 8; int32 Privilege4 = 8;
int32 Privilege5 = 9; int32 Privilege5 = 9;
int32 Privilege6 = 10; int32 Privilege6 = 10;
map<int64,int64> Privilege7 = 11; map<int64, int64> Privilege7 = 11;
int32 Privilege7Price = 12; int32 Privilege7Price = 12;
int32 Privilege8 = 13; int32 Privilege8 = 13;
repeated int32 RewardOutlineID = 14; repeated int32 RewardOutlineID = 14;
int32 ShopId2 = 15; int32 ShopId2 = 15;
int32 ShopId7 = 16; int32 ShopId7 = 16;
int32 MatchFreeTimes = 17; // vip比赛场免费次数 int32 MatchFreeTimes = 17; // vip比赛场免费次数
map<int64,int64> Privilege9 = 18; // vip免费礼包vip等级领取一次 map<int64, int64> Privilege9 = 18; // vip免费礼包vip等级领取一次
} }
// etcd /game/VIPcfg VIP配置 // etcd /game/VIPcfg VIP配置
@ -667,9 +667,9 @@ message EntrySwitch{
} }
message ChessRankConfig { message ChessRankConfig {
string Name = 1; // string Name = 1; //
int32 Score = 2; // int32 Score = 2; //
repeated WelfareDate Item = 3; // repeated WelfareDate Item = 3; //
} }
message ChessRankcfgData{ message ChessRankcfgData{
@ -735,7 +735,7 @@ message ActInviteConfig {
string Platform = 1; string Platform = 1;
int64 BindScore = 2; // int64 BindScore = 2; //
int64 RechargeScore = 3; // int64 RechargeScore = 3; //
map<int64,int64> PayScore = 4; // map<int64, int64> PayScore = 4; //
repeated int64 Rates = 5; // repeated int64 Rates = 5; //
repeated RankAward Awards1 = 6; // repeated RankAward Awards1 = 6; //
repeated RankAward Awards2 = 7; // repeated RankAward Awards2 = 7; //
@ -787,36 +787,36 @@ message ActPermitConfig{
// //
message DiamondLotteryInfo{ message DiamondLotteryInfo{
int32 Id = 1; int32 Id = 1;
int32 Type = 2; int32 Type = 2;
string Name = 3; string Name = 3;
int32 ItemId = 4; int32 ItemId = 4;
int32 Grade = 5; int32 Grade = 5;
int32 Oddrate =6; int32 Oddrate = 6;
} }
// //
message DiamondLotteryPlayers{ message DiamondLotteryPlayers{
int32 uid = 1; int32 uid = 1;
int32 Count = 2; // int32 Count = 2; //
repeated AwardData Award = 3; //ID repeated AwardData Award = 3; //ID
} }
message AwardData{ message AwardData{
int32 AwardId = 1; int32 AwardId = 1;
int32 Weight = 2; int32 Weight = 2;
} }
message DiamondLotteryData{ message DiamondLotteryData{
string Channel = 1; // string Channel = 1; //
repeated DiamondLotteryInfo Info = 2; repeated DiamondLotteryInfo Info = 2;
int32 MaxScore = 3; // int32 MaxScore = 3; //
int32 DiamondNum = 4; // int32 DiamondNum = 4; //
repeated DiamondLotteryPlayers Players = 5;// repeated DiamondLotteryPlayers Players = 5;//
} }
// etcd /game/diamond_lottery // etcd /game/diamond_lottery
message DiamondLotteryConfig{ message DiamondLotteryConfig{
string Platform = 1; // string Platform = 1; //
repeated DiamondLotteryData LotteryData = 2; repeated DiamondLotteryData LotteryData = 2;
} }
// etcd /game/item // etcd /game/item
@ -826,19 +826,19 @@ message ItemConfig {
} }
message RankAwardInfo{ message RankAwardInfo{
int32 Id =1; int32 Id = 1;
int32 RankType =2; int32 RankType = 2;
int32 RankLevelId = 3; int32 RankLevelId = 3;
repeated ItemInfo Item = 4; // repeated ItemInfo Item = 4; //
} }
message RankTypeInfo{ message RankTypeInfo{
int32 Id =1; int32 Id = 1;
int32 Order = 2; int32 Order = 2;
string RankName = 3; string RankName = 3;
int32 RankType = 4; int32 RankType = 4;
int32 TurnOff = 5; // int32 TurnOff = 5; //
repeated RankAwardInfo Award= 6; repeated RankAwardInfo Award = 6;
} }
//etcd /game/RankType //etcd /game/RankType
message RankTypeConfig{ message RankTypeConfig{
@ -847,7 +847,7 @@ message RankTypeConfig{
} }
message SkinLevel { message SkinLevel {
int32 Level = 1; // int32 Level = 1; //
map<int32,int64> UpItem = 2; // map<int32, int64> UpItem = 2; //
int32 SkillId = 3; // id int32 SkillId = 3; // id
int32 SkillLevel = 4; // int32 SkillLevel = 4; //
int32 SkillValue = 5; // int32 SkillValue = 5; //
@ -856,7 +856,7 @@ message SkinLevel {
message SkinItem { message SkinItem {
int32 Id = 1; // id int32 Id = 1; // id
int32 UnlockType = 2; // 0使 1使使 2使 int32 UnlockType = 2; // 0使 1使使 2使
map<int32,int64> UnlockParam = 3; // map<int32, int64> UnlockParam = 3; //
int32 IsUpgrade = 4; // 1 2 int32 IsUpgrade = 4; // 1 2
int32 SkillType = 5; // 0 1穿 int32 SkillType = 5; // 0 1穿
repeated SkinLevel Levels = 6; // repeated SkinLevel Levels = 6; //
@ -864,27 +864,27 @@ message SkinItem {
// etcd /game/skin_config // etcd /game/skin_config
message SkinConfig { message SkinConfig {
string Platform = 1; // string Platform = 1; //
repeated SkinItem Items = 2; // repeated SkinItem Items = 2; //
} }
// etcd /game/awardlog_config // etcd /game/awardlog_config
message AwardLogConfig{ message AwardLogConfig{
string Platform = 1; // string Platform = 1; //
repeated AwardLogData AwardLog =2; repeated AwardLogData AwardLog = 2;
repeated AnnouncerLogInfo AnnouncerLog = 3; repeated AnnouncerLogInfo AnnouncerLog = 3;
} }
message AwardLogData{ message AwardLogData{
int32 TypeId = 1; //1 2 int32 TypeId = 1; //1 2
int32 SortId = 2; // 1- 2- int32 SortId = 2; // 1- 2-
repeated AwardLogInfo AwardLog =3; repeated AwardLogInfo AwardLog = 3;
} }
message AwardLogInfo{ message AwardLogInfo{
int32 ItemId = 2; //ID int32 ItemId = 2; //ID
int64 Num = 4; // int64 Num = 4; //
string Url = 5; //icon string Url = 5; //icon
int32 Order = 6; // int32 Order = 6; //
} }
// //
@ -893,7 +893,7 @@ message AnnouncerLogInfo{
string Name = 2; // string Name = 2; //
string Phone = 3; // string Phone = 3; //
int32 ItemId = 4; //ID int32 ItemId = 4; //ID
int32 TypeId = 5; //1- 2- int32 TypeId = 5; //1- 2-
} }
// etcd /game/guide_config // etcd /game/guide_config
@ -906,17 +906,17 @@ message GuideConfig {
// //
// etcd /game/machine_config // etcd /game/machine_config
message MachineConfig{ message MachineConfig{
string Platform = 1; // string Platform = 1; //
repeated MachineInfo Info = 2; repeated MachineInfo Info = 2;
} }
message MachineInfo{ message MachineInfo{
int32 MachineId = 1; //Id int32 MachineId = 1; //Id
int64 AppId = 2; int64 AppId = 2;
string ServerSecret = 3; string ServerSecret = 3;
string StreamId = 4; string StreamId = 4;
int32 CostItemNum = 5; // int32 CostItemNum = 5; //
int32 ItemId = 6; //Id int32 ItemId = 6; //Id
int32 ItemNum = 7; // int32 ItemNum = 7; //
string IconAddr = 8;// string IconAddr = 8;//
string Name = 9;// string Name = 9;//
} }
@ -979,4 +979,12 @@ message RoomConfigSystem{
int32 AutoCreate = 12; // 1 2 int32 AutoCreate = 12; // 1 2
int32 AutoCreateTime = 13; // int32 AutoCreateTime = 13; //
int32 On = 14; // 1 2 int32 On = 14; // 1 2
}
// etcd /game/client_upgrade
message ClientUpgrade{
string Platform = 1; //
int32 On = 2; // 1 2
int32 OnForce = 3; // 1 2
repeated ItemInfo Reward = 4; //
} }

View File

@ -280,7 +280,10 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
if acceptPlayer != nil { if acceptPlayer != nil {
logger.Logger.Trace("道具赠送成功", msg.ItemId) logger.Logger.Trace("道具赠送成功", msg.ItemId)
remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId) remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId)
BagMgrSingleton.AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []int32{msg.ItemId, msg.ItemNum}) AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []*model.Item{{
ItemId: msg.GetItemId(),
ItemNum: int64(msg.GetItemNum()),
}})
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform, Platform: p.Platform,
SnId: p.SnId, SnId: p.SnId,
@ -305,7 +308,10 @@ func CSUpBagInfo(s *netlib.Session, packetid int, data interface{}, sid int64) e
if data != nil && aPlayer != nil { if data != nil && aPlayer != nil {
logger.Logger.Trace("道具赠送成功", msg.ItemId) logger.Logger.Trace("道具赠送成功", msg.ItemId)
remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId) remark := fmt.Sprintf("赠送给玩家(%v)", msg.AcceptSnId)
BagMgrSingleton.AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []int32{msg.ItemId, msg.ItemNum}) AddMailByItem(p.Platform, p.SnId, p.Name, msg.AcceptSnId, msg.ShowId, []*model.Item{{
ItemId: msg.GetItemId(),
ItemNum: int64(msg.GetItemNum()),
}})
BagMgrSingleton.AddItems(&model.AddItemParam{ BagMgrSingleton.AddItems(&model.AddItemParam{
Platform: p.Platform, Platform: p.Platform,
SnId: p.SnId, SnId: p.SnId,

View File

@ -10,6 +10,7 @@ import (
"math/rand" "math/rand"
"net/url" "net/url"
"regexp" "regexp"
"slices"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -84,7 +85,7 @@ func (this *CSInviteCodePlayerHandler) Process(s *netlib.Session, packetid int,
} }
//发送邮件 //发送邮件
var otherParams []int32 var otherParams []int64
newMsg := model.NewMessage("", p.SnId, "", p.SnId, model.MSGTYPE_INVITECODE, p.Name, inviteCode, coin, 0, newMsg := model.NewMessage("", p.SnId, "", p.SnId, model.MSGTYPE_INVITECODE, p.Name, inviteCode, coin, 0,
model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", otherParams, p.Platform, model.HallAll, nil) model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", otherParams, p.Platform, model.HallAll, nil)
err = model.InsertMessage(p.Platform, newMsg) err = model.InsertMessage(p.Platform, newMsg)
@ -1983,11 +1984,15 @@ func CSPlayerData(s *netlib.Session, packetid int, data interface{}, sid int64)
} }
// 老版本升级 // 老版本升级
if p.ClientVer < model.GameParamData.ClientVersion { clientUpgradeConfig := PlatformMgrSingleton.GetConfig(p.Platform).ClientUpgrade
if cspl.GetClientVer() == model.GameParamData.ClientVersion { if clientUpgradeConfig != nil && clientUpgradeConfig.GetOn() == common.On &&
// 升级了 (len(model.GameParamData.ClientVersionChannel) == 0 || slices.Contains(model.GameParamData.ClientVersionChannel, p.LastChannel)) {
p.ClientVer = model.GameParamData.ClientVersion if p.ClientVer < model.GameParamData.ClientVersion {
//todo 发奖 if cspl.GetClientVer() == model.GameParamData.ClientVersion {
// 升级了
p.ClientVer = model.GameParamData.ClientVersion
AddMailClientUpgrade(p.SnId, clientUpgradeConfig.GetReward())
}
} }
} }
} }

View File

@ -14,6 +14,7 @@ import (
"mongo.games.com/game/model" "mongo.games.com/game/model"
"mongo.games.com/game/mq" "mongo.games.com/game/mq"
"mongo.games.com/game/proto" "mongo.games.com/game/proto"
"mongo.games.com/game/protocol/upgrade"
webapiproto "mongo.games.com/game/protocol/webapi" webapiproto "mongo.games.com/game/protocol/webapi"
"mongo.games.com/game/protocol/welfare" "mongo.games.com/game/protocol/welfare"
"mongo.games.com/game/srvdata" "mongo.games.com/game/srvdata"
@ -1309,6 +1310,39 @@ func (this *CSDiamondBankTakeDiamondHandler) Process(s *netlib.Session, packetid
return nil return nil
}*/ }*/
func CSClientUpgrades(s *netlib.Session, packetid int, data interface{}, sid int64) error {
logger.Logger.Tracef("CSClientUpgrades Process recv %v", data)
_, ok := data.(*upgrade.CSClientUpgrades)
if !ok {
return nil
}
p := PlayerMgrSington.GetPlayer(sid)
if p == nil {
return nil
}
cfg := PlatformMgrSingleton.GetConfig(p.Platform).ClientUpgrade
if cfg == nil {
return nil
}
pack := &upgrade.SCClientUpgrades{
On: cfg.GetOn() == common.On,
OnForce: cfg.GetOnForce() == common.On,
Version: model.GameParamData.ClientVersion,
}
for _, v := range cfg.GetReward() {
pack.Award = append(pack.Award, &upgrade.PropInfo{
ItemId: v.GetItemId(),
ItemNum: v.GetItemNum(),
})
}
p.SendToClient(int(upgrade.PacketID_PACKET_SCClientUpgrades), pack)
logger.Logger.Tracef("SCClientUpgrades: %v", pack)
return nil
}
func init() { func init() {
// 领取救济金 // 领取救济金
common.RegisterHandler(int(welfare.SPacketID_PACKET_CS_WELF_GETRELIEFFUND), &CSGetReliefFundHandler{}) common.RegisterHandler(int(welfare.SPacketID_PACKET_CS_WELF_GETRELIEFFUND), &CSGetReliefFundHandler{})
@ -1374,4 +1408,6 @@ func init() {
common.Register(int(welfare.SPacketID_PACKET_CSPermitExchange), welfare.CSPermitExchange{}, CSPermitExchange) common.Register(int(welfare.SPacketID_PACKET_CSPermitExchange), welfare.CSPermitExchange{}, CSPermitExchange)
// 赛季典藏通行证商品信息 // 赛季典藏通行证商品信息
common.Register(int(welfare.SPacketID_PACKET_CSPermitShop), welfare.CSPermitShop{}, CSPermitShop) common.Register(int(welfare.SPacketID_PACKET_CSPermitShop), welfare.CSPermitShop{}, CSPermitShop)
// 客户端升级奖励信息
common.Register(int(upgrade.PacketID_PACKET_CSClientUpgrades), upgrade.CSClientUpgrades{}, CSClientUpgrades)
} }

127
worldsrv/addmail.go Normal file
View File

@ -0,0 +1,127 @@
package main
import (
"mongo.games.com/game/protocol/webapi"
"time"
"github.com/globalsign/mgo/bson"
"mongo.games.com/goserver/core/basic"
"mongo.games.com/goserver/core/i18n"
"mongo.games.com/goserver/core/logger"
"mongo.games.com/goserver/core/task"
"mongo.games.com/game/model"
)
type AddMailParam struct {
Platform string // 平台
Tp int32 // 邮件类型
SrcId int32 // 发送人
SrcName string // 发送人名字
SnId int32 // 收件人玩家id
Title string // 标题
Content string // 内容
Items []*model.Item // 道具
ShowId int64 // 显示位置
Channel []string // 包渠道
}
func AddMail(param *AddMailParam) {
logger.Logger.Tracef("AddMail %+v", *param)
if param.SnId <= 0 || param.Title == "" || param.Content == "" {
return
}
p := PlayerMgrSington.GetPlayerBySnId(param.SnId)
if p != nil {
param.Platform = p.Platform
}
if param.Platform == "" {
return
}
opener := int32(1)
if param.SrcId <= 0 {
opener = 0
}
var params []int64
for _, v := range param.Items {
params = append(params, int64(v.ItemId))
params = append(params, v.ItemNum)
}
var msg *model.Message
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
msg = &model.Message{
Id: bson.NewObjectId(),
MType: param.Tp,
Title: param.Title,
Content: param.Content,
Oper: opener,
SrcId: param.SrcId,
SrcName: param.SrcName,
SnId: param.SnId,
State: model.MSGSTATE_UNREAD,
CreatTs: time.Now().Unix(),
AttachState: model.MSGATTACHSTATE_DEFAULT,
Params: params,
Platform: param.Platform,
ShowId: param.ShowId,
Channel: param.Channel,
}
if msg.Pid == "" {
msg.Pid = msg.Id.Hex()
}
return model.InsertMessage(param.Platform, msg)
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
if data == nil {
if p := PlayerMgrSington.GetPlayerBySnId(param.SnId); p != nil {
p.AddMessage(msg)
}
} else {
logger.Logger.Errorf("AddMail Error %v", data)
}
}), "AddMail").Start()
}
// AddMailByItem 赠送道具到邮件
// srcId 发送人 srcName发送人名字
// showId 显示位置
func AddMailByItem(platform string, srcId int32, srcName string, snid int32, showId int64, items []*model.Item) {
content := i18n.Tr("languages", "GiftMail", srcName, srcName, srcName, srcName)
title := i18n.Tr("languages", "GiftMailTitle")
AddMail(&AddMailParam{
Platform: platform,
Tp: model.MSGTYPE_ITEM,
SrcId: srcId,
SrcName: srcName,
SnId: snid,
Title: title,
Content: content,
Items: items,
ShowId: showId,
})
}
func AddMailClientUpgrade(snid int32, items []*webapi.ItemInfo) {
var arr []*model.Item
for _, v := range items {
arr = append(arr, &model.Item{
ItemId: v.ItemId,
ItemNum: v.ItemNum,
})
}
content := i18n.Tr("languages", "UpgradeTitle")
title := i18n.Tr("languages", "Upgrade")
AddMail(&AddMailParam{
Tp: model.MSGTYPE_ITEM,
SnId: snid,
Title: title,
Content: content,
Items: arr,
})
}

View File

@ -806,29 +806,6 @@ func (this *BagMgr) AddItemsOffline(param *model.AddItemParam, callback func(err
})).StartByExecutor(fmt.Sprintf("Player%v", param.SnId)) })).StartByExecutor(fmt.Sprintf("Player%v", param.SnId))
} }
// AddMailByItem 赠送道具到邮件
// srcId 发送人 srcName发送人名字
// showId 显示位置
// items[0]:道具id items[1]:道具数量 items[2]:道具id items[3]:道具数量
func (this *BagMgr) AddMailByItem(platform string, srcId int32, srcName string, snid int32, showId int64, items []int32) {
logger.Logger.Trace("AddMailByItem:", srcId, srcName, items)
var newMsg *model.Message
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
content := i18n.Tr("languages", "GiftMail", srcName, srcName, srcName, srcName)
title := i18n.Tr("languages", "GiftMailTitle")
newMsg = model.NewMessageByPlayer("", 1, srcId, srcName, snid, model.MSGTYPE_ITEM, title, content,
0, 0, model.MSGSTATE_UNREAD, time.Now().Unix(), 0, "", items, platform, showId)
return model.InsertMessage(platform, newMsg)
}), task.CompleteNotifyWrapper(func(data interface{}, t task.Task) {
if data == nil {
p := PlayerMgrSington.GetPlayerBySnId(snid)
if p != nil {
p.AddMessage(newMsg)
}
}
}), "AddMailByItem").Start()
}
// VerifyUpJybInfo 兑换礼包 // VerifyUpJybInfo 兑换礼包
func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs) { func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs) {

View File

@ -100,6 +100,8 @@ func init() {
etcd.Register(etcd.ETCDKEY_RoomType, webapi.RoomType{}, handlerEvent) etcd.Register(etcd.ETCDKEY_RoomType, webapi.RoomType{}, handlerEvent)
//娃娃机配置 //娃娃机配置
etcd.Register(etcd.ETCDKEY_MACHINE, webapi.MachineConfig{}, platformConfigEvent) etcd.Register(etcd.ETCDKEY_MACHINE, webapi.MachineConfig{}, platformConfigEvent)
//客户端升级奖励配置
etcd.Register(etcd.ETCDKEY_ClientUpgrade, webapi.ClientUpgrade{}, platformConfigEvent)
} }
func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {
@ -334,9 +336,26 @@ func platformConfigEvent(ctx context.Context, completeKey string, isInit bool, e
if !isInit { if !isInit {
PlayerMgrSington.BroadcastDataConfigToPlatform(config.Platform, common.DataConfigSprite) PlayerMgrSington.BroadcastDataConfigToPlatform(config.Platform, common.DataConfigSprite)
} }
case *webapi.ClientUpgrade:
PlatformMgrSingleton.GetConfig(config.Platform).ClientUpgrade = config
default: default:
logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey) logger.Logger.Errorf("etcd completeKey:%s, Not processed", completeKey)
} }
PlatformMgrSingleton.GetConfig("1").ClientUpgrade = &webapi.ClientUpgrade{
Platform: "1",
On: 1,
OnForce: 0,
Reward: []*webapi.ItemInfo{
{
ItemId: 100001,
ItemNum: 100,
},
{
ItemId: 100002,
ItemNum: 100,
},
},
}
} }
func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) { func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *clientv3.Event, data interface{}) {

View File

@ -92,14 +92,14 @@ func (r *PermitMgr) OnDayTimer() {
rank := k + 1 rank := k + 1
for _, rankInfo := range cfg { for _, rankInfo := range cfg {
var has bool var has bool
var items []int32 var items []int64
for r := rankInfo.GetStart(); r <= rankInfo.GetEnd(); r++ { for r := rankInfo.GetStart(); r <= rankInfo.GetEnd(); r++ {
if rank == int(r) { if rank == int(r) {
has = true has = true
var awards []model.AwardItem var awards []model.AwardItem
for _, item := range rankInfo.GetItemId() { for _, item := range rankInfo.GetItemId() {
items = append(items, item.GetItemId()) items = append(items, int64(item.GetItemId()))
items = append(items, int32(item.GetItemNum())) items = append(items, item.GetItemNum())
awards = append(awards, model.AwardItem{ awards = append(awards, model.AwardItem{
Id: item.GetItemId(), Id: item.GetItemId(),
Num: item.GetItemNum(), Num: item.GetItemNum(),

View File

@ -358,7 +358,7 @@ func (this *Player) OnLogined() {
} }
mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeLogin, this.Tel, this.Ip, mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeLogin, this.Tel, this.Ip,
this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(), 0, 0, this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(), 0, 0,
this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId)) this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId, this.ClientVer))
this.OnlineLogLogin() this.OnlineLogLogin()
@ -431,7 +431,7 @@ func (this *Player) OnRehold() {
} }
mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeRehold, this.Tel, this.Ip, mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeRehold, this.Tel, this.Ip,
this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(), this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(),
gameid, 0, this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId)) gameid, 0, this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId, this.ClientVer))
this.OnlineLogRehold() this.OnlineLogRehold()
} }
@ -683,7 +683,7 @@ func (this *Player) SendMessage(showId int64) {
Grade: proto.Int64(msg.Grade), Grade: proto.Int64(msg.Grade),
State: proto.Int32(msg.State), State: proto.Int32(msg.State),
Ts: proto.Int32(int32(msg.CreatTs)), Ts: proto.Int32(int32(msg.CreatTs)),
Params: msg.Params, Params: common.CopySliceInt64ToInt32(msg.Params), //todo 修改协议
AttachState: proto.Int32(msg.AttachState), AttachState: proto.Int32(msg.AttachState),
GiftId: proto.String(msg.GiftId), GiftId: proto.String(msg.GiftId),
GiftState: proto.Int32(giftState), GiftState: proto.Int32(giftState),
@ -1039,7 +1039,7 @@ func (this *Player) TestMail() {
var newMsg *model.Message var newMsg *model.Message
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
var otherParams []int32 var otherParams []int64
otherParams = append(otherParams, 10001, 3) otherParams = append(otherParams, 10001, 3)
otherParams = append(otherParams, 20001, 3) otherParams = append(otherParams, 20001, 3)
otherParams = append(otherParams, 20002, 3) otherParams = append(otherParams, 20002, 3)
@ -1059,7 +1059,7 @@ func (this *Player) TestSubMail() {
var newMsg *model.Message var newMsg *model.Message
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
var otherParams []int32 var otherParams []int64
otherParams = append(otherParams, 10001, 3) otherParams = append(otherParams, 10001, 3)
otherParams = append(otherParams, 20001, 3) otherParams = append(otherParams, 20001, 3)
otherParams = append(otherParams, 20002, 3) otherParams = append(otherParams, 20002, 3)
@ -1106,8 +1106,8 @@ func (this *Player) GetMessageAttach(id string) {
if num := len(msg.Params); num > 0 && num%2 == 0 { if num := len(msg.Params); num > 0 && num%2 == 0 {
for i := 0; i < num; i += 2 { for i := 0; i < num; i += 2 {
items = append(items, &model.Item{ items = append(items, &model.Item{
ItemId: msg.Params[i], // 物品id ItemId: int32(msg.Params[i]), // 物品id
ItemNum: int64(msg.Params[i+1]), // 数量 ItemNum: msg.Params[i+1], // 数量
ObtainTime: time.Now().Unix(), ObtainTime: time.Now().Unix(),
}) })
if gainWay == common.GainWayItemPermitRank { if gainWay == common.GainWayItemPermitRank {
@ -1119,7 +1119,7 @@ func (this *Player) GetMessageAttach(id string) {
} }
if tp != -1 { if tp != -1 {
mq.Write(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel, mq.Write(model.GenerateSystemFreeGive(this.SnId, this.Name, this.Platform, this.Channel,
model.SystemFreeGive_GiveType_TaskPermitRank, tp, int64(msg.Params[i+1]))) model.SystemFreeGive_GiveType_TaskPermitRank, tp, msg.Params[i+1]))
} }
} }
} }
@ -1283,7 +1283,7 @@ func (this *Player) DropLine() {
} }
mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeDrop, this.Tel, this.Ip, mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeDrop, this.Tel, this.Ip,
this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(), this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(),
gameid, this.LastGameId, this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId)) gameid, this.LastGameId, this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId, this.ClientVer))
this.SendPlayerCoin() this.SendPlayerCoin()
this.OnlineLogDrop() this.OnlineLogDrop()
@ -1408,7 +1408,7 @@ func (this *Player) OnLogouted() {
if !this.IsRob { if !this.IsRob {
mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeLogout, this.Tel, this.Ip, mq.Write(model.NewLoginLog(this.SnId, common.LoginLogTypeLogout, this.Tel, this.Ip,
this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(), this.Platform, this.Channel, this.BeUnderAgentCode, this.PackageID, this.City, clog, this.GetTotalCoin(),
0, 0, this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId)) 0, 0, this.DeviceName, this.PackageName, this.AppVersion, this.BuildVersion, this.AppChannel, this.ChannelId, this.ClientVer))
this.OnlineLogLogout() this.OnlineLogLogout()
} }

View File

@ -61,7 +61,7 @@ func (this *PlayerRankSeason) sendEmailAward(rankType int32) {
var coin int64 var coin int64
var diamond int64 var diamond int64
var otherParams []int32 var otherParams []int64
for _, v := range item.Awards { for _, v := range item.Awards {
switch v.Id { switch v.Id {
case 1: // 金币 case 1: // 金币
@ -70,7 +70,7 @@ func (this *PlayerRankSeason) sendEmailAward(rankType int32) {
diamond = int64(v.Num) diamond = int64(v.Num)
default: default:
// 道具 // 道具
otherParams = []int32{v.Id, v.Num} otherParams = []int64{int64(v.Id), int64(v.Num)}
} }
} }
@ -767,12 +767,12 @@ func (r *RankMatchMgr) RankAward() {
logger.Logger.Errorf("RankMatchMgr OnDayTimer FindPlayerPermitList player is nil %v", list.List[k].SnId) logger.Logger.Errorf("RankMatchMgr OnDayTimer FindPlayerPermitList player is nil %v", list.List[k].SnId)
continue continue
} }
var items []int32 var items []int64
for _, award := range rankAward { for _, award := range rankAward {
if award.RankLevelId == rankId { if award.RankLevelId == rankId {
for _, itemInfo := range award.Item { for _, itemInfo := range award.Item {
items = append(items, itemInfo.ItemId) items = append(items, int64(itemInfo.ItemId))
items = append(items, int32(itemInfo.ItemNum)) items = append(items, itemInfo.ItemNum)
} }
break break
} }
@ -839,12 +839,12 @@ func (r *RankMatchMgr) RankAward() {
logger.Logger.Errorf("RankMatchMgr OnDayTimer FindWinCoinListTienlen player is nil %v", ret.List[k].SnId) logger.Logger.Errorf("RankMatchMgr OnDayTimer FindWinCoinListTienlen player is nil %v", ret.List[k].SnId)
continue continue
} }
var items []int32 var items []int64
for _, award := range rankAward { for _, award := range rankAward {
if award.RankLevelId == rankId { if award.RankLevelId == rankId {
for _, itemInfo := range award.Item { for _, itemInfo := range award.Item {
items = append(items, itemInfo.ItemId) items = append(items, int64(itemInfo.ItemId))
items = append(items, int32(itemInfo.ItemNum)) items = append(items, itemInfo.ItemNum)
} }
break break
} }

View File

@ -1439,7 +1439,7 @@ func init() {
// var otherParams []int32 // var otherParams []int32
newMsg = model.NewMessage("", int32(srcSnid), "", int32(destSnid), int32(messageType), title, content, coin, diamond, newMsg = model.NewMessage("", int32(srcSnid), "", int32(destSnid), int32(messageType), title, content, coin, diamond,
model.MSGSTATE_UNREAD, time.Now().Unix(), model.MSGATTACHSTATE_DEFAULT, "", otherParams, platform, showId, channel) model.MSGSTATE_UNREAD, time.Now().Unix(), model.MSGATTACHSTATE_DEFAULT, "", common.CopySliceInt32ToInt64(otherParams), platform, showId, channel)
if newMsg != nil { if newMsg != nil {
err := model.InsertMessage(platform, newMsg) err := model.InsertMessage(platform, newMsg)
if err != nil { if err != nil {
@ -1452,7 +1452,7 @@ func init() {
if destSnid == 0 { if destSnid == 0 {
for _, psnid := range onlinePlayerSnid { for _, psnid := range onlinePlayerSnid {
newMsg := model.NewMessage(newMsg.Id.Hex(), newMsg.SrcId, "", psnid, newMsg.MType, newMsg.Title, newMsg.Content, newMsg.Coin, newMsg.Diamond, newMsg := model.NewMessage(newMsg.Id.Hex(), newMsg.SrcId, "", psnid, newMsg.MType, newMsg.Title, newMsg.Content, newMsg.Coin, newMsg.Diamond,
newMsg.State, newMsg.CreatTs, newMsg.AttachState, newMsg.GiftId, otherParams, platform, newMsg.ShowId, channel) newMsg.State, newMsg.CreatTs, newMsg.AttachState, newMsg.GiftId, common.CopySliceInt32ToInt64(otherParams), platform, newMsg.ShowId, channel)
if newMsg != nil { if newMsg != nil {
dbMsgs = append(dbMsgs, newMsg) dbMsgs = append(dbMsgs, newMsg)
} }