Compare commits

..

No commits in common. "78feeb2595aed9d31338d8a5278fd6829466c796" and "0ccfff81de0fddc58011651e95e5a2f745bf6b27" have entirely different histories.

9 changed files with 716 additions and 451 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1365,6 +1365,24 @@ message DB_PlayerExpArray {
repeated DB_PlayerExp Arr = 1; repeated DB_PlayerExp Arr = 1;
} }
message DB_PlayerInfo {
string City = 1;
int32 Head = 2;
string Name = 3;
int32 Sex = 4;
int32 Id = 5;
}
message DB_PlayerInfoArray {
repeated DB_PlayerInfo Arr = 1;
}
message DB_PlayerType { message DB_PlayerType {
int32 Id = 1; int32 Id = 1;

77
srvdata/db_playerinfo.go Normal file
View File

@ -0,0 +1,77 @@
// Code generated by xlsx2proto.
// DO NOT EDIT!
package srvdata
import (
"google.golang.org/protobuf/proto"
"mongo.games.com/game/protocol/server"
)
var PBDB_PlayerInfoMgr = &DB_PlayerInfoMgr{
Datas: &server.DB_PlayerInfoArray{},
pool: make(map[int32]*server.DB_PlayerInfo),
}
type DB_PlayerInfoMgr struct {
Datas *server.DB_PlayerInfoArray
pool map[int32]*server.DB_PlayerInfo
}
func (this *DB_PlayerInfoMgr) unmarshal(data []byte) error {
err := proto.Unmarshal(data, this.Datas)
if err == nil {
this.arrangeData()
}
return err
}
func (this *DB_PlayerInfoMgr) reunmarshal(data []byte) error {
newDatas := &server.DB_PlayerInfoArray{}
err := proto.Unmarshal(data, newDatas)
if err == nil {
for _, item := range newDatas.Arr {
existItem := this.GetData(item.GetId())
if existItem == nil {
this.pool[item.GetId()] = item
this.Datas.Arr = append(this.Datas.Arr, item)
} else {
*existItem = *item
}
}
}
return err
}
func (this *DB_PlayerInfoMgr) arrangeData() {
if this.Datas == nil {
return
}
dataArr := this.Datas.GetArr()
if dataArr == nil {
return
}
for _, data := range dataArr {
this.pool[data.GetId()] = data
}
}
func (this *DB_PlayerInfoMgr) GetData(id int32) *server.DB_PlayerInfo {
if data, ok := this.pool[id]; ok {
return data
}
return nil
}
func init() {
DataMgr.register("DB_PlayerInfo.dat", &ProtobufDataLoader{dh: PBDB_PlayerInfoMgr})
}

View File

@ -466,6 +466,8 @@ func (this *BagMgr) VerifyUpJybInfo(p *Player, args *model.VerifyUpJybInfoArgs)
pack.OpRetCode = playerproto.OpResultCode_OPRC_Error pack.OpRetCode = playerproto.OpResultCode_OPRC_Error
proto.SetDefaults(pack) proto.SetDefaults(pack)
p.SendToClient(int(playerproto.PlayerPacketID_PACKET_ALL_SETTING), pack) p.SendToClient(int(playerproto.PlayerPacketID_PACKET_ALL_SETTING), pack)
} else {
PetMgrSington.CheckShowRed(p)
} }
p.dirty = true p.dirty = true
} }

View File

@ -180,9 +180,6 @@ func NewPlayer(sid int64, pd *model.PlayerData, s *netlib.Session) *Player {
func (this *Player) init() bool { func (this *Player) init() bool {
this.SetOnline() this.SetOnline()
this.isNewbie = this.CreateTime == this.LastLoginTime this.isNewbie = this.CreateTime == this.LastLoginTime
if this.WelfData == nil {
this.WelfData = model.NewWelfareData()
}
return true return true
} }
@ -457,7 +454,7 @@ func (this *Player) CheckShowRed() {
ShopMgrSington.ShopCheckShowRed(this) ShopMgrSington.ShopCheckShowRed(this)
//数据依赖于背包数据 放入加载背包数据之后执行 //数据依赖于背包数据 放入加载背包数据之后执行
PetMgrSington.CheckShowRed(this) //PetMgrSington.CheckShowRed(this)
//福利红点 //福利红点
WelfareMgrSington.WelfareShowRed(this) WelfareMgrSington.WelfareShowRed(this)
@ -1158,6 +1155,8 @@ func (this *Player) GetMessageAttach(id string) {
} }
proto.SetDefaults(pack) proto.SetDefaults(pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack) this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
} else {
PetMgrSington.CheckShowRed(this)
} }
this.dirty = true this.dirty = true
} }
@ -1351,6 +1350,8 @@ func (this *Player) GetMessageAttachs(ids []string) {
proto.SetDefaults(pack) proto.SetDefaults(pack)
this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack) this.SendToClient(int(msg_proto.MSGPacketID_PACKET_SC_GETMESSAGEATTACH), pack)
*/ */
} else {
PetMgrSington.CheckShowRed(this)
} }
this.dirty = true this.dirty = true
} }
@ -2287,9 +2288,6 @@ func (this *Player) ResetPermit() {
if (this.PermitStartTs == 0 || this.PermitStartTs < permitStartTs) && permitStartTs > 0 { if (this.PermitStartTs == 0 || this.PermitStartTs < permitStartTs) && permitStartTs > 0 {
this.PermitStartTs = permitStartTs this.PermitStartTs = permitStartTs
this.Permit = time.Time{} this.Permit = time.Time{}
if this.WelfData == nil {
this.WelfData = model.NewWelfareData()
}
this.WelfData.PermitAward = make(map[int32]int64) this.WelfData.PermitAward = make(map[int32]int64)
this.WelfData.PermitExchange = make(map[int32][]int64) this.WelfData.PermitExchange = make(map[int32][]int64)
this.dirty = true this.dirty = true
@ -3068,6 +3066,9 @@ func (this *Player) SendPlayerInfo() {
if this.scene != nil && this.thrscene == 0 { if this.scene != nil && this.thrscene == 0 {
this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel) this.SendGameConfig(int32(this.scene.gameId), this.Platform, this.Channel)
} }
PetMgrSington.CheckShowRed(this)
//this.SendJackpotInfo() //this.SendJackpotInfo()
} }

View File

@ -535,6 +535,9 @@ func (this *ShopMgr) shopAddItem(p *Player, shopInfo *model.ShopInfo, vipShopId
item := &Item{ItemId: info.ItemId, ItemNum: info.ItemNum, ObtainTime: time.Now().Unix()} item := &Item{ItemId: info.ItemId, ItemNum: info.ItemNum, ObtainTime: time.Now().Unix()}
BagMgrSingleton.AddItems(p, []*Item{item}, 0, int32(gainWay), "system", name, 0, 0, false) BagMgrSingleton.AddItems(p, []*Item{item}, 0, int32(gainWay), "system", name, 0, 0, false)
} }
// 获得道具,检查是否显示红点
PetMgrSington.CheckShowRed(p)
} }
// createOrder 保存购买记录 // createOrder 保存购买记录

BIN
xlsx/DB_PlayerInfo.xlsx Normal file

Binary file not shown.