保存玩家最后一次包渠道
This commit is contained in:
parent
2cbd5d46a0
commit
bc77fe8749
|
@ -164,7 +164,6 @@ func init() {
|
||||||
|
|
||||||
p.LastSyncCoin = p.Coin
|
p.LastSyncCoin = p.Coin
|
||||||
p.IsQM = IsQM
|
p.IsQM = IsQM
|
||||||
p.AppChannel = msg.GetAppChannel()
|
|
||||||
|
|
||||||
if sid == 0 && (scene != nil && !scene.IsMatchScene()) {
|
if sid == 0 && (scene != nil && !scene.IsMatchScene()) {
|
||||||
logger.Logger.Warnf("when WGPlayerEnter (sid == 0)")
|
logger.Logger.Warnf("when WGPlayerEnter (sid == 0)")
|
||||||
|
@ -308,7 +307,6 @@ func init() {
|
||||||
p.SetTakeCoin(msg.GetTakeCoin())
|
p.SetTakeCoin(msg.GetTakeCoin())
|
||||||
p.LastSyncCoin = p.Coin
|
p.LastSyncCoin = p.Coin
|
||||||
p.IsQM = IsQM
|
p.IsQM = IsQM
|
||||||
p.AppChannel = msg.GetAppChannel()
|
|
||||||
if scene != nil {
|
if scene != nil {
|
||||||
scene.AudienceEnter(p, isload)
|
scene.AudienceEnter(p, isload)
|
||||||
if !p.IsRobot() && !scene.Testing {
|
if !p.IsRobot() && !scene.Testing {
|
||||||
|
|
|
@ -118,7 +118,6 @@ type Player struct {
|
||||||
MatchRobotGrades []MatchRobotGrade
|
MatchRobotGrades []MatchRobotGrade
|
||||||
TestLog []string // 调试日志
|
TestLog []string // 调试日志
|
||||||
RankScore map[int32]int64 // 段位积分
|
RankScore map[int32]int64 // 段位积分
|
||||||
AppChannel string // app渠道(玩家本次登录使用的包的渠道类型,换登录包,这个值也会变;玩家model.PlayerData存储的渠道是玩家第一次登录的渠道,不会修改)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type MatchRobotGrade struct {
|
type MatchRobotGrade struct {
|
||||||
|
|
|
@ -2128,7 +2128,7 @@ func (this *Scene) TryBillExGameDrop(p *Player) {
|
||||||
|
|
||||||
// 渠道开关
|
// 渠道开关
|
||||||
conf := ConfigMgrInst.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDropItem]
|
conf := ConfigMgrInst.GetConfig(p.Platform).ChannelSwitch[common.ChannelSwitchDropItem]
|
||||||
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.AppChannel)) {
|
if !model.GameParamData.CloseChannelSwitch && (conf == nil || !common.InSliceString(conf.OnChannelName, p.LastChannel)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -458,6 +458,7 @@ type PlayerData struct {
|
||||||
ItemRecExpireTime int64 // 记牌器到期时间
|
ItemRecExpireTime int64 // 记牌器到期时间
|
||||||
RequestAddFriend map[int32]int64 // 玩家申请好友记录
|
RequestAddFriend map[int32]int64 // 玩家申请好友记录
|
||||||
IsTakeExpireItem bool // 是否领取
|
IsTakeExpireItem bool // 是否领取
|
||||||
|
LastChannel string // 最后包类型
|
||||||
}
|
}
|
||||||
|
|
||||||
// 七日签到数据
|
// 七日签到数据
|
||||||
|
@ -651,6 +652,7 @@ func ConvertPlayerDataToWebData(param *WebPlayerDataParam) *webapi.PlayerData {
|
||||||
pdfw.InviteSnId = param.InviteSnId
|
pdfw.InviteSnId = param.InviteSnId
|
||||||
pdfw.InviteScore = param.InviteScore
|
pdfw.InviteScore = param.InviteScore
|
||||||
pdfw.Channel = param.Channel
|
pdfw.Channel = param.Channel
|
||||||
|
pdfw.LastChannel = param.LastChannel
|
||||||
return pdfw
|
return pdfw
|
||||||
}
|
}
|
||||||
func (this *PlayerData) IsMarkFlag(flag int) bool {
|
func (this *PlayerData) IsMarkFlag(flag int) bool {
|
||||||
|
|
|
@ -1307,7 +1307,6 @@ type WGPlayerEnter struct {
|
||||||
Items map[int32]int64 `protobuf:"bytes,17,rep,name=Items,proto3" json:"Items,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
Items map[int32]int64 `protobuf:"bytes,17,rep,name=Items,proto3" json:"Items,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||||
MatchParams []int32 `protobuf:"varint,18,rep,packed,name=MatchParams,proto3" json:"MatchParams,omitempty"` //比赛参数
|
MatchParams []int32 `protobuf:"varint,18,rep,packed,name=MatchParams,proto3" json:"MatchParams,omitempty"` //比赛参数
|
||||||
RankScore map[int32]int64 `protobuf:"bytes,19,rep,name=RankScore,proto3" json:"RankScore,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 排位积分
|
RankScore map[int32]int64 `protobuf:"bytes,19,rep,name=RankScore,proto3" json:"RankScore,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 排位积分
|
||||||
AppChannel string `protobuf:"bytes,20,opt,name=AppChannel,proto3" json:"AppChannel,omitempty"` // 包渠道
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WGPlayerEnter) Reset() {
|
func (x *WGPlayerEnter) Reset() {
|
||||||
|
@ -1475,13 +1474,6 @@ func (x *WGPlayerEnter) GetRankScore() map[int32]int64 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *WGPlayerEnter) GetAppChannel() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.AppChannel
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
//从观众席坐到座位
|
//从观众席坐到座位
|
||||||
//PACKET_WG_AUDIENCESIT
|
//PACKET_WG_AUDIENCESIT
|
||||||
type WGAudienceSit struct {
|
type WGAudienceSit struct {
|
||||||
|
@ -8778,7 +8770,7 @@ var file_server_proto_rawDesc = []byte{
|
||||||
0x52, 0x0c, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x24,
|
0x52, 0x0c, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x12, 0x24,
|
||||||
0x0a, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x66, 0x67, 0x18,
|
0x0a, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d, 0x65, 0x43, 0x66, 0x67, 0x18,
|
||||||
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d,
|
0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x52, 0x65, 0x62, 0x61, 0x74, 0x65, 0x47, 0x61, 0x6d,
|
||||||
0x65, 0x43, 0x66, 0x67, 0x22, 0xc3, 0x06, 0x0a, 0x0d, 0x57, 0x47, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
0x65, 0x43, 0x66, 0x67, 0x22, 0xa3, 0x06, 0x0a, 0x0d, 0x57, 0x47, 0x50, 0x6c, 0x61, 0x79, 0x65,
|
||||||
0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x69, 0x64, 0x18, 0x01, 0x20,
|
0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x53, 0x69, 0x64, 0x18, 0x01, 0x20,
|
||||||
0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65,
|
0x01, 0x28, 0x03, 0x52, 0x03, 0x53, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65,
|
||||||
0x53, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x47, 0x61, 0x74, 0x65, 0x53,
|
0x53, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x47, 0x61, 0x74, 0x65, 0x53,
|
||||||
|
@ -8821,9 +8813,7 @@ var file_server_proto_rawDesc = []byte{
|
||||||
0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x57, 0x47, 0x50, 0x6c, 0x61,
|
0x0b, 0x32, 0x24, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x57, 0x47, 0x50, 0x6c, 0x61,
|
||||||
0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f,
|
0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f,
|
||||||
0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f,
|
0x72, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x52, 0x61, 0x6e, 0x6b, 0x53, 0x63, 0x6f,
|
||||||
0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x41, 0x70, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
0x72, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
||||||
0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x41, 0x70, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x6e,
|
|
||||||
0x65, 0x6c, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
|
|
||||||
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
|
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b,
|
||||||
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e,
|
0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e,
|
||||||
|
|
|
@ -229,7 +229,6 @@ message WGPlayerEnter {
|
||||||
map<int32, int64> Items = 17;
|
map<int32, int64> Items = 17;
|
||||||
repeated int32 MatchParams = 18;//比赛参数
|
repeated int32 MatchParams = 18;//比赛参数
|
||||||
map<int32, int64> RankScore = 19;// 排位积分
|
map<int32, int64> RankScore = 19;// 排位积分
|
||||||
string AppChannel = 20; // 包渠道
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//从观众席坐到座位
|
//从观众席坐到座位
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -199,7 +199,8 @@ message PlayerData{
|
||||||
string InviteCode = 50;//邀请码
|
string InviteCode = 50;//邀请码
|
||||||
int32 InviteSnId = 51;//邀请人
|
int32 InviteSnId = 51;//邀请人
|
||||||
int64 InviteScore = 52;//邀请积分
|
int64 InviteScore = 52;//邀请积分
|
||||||
string Channel = 53; // 渠道名称
|
string Channel = 53; // 首次安装渠道
|
||||||
|
string LastChannel = 54; // 最近使用的包渠道
|
||||||
}
|
}
|
||||||
|
|
||||||
message RoomInfo{
|
message RoomInfo{
|
||||||
|
|
|
@ -1920,6 +1920,7 @@ func CSPlayerData(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
p.AppVersion = msg.GetAppVersion()
|
p.AppVersion = msg.GetAppVersion()
|
||||||
p.BuildVersion = msg.GetBuildVersion()
|
p.BuildVersion = msg.GetBuildVersion()
|
||||||
p.AppChannel = msg.GetAppChannel()
|
p.AppChannel = msg.GetAppChannel()
|
||||||
|
p.LastChannel = p.AppChannel
|
||||||
if (p.Channel == "" || p.Channel == "0") && p.Channel != msg.AppChannel {
|
if (p.Channel == "" || p.Channel == "0") && p.Channel != msg.AppChannel {
|
||||||
p.Channel = msg.AppChannel
|
p.Channel = msg.AppChannel
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,6 @@ func (this *Scene) PlayerEnter(p *Player, pos int, ischangeroom bool) bool {
|
||||||
IParams: p.MarshalIParam(),
|
IParams: p.MarshalIParam(),
|
||||||
SParams: p.MarshalSParam(),
|
SParams: p.MarshalSParam(),
|
||||||
CParams: p.MarshalCParam(),
|
CParams: p.MarshalCParam(),
|
||||||
AppChannel: p.AppChannel,
|
|
||||||
}
|
}
|
||||||
//sa, err2 := p.MarshalSingleAdjustData(this.dbGameFree.Id)
|
//sa, err2 := p.MarshalSingleAdjustData(this.dbGameFree.Id)
|
||||||
//if err2 == nil && sa != nil {
|
//if err2 == nil && sa != nil {
|
||||||
|
@ -694,7 +693,6 @@ func (this *Scene) AudienceEnter(p *Player, ischangeroom bool) bool {
|
||||||
IParams: p.MarshalIParam(),
|
IParams: p.MarshalIParam(),
|
||||||
SParams: p.MarshalSParam(),
|
SParams: p.MarshalSParam(),
|
||||||
CParams: p.MarshalCParam(),
|
CParams: p.MarshalCParam(),
|
||||||
AppChannel: p.AppChannel,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !p.IsRob { //保存下进入时的环境
|
if !p.IsRob { //保存下进入时的环境
|
||||||
|
|
Loading…
Reference in New Issue