/// <summary> /// Update <see cref="Decor"/> (create, move or delete), this is called directly from a packet hander. /// </summary> public void DecorUpdate(Player player, ClientHousingDecorUpdate housingDecorUpdate) { if (!residence.CanModifyResidence(player.CharacterId)) { throw new InvalidPacketValueException(); } foreach (ClientHousingDecorUpdate.DecorUpdate update in housingDecorUpdate.DecorUpdates) { switch (housingDecorUpdate.Operation) { case DecorUpdateOperation.Create: DecorCreate(player, update); break; case DecorUpdateOperation.Move: DecorMove(update); break; case DecorUpdateOperation.Delete: DecorDelete(update); break; default: throw new InvalidPacketValueException(); } } }
public static void HandleHousingDecorUpdate(WorldSession session, ClientHousingDecorUpdate housingDecorUpdate) { if (!(session.Player.Map is ResidenceMap residenceMap)) { throw new InvalidPacketValueException(); } residenceMap.DecorUpdate(session.Player, housingDecorUpdate); }