ItemTable.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /*
  2. * Copyright (C) 2004-2013 L2J Server
  3. *
  4. * This file is part of L2J Server.
  5. *
  6. * L2J Server is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * L2J Server is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. package com.l2jserver.gameserver.datatables;
  20. import static com.l2jserver.gameserver.model.itemcontainer.PcInventory.ADENA_ID;
  21. import java.sql.Connection;
  22. import java.sql.PreparedStatement;
  23. import java.util.Map;
  24. import java.util.Set;
  25. import java.util.concurrent.ScheduledFuture;
  26. import java.util.logging.Level;
  27. import java.util.logging.LogRecord;
  28. import java.util.logging.Logger;
  29. import javolution.util.FastList;
  30. import javolution.util.FastMap;
  31. import com.l2jserver.Config;
  32. import com.l2jserver.L2DatabaseFactory;
  33. import com.l2jserver.gameserver.ThreadPoolManager;
  34. import com.l2jserver.gameserver.engines.DocumentEngine;
  35. import com.l2jserver.gameserver.engines.items.Item;
  36. import com.l2jserver.gameserver.enums.ItemLocation;
  37. import com.l2jserver.gameserver.idfactory.IdFactory;
  38. import com.l2jserver.gameserver.model.L2Object;
  39. import com.l2jserver.gameserver.model.L2World;
  40. import com.l2jserver.gameserver.model.actor.L2Attackable;
  41. import com.l2jserver.gameserver.model.actor.instance.L2EventMonsterInstance;
  42. import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  43. import com.l2jserver.gameserver.model.items.L2Armor;
  44. import com.l2jserver.gameserver.model.items.L2EtcItem;
  45. import com.l2jserver.gameserver.model.items.L2Item;
  46. import com.l2jserver.gameserver.model.items.L2Weapon;
  47. import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
  48. import com.l2jserver.gameserver.model.items.type.L2ArmorType;
  49. import com.l2jserver.gameserver.model.items.type.L2WeaponType;
  50. import com.l2jserver.gameserver.scripting.scriptengine.events.ItemCreateEvent;
  51. import com.l2jserver.gameserver.scripting.scriptengine.listeners.player.NewItemListener;
  52. import com.l2jserver.gameserver.util.GMAudit;
  53. /**
  54. * This class ...
  55. * @version $Revision: 1.9.2.6.2.9 $ $Date: 2005/04/02 15:57:34 $
  56. */
  57. public class ItemTable
  58. {
  59. private static Logger _log = Logger.getLogger(ItemTable.class.getName());
  60. private static Logger _logItems = Logger.getLogger("item");
  61. private static FastList<NewItemListener> newItemListeners = new FastList<NewItemListener>().shared();
  62. public static final Map<String, Integer> _materials = new FastMap<>();
  63. public static final Map<String, Integer> _crystalTypes = new FastMap<>();
  64. public static final Map<String, Integer> _slots = new FastMap<>();
  65. public static final Map<String, L2WeaponType> _weaponTypes = new FastMap<>();
  66. public static final Map<String, L2ArmorType> _armorTypes = new FastMap<>();
  67. private L2Item[] _allTemplates;
  68. private final Map<Integer, L2EtcItem> _etcItems;
  69. private final Map<Integer, L2Armor> _armors;
  70. private final Map<Integer, L2Weapon> _weapons;
  71. static
  72. {
  73. _materials.put("adamantaite", L2Item.MATERIAL_ADAMANTAITE);
  74. _materials.put("blood_steel", L2Item.MATERIAL_BLOOD_STEEL);
  75. _materials.put("bone", L2Item.MATERIAL_BONE);
  76. _materials.put("bronze", L2Item.MATERIAL_BRONZE);
  77. _materials.put("cloth", L2Item.MATERIAL_CLOTH);
  78. _materials.put("chrysolite", L2Item.MATERIAL_CHRYSOLITE);
  79. _materials.put("cobweb", L2Item.MATERIAL_COBWEB);
  80. _materials.put("cotton", L2Item.MATERIAL_FINE_STEEL);
  81. _materials.put("crystal", L2Item.MATERIAL_CRYSTAL);
  82. _materials.put("damascus", L2Item.MATERIAL_DAMASCUS);
  83. _materials.put("dyestuff", L2Item.MATERIAL_DYESTUFF);
  84. _materials.put("fine_steel", L2Item.MATERIAL_FINE_STEEL);
  85. _materials.put("fish", L2Item.MATERIAL_FISH);
  86. _materials.put("gold", L2Item.MATERIAL_GOLD);
  87. _materials.put("horn", L2Item.MATERIAL_HORN);
  88. _materials.put("leather", L2Item.MATERIAL_LEATHER);
  89. _materials.put("liquid", L2Item.MATERIAL_LIQUID);
  90. _materials.put("mithril", L2Item.MATERIAL_MITHRIL);
  91. _materials.put("oriharukon", L2Item.MATERIAL_ORIHARUKON);
  92. _materials.put("paper", L2Item.MATERIAL_PAPER);
  93. _materials.put("rune_xp", L2Item.MATERIAL_RUNE_XP);
  94. _materials.put("rune_sp", L2Item.MATERIAL_RUNE_SP);
  95. _materials.put("rune_remove_penalty", L2Item.MATERIAL_RUNE_PENALTY);
  96. _materials.put("scale_of_dragon", L2Item.MATERIAL_SCALE_OF_DRAGON);
  97. _materials.put("seed", L2Item.MATERIAL_SEED);
  98. _materials.put("silver", L2Item.MATERIAL_SILVER);
  99. _materials.put("steel", L2Item.MATERIAL_STEEL);
  100. _materials.put("wood", L2Item.MATERIAL_WOOD);
  101. _crystalTypes.put("s84", L2Item.CRYSTAL_S84);
  102. _crystalTypes.put("s80", L2Item.CRYSTAL_S80);
  103. _crystalTypes.put("s", L2Item.CRYSTAL_S);
  104. _crystalTypes.put("a", L2Item.CRYSTAL_A);
  105. _crystalTypes.put("b", L2Item.CRYSTAL_B);
  106. _crystalTypes.put("c", L2Item.CRYSTAL_C);
  107. _crystalTypes.put("d", L2Item.CRYSTAL_D);
  108. _crystalTypes.put("none", L2Item.CRYSTAL_NONE);
  109. // weapon types
  110. for (L2WeaponType type : L2WeaponType.values())
  111. {
  112. _weaponTypes.put(type.getName(), type);
  113. }
  114. // armor types
  115. for (L2ArmorType type : L2ArmorType.values())
  116. {
  117. _armorTypes.put(type.getName(), type);
  118. }
  119. _slots.put("shirt", L2Item.SLOT_UNDERWEAR);
  120. _slots.put("lbracelet", L2Item.SLOT_L_BRACELET);
  121. _slots.put("rbracelet", L2Item.SLOT_R_BRACELET);
  122. _slots.put("talisman", L2Item.SLOT_DECO);
  123. _slots.put("chest", L2Item.SLOT_CHEST);
  124. _slots.put("fullarmor", L2Item.SLOT_FULL_ARMOR);
  125. _slots.put("head", L2Item.SLOT_HEAD);
  126. _slots.put("hair", L2Item.SLOT_HAIR);
  127. _slots.put("hairall", L2Item.SLOT_HAIRALL);
  128. _slots.put("underwear", L2Item.SLOT_UNDERWEAR);
  129. _slots.put("back", L2Item.SLOT_BACK);
  130. _slots.put("neck", L2Item.SLOT_NECK);
  131. _slots.put("legs", L2Item.SLOT_LEGS);
  132. _slots.put("feet", L2Item.SLOT_FEET);
  133. _slots.put("gloves", L2Item.SLOT_GLOVES);
  134. _slots.put("chest,legs", L2Item.SLOT_CHEST | L2Item.SLOT_LEGS);
  135. _slots.put("belt", L2Item.SLOT_BELT);
  136. _slots.put("rhand", L2Item.SLOT_R_HAND);
  137. _slots.put("lhand", L2Item.SLOT_L_HAND);
  138. _slots.put("lrhand", L2Item.SLOT_LR_HAND);
  139. _slots.put("rear;lear", L2Item.SLOT_R_EAR | L2Item.SLOT_L_EAR);
  140. _slots.put("rfinger;lfinger", L2Item.SLOT_R_FINGER | L2Item.SLOT_L_FINGER);
  141. _slots.put("wolf", L2Item.SLOT_WOLF);
  142. _slots.put("greatwolf", L2Item.SLOT_GREATWOLF);
  143. _slots.put("hatchling", L2Item.SLOT_HATCHLING);
  144. _slots.put("strider", L2Item.SLOT_STRIDER);
  145. _slots.put("babypet", L2Item.SLOT_BABYPET);
  146. _slots.put("none", L2Item.SLOT_NONE);
  147. // retail compatibility
  148. _slots.put("onepiece", L2Item.SLOT_FULL_ARMOR);
  149. _slots.put("hair2", L2Item.SLOT_HAIR2);
  150. _slots.put("dhair", L2Item.SLOT_HAIRALL);
  151. _slots.put("alldress", L2Item.SLOT_ALLDRESS);
  152. _slots.put("deco1", L2Item.SLOT_DECO);
  153. _slots.put("waist", L2Item.SLOT_BELT);
  154. }
  155. /**
  156. * Returns instance of ItemTable
  157. * @return ItemTable
  158. */
  159. public static ItemTable getInstance()
  160. {
  161. return SingletonHolder._instance;
  162. }
  163. /**
  164. * @return a new object Item
  165. */
  166. public Item newItem()
  167. {
  168. return new Item();
  169. }
  170. /**
  171. * Constructor.
  172. */
  173. protected ItemTable()
  174. {
  175. _etcItems = new FastMap<>();
  176. _armors = new FastMap<>();
  177. _weapons = new FastMap<>();
  178. load();
  179. }
  180. private void load()
  181. {
  182. int highest = 0;
  183. _armors.clear();
  184. _etcItems.clear();
  185. _weapons.clear();
  186. for (L2Item item : DocumentEngine.getInstance().loadItems())
  187. {
  188. if (highest < item.getId())
  189. {
  190. highest = item.getId();
  191. }
  192. if (item instanceof L2EtcItem)
  193. {
  194. _etcItems.put(item.getId(), (L2EtcItem) item);
  195. }
  196. else if (item instanceof L2Armor)
  197. {
  198. _armors.put(item.getId(), (L2Armor) item);
  199. }
  200. else
  201. {
  202. _weapons.put(item.getId(), (L2Weapon) item);
  203. }
  204. }
  205. buildFastLookupTable(highest);
  206. _log.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _etcItems.size() + " Etc Items");
  207. _log.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _armors.size() + " Armor Items");
  208. _log.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + _weapons.size() + " Weapon Items");
  209. _log.log(Level.INFO, getClass().getSimpleName() + ": Loaded: " + (_etcItems.size() + _armors.size() + _weapons.size()) + " Items in total.");
  210. }
  211. /**
  212. * Builds a variable in which all items are putting in in function of their ID.
  213. * @param size
  214. */
  215. private void buildFastLookupTable(int size)
  216. {
  217. // Create a FastLookUp Table called _allTemplates of size : value of the highest item ID
  218. _log.info(getClass().getSimpleName() + ": Highest item id used:" + size);
  219. _allTemplates = new L2Item[size + 1];
  220. // Insert armor item in Fast Look Up Table
  221. for (L2Armor item : _armors.values())
  222. {
  223. _allTemplates[item.getId()] = item;
  224. }
  225. // Insert weapon item in Fast Look Up Table
  226. for (L2Weapon item : _weapons.values())
  227. {
  228. _allTemplates[item.getId()] = item;
  229. }
  230. // Insert etcItem item in Fast Look Up Table
  231. for (L2EtcItem item : _etcItems.values())
  232. {
  233. _allTemplates[item.getId()] = item;
  234. }
  235. }
  236. /**
  237. * Returns the item corresponding to the item ID
  238. * @param id : int designating the item
  239. * @return L2Item
  240. */
  241. public L2Item getTemplate(int id)
  242. {
  243. if ((id >= _allTemplates.length) || (id < 0))
  244. {
  245. return null;
  246. }
  247. return _allTemplates[id];
  248. }
  249. /**
  250. * Create the L2ItemInstance corresponding to the Item Identifier and quantitiy add logs the activity. <B><U> Actions</U> :</B> <li>Create and Init the L2ItemInstance corresponding to the Item Identifier and quantity</li> <li>Add the L2ItemInstance object to _allObjects of L2world</li> <li>Logs
  251. * Item creation according to log settings</li>
  252. * @param process : String Identifier of process triggering this action
  253. * @param itemId : int Item Identifier of the item to be created
  254. * @param count : int Quantity of items to be created for stackable items
  255. * @param actor : L2PcInstance Player requesting the item creation
  256. * @param reference : Object Object referencing current action like NPC selling item or previous item in transformation
  257. * @return L2ItemInstance corresponding to the new item
  258. */
  259. public L2ItemInstance createItem(String process, int itemId, long count, L2PcInstance actor, Object reference)
  260. {
  261. if (!fireNewItemListeners(process, itemId, count, actor, reference))
  262. {
  263. return null;
  264. }
  265. // Create and Init the L2ItemInstance corresponding to the Item Identifier
  266. L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
  267. if (process.equalsIgnoreCase("loot"))
  268. {
  269. ScheduledFuture<?> itemLootShedule;
  270. if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids
  271. {
  272. L2Attackable raid = (L2Attackable) reference;
  273. // if in CommandChannel and was killing a World/RaidBoss
  274. if ((raid.getFirstCommandChannelAttacked() != null) && !Config.AUTO_LOOT_RAIDS)
  275. {
  276. item.setOwnerId(raid.getFirstCommandChannelAttacked().getLeaderObjectId());
  277. itemLootShedule = ThreadPoolManager.getInstance().scheduleGeneral(new ResetOwner(item), Config.LOOT_RAIDS_PRIVILEGE_INTERVAL);
  278. item.setItemLootShedule(itemLootShedule);
  279. }
  280. }
  281. else if (!Config.AUTO_LOOT || ((reference instanceof L2EventMonsterInstance) && ((L2EventMonsterInstance) reference).eventDropOnGround()))
  282. {
  283. item.setOwnerId(actor.getObjectId());
  284. itemLootShedule = ThreadPoolManager.getInstance().scheduleGeneral(new ResetOwner(item), 15000);
  285. item.setItemLootShedule(itemLootShedule);
  286. }
  287. }
  288. if (Config.DEBUG)
  289. {
  290. _log.fine(getClass().getSimpleName() + ": Item created oid:" + item.getObjectId() + " itemid:" + itemId);
  291. }
  292. // Add the L2ItemInstance object to _allObjects of L2world
  293. L2World.getInstance().storeObject(item);
  294. // Set Item parameters
  295. if (item.isStackable() && (count > 1))
  296. {
  297. item.setCount(count);
  298. }
  299. if (Config.LOG_ITEMS && !process.equals("Reset"))
  300. {
  301. if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
  302. {
  303. LogRecord record = new LogRecord(Level.INFO, "CREATE:" + process);
  304. record.setLoggerName("item");
  305. record.setParameters(new Object[]
  306. {
  307. item,
  308. actor,
  309. reference
  310. });
  311. _logItems.log(record);
  312. }
  313. }
  314. if (actor != null)
  315. {
  316. if (actor.isGM())
  317. {
  318. String referenceName = "no-reference";
  319. if (reference instanceof L2Object)
  320. {
  321. referenceName = (((L2Object) reference).getName() != null ? ((L2Object) reference).getName() : "no-name");
  322. }
  323. else if (reference instanceof String)
  324. {
  325. referenceName = (String) reference;
  326. }
  327. String targetName = (actor.getTarget() != null ? actor.getTarget().getName() : "no-target");
  328. if (Config.GMAUDIT)
  329. {
  330. GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + itemId + " count: " + count + " name: " + item.getItemName() + " objId: " + item.getObjectId() + ")", targetName, "L2Object referencing this action is: " + referenceName);
  331. }
  332. }
  333. }
  334. return item;
  335. }
  336. public L2ItemInstance createItem(String process, int itemId, int count, L2PcInstance actor)
  337. {
  338. return createItem(process, itemId, count, actor, null);
  339. }
  340. /**
  341. * Returns a dummy item.<br>
  342. * <U><I>Concept :</I></U><BR>
  343. * Dummy item is created by setting the ID of the object in the world at null value
  344. * @param itemId : int designating the item
  345. * @return L2ItemInstance designating the dummy item created
  346. */
  347. public L2ItemInstance createDummyItem(int itemId)
  348. {
  349. L2Item item = getTemplate(itemId);
  350. if (item == null)
  351. {
  352. return null;
  353. }
  354. L2ItemInstance temp = new L2ItemInstance(0, item);
  355. return temp;
  356. }
  357. /**
  358. * Destroys the L2ItemInstance.<br>
  359. * <B><U> Actions</U> :</B>
  360. * <ul>
  361. * <li>Sets L2ItemInstance parameters to be unusable</li>
  362. * <li>Removes the L2ItemInstance object to _allObjects of L2world</li>
  363. * <li>Logs Item deletion according to log settings</li>
  364. * </ul>
  365. * @param process a string identifier of process triggering this action.
  366. * @param item the item instance to be destroyed.
  367. * @param actor the player requesting the item destroy.
  368. * @param reference the object referencing current action like NPC selling item or previous item in transformation.
  369. */
  370. public void destroyItem(String process, L2ItemInstance item, L2PcInstance actor, Object reference)
  371. {
  372. synchronized (item)
  373. {
  374. long old = item.getCount();
  375. item.setCount(0);
  376. item.setOwnerId(0);
  377. item.setItemLocation(ItemLocation.VOID);
  378. item.setLastChange(L2ItemInstance.REMOVED);
  379. L2World.getInstance().removeObject(item);
  380. IdFactory.getInstance().releaseId(item.getObjectId());
  381. if (Config.LOG_ITEMS)
  382. {
  383. if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
  384. {
  385. LogRecord record = new LogRecord(Level.INFO, "DELETE:" + process);
  386. record.setLoggerName("item");
  387. record.setParameters(new Object[]
  388. {
  389. item,
  390. "PrevCount(" + old + ")",
  391. actor,
  392. reference
  393. });
  394. _logItems.log(record);
  395. }
  396. }
  397. if (actor != null)
  398. {
  399. if (actor.isGM())
  400. {
  401. String referenceName = "no-reference";
  402. if (reference instanceof L2Object)
  403. {
  404. referenceName = (((L2Object) reference).getName() != null ? ((L2Object) reference).getName() : "no-name");
  405. }
  406. else if (reference instanceof String)
  407. {
  408. referenceName = (String) reference;
  409. }
  410. String targetName = (actor.getTarget() != null ? actor.getTarget().getName() : "no-target");
  411. if (Config.GMAUDIT)
  412. {
  413. GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + item.getId() + " count: " + item.getCount() + " itemObjId: " + item.getObjectId() + ")", targetName, "L2Object referencing this action is: " + referenceName);
  414. }
  415. }
  416. }
  417. // if it's a pet control item, delete the pet as well
  418. if (item.getItem().isPetItem())
  419. {
  420. try (Connection con = L2DatabaseFactory.getInstance().getConnection();
  421. PreparedStatement statement = con.prepareStatement("DELETE FROM pets WHERE item_obj_id=?"))
  422. {
  423. // Delete the pet in db
  424. statement.setInt(1, item.getObjectId());
  425. statement.execute();
  426. }
  427. catch (Exception e)
  428. {
  429. _log.log(Level.WARNING, "could not delete pet objectid:", e);
  430. }
  431. }
  432. }
  433. }
  434. public void reload()
  435. {
  436. load();
  437. EnchantItemHPBonusData.getInstance().load();
  438. }
  439. protected static class ResetOwner implements Runnable
  440. {
  441. L2ItemInstance _item;
  442. public ResetOwner(L2ItemInstance item)
  443. {
  444. _item = item;
  445. }
  446. @Override
  447. public void run()
  448. {
  449. _item.setOwnerId(0);
  450. _item.setItemLootShedule(null);
  451. }
  452. }
  453. public Set<Integer> getAllArmorsId()
  454. {
  455. return _armors.keySet();
  456. }
  457. public Set<Integer> getAllWeaponsId()
  458. {
  459. return _weapons.keySet();
  460. }
  461. public int getArraySize()
  462. {
  463. return _allTemplates.length;
  464. }
  465. private static class SingletonHolder
  466. {
  467. protected static final ItemTable _instance = new ItemTable();
  468. }
  469. // Listeners
  470. /**
  471. * Fires all the new item listeners, if any
  472. * @param process
  473. * @param itemId
  474. * @param count
  475. * @param actor
  476. * @param reference
  477. * @return
  478. */
  479. private boolean fireNewItemListeners(String process, int itemId, long count, L2PcInstance actor, Object reference)
  480. {
  481. if (!newItemListeners.isEmpty() && (actor != null))
  482. {
  483. ItemCreateEvent event = new ItemCreateEvent();
  484. event.setItemId(itemId);
  485. event.setPlayer(actor);
  486. event.setCount(count);
  487. event.setProcess(process);
  488. event.setReference(reference);
  489. for (NewItemListener listener : newItemListeners)
  490. {
  491. if (listener.containsItemId(itemId))
  492. {
  493. if (!listener.onCreate(event))
  494. {
  495. return false;
  496. }
  497. }
  498. }
  499. }
  500. return true;
  501. }
  502. /**
  503. * Adds a new item listener
  504. * @param listener
  505. */
  506. public static void addNewItemListener(NewItemListener listener)
  507. {
  508. if (!newItemListeners.contains(listener))
  509. {
  510. newItemListeners.add(listener);
  511. }
  512. }
  513. /**
  514. * Removes a new item listener
  515. * @param listener
  516. */
  517. public static void removeNewItemListener(NewItemListener listener)
  518. {
  519. newItemListeners.remove(listener);
  520. }
  521. }