增加额外的经验条

This commit is contained in:
hahwu 2025-05-29 18:15:26 +08:00
parent 42e9b73764
commit 17343a432e
4 changed files with 15 additions and 4 deletions

View File

@ -72,7 +72,7 @@ func ReqGmCommand_(player *Player, Command string) error {
player.PushClientRes(player.PlayMod.mod_list.Card.BackData())
case "addexp":
num, _ := strconv.Atoi(arg[1])
player.GetPlayerBaseMod().AddExp(player, num)
player.GetPlayerBaseMod().AddExp(player, num, 0)
player.PushClientRes(&player.GetPlayerBaseMod().Data)
case "addDailyActive":
num, _ := strconv.Atoi(arg[1])

View File

@ -582,6 +582,7 @@ func (p *PlayerBaseData) BackAsset() *msg.ResPlayerAsset {
Exp: int32(BaseMod.Exp),
Login: int32(BaseMod.LoginTime),
Logout: int32(BaseMod.LogoutTime),
PExp: int32(BaseMod.PExp),
}
}

View File

@ -80,7 +80,7 @@ func UnitDecorate(p *Player) error {
PlayerBaseMod := p.GetPlayerBaseMod()
PlayerBaseMod.Data.Level = 6
PlayerBaseMod.Data.Exp = 50
PlayerBaseMod.AddExp(p, 100)
PlayerBaseMod.AddExp(p, 100, 0)
return nil
}

View File

@ -2276,6 +2276,7 @@ type ResPlayerAsset struct {
Exp int32 `protobuf:"varint,7,opt,name=exp,proto3" json:"exp,omitempty"`
Login int32 `protobuf:"varint,8,opt,name=Login,proto3" json:"Login,omitempty"`
Logout int32 `protobuf:"varint,9,opt,name=Logout,proto3" json:"Logout,omitempty"`
PExp int32 `protobuf:"varint,10,opt,name=pExp,proto3" json:"pExp,omitempty"` // 玩家经验
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@ -2373,6 +2374,13 @@ func (x *ResPlayerAsset) GetLogout() int32 {
return 0
}
func (x *ResPlayerAsset) GetPExp() int32 {
if x != nil {
return x.PExp
}
return 0
}
// 客户端向服务器请求更新基本信息条目(没有响应)
type UpdateBaseItemInfo struct {
state protoimpl.MessageState `protogen:"open.v1"`
@ -22972,7 +22980,7 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\n" +
"FaceBookId\x18\x17 \x01(\tR\n" +
"FaceBookId\"\x10\n" +
"\x0eReqPlayerAsset\"\xe5\x01\n" +
"\x0eReqPlayerAsset\"\xf9\x01\n" +
"\x0eResPlayerAsset\x12\x14\n" +
"\x05dwUin\x18\x01 \x01(\x03R\x05dwUin\x12\x16\n" +
"\x06energy\x18\x02 \x01(\x05R\x06energy\x12\x12\n" +
@ -22982,7 +22990,9 @@ const file_proto_Gameapi_proto_rawDesc = "" +
"\x05level\x18\x06 \x01(\x05R\x05level\x12\x10\n" +
"\x03exp\x18\a \x01(\x05R\x03exp\x12\x14\n" +
"\x05Login\x18\b \x01(\x05R\x05Login\x12\x16\n" +
"\x06Logout\x18\t \x01(\x05R\x06Logout\"\xbb\x01\n" +
"\x06Logout\x18\t \x01(\x05R\x06Logout\x12\x12\n" +
"\x04pExp\x18\n" +
" \x01(\x05R\x04pExp\"\xbb\x01\n" +
"\x12UpdateBaseItemInfo\x12\x14\n" +
"\x05dwUin\x18\x01 \x01(\x03R\x05dwUin\x12O\n" +
"\vmUpdateItem\x18\x02 \x03(\v2-.tutorial.UpdateBaseItemInfo.MUpdateItemEntryR\vmUpdateItem\x1a>\n" +