mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
时装、风之翼读表,give命令更新
修复了角色替换圣遗物异常的问题
This commit is contained in:
@@ -359,81 +359,6 @@ func (g *GameManager) PacketAvatarPropNotify(avatar *model.Avatar) *proto.Avatar
|
||||
return avatarPropNotify
|
||||
}
|
||||
|
||||
func (g *GameManager) AvatarChangeCostumeReq(player *model.Player, payloadMsg pb.Message) {
|
||||
logger.Debug("user change avatar costume, uid: %v", player.PlayerID)
|
||||
req := payloadMsg.(*proto.AvatarChangeCostumeReq)
|
||||
avatarGuid := req.AvatarGuid
|
||||
costumeId := req.CostumeId
|
||||
|
||||
exist := false
|
||||
for _, v := range player.CostumeList {
|
||||
if v == costumeId {
|
||||
exist = true
|
||||
}
|
||||
}
|
||||
if costumeId == 0 {
|
||||
exist = true
|
||||
}
|
||||
if !exist {
|
||||
return
|
||||
}
|
||||
|
||||
avatar := player.GameObjectGuidMap[avatarGuid].(*model.Avatar)
|
||||
avatar.Costume = req.CostumeId
|
||||
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
scene := world.GetSceneById(player.SceneId)
|
||||
|
||||
avatarChangeCostumeNotify := new(proto.AvatarChangeCostumeNotify)
|
||||
avatarChangeCostumeNotify.EntityInfo = g.PacketSceneEntityInfoAvatar(scene, player, avatar.AvatarId)
|
||||
for _, scenePlayer := range scene.GetAllPlayer() {
|
||||
g.SendMsg(cmd.AvatarChangeCostumeNotify, scenePlayer.PlayerID, scenePlayer.ClientSeq, avatarChangeCostumeNotify)
|
||||
}
|
||||
|
||||
avatarChangeCostumeRsp := &proto.AvatarChangeCostumeRsp{
|
||||
AvatarGuid: req.AvatarGuid,
|
||||
CostumeId: req.CostumeId,
|
||||
}
|
||||
g.SendMsg(cmd.AvatarChangeCostumeRsp, player.PlayerID, player.ClientSeq, avatarChangeCostumeRsp)
|
||||
}
|
||||
|
||||
func (g *GameManager) AvatarWearFlycloakReq(player *model.Player, payloadMsg pb.Message) {
|
||||
logger.Debug("user change avatar fly cloak, uid: %v", player.PlayerID)
|
||||
req := payloadMsg.(*proto.AvatarWearFlycloakReq)
|
||||
avatarGuid := req.AvatarGuid
|
||||
flycloakId := req.FlycloakId
|
||||
|
||||
exist := false
|
||||
for _, v := range player.FlyCloakList {
|
||||
if v == flycloakId {
|
||||
exist = true
|
||||
}
|
||||
}
|
||||
if !exist {
|
||||
return
|
||||
}
|
||||
|
||||
avatar := player.GameObjectGuidMap[avatarGuid].(*model.Avatar)
|
||||
avatar.FlyCloak = req.FlycloakId
|
||||
|
||||
world := WORLD_MANAGER.GetWorldByID(player.WorldId)
|
||||
scene := world.GetSceneById(player.SceneId)
|
||||
|
||||
avatarFlycloakChangeNotify := &proto.AvatarFlycloakChangeNotify{
|
||||
AvatarGuid: avatarGuid,
|
||||
FlycloakId: flycloakId,
|
||||
}
|
||||
for _, scenePlayer := range scene.GetAllPlayer() {
|
||||
g.SendMsg(cmd.AvatarFlycloakChangeNotify, scenePlayer.PlayerID, scenePlayer.ClientSeq, avatarFlycloakChangeNotify)
|
||||
}
|
||||
|
||||
avatarWearFlycloakRsp := &proto.AvatarWearFlycloakRsp{
|
||||
AvatarGuid: req.AvatarGuid,
|
||||
FlycloakId: req.FlycloakId,
|
||||
}
|
||||
g.SendMsg(cmd.AvatarWearFlycloakRsp, player.PlayerID, player.ClientSeq, avatarWearFlycloakRsp)
|
||||
}
|
||||
|
||||
func (g *GameManager) UpdateUserAvatarFightProp(userId uint32, avatarId uint32) {
|
||||
player := USER_MANAGER.GetOnlineUser(userId)
|
||||
if player == nil {
|
||||
|
||||
Reference in New Issue
Block a user