playroom优化
This commit is contained in:
parent
5d00d87e18
commit
a91952b796
@ -3763,7 +3763,14 @@ func ReqPlayroomDressSet(player *Player, buf []byte) error {
|
||||
req := &msg.ReqPlayroomDressSet{}
|
||||
proto.Unmarshal(buf, req)
|
||||
PlayroomMod := player.PlayMod.getPlayroomMod()
|
||||
PlayroomMod.PlayroomDressSet(GoUtil.MapInt32ToInt(req.DressSet))
|
||||
error := PlayroomMod.PlayroomDressSet(GoUtil.MapInt32ToInt(req.DressSet))
|
||||
if error != nil {
|
||||
player.SendErrClienRes(&msg.ResPlayroomDressSet{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
Msg: error.Error(),
|
||||
})
|
||||
return error
|
||||
}
|
||||
player.PlayMod.save()
|
||||
PlayroomBackData(player)
|
||||
player.PushClientRes(&msg.ResPlayroomDressSet{
|
||||
@ -3776,7 +3783,14 @@ func ReqPlayroomPetAirSet(player *Player, buf []byte) error {
|
||||
req := &msg.ReqPlayroomPetAirSet{}
|
||||
proto.Unmarshal(buf, req)
|
||||
PlayroomMod := player.PlayMod.getPlayroomMod()
|
||||
PlayroomMod.PlayroomPetAirSet(int(req.PetAirSet))
|
||||
error := PlayroomMod.PlayroomPetAirSet(int(req.PetAirSet))
|
||||
if error != nil {
|
||||
player.SendErrClienRes(&msg.ResPlayroomPetAirSet{
|
||||
Code: msg.RES_CODE_FAIL,
|
||||
Msg: error.Error(),
|
||||
})
|
||||
return error
|
||||
}
|
||||
player.PlayMod.save()
|
||||
PlayroomBackData(player)
|
||||
player.PushClientRes(&msg.ResPlayroomPetAirSet{
|
||||
|
||||
@ -573,10 +573,12 @@ func (p *PlayroomMod) PlayroomDressSet(DressSet map[int]int) error {
|
||||
// 判断服装是否存在
|
||||
for Type, Id := range DressSet {
|
||||
dresses, ok := p.Dress[Type]
|
||||
if Id == 0 {
|
||||
continue
|
||||
}
|
||||
if !ok {
|
||||
return fmt.Errorf("dress type not found")
|
||||
}
|
||||
|
||||
if !GoUtil.InArray(Id, dresses) {
|
||||
return fmt.Errorf("dress not found")
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user