From 05706007f10e86e9022b10812795436de42453ab Mon Sep 17 00:00:00 2001 From: Axel Cocat Date: Wed, 9 Mar 2022 14:28:21 +0100 Subject: [PATCH] feat(character/pvp): add pvp page --- package-lock.json | 4 +- package.json | 2 +- src/armory/Armory.ts | 1 + src/armory/Utils.ts | 19 +++ src/armory/controllers/CharacterController.ts | 81 +++++++++++-- src/armory/controllers/GuildController.ts | 8 +- src/tools/fetchdata.ts | 6 +- static/character-pvp.hbs | 42 +++++++ static/character-talents.hbs | 2 +- static/character.hbs | 2 +- static/css/character-pvp.css | 9 ++ static/css/emblems.css | 26 ++++ static/css/guild.css | 22 +--- static/guild.hbs | 70 +---------- .../arena-banners/PVP-Banner-2-Border-1.PNG | Bin 0 -> 256 bytes .../arena-banners/PVP-Banner-2-Border-2.PNG | Bin 0 -> 7396 bytes .../arena-banners/PVP-Banner-2-Border-3.PNG | Bin 0 -> 6192 bytes .../arena-banners/PVP-Banner-2-Border-4.PNG | Bin 0 -> 9552 bytes .../arena-banners/PVP-Banner-2-Border-5.PNG | Bin 0 -> 12226 bytes .../arena-banners/PVP-Banner-2-Border-6.PNG | Bin 0 -> 7507 bytes .../img/arena-banners/PVP-Banner-2-Crop.PNG | Bin 0 -> 7144 bytes static/img/arena-banners/PVP-Banner-2.PNG | Bin 0 -> 7738 bytes .../arena-banners/PVP-Banner-3-Border-1.PNG | Bin 0 -> 256 bytes .../arena-banners/PVP-Banner-3-Border-2.PNG | Bin 0 -> 8184 bytes .../arena-banners/PVP-Banner-3-Border-3.PNG | Bin 0 -> 6278 bytes .../arena-banners/PVP-Banner-3-Border-4.PNG | Bin 0 -> 10628 bytes .../arena-banners/PVP-Banner-3-Border-5.PNG | Bin 0 -> 13548 bytes .../arena-banners/PVP-Banner-3-Border-6.PNG | Bin 0 -> 7957 bytes .../img/arena-banners/PVP-Banner-3-Crop.PNG | Bin 0 -> 7270 bytes static/img/arena-banners/PVP-Banner-3.PNG | Bin 0 -> 8166 bytes .../arena-banners/PVP-Banner-5-Border-1.PNG | Bin 0 -> 256 bytes .../arena-banners/PVP-Banner-5-Border-2.PNG | Bin 0 -> 6187 bytes .../arena-banners/PVP-Banner-5-Border-3.PNG | Bin 0 -> 5182 bytes .../arena-banners/PVP-Banner-5-Border-4.PNG | Bin 0 -> 7882 bytes .../arena-banners/PVP-Banner-5-Border-5.PNG | Bin 0 -> 9810 bytes .../arena-banners/PVP-Banner-5-Border-6.PNG | Bin 0 -> 6359 bytes .../img/arena-banners/PVP-Banner-5-Crop.PNG | Bin 0 -> 5611 bytes static/img/arena-banners/PVP-Banner-5.PNG | Bin 0 -> 6300 bytes .../img/arena-banners/PVP-Banner-Emblem-1.PNG | Bin 0 -> 12176 bytes .../arena-banners/PVP-Banner-Emblem-10.PNG | Bin 0 -> 16850 bytes .../arena-banners/PVP-Banner-Emblem-100.PNG | Bin 0 -> 16114 bytes .../arena-banners/PVP-Banner-Emblem-101.PNG | Bin 0 -> 10013 bytes .../arena-banners/PVP-Banner-Emblem-102.PNG | Bin 0 -> 4664 bytes .../arena-banners/PVP-Banner-Emblem-11.PNG | Bin 0 -> 15844 bytes .../arena-banners/PVP-Banner-Emblem-12.PNG | Bin 0 -> 17831 bytes .../arena-banners/PVP-Banner-Emblem-13.PNG | Bin 0 -> 8683 bytes .../arena-banners/PVP-Banner-Emblem-14.PNG | Bin 0 -> 6890 bytes .../arena-banners/PVP-Banner-Emblem-15.PNG | Bin 0 -> 6111 bytes .../arena-banners/PVP-Banner-Emblem-16.PNG | Bin 0 -> 12323 bytes .../arena-banners/PVP-Banner-Emblem-17.PNG | Bin 0 -> 13225 bytes .../arena-banners/PVP-Banner-Emblem-18.PNG | Bin 0 -> 12687 bytes .../arena-banners/PVP-Banner-Emblem-19.PNG | Bin 0 -> 10358 bytes .../img/arena-banners/PVP-Banner-Emblem-2.PNG | Bin 0 -> 17769 bytes .../arena-banners/PVP-Banner-Emblem-20.PNG | Bin 0 -> 18484 bytes .../arena-banners/PVP-Banner-Emblem-21.PNG | Bin 0 -> 11363 bytes .../arena-banners/PVP-Banner-Emblem-22.PNG | Bin 0 -> 12402 bytes .../arena-banners/PVP-Banner-Emblem-23.PNG | Bin 0 -> 14658 bytes .../arena-banners/PVP-Banner-Emblem-24.PNG | Bin 0 -> 14946 bytes .../arena-banners/PVP-Banner-Emblem-25.PNG | Bin 0 -> 18414 bytes .../arena-banners/PVP-Banner-Emblem-26.PNG | Bin 0 -> 12777 bytes .../arena-banners/PVP-Banner-Emblem-27.PNG | Bin 0 -> 8894 bytes .../arena-banners/PVP-Banner-Emblem-28.PNG | Bin 0 -> 13741 bytes .../arena-banners/PVP-Banner-Emblem-29.PNG | Bin 0 -> 14425 bytes .../img/arena-banners/PVP-Banner-Emblem-3.PNG | Bin 0 -> 14119 bytes .../arena-banners/PVP-Banner-Emblem-30.PNG | Bin 0 -> 16475 bytes .../arena-banners/PVP-Banner-Emblem-31.PNG | Bin 0 -> 13155 bytes .../arena-banners/PVP-Banner-Emblem-32.PNG | Bin 0 -> 7774 bytes .../arena-banners/PVP-Banner-Emblem-33.PNG | Bin 0 -> 9818 bytes .../arena-banners/PVP-Banner-Emblem-34.PNG | Bin 0 -> 9092 bytes .../arena-banners/PVP-Banner-Emblem-35.PNG | Bin 0 -> 8106 bytes .../arena-banners/PVP-Banner-Emblem-36.PNG | Bin 0 -> 16896 bytes .../arena-banners/PVP-Banner-Emblem-37.PNG | Bin 0 -> 6754 bytes .../arena-banners/PVP-Banner-Emblem-38.PNG | Bin 0 -> 10116 bytes .../arena-banners/PVP-Banner-Emblem-39.PNG | Bin 0 -> 8631 bytes .../img/arena-banners/PVP-Banner-Emblem-4.PNG | Bin 0 -> 6984 bytes .../arena-banners/PVP-Banner-Emblem-40.PNG | Bin 0 -> 7892 bytes .../arena-banners/PVP-Banner-Emblem-41.PNG | Bin 0 -> 7748 bytes .../arena-banners/PVP-Banner-Emblem-42.PNG | Bin 0 -> 8387 bytes .../arena-banners/PVP-Banner-Emblem-43.PNG | Bin 0 -> 6486 bytes .../arena-banners/PVP-Banner-Emblem-44.PNG | Bin 0 -> 14028 bytes .../arena-banners/PVP-Banner-Emblem-45.PNG | Bin 0 -> 15769 bytes .../arena-banners/PVP-Banner-Emblem-46.PNG | Bin 0 -> 19122 bytes .../arena-banners/PVP-Banner-Emblem-47.PNG | Bin 0 -> 12666 bytes .../arena-banners/PVP-Banner-Emblem-48.PNG | Bin 0 -> 14515 bytes .../arena-banners/PVP-Banner-Emblem-49.PNG | Bin 0 -> 9201 bytes .../img/arena-banners/PVP-Banner-Emblem-5.PNG | Bin 0 -> 16888 bytes .../arena-banners/PVP-Banner-Emblem-50.PNG | Bin 0 -> 11758 bytes .../arena-banners/PVP-Banner-Emblem-51.PNG | Bin 0 -> 11243 bytes .../arena-banners/PVP-Banner-Emblem-52.PNG | Bin 0 -> 16562 bytes .../arena-banners/PVP-Banner-Emblem-53.PNG | Bin 0 -> 18976 bytes .../arena-banners/PVP-Banner-Emblem-54.PNG | Bin 0 -> 9780 bytes .../arena-banners/PVP-Banner-Emblem-55.PNG | Bin 0 -> 15024 bytes .../arena-banners/PVP-Banner-Emblem-56.PNG | Bin 0 -> 11662 bytes .../arena-banners/PVP-Banner-Emblem-57.PNG | Bin 0 -> 15401 bytes .../arena-banners/PVP-Banner-Emblem-58.PNG | Bin 0 -> 17329 bytes .../arena-banners/PVP-Banner-Emblem-59.PNG | Bin 0 -> 14836 bytes .../img/arena-banners/PVP-Banner-Emblem-6.PNG | Bin 0 -> 8566 bytes .../arena-banners/PVP-Banner-Emblem-60.PNG | Bin 0 -> 17865 bytes .../arena-banners/PVP-Banner-Emblem-61.PNG | Bin 0 -> 14493 bytes .../arena-banners/PVP-Banner-Emblem-62.PNG | Bin 0 -> 9421 bytes .../arena-banners/PVP-Banner-Emblem-63.PNG | Bin 0 -> 15376 bytes .../arena-banners/PVP-Banner-Emblem-64.PNG | Bin 0 -> 11843 bytes .../arena-banners/PVP-Banner-Emblem-65.PNG | Bin 0 -> 8092 bytes .../arena-banners/PVP-Banner-Emblem-66.PNG | Bin 0 -> 13134 bytes .../arena-banners/PVP-Banner-Emblem-67.PNG | Bin 0 -> 9749 bytes .../arena-banners/PVP-Banner-Emblem-68.PNG | Bin 0 -> 10610 bytes .../arena-banners/PVP-Banner-Emblem-69.PNG | Bin 0 -> 9936 bytes .../img/arena-banners/PVP-Banner-Emblem-7.PNG | Bin 0 -> 10219 bytes .../arena-banners/PVP-Banner-Emblem-70.PNG | Bin 0 -> 17668 bytes .../arena-banners/PVP-Banner-Emblem-71.PNG | Bin 0 -> 11188 bytes .../arena-banners/PVP-Banner-Emblem-72.PNG | Bin 0 -> 18107 bytes .../arena-banners/PVP-Banner-Emblem-73.PNG | Bin 0 -> 18795 bytes .../arena-banners/PVP-Banner-Emblem-74.PNG | Bin 0 -> 15646 bytes .../arena-banners/PVP-Banner-Emblem-75.PNG | Bin 0 -> 11235 bytes .../arena-banners/PVP-Banner-Emblem-76.PNG | Bin 0 -> 15749 bytes .../arena-banners/PVP-Banner-Emblem-77.PNG | Bin 0 -> 17969 bytes .../arena-banners/PVP-Banner-Emblem-78.PNG | Bin 0 -> 12529 bytes .../arena-banners/PVP-Banner-Emblem-79.PNG | Bin 0 -> 6965 bytes .../img/arena-banners/PVP-Banner-Emblem-8.PNG | Bin 0 -> 9193 bytes .../arena-banners/PVP-Banner-Emblem-80.PNG | Bin 0 -> 16555 bytes .../arena-banners/PVP-Banner-Emblem-81.PNG | Bin 0 -> 8176 bytes .../arena-banners/PVP-Banner-Emblem-82.PNG | Bin 0 -> 13671 bytes .../arena-banners/PVP-Banner-Emblem-83.PNG | Bin 0 -> 11572 bytes .../arena-banners/PVP-Banner-Emblem-84.PNG | Bin 0 -> 8044 bytes .../arena-banners/PVP-Banner-Emblem-85.PNG | Bin 0 -> 11725 bytes .../arena-banners/PVP-Banner-Emblem-86.PNG | Bin 0 -> 15962 bytes .../arena-banners/PVP-Banner-Emblem-87.PNG | Bin 0 -> 7028 bytes .../arena-banners/PVP-Banner-Emblem-88.PNG | Bin 0 -> 12843 bytes .../arena-banners/PVP-Banner-Emblem-89.PNG | Bin 0 -> 10483 bytes .../img/arena-banners/PVP-Banner-Emblem-9.PNG | Bin 0 -> 16300 bytes .../arena-banners/PVP-Banner-Emblem-90.PNG | Bin 0 -> 11365 bytes .../arena-banners/PVP-Banner-Emblem-91.PNG | Bin 0 -> 17647 bytes .../arena-banners/PVP-Banner-Emblem-92.PNG | Bin 0 -> 13804 bytes .../arena-banners/PVP-Banner-Emblem-93.PNG | Bin 0 -> 14051 bytes .../arena-banners/PVP-Banner-Emblem-94.PNG | Bin 0 -> 10809 bytes .../arena-banners/PVP-Banner-Emblem-95.PNG | Bin 0 -> 9307 bytes .../arena-banners/PVP-Banner-Emblem-96.PNG | Bin 0 -> 9802 bytes .../arena-banners/PVP-Banner-Emblem-97.PNG | Bin 0 -> 14696 bytes .../arena-banners/PVP-Banner-Emblem-98.PNG | Bin 0 -> 12152 bytes .../arena-banners/PVP-Banner-Emblem-99.PNG | Bin 0 -> 15519 bytes static/img/guild-emblems/circle2.png | Bin 102880 -> 0 bytes static/img/guild-emblems/circle3.png | Bin 185764 -> 0 bytes static/js/emblems.js | 112 ++++++++++++++++++ static/partials/character-header.hbs | 1 + static/partials/emblems.hbs | 2 + 145 files changed, 302 insertions(+), 107 deletions(-) create mode 100644 static/character-pvp.hbs create mode 100644 static/css/character-pvp.css create mode 100644 static/css/emblems.css create mode 100644 static/img/arena-banners/PVP-Banner-2-Border-1.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2-Border-2.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2-Border-3.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2-Border-4.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2-Border-5.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2-Border-6.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2-Crop.PNG create mode 100644 static/img/arena-banners/PVP-Banner-2.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Border-1.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Border-2.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Border-3.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Border-4.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Border-5.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Border-6.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3-Crop.PNG create mode 100644 static/img/arena-banners/PVP-Banner-3.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Border-1.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Border-2.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Border-3.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Border-4.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Border-5.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Border-6.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5-Crop.PNG create mode 100644 static/img/arena-banners/PVP-Banner-5.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-1.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-10.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-100.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-101.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-102.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-11.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-12.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-13.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-14.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-15.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-16.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-17.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-18.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-19.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-2.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-20.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-21.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-22.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-23.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-24.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-25.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-26.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-27.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-28.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-29.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-3.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-30.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-31.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-32.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-33.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-34.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-35.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-36.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-37.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-38.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-39.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-4.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-40.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-41.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-42.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-43.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-44.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-45.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-46.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-47.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-48.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-49.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-5.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-50.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-51.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-52.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-53.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-54.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-55.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-56.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-57.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-58.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-59.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-6.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-60.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-61.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-62.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-63.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-64.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-65.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-66.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-67.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-68.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-69.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-7.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-70.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-71.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-72.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-73.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-74.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-75.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-76.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-77.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-78.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-79.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-8.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-80.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-81.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-82.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-83.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-84.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-85.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-86.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-87.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-88.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-89.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-9.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-90.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-91.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-92.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-93.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-94.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-95.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-96.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-97.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-98.PNG create mode 100644 static/img/arena-banners/PVP-Banner-Emblem-99.PNG delete mode 100644 static/img/guild-emblems/circle2.png delete mode 100644 static/img/guild-emblems/circle3.png create mode 100644 static/js/emblems.js create mode 100644 static/partials/emblems.hbs diff --git a/package-lock.json b/package-lock.json index 121827e..74b0ebf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "azerothcore-armory", - "version": "0.9.1", + "version": "0.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "azerothcore-armory", - "version": "0.9.1", + "version": "0.10.0", "license": "MIT", "dependencies": { "@supercharge/promise-pool": "^2.1.0", diff --git a/package.json b/package.json index cf8630a..0552307 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azerothcore-armory", - "version": "0.9.1", + "version": "0.10.0", "description": "", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/src/armory/Armory.ts b/src/armory/Armory.ts index eaa25e9..bc90a54 100644 --- a/src/armory/Armory.ts +++ b/src/armory/Armory.ts @@ -138,6 +138,7 @@ export class Armory { app.get("/character/:realm/:name/talents", this.wrapRoute(charsController.talents.bind(charsController))); app.get("/character/:realm/:name/achievements", this.wrapRoute(charsController.achievements.bind(charsController))); app.get("/character/:realm/:character/achievements/data", this.wrapRoute(charsController.achievementsData.bind(charsController))); + app.get("/character/:realm/:name/pvp", this.wrapRoute(charsController.pvp.bind(charsController))); const guildsController = new GuildController(this); app.get("/guild/:realm/:name", this.wrapRoute(guildsController.guild.bind(guildsController))); diff --git a/src/armory/Utils.ts b/src/armory/Utils.ts index 3c1f654..7f0c427 100644 --- a/src/armory/Utils.ts +++ b/src/armory/Utils.ts @@ -3,6 +3,14 @@ export enum EFaction { Alliance = 1, } +export interface IEmblem { + icon: string; + iconColor: string; + border: string; + borderColor: string; + background: string; +} + export class Utils { public static raceNames = { 1: "human", @@ -32,4 +40,15 @@ export class Utils { public static getFactionFromRaceId(race: number): EFaction { return [1, 3, 4, 7, 11].includes(race) ? EFaction.Alliance : EFaction.Horde; } + + public static makeEmblemObject(obj: any, padWithZeroes: boolean = true): IEmblem { + const padLength = padWithZeroes ? 2 : 0; + return { + icon: obj.emblemStyle.toString().padStart(padLength, "0"), + iconColor: obj.emblemColor.toString().padStart(padLength, "0"), + border: obj.borderStyle.toString().padStart(padLength, "0"), + borderColor: obj.borderColor.toString().padStart(padLength, "0"), + background: obj.background.toString().padStart(padLength, "0"), + }; + } } diff --git a/src/armory/controllers/CharacterController.ts b/src/armory/controllers/CharacterController.ts index 66d363b..bc56c90 100644 --- a/src/armory/controllers/CharacterController.ts +++ b/src/armory/controllers/CharacterController.ts @@ -178,9 +178,9 @@ export class CharacterController { const mounts = await this.getMounts(realmName, charData.guid); res.render("character.hbs", { - title: `Armory - ${charName}`, + title: `Armory - ${charData.name}`, ...this.makeSharedDataObject(realm, charData), - data: JSON.stringify({ + data: { race: charData.race, gender: charData.gender, class: charData.class, @@ -189,7 +189,7 @@ export class CharacterController { customizationOptions: customization, equipment, mounts, - }), + }, }); this.armory.gc(); @@ -212,13 +212,13 @@ export class CharacterController { } res.render("character-talents.hbs", { - title: `Armory - ${charName} - Talents`, + title: `Armory - ${charData.name} - Talents`, ...this.makeSharedDataObject(realm, charData), - data: JSON.stringify({ + data: { talents: await this.getTalents(realm.name, charData.guid), trees: await this.getTalentTrees(charData.class), glyphs: await this.getGlyphs(realm.name, charData.guid), - }), + }, }); } @@ -239,7 +239,7 @@ export class CharacterController { } res.render("character-achievements.hbs", { - title: `Armory - ${charName} - Achievements`, + title: `Armory - ${charData.name} - Achievements`, ...this.makeSharedDataObject(realm, charData), }); } @@ -266,6 +266,31 @@ export class CharacterController { }); } + public async pvp(req: express.Request, res: express.Response, next: express.NextFunction): Promise { + const realmName = req.params.realm; + const charName = req.params.name; + + const realm = this.armory.getRealm(realmName); + if (realm === undefined) { + // Could not find realm + return next(404); + } + + const charData = await this.getCharacterData(realm, charName); + if (charData === null) { + // Could not find character + return next(404); + } + + res.render("character-pvp.hbs", { + title: `Armory - ${charData.name} - PvP`, + ...this.makeSharedDataObject(realm, charData), + faction: Utils.getFactionFromRaceId(charData.race), + kills: await this.getPvpKills(realm.name, charData.guid), + arenaTeams: await this.getArenaTeams(realm.name, charData.guid), + }); + } + private makeSharedDataObject(realm: IRealmConfig, charData: ICharacterData) { return { realm: realm.name, @@ -323,7 +348,7 @@ export class CharacterController { FROM character_spell WHERE guid = ? AND spell IN (?) `, - values:[charGuid, this.mountSpells], + values: [charGuid, this.mountSpells], timeout: this.armory.config.dbQueryTimeout, }); @@ -770,4 +795,44 @@ export class CharacterController { earned, }; } + + private async getPvpKills(realm: string, charGuid: number): Promise<{ total: number, today: number, yesterday: number }> { + const [rows, fields] = await this.armory.getCharactersDb(realm).query({ + sql: ` + SELECT totalKills, todayKills, yesterdayKills + FROM characters + WHERE guid = ? + `, + values: [charGuid], + timeout: this.armory.config.dbQueryTimeout, + }); + const row = rows[0]; + + return { + total: row.totalKills, + today: row.todayKills, + yesterday: row.yesterdayKills, + }; + } + + private async getArenaTeams(realm: string, charGuid: number): Promise { + const [rows, fields] = await this.armory.getCharactersDb(realm).query({ + sql: ` + SELECT + arena_team.arenaTeamId AS id, arena_team.name, arena_team.type, arena_team.rating, arena_team.seasonWins, arena_team.seasonGames, + arena_team.backgroundColor AS background, arena_team.emblemStyle, arena_team.emblemColor, arena_team.borderStyle, arena_team.borderColor + FROM arena_team_member + LEFT JOIN arena_team ON arena_team_member.arenaTeamId = arena_team.arenaTeamId + WHERE guid = ? + ORDER BY arena_team.type ASC + `, + values: [charGuid], + timeout: this.armory.config.dbQueryTimeout, + }); + + return (rows as RowDataPacket[]).map(row => { + row.emblem = Utils.makeEmblemObject(row, false); + return row; + }); + } } diff --git a/src/armory/controllers/GuildController.ts b/src/armory/controllers/GuildController.ts index f5a3876..8eb22d2 100644 --- a/src/armory/controllers/GuildController.ts +++ b/src/armory/controllers/GuildController.ts @@ -133,13 +133,7 @@ export class GuildController { name: guild.name, leader: leader.name, faction: Utils.getFactionFromRaceId(leader.race), - emblem: { - icon: guild.emblemStyle.toString().padStart(2, "0"), - iconColor: guild.emblemColor.toString().padStart(2, "0"), - border: guild.borderStyle.toString().padStart(2, "0"), - borderColor: guild.borderColor.toString().padStart(2, "0"), - background: guild.background.toString().padStart(2, "0"), - }, + emblem: Utils.makeEmblemObject(guild), membersCount, }; } diff --git a/src/tools/fetchdata.ts b/src/tools/fetchdata.ts index 5556e53..9e6b412 100644 --- a/src/tools/fetchdata.ts +++ b/src/tools/fetchdata.ts @@ -18,18 +18,18 @@ require("source-map-support").install(); const baseUrl = "https://wow.zamimg.com/modelviewer/live"; class Stopwatch { - private startTime: Date; + private startTime: number; public constructor() { this.start(); } public start(): void { - this.startTime = new Date(); + this.startTime = Date.now(); } public stop(text?: string): void { - const dt = Date.now() - this.startTime.getTime(); + const dt = Date.now() - this.startTime; const txt = text ?? "Done in {time}"; console.log(txt.replace("{time}", prettyMs(dt))); } diff --git a/static/character-pvp.hbs b/static/character-pvp.hbs new file mode 100644 index 0000000..6a62632 --- /dev/null +++ b/static/character-pvp.hbs @@ -0,0 +1,42 @@ + +{{> emblems}} + +{{> character-header }} + +
+
+ {{#eq faction 1}} + + {{else}} + + {{/eq}} + +
Total Kills: {{kills.total}}
+
Kills Today: {{kills.today}}
+
Kills Yesterday: {{kills.yesterday}}
+
+ + {{#each arenaTeams}} +
+
+
+
{{this.name}}
+
{{this.type}}v{{this.type}} Team
+
Rating: {{this.rating}}
+
{{this.seasonWins}} W / {{subtract this.seasonGames this.seasonWins}} L
+
+
+
+ +
+
+
+
+ {{/each}} +
+ + diff --git a/static/character-talents.hbs b/static/character-talents.hbs index 9d79bb6..d2ee79f 100644 --- a/static/character-talents.hbs +++ b/static/character-talents.hbs @@ -53,7 +53,7 @@