mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 13:16:39 +00:00
Compare commits
668 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9118d13f2f | |||
| 9f1519cd94 | |||
| 494789f8d0 | |||
| 462f1a2f45 | |||
| 1b27b43a6b | |||
| 512f29c0d4 | |||
| 1e136c4e2f | |||
| ec68e2bb99 | |||
| 3e768ad03c | |||
| f9ca3b49af | |||
| b596784ae3 | |||
| 64c5292c69 | |||
| d22fca7593 | |||
| 2b203c0ebe | |||
| c826d3b4e9 | |||
| 78a9de124e | |||
| 1ce272a1c3 | |||
| 678a4e30f5 | |||
| dbf8440a32 | |||
| b2a73dc572 | |||
| 406ea039d7 | |||
| b4e46c1f7e | |||
| 5502ab8765 | |||
| 7dc9b40ee1 | |||
| 2c9fe4f2b8 | |||
| 78223b7ebf | |||
| 73f310d098 | |||
| f22d90f6e2 | |||
| 78d4bd464e | |||
| 186c2fe2ae | |||
| 5250b819fa | |||
| da4bcbf736 | |||
| d8134df679 | |||
| 89382d5e4a | |||
| aa3c72c1de | |||
| 5e9a9e8afe | |||
| ba53b4144e | |||
| 5134a0e43b | |||
| 402d742def | |||
| 2b4e555eae | |||
| efe1879115 | |||
| ec857cefae | |||
| 034667f03b | |||
| d12145c449 | |||
| ce12481021 | |||
| 7cf96ca2d8 | |||
| e011864ed5 | |||
| 7482cfc066 | |||
| 8851b410d2 | |||
| 89fdd842e1 | |||
| c613dbb2f7 | |||
| 6f7fa98996 | |||
| fcf01f6d87 | |||
| 3228d6edf6 | |||
| 149fa54cfa | |||
| edda5ef811 | |||
| 786a7e2169 | |||
| 59584a8d94 | |||
| 94ac04b360 | |||
| 3e703769a4 | |||
| 57b3255fad | |||
| 10fd26ebbf | |||
| b9d8a13c76 | |||
| c0d4dd4176 | |||
| 6637e2c59f | |||
| e65b61a95f | |||
| c954685239 | |||
| 893d53425a | |||
| 295ec0e1b4 | |||
| 1d8dc4c8a8 | |||
| b108828502 | |||
| 3f9df40c3c | |||
| 3e8d34825a | |||
| 59691f39d7 | |||
| 8e3ad529dc | |||
| 607871a7ac | |||
| 6232a64cdb | |||
| 25c6b055a4 | |||
| 216b6ef426 | |||
| 597b041d92 | |||
| f6889d20e9 | |||
| 79285b1002 | |||
| b79e1947f1 | |||
| aa2b7f8947 | |||
| 1d5a3a82a8 | |||
| 8ee7759dec | |||
| 5ec18709a6 | |||
| 7c27c4350d | |||
| 6068085de4 | |||
| e1f515ba4b | |||
| c7a3e88b81 | |||
| b0da836f5a | |||
| a24a6f1160 | |||
| be1e558b3b | |||
| c4a99aabd0 | |||
| 0dfc6eaa15 | |||
| 3cccb183a2 | |||
| c6cfcc3ea9 | |||
| 53b599518a | |||
| 5e7e255d72 | |||
| 676467cbdc | |||
| 1351f147f4 | |||
| d243cbf8a3 | |||
| 8a962e09f6 | |||
| f64d072af7 | |||
| ea878ed27f | |||
| 793d4bc3a4 | |||
| 4592c15dd6 | |||
| 4cf6db79aa | |||
| 576e7b0f91 | |||
| 113846c48c | |||
| dd71420a0e | |||
| 0f9427098d | |||
| 25705878d8 | |||
| 6e2d11a283 | |||
| 2ccf692167 | |||
| 5e50c4181f | |||
| eaeb583048 | |||
| c68ff9bc5a | |||
| 3bda8251b9 | |||
| cadd29e5d1 | |||
| 4002d6a083 | |||
| 5331f4d841 | |||
| f4f5728195 | |||
| ed64c82a2f | |||
| c847e3da86 | |||
| 7d2f88325a | |||
| 1089f8139b | |||
| f07e3f4d3b | |||
| 9f8f838265 | |||
| 5af1620e50 | |||
| 20c639c872 | |||
| 635b7b5e86 | |||
| 139845f971 | |||
| ce74ac9913 | |||
| 1db2dffa57 | |||
| 59f8d54491 | |||
| 9488ee1e8c | |||
| ffe4d528e7 | |||
| ddb5794462 | |||
| c8b3ca53fe | |||
| fb2df0e570 | |||
| 6b5e4afd2d | |||
| 3b409def2c | |||
| 1488c3685c | |||
| 71966c85ca | |||
| 6cbfecd5a1 | |||
| 73d4e90275 | |||
| f7923457fd | |||
| f381453dbd | |||
| 792ea1608a | |||
| 230d115195 | |||
| dda1712bb8 | |||
| 849f4e18a5 | |||
| dfd8f84cac | |||
| 44c85a0dd7 | |||
| 8d6fcf2a84 | |||
| c59ec59e85 | |||
| a2e531d7e4 | |||
| 8ab3ec4fb0 | |||
| 19b751257b | |||
| f4904d00d2 | |||
| 67f5759e47 | |||
| eca4eed996 | |||
| 5c105d7408 | |||
| a444857b46 | |||
| 4025b84891 | |||
| 6d56b5b730 | |||
| 0f13a92b73 | |||
| 44dc9967a3 | |||
| 7e8a24fcec | |||
| 2829d21057 | |||
| 66d6d523cf | |||
| 1a02017737 | |||
| b5c4357de2 | |||
| 5c60913583 | |||
| 30f35a920b | |||
| 445c94bf4a | |||
| 221d173c59 | |||
| 68d28bcd3e | |||
| d107226ced | |||
| 2c0716f654 | |||
| 0c01872608 | |||
| 3936b2b882 | |||
| 15113f4056 | |||
| 16b31c5a3a | |||
| 28b07d635a | |||
| 059a4b7568 | |||
| b9ceba1b1c | |||
| cb95251c68 | |||
| be00aa1b60 | |||
| b2658a6cbc | |||
| 026133f32a | |||
| 6d4f22a1c0 | |||
| e75f87a535 | |||
| 83e066bffc | |||
| 4639405fdf | |||
| 8ef3e87370 | |||
| bec28769aa | |||
| 8586cdc47e | |||
| 63ba5dc3ab | |||
| fcc7725ca3 | |||
| 5df6a61c96 | |||
| fc5105eed7 | |||
| 243fb781e8 | |||
| ec4d228dd5 | |||
| 2910073373 | |||
| b4d5e807e3 | |||
| 8f729fe948 | |||
| 7160aa651e | |||
| 8414ce02e3 | |||
| 17034a6e47 | |||
| be1772d464 | |||
| a00f086bb8 | |||
| de830e5535 | |||
| d1404a2d95 | |||
| 38da37755d | |||
| 57ac46d090 | |||
| 59f32b8d34 | |||
| a45117cd04 | |||
| 291aaea581 | |||
| 162d34e1d9 | |||
| 86c9be410d | |||
| 30e34c67b4 | |||
| ce8b8da0d6 | |||
| 02e8b125a4 | |||
| 11369247b1 | |||
| d493a6627b | |||
| b07945f0be | |||
| 8f3ac74196 | |||
| bcf7ccefcd | |||
| 9e9ef6809b | |||
| c8f6dbb86d | |||
| 7de50d0e60 | |||
| aaaee6c6a4 | |||
| d7f38361f2 | |||
| 275995a374 | |||
| 7072b5721b | |||
| 123bc5f19a | |||
| e6db71e31e | |||
| 129a738072 | |||
| 0de90dc135 | |||
| 5bc4cff7a9 | |||
| f9191d4ef4 | |||
| 49d751b3d5 | |||
| 14f48fcc93 | |||
| 25addc3bd9 | |||
| 7f12ad325a | |||
| 6636c64c82 | |||
| e2708af6f2 | |||
| 1de0c27629 | |||
| 9ccdb9eb84 | |||
| e69f7a6cf1 | |||
| efd04f8324 | |||
| eeacc62a91 | |||
| a7a525ed0b | |||
| e43538cf73 | |||
| 5b90d26a33 | |||
| 992e4ac59e | |||
| 6b85c914a5 | |||
| 089246db53 | |||
| f3e5423677 | |||
| 0e96099b3d | |||
| 6398381c44 | |||
| 7c1a139991 | |||
| 8554aab2ff | |||
| 77e72ba666 | |||
| 8329760632 | |||
| d8aa8f7e7a | |||
| 29cdd91ca0 | |||
| df99d97431 | |||
| f314e05087 | |||
| d120cf8a40 | |||
| 209b0eb273 | |||
| 763fc82379 | |||
| 6e0d101457 | |||
| a1a4f91ea6 | |||
| 6cc845e05e | |||
| 597e324319 | |||
| f370a6048f | |||
| 9d784d0d9b | |||
| fd7b15abb1 | |||
| b27428a6d8 | |||
| f201d4c999 | |||
| d9c41526e8 | |||
| 07b46ed445 | |||
| 9f9eaed983 | |||
| 862e1e33bf | |||
| dca34cc2ff | |||
| ccb316b11b | |||
| 10ae4ea8f6 | |||
| 7df9b2974b | |||
| 0b3065d7a9 | |||
| 7549fbbeea | |||
| e26eba8e03 | |||
| 02828a73b8 | |||
| 0e710fe5e7 | |||
| 86568e9292 | |||
| bf1d05d639 | |||
| 4eaf44fc33 | |||
| e62a283a79 | |||
| a847e461c1 | |||
| 37fefad58e | |||
| 26b26af8d7 | |||
| ee86001132 | |||
| 7d89c05a48 | |||
| 6e15fae6a0 | |||
| 2f962c2c8a | |||
| 6bbd1e94c3 | |||
| 78d44440eb | |||
| 1e45ffa24d | |||
| 37d5d96871 | |||
| 90725f9fd9 | |||
| c1aa3e7056 | |||
| 1d59fff2bf | |||
| 6beb220e93 | |||
| 3091a84540 | |||
| 9fbab76d40 | |||
| b03d47b9cd | |||
| b583d95f09 | |||
| 6846deb9c8 | |||
| adfec15893 | |||
| 132c936c90 | |||
| a0ed0d57c5 | |||
| 128e8ce08d | |||
| 55629ce396 | |||
| bf7c1252f8 | |||
| e2bfa44df0 | |||
| e5acc7c322 | |||
| 5aaaaed6f1 | |||
| 6d31786456 | |||
| 0aeab11408 | |||
| fc484d0b1c | |||
| 8dcc810b43 | |||
| 04f3d6286c | |||
| 35044becc1 | |||
| e08afb1234 | |||
| b2b87ea4e0 | |||
| 837c0a4385 | |||
| 9b075c28b6 | |||
| c4f05c3864 | |||
| 0c12ca8370 | |||
| a450779c91 | |||
| dc004c2a9d | |||
| d59dcb68ca | |||
| c7dbdfae58 | |||
| 759f9bd007 | |||
| 8f0b80097e | |||
| 71ae03d5bc | |||
| 34dc081306 | |||
| 35b35f85cf | |||
| 90da136b7a | |||
| 5b4aeaa457 | |||
| b02008ec53 | |||
| c709a6aa8e | |||
| 9113508269 | |||
| 1b7c12297d | |||
| b1311780a7 | |||
| 0d734a0837 | |||
| ee54a7eb5f | |||
| a6814d46de | |||
| 9dba6a6680 | |||
| bc875ae554 | |||
| bb897b755f | |||
| a39a825045 | |||
| ccd0713b33 | |||
| 5d94c9844a | |||
| bbe2db7c0f | |||
| 5dc76e595b | |||
| b6b662f1c7 | |||
| 5275201713 | |||
| 1e86e0c02f | |||
| 25c0416f1e | |||
| 326dba6aeb | |||
| b75741ff4e | |||
| 8e62383997 | |||
| 4296e2e39e | |||
| e5f924d1d5 | |||
| fb2aee1827 | |||
| 791d8b329d | |||
| abcf8cbce1 | |||
| 3ed6663c4c | |||
| f22608a43a | |||
| 0e5d578d71 | |||
| 8107ed52e1 | |||
| d904db0e52 | |||
| e6c8a38ffa | |||
| dbe0591b09 | |||
| 5b6f1d38be | |||
| ce85c70a07 | |||
| f814b5bec5 | |||
| 4e40d7eacc | |||
| 31ad0da811 | |||
| 25a19a13dc | |||
| 2a5ddde78a | |||
| eca2ed0321 | |||
| afc32afb02 | |||
| 751db6fffb | |||
| c4eb1f8439 | |||
| d6c03b54a1 | |||
| 261a9e6938 | |||
| ac214f71d4 | |||
| fd878e7b16 | |||
| 58cde58b45 | |||
| cc2ef11158 | |||
| 2dfb7614cc | |||
| 6dffeacc6e | |||
| 2ec6dcbe24 | |||
| 39bc12b582 | |||
| 6d78f926c8 | |||
| 00af2903c3 | |||
| 58fafd0f9c | |||
| 9f0989ee2d | |||
| 14648b96c4 | |||
| bfd1cf9379 | |||
| 3c35e9bbc8 | |||
| d86544ff60 | |||
| 70eed67e08 | |||
| 1c0524681e | |||
| aa9320de3c | |||
| ad28f3c3f3 | |||
| 71dfa9acc0 | |||
| 56d0478ab1 | |||
| 0d02fadb60 | |||
| 4de5a7b86d | |||
| ba3c19ad0b | |||
| 8ec80644ee | |||
| ed7e2b2652 | |||
| a83ad7080a | |||
| 677d595c9d | |||
| 615f4a5304 | |||
| 5fd62d82db | |||
| b938e6223c | |||
| 51c8771bd2 | |||
| cc9196bd65 | |||
| 6303f129af | |||
| 3f0987ba55 | |||
| 1d4438ae1f | |||
| 03adf20fe9 | |||
| dd6cde68bb | |||
| 95c8b60ec6 | |||
| fa418172d6 | |||
| 7b106fc622 | |||
| 62a453f0d7 | |||
| fa9314811e | |||
| d2d7b8108d | |||
| 99793cab8b | |||
| e2484997dd | |||
| 66935fe21b | |||
| db988e4261 | |||
| fdd260d5fa | |||
| 9110bc863e | |||
| 4a41583805 | |||
| 5396c0c88b | |||
| 968ae26c99 | |||
| 7bf466cf3f | |||
| 49d7eb1402 | |||
| d83ced6f76 | |||
| 1ea8888607 | |||
| f9eb4603a3 | |||
| d656be6be4 | |||
| fbbbd3b09d | |||
| a6d1652f44 | |||
| f0bf285836 | |||
| 1f560529da | |||
| f65a6d2761 | |||
| 79f250da2d | |||
| 752e6c89f3 | |||
| e962ad3a35 | |||
| 872d494bb6 | |||
| 8a48473dbc | |||
| a208801d1f | |||
| a5d8a64792 | |||
| ee1f0ea91f | |||
| 7c20a86f23 | |||
| dbe6adbed0 | |||
| d300e78b39 | |||
| 0400504adc | |||
| 5ce2889210 | |||
| cc0371c16e | |||
| 4e297f3d96 | |||
| e9f48d5fba | |||
| 00c41dda8c | |||
| 7b235a6ede | |||
| 58d5983ef1 | |||
| 7749c626f0 | |||
| a6cd0bc33a | |||
| cba95851a2 | |||
| 7f5706abcf | |||
| 44b8c9203a | |||
| afdbc0ce80 | |||
| e850d80656 | |||
| b9722c6d28 | |||
| 5a7ee28740 | |||
| e4f2aec11e | |||
| e99c8dafc5 | |||
| 936043a53c | |||
| 3c09448e90 | |||
| e09a8f8f8f | |||
| 804f0681a9 | |||
| 71c53cb18b | |||
| 176bfc8524 | |||
| 28b1abe1a7 | |||
| 3a94132749 | |||
| 5ebbbf647b | |||
| 5f482a9b30 | |||
| 91aa950304 | |||
| 613066976d | |||
| 1a556f4451 | |||
| d10145fc6f | |||
| f3002d9656 | |||
| 59c373bcff | |||
| ae8273e0b1 | |||
| 10083387b6 | |||
| 7e065ad966 | |||
| ffa968f64f | |||
| 6bf5608cf3 | |||
| 3853c4f150 | |||
| d6d4c458e7 | |||
| 26b160c59b | |||
| d107ff3069 | |||
| 220d8497dd | |||
| 645251992d | |||
| 9815f50efa | |||
| c0f57bed1f | |||
| d280d54446 | |||
| c99c5c1f1c | |||
| e45f02af95 | |||
| 323b35989c | |||
| 7f23c93ce5 | |||
| 6a7782ab8d | |||
| 5457f30659 | |||
| 652ea89dea | |||
| c79fbb99aa | |||
| 4f0e9945c6 | |||
| 4fbb98a5f7 | |||
| 8c78a19c95 | |||
| 6a77764f8b | |||
| d0ec0872b9 | |||
| 724d47432b | |||
| f26d56d6d5 | |||
| 886b321e66 | |||
| 85971590c8 | |||
| 898b1ea4d1 | |||
| d460fb3db8 | |||
| fbc5d045de | |||
| 3414d3a1ae | |||
| feed584a41 | |||
| 119b2d023f | |||
| 73acc3310c | |||
| 6da7116c66 | |||
| 26b21673ad | |||
| ef1f6adf18 | |||
| 1c2e1ea228 | |||
| 7cf66a2daa | |||
| 91c958ae63 | |||
| 8de410ebb7 | |||
| 550485ba33 | |||
| eb2b4fd9e0 | |||
| 42f439c4b7 | |||
| 294e51fca7 | |||
| 94166e0f95 | |||
| 1a1c3abc24 | |||
| 0f4f5d7046 | |||
| 8ec4afe721 | |||
| aa4536e1ef | |||
| 01a671918a | |||
| e09f28c62c | |||
| 82000949e3 | |||
| 4a154686e1 | |||
| 29dfe9d404 | |||
| 9a0c98397e | |||
| bc0795bb48 | |||
| d972183a79 | |||
| f70b4a79b2 | |||
| 7cac2e2bc3 | |||
| 2be1321aa9 | |||
| ba5bb09af7 | |||
| 5ab9b941e2 | |||
| d28f902ecc | |||
| fd862d16bb | |||
| a6e5534b64 | |||
| 225497337c | |||
| a5348e207b | |||
| c4c5256438 | |||
| b3b9899a23 | |||
| 7d1d385418 | |||
| 96cdf1b076 | |||
| 8688e9c9fa | |||
| 6a28828e08 | |||
| 8566662d56 | |||
| 298ae3e3ba | |||
| 4507b063f5 | |||
| 774e0c7faa | |||
| 8b54bb34e4 | |||
| e87b8e2682 | |||
| 2dc3ca52db | |||
| 514029a6bb | |||
| b29f398239 | |||
| e474b2a280 | |||
| d38b8a4867 | |||
| 1a5f48521d | |||
| ba427c64ba | |||
| 9d59b3def4 | |||
| a6f5bf72be | |||
| 6ff7f7aa53 | |||
| 1a2897c423 | |||
| 8b5b19ae2c | |||
| 6fa41a3b73 | |||
| 6496690123 | |||
| a11482ff23 | |||
| 4672e48fbd | |||
| 8f3cce6585 | |||
| 8d3a179ecc | |||
| 2cbcefd9a0 | |||
| ef06a0d0b6 | |||
| 1935ea60d0 | |||
| 8c7e1be344 | |||
| 9240497cbc | |||
| 0da4610249 | |||
| 26c7287997 | |||
| cece66adc6 | |||
| d29993fafa | |||
| 39c27c987d | |||
| 5470ec6293 | |||
| 1acdc6034b | |||
| e9fc80815a | |||
| a84536cd05 | |||
| 0a34809bb3 | |||
| 03847fb1ac | |||
| 8a27fce3a8 | |||
| 6a42639386 | |||
| b9214bfdee | |||
| 04fda24c8e | |||
| 446c5d90ec | |||
| 80f15ed04a | |||
| 51fb46556d | |||
| d73194c1f6 | |||
| ec1cf68ce2 | |||
| 39b39970f6 | |||
| 40edefa6f4 | |||
| 7154d5b841 | |||
| dfe43ce189 | |||
| 69d5fee471 | |||
| f1d9221b4c | |||
| fb2f901539 | |||
| 7c12c5d5ef | |||
| 7559732408 | |||
| fac0d795f2 | |||
| 3efd9c7f60 | |||
| bf8a0328b3 | |||
| 0ebb1cc54c | |||
| a111668888 | |||
| 0550fcfd3f | |||
| 293361a1f7 | |||
| 5d75b7b365 | |||
| 6400e2f8bc | |||
| 76b0183a0f | |||
| b3471c51df | |||
| b2c86f5571 | |||
| 264c6cb019 | |||
| 9bcb617f90 | |||
| f5d37a9959 | |||
| c44b82500d | |||
| 4f550fcbf3 | |||
| 1103d50733 | |||
| ddcb184183 | |||
| 90bcc5f03c |
+12
-1
@@ -7,10 +7,21 @@ name: EQEmulator Server Linux CI
|
|||||||
concurrency:
|
concurrency:
|
||||||
limit: 1
|
limit: 1
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: cache
|
||||||
|
host:
|
||||||
|
path: /var/lib/cache
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: server-build
|
- name: server-build
|
||||||
# Source build script https://github.com/Akkadius/akk-stack/blob/master/containers/eqemu-server/Dockerfile#L20
|
# Source build script https://github.com/Akkadius/akk-stack/blob/master/containers/eqemu-server/Dockerfile#L20
|
||||||
image: akkadius/eqemu-server:latest
|
image: akkadius/eqemu-server:latest
|
||||||
commands:
|
commands:
|
||||||
- sudo chown eqemu:eqemu /drone/src/ * -R
|
- sudo chown eqemu:eqemu /drone/src/ * -R
|
||||||
- git submodule init && git submodule update && mkdir -p build && cd build && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
|
- sudo chown eqemu:eqemu /home/eqemu/.ccache/ * -R
|
||||||
|
- git submodule init && git submodule update && mkdir -p build && cd build && cmake -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LUA=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-O0 -g -DNDEBUG" -G 'Unix Makefiles' .. && make -j$((`nproc`-4))
|
||||||
|
- curl https://raw.githubusercontent.com/Akkadius/eqemu-install-v2/master/eqemu_config.json --output eqemu_config.json
|
||||||
|
- ./bin/tests
|
||||||
|
volumes:
|
||||||
|
- name: cache
|
||||||
|
path: /home/eqemu/.ccache/
|
||||||
|
|||||||
@@ -54,3 +54,5 @@ bin/
|
|||||||
/Win32
|
/Win32
|
||||||
/x64
|
/x64
|
||||||
/client_files/**/CMakeFiles/
|
/client_files/**/CMakeFiles/
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
language: cpp
|
|
||||||
compiler: gcc
|
|
||||||
dist: bionic
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- libmysqlclient-dev
|
|
||||||
- libperl-dev
|
|
||||||
- libboost-dev
|
|
||||||
- liblua5.1-0-dev
|
|
||||||
- zlib1g-dev
|
|
||||||
- uuid-dev
|
|
||||||
- libssl-dev
|
|
||||||
|
|
||||||
script:
|
|
||||||
- cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LOGIN=ON
|
|
||||||
- make -j2
|
|
||||||
- ./bin/tests
|
|
||||||
+3
-3
@@ -12,7 +12,7 @@ IF(NOT CMAKE_BUILD_TYPE)
|
|||||||
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
|
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
|
||||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
SET(CMAKE_CXX_STANDARD 14)
|
SET(CMAKE_CXX_STANDARD 17)
|
||||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
SET(CMAKE_CXX_EXTENSIONS OFF)
|
SET(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
@@ -20,6 +20,7 @@ IF(MSVC)
|
|||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
ADD_DEFINITIONS(-DNOMINMAX)
|
ADD_DEFINITIONS(-DNOMINMAX)
|
||||||
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
ADD_DEFINITIONS(-DCRASH_LOGGING)
|
||||||
|
ADD_DEFINITIONS(-D_HAS_AUTO_PTR_ETC) # for Luabind on C++17
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||||
ELSE(MSVC)
|
ELSE(MSVC)
|
||||||
@@ -121,7 +122,6 @@ ENDIF()
|
|||||||
MESSAGE(STATUS "**************************************************")
|
MESSAGE(STATUS "**************************************************")
|
||||||
|
|
||||||
#options
|
#options
|
||||||
OPTION(EQEMU_DEPOP_INVALIDATES_CACHE "#repop invalidates the npc_types cache (will cause a larger database hit on #repop but is more convienent)." ON)
|
|
||||||
OPTION(EQEMU_ENABLE_BOTS "Enable Bots" OFF)
|
OPTION(EQEMU_ENABLE_BOTS "Enable Bots" OFF)
|
||||||
OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON)
|
OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON)
|
||||||
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
OPTION(EQEMU_BUILD_SERVER "Build the game server." ON)
|
||||||
@@ -373,7 +373,7 @@ ENDIF()
|
|||||||
IF(PERL_LIBRARY_ENABLED)
|
IF(PERL_LIBRARY_ENABLED)
|
||||||
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON)
|
||||||
IF(EQEMU_BUILD_PERL)
|
IF(EQEMU_BUILD_PERL)
|
||||||
SET(SERVER_LIBS ${SERVER_LIBS} ${PERL_LIBRARY_LIBS})
|
SET(SERVER_LIBS ${SERVER_LIBS} ${PERL_LIBRARY_LIBS} perlbind)
|
||||||
INCLUDE_DIRECTORIES(SYSTEM "${PERL_LIBRARY_INCLUDE}")
|
INCLUDE_DIRECTORIES(SYSTEM "${PERL_LIBRARY_INCLUDE}")
|
||||||
ADD_DEFINITIONS(-DEMBPERL)
|
ADD_DEFINITIONS(-DEMBPERL)
|
||||||
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
|
||||||
|
|||||||
@@ -18,11 +18,11 @@
|
|||||||
|**Install Count**|||
|
|**Install Count**|||
|
||||||
### > Windows
|
### > Windows
|
||||||
|
|
||||||
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-windows)
|
* [Install Guide](https://docs.eqemu.io/server/installation/server-installation-windows/)
|
||||||
|
|
||||||
### > Debian/Ubuntu/CentOS/Fedora
|
### > Debian/Ubuntu/CentOS/Fedora
|
||||||
|
|
||||||
* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-linux)
|
* [Install Guide](https://docs.eqemu.io/server/installation/server-installation-linux/)
|
||||||
|
|
||||||
* You can use curl or wget to kick off the installer (whichever your OS has)
|
* You can use curl or wget to kick off the installer (whichever your OS has)
|
||||||
> curl -O https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh install.sh && chmod 755 install.sh && ./install.sh
|
> curl -O https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh install.sh && chmod 755 install.sh && ./install.sh
|
||||||
@@ -56,7 +56,7 @@ forum, although pull requests will be much quicker and easier on all parties.
|
|||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
- [EQEmulator Forums](http://www.eqemulator.org/forums)
|
- [EQEmulator Forums](http://www.eqemulator.org/forums)
|
||||||
- [EQEmulator Wiki](https://eqemu.gitbook.io/)
|
- [EQEmulator Wiki](https://docs.eqemu.io/)
|
||||||
|
|
||||||
## Related Repositories
|
## Related Repositories
|
||||||
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
|
* [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests)
|
||||||
|
|||||||
@@ -25,11 +25,13 @@
|
|||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
#include "../../common/crash.h"
|
#include "../../common/crash.h"
|
||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
#include "../../common/string_util.h"
|
#include "../../common/strings.h"
|
||||||
#include "../../common/content/world_content_service.h"
|
#include "../../common/content/world_content_service.h"
|
||||||
|
#include "../../common/zone_store.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
|
||||||
void ExportSpells(SharedDatabase *db);
|
void ExportSpells(SharedDatabase *db);
|
||||||
void ExportSkillCaps(SharedDatabase *db);
|
void ExportSkillCaps(SharedDatabase *db);
|
||||||
|
|||||||
@@ -23,11 +23,13 @@
|
|||||||
#include "../../common/platform.h"
|
#include "../../common/platform.h"
|
||||||
#include "../../common/crash.h"
|
#include "../../common/crash.h"
|
||||||
#include "../../common/rulesys.h"
|
#include "../../common/rulesys.h"
|
||||||
#include "../../common/string_util.h"
|
#include "../../common/strings.h"
|
||||||
#include "../../common/content/world_content_service.h"
|
#include "../../common/content/world_content_service.h"
|
||||||
|
#include "../../common/zone_store.h"
|
||||||
|
|
||||||
EQEmuLogSys LogSys;
|
EQEmuLogSys LogSys;
|
||||||
WorldContentService content_service;
|
WorldContentService content_service;
|
||||||
|
ZoneStore zone_store;
|
||||||
|
|
||||||
void ImportSpells(SharedDatabase *db);
|
void ImportSpells(SharedDatabase *db);
|
||||||
void ImportSkillCaps(SharedDatabase *db);
|
void ImportSkillCaps(SharedDatabase *db);
|
||||||
@@ -146,8 +148,8 @@ void ImportSpells(SharedDatabase *db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string escaped = ::EscapeString(buffer);
|
std::string escaped = ::Strings::Escape(buffer);
|
||||||
auto split = SplitString(escaped, '^');
|
auto split = Strings::Split(escaped, '^');
|
||||||
int line_columns = (int)split.size();
|
int line_columns = (int)split.size();
|
||||||
|
|
||||||
std::string sql;
|
std::string sql;
|
||||||
@@ -225,7 +227,7 @@ void ImportSkillCaps(SharedDatabase *db) {
|
|||||||
|
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
while(fgets(buffer, 2048, f)) {
|
while(fgets(buffer, 2048, f)) {
|
||||||
auto split = SplitString(buffer, '^');
|
auto split = Strings::Split(buffer, '^');
|
||||||
|
|
||||||
if(split.size() < 4) {
|
if(split.size() < 4) {
|
||||||
continue;
|
continue;
|
||||||
@@ -260,7 +262,7 @@ void ImportBaseData(SharedDatabase *db) {
|
|||||||
|
|
||||||
char buffer[2048];
|
char buffer[2048];
|
||||||
while(fgets(buffer, 2048, f)) {
|
while(fgets(buffer, 2048, f)) {
|
||||||
auto split = SplitString(buffer, '^');
|
auto split = Strings::Split(buffer, '^');
|
||||||
|
|
||||||
if(split.size() < 10) {
|
if(split.size() < 10) {
|
||||||
continue;
|
continue;
|
||||||
@@ -318,7 +320,7 @@ void ImportDBStrings(SharedDatabase *db) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto split = SplitString(buffer, '^');
|
auto split = Strings::Split(buffer, '^');
|
||||||
|
|
||||||
if(split.size() < 2) {
|
if(split.size() < 2) {
|
||||||
continue;
|
continue;
|
||||||
@@ -332,7 +334,7 @@ void ImportDBStrings(SharedDatabase *db) {
|
|||||||
type = atoi(split[1].c_str());
|
type = atoi(split[1].c_str());
|
||||||
|
|
||||||
if(split.size() >= 3) {
|
if(split.size() >= 3) {
|
||||||
value = ::EscapeString(split[2]);
|
value = ::Strings::Escape(split[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
sql = StringFormat("INSERT INTO db_str(id, type, value) VALUES(%u, %u, '%s')",
|
sql = StringFormat("INSERT INTO db_str(id, type, value) VALUES(%u, %u, '%s')",
|
||||||
|
|||||||
+43
-31
@@ -7,6 +7,7 @@ SET(common_sources
|
|||||||
compression.cpp
|
compression.cpp
|
||||||
condition.cpp
|
condition.cpp
|
||||||
content/world_content_service.cpp
|
content/world_content_service.cpp
|
||||||
|
discord/discord.cpp
|
||||||
crash.cpp
|
crash.cpp
|
||||||
crc16.cpp
|
crc16.cpp
|
||||||
crc32.cpp
|
crc32.cpp
|
||||||
@@ -34,6 +35,7 @@ SET(common_sources
|
|||||||
event_sub.cpp
|
event_sub.cpp
|
||||||
expedition_lockout_timer.cpp
|
expedition_lockout_timer.cpp
|
||||||
extprofile.cpp
|
extprofile.cpp
|
||||||
|
discord_manager.cpp
|
||||||
faction.cpp
|
faction.cpp
|
||||||
file_util.cpp
|
file_util.cpp
|
||||||
guild_base.cpp
|
guild_base.cpp
|
||||||
@@ -75,13 +77,14 @@ SET(common_sources
|
|||||||
shareddb.cpp
|
shareddb.cpp
|
||||||
skills.cpp
|
skills.cpp
|
||||||
spdat.cpp
|
spdat.cpp
|
||||||
string_util.cpp
|
strings.cpp
|
||||||
struct_strategy.cpp
|
struct_strategy.cpp
|
||||||
textures.cpp
|
textures.cpp
|
||||||
timer.cpp
|
timer.cpp
|
||||||
unix.cpp
|
unix.cpp
|
||||||
platform.cpp
|
platform.cpp
|
||||||
json/jsoncpp.cpp
|
json/jsoncpp.cpp
|
||||||
|
zone_store.cpp
|
||||||
net/console_server.cpp
|
net/console_server.cpp
|
||||||
net/console_server_connection.cpp
|
net/console_server_connection.cpp
|
||||||
net/crc32.cpp
|
net/crc32.cpp
|
||||||
@@ -118,6 +121,9 @@ SET(repositories
|
|||||||
# Criteria
|
# Criteria
|
||||||
repositories/criteria/content_filter_criteria.h
|
repositories/criteria/content_filter_criteria.h
|
||||||
|
|
||||||
|
repositories/base/base_grid_repository.h
|
||||||
|
repositories/base/base_grid_entries_repository.h
|
||||||
|
|
||||||
# Base Repositories
|
# Base Repositories
|
||||||
repositories/base/base_aa_ability_repository.h
|
repositories/base/base_aa_ability_repository.h
|
||||||
repositories/base/base_aa_ranks_repository.h
|
repositories/base/base_aa_ranks_repository.h
|
||||||
@@ -137,6 +143,7 @@ SET(repositories
|
|||||||
repositories/base/base_auras_repository.h
|
repositories/base/base_auras_repository.h
|
||||||
repositories/base/base_base_data_repository.h
|
repositories/base/base_base_data_repository.h
|
||||||
repositories/base/base_blocked_spells_repository.h
|
repositories/base/base_blocked_spells_repository.h
|
||||||
|
repositories/base/base_books_repository.h
|
||||||
repositories/base/base_bugs_repository.h
|
repositories/base/base_bugs_repository.h
|
||||||
repositories/base/base_bug_reports_repository.h
|
repositories/base/base_bug_reports_repository.h
|
||||||
repositories/base/base_buyer_repository.h
|
repositories/base/base_buyer_repository.h
|
||||||
@@ -153,6 +160,7 @@ SET(repositories
|
|||||||
repositories/base/base_character_data_repository.h
|
repositories/base/base_character_data_repository.h
|
||||||
repositories/base/base_character_disciplines_repository.h
|
repositories/base/base_character_disciplines_repository.h
|
||||||
repositories/base/base_character_expedition_lockouts_repository.h
|
repositories/base/base_character_expedition_lockouts_repository.h
|
||||||
|
repositories/base/base_character_exp_modifiers_repository.h
|
||||||
repositories/base/base_character_inspect_messages_repository.h
|
repositories/base/base_character_inspect_messages_repository.h
|
||||||
repositories/base/base_character_instance_safereturns_repository.h
|
repositories/base/base_character_instance_safereturns_repository.h
|
||||||
repositories/base/base_character_item_recast_repository.h
|
repositories/base/base_character_item_recast_repository.h
|
||||||
@@ -160,32 +168,36 @@ SET(repositories
|
|||||||
repositories/base/base_character_leadership_abilities_repository.h
|
repositories/base/base_character_leadership_abilities_repository.h
|
||||||
repositories/base/base_character_material_repository.h
|
repositories/base/base_character_material_repository.h
|
||||||
repositories/base/base_character_memmed_spells_repository.h
|
repositories/base/base_character_memmed_spells_repository.h
|
||||||
|
repositories/base/base_character_peqzone_flags_repository.h
|
||||||
repositories/base/base_character_pet_buffs_repository.h
|
repositories/base/base_character_pet_buffs_repository.h
|
||||||
repositories/base/base_character_pet_info_repository.h
|
repositories/base/base_character_pet_info_repository.h
|
||||||
repositories/base/base_character_pet_inventory_repository.h
|
repositories/base/base_character_pet_inventory_repository.h
|
||||||
repositories/base/base_character_potionbelt_repository.h
|
repositories/base/base_character_potionbelt_repository.h
|
||||||
repositories/base/base_character_skills_repository.h
|
repositories/base/base_character_skills_repository.h
|
||||||
repositories/base/base_character_spells_repository.h
|
repositories/base/base_character_spells_repository.h
|
||||||
repositories/base/base_character_task_timers_repository.h
|
|
||||||
repositories/base/base_character_tasks_repository.h
|
repositories/base/base_character_tasks_repository.h
|
||||||
|
repositories/base/base_character_task_timers_repository.h
|
||||||
repositories/base/base_char_create_combinations_repository.h
|
repositories/base/base_char_create_combinations_repository.h
|
||||||
repositories/base/base_char_create_point_allocations_repository.h
|
repositories/base/base_char_create_point_allocations_repository.h
|
||||||
repositories/base/base_char_recipe_list_repository.h
|
repositories/base/base_char_recipe_list_repository.h
|
||||||
repositories/base/base_completed_tasks_repository.h
|
|
||||||
repositories/base/base_completed_shared_tasks_repository.h
|
repositories/base/base_completed_shared_tasks_repository.h
|
||||||
repositories/base/base_completed_shared_task_members_repository.h
|
|
||||||
repositories/base/base_completed_shared_task_activity_state_repository.h
|
repositories/base/base_completed_shared_task_activity_state_repository.h
|
||||||
|
repositories/base/base_completed_shared_task_members_repository.h
|
||||||
|
repositories/base/base_completed_tasks_repository.h
|
||||||
repositories/base/base_content_flags_repository.h
|
repositories/base/base_content_flags_repository.h
|
||||||
repositories/base/base_damageshieldtypes_repository.h
|
repositories/base/base_damageshieldtypes_repository.h
|
||||||
repositories/base/base_data_buckets_repository.h
|
repositories/base/base_data_buckets_repository.h
|
||||||
repositories/base/base_db_str_repository.h
|
repositories/base/base_db_str_repository.h
|
||||||
|
repositories/base/base_discord_webhooks_repository.h
|
||||||
repositories/base/base_discovered_items_repository.h
|
repositories/base/base_discovered_items_repository.h
|
||||||
repositories/base/base_doors_repository.h
|
repositories/base/base_doors_repository.h
|
||||||
repositories/base/base_dynamic_zones_repository.h
|
repositories/base/base_dynamic_zones_repository.h
|
||||||
repositories/base/base_dynamic_zone_members_repository.h
|
repositories/base/base_dynamic_zone_members_repository.h
|
||||||
|
repositories/base/base_dynamic_zone_templates_repository.h
|
||||||
repositories/base/base_eventlog_repository.h
|
repositories/base/base_eventlog_repository.h
|
||||||
repositories/base/base_expeditions_repository.h
|
repositories/base/base_expeditions_repository.h
|
||||||
repositories/base/base_expedition_lockouts_repository.h
|
repositories/base/base_expedition_lockouts_repository.h
|
||||||
|
repositories/base/base_faction_association_repository.h
|
||||||
repositories/base/base_faction_base_data_repository.h
|
repositories/base/base_faction_base_data_repository.h
|
||||||
repositories/base/base_faction_list_repository.h
|
repositories/base/base_faction_list_repository.h
|
||||||
repositories/base/base_faction_list_mod_repository.h
|
repositories/base/base_faction_list_mod_repository.h
|
||||||
@@ -195,18 +207,15 @@ SET(repositories
|
|||||||
repositories/base/base_friends_repository.h
|
repositories/base/base_friends_repository.h
|
||||||
repositories/base/base_global_loot_repository.h
|
repositories/base/base_global_loot_repository.h
|
||||||
repositories/base/base_gm_ips_repository.h
|
repositories/base/base_gm_ips_repository.h
|
||||||
repositories/base/base_goallists_repository.h
|
|
||||||
repositories/base/base_graveyard_repository.h
|
repositories/base/base_graveyard_repository.h
|
||||||
repositories/base/base_grid_repository.h
|
|
||||||
repositories/base/base_grid_entries_repository.h
|
|
||||||
repositories/base/base_ground_spawns_repository.h
|
repositories/base/base_ground_spawns_repository.h
|
||||||
repositories/base/base_group_id_repository.h
|
repositories/base/base_group_id_repository.h
|
||||||
repositories/base/base_group_leaders_repository.h
|
repositories/base/base_group_leaders_repository.h
|
||||||
repositories/base/base_guilds_repository.h
|
repositories/base/base_guilds_repository.h
|
||||||
repositories/base/base_guild_members_repository.h
|
|
||||||
repositories/base/base_guild_ranks_repository.h
|
repositories/base/base_guild_ranks_repository.h
|
||||||
repositories/base/base_guild_relations_repository.h
|
repositories/base/base_guild_relations_repository.h
|
||||||
repositories/base/base_hackers_repository.h
|
repositories/base/base_hackers_repository.h
|
||||||
|
repositories/base/base_horses_repository.h
|
||||||
repositories/base/base_instance_list_repository.h
|
repositories/base/base_instance_list_repository.h
|
||||||
repositories/base/base_instance_list_player_repository.h
|
repositories/base/base_instance_list_player_repository.h
|
||||||
repositories/base/base_inventory_repository.h
|
repositories/base/base_inventory_repository.h
|
||||||
@@ -247,10 +256,10 @@ SET(repositories
|
|||||||
repositories/base/base_perl_event_export_settings_repository.h
|
repositories/base/base_perl_event_export_settings_repository.h
|
||||||
repositories/base/base_petitions_repository.h
|
repositories/base/base_petitions_repository.h
|
||||||
repositories/base/base_pets_repository.h
|
repositories/base/base_pets_repository.h
|
||||||
|
repositories/base/base_pets_beastlord_data_repository.h
|
||||||
repositories/base/base_pets_equipmentset_repository.h
|
repositories/base/base_pets_equipmentset_repository.h
|
||||||
repositories/base/base_pets_equipmentset_entries_repository.h
|
repositories/base/base_pets_equipmentset_entries_repository.h
|
||||||
repositories/base/base_player_titlesets_repository.h
|
repositories/base/base_player_titlesets_repository.h
|
||||||
repositories/base/base_proximities_repository.h
|
|
||||||
repositories/base/base_quest_globals_repository.h
|
repositories/base/base_quest_globals_repository.h
|
||||||
repositories/base/base_raid_details_repository.h
|
repositories/base/base_raid_details_repository.h
|
||||||
repositories/base/base_raid_members_repository.h
|
repositories/base/base_raid_members_repository.h
|
||||||
@@ -310,6 +319,7 @@ SET(repositories
|
|||||||
repositories/auras_repository.h
|
repositories/auras_repository.h
|
||||||
repositories/base_data_repository.h
|
repositories/base_data_repository.h
|
||||||
repositories/blocked_spells_repository.h
|
repositories/blocked_spells_repository.h
|
||||||
|
repositories/books_repository.h
|
||||||
repositories/bugs_repository.h
|
repositories/bugs_repository.h
|
||||||
repositories/bug_reports_repository.h
|
repositories/bug_reports_repository.h
|
||||||
repositories/buyer_repository.h
|
repositories/buyer_repository.h
|
||||||
@@ -326,6 +336,7 @@ SET(repositories
|
|||||||
repositories/character_data_repository.h
|
repositories/character_data_repository.h
|
||||||
repositories/character_disciplines_repository.h
|
repositories/character_disciplines_repository.h
|
||||||
repositories/character_expedition_lockouts_repository.h
|
repositories/character_expedition_lockouts_repository.h
|
||||||
|
repositories/character_exp_modifiers_repository.h
|
||||||
repositories/character_inspect_messages_repository.h
|
repositories/character_inspect_messages_repository.h
|
||||||
repositories/character_instance_safereturns_repository.h
|
repositories/character_instance_safereturns_repository.h
|
||||||
repositories/character_item_recast_repository.h
|
repositories/character_item_recast_repository.h
|
||||||
@@ -333,32 +344,36 @@ SET(repositories
|
|||||||
repositories/character_leadership_abilities_repository.h
|
repositories/character_leadership_abilities_repository.h
|
||||||
repositories/character_material_repository.h
|
repositories/character_material_repository.h
|
||||||
repositories/character_memmed_spells_repository.h
|
repositories/character_memmed_spells_repository.h
|
||||||
|
repositories/character_peqzone_flags_repository.h
|
||||||
repositories/character_pet_buffs_repository.h
|
repositories/character_pet_buffs_repository.h
|
||||||
repositories/character_pet_info_repository.h
|
repositories/character_pet_info_repository.h
|
||||||
repositories/character_pet_inventory_repository.h
|
repositories/character_pet_inventory_repository.h
|
||||||
repositories/character_potionbelt_repository.h
|
repositories/character_potionbelt_repository.h
|
||||||
repositories/character_skills_repository.h
|
repositories/character_skills_repository.h
|
||||||
repositories/character_spells_repository.h
|
repositories/character_spells_repository.h
|
||||||
repositories/character_task_timers_repository.h
|
|
||||||
repositories/character_tasks_repository.h
|
repositories/character_tasks_repository.h
|
||||||
|
repositories/character_task_timers_repository.h
|
||||||
repositories/char_create_combinations_repository.h
|
repositories/char_create_combinations_repository.h
|
||||||
repositories/char_create_point_allocations_repository.h
|
repositories/char_create_point_allocations_repository.h
|
||||||
repositories/char_recipe_list_repository.h
|
repositories/char_recipe_list_repository.h
|
||||||
repositories/completed_tasks_repository.h
|
|
||||||
repositories/completed_shared_tasks_repository.h
|
repositories/completed_shared_tasks_repository.h
|
||||||
repositories/completed_shared_task_members_repository.h
|
|
||||||
repositories/completed_shared_task_activity_state_repository.h
|
repositories/completed_shared_task_activity_state_repository.h
|
||||||
|
repositories/completed_shared_task_members_repository.h
|
||||||
|
repositories/completed_tasks_repository.h
|
||||||
repositories/content_flags_repository.h
|
repositories/content_flags_repository.h
|
||||||
repositories/damageshieldtypes_repository.h
|
repositories/damageshieldtypes_repository.h
|
||||||
repositories/data_buckets_repository.h
|
repositories/data_buckets_repository.h
|
||||||
repositories/db_str_repository.h
|
repositories/db_str_repository.h
|
||||||
|
repositories/discord_webhooks_repository.h
|
||||||
repositories/discovered_items_repository.h
|
repositories/discovered_items_repository.h
|
||||||
repositories/doors_repository.h
|
repositories/doors_repository.h
|
||||||
repositories/dynamic_zones_repository.h
|
repositories/dynamic_zones_repository.h
|
||||||
repositories/dynamic_zone_members_repository.h
|
repositories/dynamic_zone_members_repository.h
|
||||||
|
repositories/dynamic_zone_templates_repository.h
|
||||||
repositories/eventlog_repository.h
|
repositories/eventlog_repository.h
|
||||||
repositories/expeditions_repository.h
|
repositories/expeditions_repository.h
|
||||||
repositories/expedition_lockouts_repository.h
|
repositories/expedition_lockouts_repository.h
|
||||||
|
repositories/faction_association_repository.h
|
||||||
repositories/faction_base_data_repository.h
|
repositories/faction_base_data_repository.h
|
||||||
repositories/faction_list_repository.h
|
repositories/faction_list_repository.h
|
||||||
repositories/faction_list_mod_repository.h
|
repositories/faction_list_mod_repository.h
|
||||||
@@ -368,18 +383,15 @@ SET(repositories
|
|||||||
repositories/friends_repository.h
|
repositories/friends_repository.h
|
||||||
repositories/global_loot_repository.h
|
repositories/global_loot_repository.h
|
||||||
repositories/gm_ips_repository.h
|
repositories/gm_ips_repository.h
|
||||||
repositories/goallists_repository.h
|
|
||||||
repositories/graveyard_repository.h
|
repositories/graveyard_repository.h
|
||||||
repositories/grid_repository.h
|
|
||||||
repositories/grid_entries_repository.h
|
|
||||||
repositories/ground_spawns_repository.h
|
repositories/ground_spawns_repository.h
|
||||||
repositories/group_id_repository.h
|
repositories/group_id_repository.h
|
||||||
repositories/group_leaders_repository.h
|
repositories/group_leaders_repository.h
|
||||||
repositories/guilds_repository.h
|
repositories/guilds_repository.h
|
||||||
repositories/guild_members_repository.h
|
|
||||||
repositories/guild_ranks_repository.h
|
repositories/guild_ranks_repository.h
|
||||||
repositories/guild_relations_repository.h
|
repositories/guild_relations_repository.h
|
||||||
repositories/hackers_repository.h
|
repositories/hackers_repository.h
|
||||||
|
repositories/horses_repository.h
|
||||||
repositories/instance_list_repository.h
|
repositories/instance_list_repository.h
|
||||||
repositories/instance_list_player_repository.h
|
repositories/instance_list_player_repository.h
|
||||||
repositories/inventory_repository.h
|
repositories/inventory_repository.h
|
||||||
@@ -420,10 +432,10 @@ SET(repositories
|
|||||||
repositories/perl_event_export_settings_repository.h
|
repositories/perl_event_export_settings_repository.h
|
||||||
repositories/petitions_repository.h
|
repositories/petitions_repository.h
|
||||||
repositories/pets_repository.h
|
repositories/pets_repository.h
|
||||||
|
repositories/pets_beastlord_data_repository.h
|
||||||
repositories/pets_equipmentset_repository.h
|
repositories/pets_equipmentset_repository.h
|
||||||
repositories/pets_equipmentset_entries_repository.h
|
repositories/pets_equipmentset_entries_repository.h
|
||||||
repositories/player_titlesets_repository.h
|
repositories/player_titlesets_repository.h
|
||||||
repositories/proximities_repository.h
|
|
||||||
repositories/quest_globals_repository.h
|
repositories/quest_globals_repository.h
|
||||||
repositories/raid_details_repository.h
|
repositories/raid_details_repository.h
|
||||||
repositories/raid_members_repository.h
|
repositories/raid_members_repository.h
|
||||||
@@ -464,13 +476,10 @@ SET(repositories
|
|||||||
repositories/zone_repository.h
|
repositories/zone_repository.h
|
||||||
repositories/zone_points_repository.h
|
repositories/zone_points_repository.h
|
||||||
|
|
||||||
# Non-Comformative
|
)
|
||||||
repositories/character_recipe_list_repository.h
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(common_headers
|
SET(common_headers
|
||||||
additive_lagged_fibonacci_engine.h
|
additive_lagged_fibonacci_engine.h
|
||||||
any.h
|
|
||||||
base_packet.h
|
base_packet.h
|
||||||
base_data.h
|
base_data.h
|
||||||
bodytypes.h
|
bodytypes.h
|
||||||
@@ -491,6 +500,8 @@ SET(common_headers
|
|||||||
database_schema.h
|
database_schema.h
|
||||||
dbcore.h
|
dbcore.h
|
||||||
deity.h
|
deity.h
|
||||||
|
discord/discord.h
|
||||||
|
discord_manager.h
|
||||||
dynamic_zone_base.h
|
dynamic_zone_base.h
|
||||||
emu_constants.h
|
emu_constants.h
|
||||||
emu_limits.h
|
emu_limits.h
|
||||||
@@ -575,7 +586,7 @@ SET(common_headers
|
|||||||
shareddb.h
|
shareddb.h
|
||||||
skills.h
|
skills.h
|
||||||
spdat.h
|
spdat.h
|
||||||
string_util.h
|
strings.h
|
||||||
struct_strategy.h
|
struct_strategy.h
|
||||||
tasks.h
|
tasks.h
|
||||||
textures.h
|
textures.h
|
||||||
@@ -585,6 +596,7 @@ SET(common_headers
|
|||||||
useperl.h
|
useperl.h
|
||||||
version.h
|
version.h
|
||||||
zone_numbers.h
|
zone_numbers.h
|
||||||
|
zone_store.h
|
||||||
event/event_loop.h
|
event/event_loop.h
|
||||||
event/task.h
|
event/task.h
|
||||||
event/timer.h
|
event/timer.h
|
||||||
@@ -640,19 +652,19 @@ SET(common_headers
|
|||||||
util/memory_stream.h
|
util/memory_stream.h
|
||||||
util/directory.h
|
util/directory.h
|
||||||
util/uuid.h
|
util/uuid.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SOURCE_GROUP(Event FILES
|
SOURCE_GROUP(Event FILES
|
||||||
event/event_loop.h
|
event/event_loop.h
|
||||||
event/timer.h
|
event/timer.h
|
||||||
event/task.h
|
event/task.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SOURCE_GROUP(Json FILES
|
SOURCE_GROUP(Json FILES
|
||||||
json/json.h
|
json/json.h
|
||||||
json/jsoncpp.cpp
|
json/jsoncpp.cpp
|
||||||
json/json-forwards.h
|
json/json-forwards.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SOURCE_GROUP(Net FILES
|
SOURCE_GROUP(Net FILES
|
||||||
net/console_server.cpp
|
net/console_server.cpp
|
||||||
@@ -689,7 +701,7 @@ SOURCE_GROUP(Net FILES
|
|||||||
net/websocket_server.h
|
net/websocket_server.h
|
||||||
net/websocket_server_connection.cpp
|
net/websocket_server_connection.cpp
|
||||||
net/websocket_server_connection.h
|
net/websocket_server_connection.h
|
||||||
)
|
)
|
||||||
|
|
||||||
SOURCE_GROUP(Patches FILES
|
SOURCE_GROUP(Patches FILES
|
||||||
patches/patches.h
|
patches/patches.h
|
||||||
@@ -733,12 +745,12 @@ SOURCE_GROUP(Patches FILES
|
|||||||
patches/titanium_limits.cpp
|
patches/titanium_limits.cpp
|
||||||
patches/uf.cpp
|
patches/uf.cpp
|
||||||
patches/uf_limits.cpp
|
patches/uf_limits.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SOURCE_GROUP(StackWalker FILES
|
SOURCE_GROUP(StackWalker FILES
|
||||||
StackWalker/StackWalker.h
|
StackWalker/StackWalker.h
|
||||||
StackWalker/StackWalker.cpp
|
StackWalker/StackWalker.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
SOURCE_GROUP(Util FILES
|
SOURCE_GROUP(Util FILES
|
||||||
util/memory_stream.h
|
util/memory_stream.h
|
||||||
@@ -746,16 +758,16 @@ SOURCE_GROUP(Util FILES
|
|||||||
util/directory.h
|
util/directory.h
|
||||||
util/uuid.cpp
|
util/uuid.cpp
|
||||||
util/uuid.h
|
util/uuid.h
|
||||||
)
|
)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(Patches SocketLib StackWalker)
|
INCLUDE_DIRECTORIES(Patches SocketLib StackWalker)
|
||||||
|
|
||||||
ADD_LIBRARY(common ${common_sources} ${common_headers} ${repositories})
|
ADD_LIBRARY(common ${common_sources} ${common_headers} ${repositories})
|
||||||
|
|
||||||
IF(UNIX)
|
IF (UNIX)
|
||||||
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
|
SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
|
||||||
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
|
||||||
ENDIF(UNIX)
|
ENDIF (UNIX)
|
||||||
|
|
||||||
|
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|||||||
-190
@@ -1,190 +0,0 @@
|
|||||||
/*
|
|
||||||
* Boost Software License - Version 1.0 - August 17th, 2003
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person or organization
|
|
||||||
* obtaining a copy of the software and accompanying documentation covered by
|
|
||||||
* this license (the "Software") to use, reproduce, display, distribute,
|
|
||||||
* execute, and transmit the Software, and to prepare derivative works of the
|
|
||||||
* Software, and to permit third-parties to whom the Software is furnished to
|
|
||||||
* do so, all subject to the following:
|
|
||||||
*
|
|
||||||
* The copyright notices in the Software and this entire statement, including
|
|
||||||
* the above license grant, this restriction and the following disclaimer,
|
|
||||||
* must be included in all copies of the Software, in whole or in part, and
|
|
||||||
* all derivative works of the Software, unless such copies or derivative
|
|
||||||
* works are solely in the form of machine-executable object code generated by
|
|
||||||
* a source language processor.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
||||||
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
||||||
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
||||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
||||||
* DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// EQ::Any is a modified version of Boost::Any and as such retains the Boost licensing.
|
|
||||||
|
|
||||||
#ifndef EQEMU_COMMON_ANY_H
|
|
||||||
#define EQEMU_COMMON_ANY_H
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <typeinfo>
|
|
||||||
|
|
||||||
namespace EQ
|
|
||||||
{
|
|
||||||
class Any
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Any()
|
|
||||||
: content(nullptr)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
Any(const ValueType &value)
|
|
||||||
: content(new Holder<ValueType>(value))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Any(const Any &other)
|
|
||||||
: content(other.content ? other.content->clone() : 0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~Any()
|
|
||||||
{
|
|
||||||
if(content)
|
|
||||||
delete content;
|
|
||||||
}
|
|
||||||
|
|
||||||
Any& swap(Any &rhs)
|
|
||||||
{
|
|
||||||
std::swap(content, rhs.content);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
Any& operator=(const ValueType &rhs)
|
|
||||||
{
|
|
||||||
Any(rhs).swap(*this);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
Any& operator=(Any rhs)
|
|
||||||
{
|
|
||||||
rhs.swap(*this);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool empty() const
|
|
||||||
{
|
|
||||||
return !content;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::type_info& type() const
|
|
||||||
{
|
|
||||||
return content ? content->type() : typeid(void);
|
|
||||||
}
|
|
||||||
|
|
||||||
class Placeholder
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~Placeholder()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const std::type_info& type() const = 0;
|
|
||||||
virtual Placeholder* clone() const = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
class Holder : public Placeholder
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Holder(const ValueType &value)
|
|
||||||
: held(value)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const std::type_info& type() const
|
|
||||||
{
|
|
||||||
return typeid(ValueType);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual Placeholder* clone() const
|
|
||||||
{
|
|
||||||
return new Holder(held);
|
|
||||||
}
|
|
||||||
|
|
||||||
ValueType held;
|
|
||||||
|
|
||||||
private:
|
|
||||||
Holder& operator=(const Holder&);
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
|
||||||
template<typename ValueType>
|
|
||||||
friend ValueType* any_cast(Any*);
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
friend ValueType* unsafe_any_cast(Any*);
|
|
||||||
|
|
||||||
Placeholder* content;
|
|
||||||
};
|
|
||||||
|
|
||||||
class bad_any_cast : public std::bad_cast
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual const char * what() const throw()
|
|
||||||
{
|
|
||||||
return "DBI::bad_any_cast: failed conversion using DBI::any_cast";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
ValueType* any_cast(Any* operand)
|
|
||||||
{
|
|
||||||
return operand &&
|
|
||||||
operand->type() == typeid(ValueType) ? &static_cast<Any::Holder<ValueType>*>(operand->content)->held : nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
inline const ValueType* any_cast(const Any* operand)
|
|
||||||
{
|
|
||||||
return any_cast<ValueType>(const_cast<Any*>(operand));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
ValueType any_cast(Any& operand)
|
|
||||||
{
|
|
||||||
typedef typename std::remove_reference<ValueType>::type nonref;
|
|
||||||
nonref* result = any_cast<nonref>(&operand);
|
|
||||||
if(!result)
|
|
||||||
throw bad_any_cast();
|
|
||||||
return *result;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
inline ValueType any_cast(const Any& operand)
|
|
||||||
{
|
|
||||||
typedef typename std::remove_reference<ValueType>::type nonref;
|
|
||||||
return any_cast<const nonref&>(const_cast<Any&>(operand));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
inline ValueType* unsafe_any_cast(Any* operand)
|
|
||||||
{
|
|
||||||
return &static_cast<Any::Holder<ValueType>*>(operand->content)->held;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename ValueType>
|
|
||||||
inline const ValueType* unsafe_any_cast(const Any* operand)
|
|
||||||
{
|
|
||||||
return unsafe_any_cast<ValueType>(const_cast<Any*>(operand));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -23,18 +23,18 @@
|
|||||||
|
|
||||||
BasePacket::BasePacket(const unsigned char *buf, uint32 len)
|
BasePacket::BasePacket(const unsigned char *buf, uint32 len)
|
||||||
{
|
{
|
||||||
this->pBuffer=nullptr;
|
pBuffer=nullptr;
|
||||||
this->size=0;
|
size=0;
|
||||||
this->_wpos = 0;
|
_wpos = 0;
|
||||||
this->_rpos = 0;
|
_rpos = 0;
|
||||||
this->timestamp.tv_sec = 0;
|
timestamp.tv_sec = 0;
|
||||||
if (len>0) {
|
if (len>0) {
|
||||||
this->size=len;
|
size=len;
|
||||||
pBuffer= new unsigned char[len];
|
pBuffer= new unsigned char[len];
|
||||||
if (buf) {
|
if (buf) {
|
||||||
memcpy(this->pBuffer,buf,len);
|
memcpy(pBuffer,buf,len);
|
||||||
} else {
|
} else {
|
||||||
memset(this->pBuffer,0,len);
|
memset(pBuffer,0,len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -380,12 +380,12 @@ const char *GetClassIDName(uint8 class_id, uint8 level)
|
|||||||
return "Merchant";
|
return "Merchant";
|
||||||
case DISCORD_MERCHANT:
|
case DISCORD_MERCHANT:
|
||||||
return "Discord Merchant";
|
return "Discord Merchant";
|
||||||
case ADVENTURERECRUITER:
|
case ADVENTURE_RECRUITER:
|
||||||
return "Adventure Recruiter";
|
return "Adventure Recruiter";
|
||||||
case ADVENTUREMERCHANT:
|
case ADVENTURE_MERCHANT:
|
||||||
return "Adventure Merchant";
|
return "Adventure Merchant";
|
||||||
case CORPSE_CLASS:
|
case LDON_TREASURE:
|
||||||
return "Corpse Class";
|
return "LDoN Treasure";
|
||||||
case TRIBUTE_MASTER:
|
case TRIBUTE_MASTER:
|
||||||
return "Tribute Master";
|
return "Tribute Master";
|
||||||
case GUILD_TRIBUTE_MASTER:
|
case GUILD_TRIBUTE_MASTER:
|
||||||
@@ -400,7 +400,7 @@ const char *GetClassIDName(uint8 class_id, uint8 level)
|
|||||||
return "Fellowship Master";
|
return "Fellowship Master";
|
||||||
case ALT_CURRENCY_MERCHANT:
|
case ALT_CURRENCY_MERCHANT:
|
||||||
return "Alternate Currency Merchant";
|
return "Alternate Currency Merchant";
|
||||||
case MERCERNARY_MASTER:
|
case MERCENARY_MASTER:
|
||||||
return "Mercenary Liaison";
|
return "Mercenary Liaison";
|
||||||
default:
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
|
|||||||
+4
-5
@@ -55,10 +55,9 @@
|
|||||||
#define BANKER 40
|
#define BANKER 40
|
||||||
#define MERCHANT 41
|
#define MERCHANT 41
|
||||||
#define DISCORD_MERCHANT 59
|
#define DISCORD_MERCHANT 59
|
||||||
#define ADVENTURERECRUITER 60
|
#define ADVENTURE_RECRUITER 60
|
||||||
#define ADVENTUREMERCHANT 61
|
#define ADVENTURE_MERCHANT 61
|
||||||
#define LDON_TREASURE 62 // objects you can use /open on first seen in LDONs
|
#define LDON_TREASURE 62 // objects you can use /open on first seen in LDONs, seen on Danvi's Corpse in Akheva
|
||||||
#define CORPSE_CLASS 62 // only seen on Danvi's Corpse in Akheva so far..
|
|
||||||
#define TRIBUTE_MASTER 63
|
#define TRIBUTE_MASTER 63
|
||||||
#define GUILD_TRIBUTE_MASTER 64 // not sure
|
#define GUILD_TRIBUTE_MASTER 64 // not sure
|
||||||
#define GUILD_BANKER 66
|
#define GUILD_BANKER 66
|
||||||
@@ -66,7 +65,7 @@
|
|||||||
#define DARK_REIGN_MERCHANT 68
|
#define DARK_REIGN_MERCHANT 68
|
||||||
#define FELLOWSHIP_MASTER 69
|
#define FELLOWSHIP_MASTER 69
|
||||||
#define ALT_CURRENCY_MERCHANT 70
|
#define ALT_CURRENCY_MERCHANT 70
|
||||||
#define MERCERNARY_MASTER 71
|
#define MERCENARY_MASTER 71
|
||||||
|
|
||||||
|
|
||||||
// player class values
|
// player class values
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "../database.h"
|
#include "../database.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../eqemu_logsys.h"
|
#include "../eqemu_logsys.h"
|
||||||
|
#include "../loottable.h"
|
||||||
#include "../repositories/content_flags_repository.h"
|
#include "../repositories/content_flags_repository.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -35,8 +36,12 @@ int WorldContentService::GetCurrentExpansion() const
|
|||||||
return current_expansion;
|
return current_expansion;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldContentService::SetExpansionContext()
|
WorldContentService *WorldContentService::SetExpansionContext()
|
||||||
{
|
{
|
||||||
|
// do a rule manager reload until where we store expansion is changed to somewhere else
|
||||||
|
RuleManager::Instance()->LoadRules(GetDatabase(), "default", true);
|
||||||
|
|
||||||
|
// pull expansion from rules
|
||||||
int expansion = RuleI(Expansion, CurrentExpansion);
|
int expansion = RuleI(Expansion, CurrentExpansion);
|
||||||
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
|
if (expansion >= Expansion::Classic && expansion <= Expansion::MaxId) {
|
||||||
content_service.SetCurrentExpansion(expansion);
|
content_service.SetCurrentExpansion(expansion);
|
||||||
@@ -47,6 +52,8 @@ void WorldContentService::SetExpansionContext()
|
|||||||
GetCurrentExpansion(),
|
GetCurrentExpansion(),
|
||||||
GetCurrentExpansionName()
|
GetCurrentExpansionName()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string WorldContentService::GetCurrentExpansionName()
|
std::string WorldContentService::GetCurrentExpansionName()
|
||||||
@@ -73,15 +80,47 @@ void WorldContentService::SetCurrentExpansion(int current_expansion)
|
|||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
const std::vector<std::string> &WorldContentService::GetContentFlags() const
|
const std::vector<ContentFlagsRepository::ContentFlags> &WorldContentService::GetContentFlags() const
|
||||||
{
|
{
|
||||||
return content_flags;
|
return content_flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
std::vector<std::string> WorldContentService::GetContentFlagsEnabled()
|
||||||
|
{
|
||||||
|
std::vector<std::string> enabled_flags;
|
||||||
|
|
||||||
|
for (auto &f: GetContentFlags()) {
|
||||||
|
if (f.enabled) {
|
||||||
|
enabled_flags.emplace_back(f.flag_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return enabled_flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
std::vector<std::string> WorldContentService::GetContentFlagsDisabled()
|
||||||
|
{
|
||||||
|
std::vector<std::string> disabled_flags;
|
||||||
|
|
||||||
|
for (auto &f: GetContentFlags()) {
|
||||||
|
if (!f.enabled) {
|
||||||
|
disabled_flags.emplace_back(f.flag_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return disabled_flags;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param content_flags
|
* @param content_flags
|
||||||
*/
|
*/
|
||||||
void WorldContentService::SetContentFlags(std::vector<std::string> content_flags)
|
void WorldContentService::SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags)
|
||||||
{
|
{
|
||||||
WorldContentService::content_flags = content_flags;
|
WorldContentService::content_flags = content_flags;
|
||||||
}
|
}
|
||||||
@@ -90,10 +129,10 @@ void WorldContentService::SetContentFlags(std::vector<std::string> content_flags
|
|||||||
* @param content_flag
|
* @param content_flag
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
|
bool WorldContentService::IsContentFlagEnabled(const std::string &content_flag)
|
||||||
{
|
{
|
||||||
for (auto &flag : GetContentFlags()) {
|
for (auto &f: GetContentFlags()) {
|
||||||
if (flag == content_flag) {
|
if (f.flag_name == content_flag && f.enabled == true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,20 +140,102 @@ bool WorldContentService::IsContentFlagEnabled(const std::string& content_flag)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldContentService::ReloadContentFlags(Database &db)
|
/**
|
||||||
|
* @param content_flag
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
bool WorldContentService::IsContentFlagDisabled(const std::string &content_flag)
|
||||||
{
|
{
|
||||||
std::vector<std::string> set_content_flags;
|
for (auto &f: GetContentFlags()) {
|
||||||
auto content_flags = ContentFlagsRepository::GetWhere(db, "enabled = 1");
|
if (f.flag_name == content_flag && f.enabled == false) {
|
||||||
|
return true;
|
||||||
set_content_flags.reserve(content_flags.size());
|
}
|
||||||
for (auto &flags: content_flags) {
|
|
||||||
set_content_flags.push_back(flags.flag_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WorldContentService::DoesPassContentFiltering(const ContentFlags &f)
|
||||||
|
{
|
||||||
|
// if we're not set to (-1 All) then fail when we aren't within minimum expansion
|
||||||
|
if (f.min_expansion > Expansion::EXPANSION_ALL && current_expansion < f.min_expansion && current_expansion != -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we're not set to (-1 All) then fail when we aren't within max expansion
|
||||||
|
if (f.max_expansion > Expansion::EXPANSION_ALL && current_expansion > f.max_expansion && current_expansion != -1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we don't have any enabled flag in enabled flags, we fail
|
||||||
|
for (const auto& flag: Strings::Split(f.content_flags)) {
|
||||||
|
if (!Strings::Contains(GetContentFlagsEnabled(), flag)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we don't have any disabled flag in disabled flags, we fail
|
||||||
|
for (const auto& flag: Strings::Split(f.content_flags_disabled)) {
|
||||||
|
if (!Strings::Contains(GetContentFlagsDisabled(), flag)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorldContentService::ReloadContentFlags()
|
||||||
|
{
|
||||||
|
std::vector<ContentFlagsRepository::ContentFlags> set_content_flags;
|
||||||
|
auto flags = ContentFlagsRepository::All(*GetDatabase());
|
||||||
|
|
||||||
|
set_content_flags.reserve(flags.size());
|
||||||
|
for (auto &f: flags) {
|
||||||
|
set_content_flags.push_back(f);
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Enabled content flags [{}]",
|
"Loaded content flag [{}] [{}]",
|
||||||
implode(", ", set_content_flags)
|
f.flag_name,
|
||||||
|
(f.enabled ? "Enabled" : "Disabled")
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
SetContentFlags(set_content_flags);
|
SetContentFlags(set_content_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Database *WorldContentService::GetDatabase() const
|
||||||
|
{
|
||||||
|
return m_database;
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldContentService *WorldContentService::SetDatabase(Database *database)
|
||||||
|
{
|
||||||
|
WorldContentService::m_database = database;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WorldContentService::SetContentFlag(const std::string &content_flag_name, bool enabled)
|
||||||
|
{
|
||||||
|
auto flags = ContentFlagsRepository::GetWhere(
|
||||||
|
*GetDatabase(),
|
||||||
|
fmt::format("flag_name = '{}'", content_flag_name)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto f = ContentFlagsRepository::NewEntity();
|
||||||
|
if (!flags.empty()) {
|
||||||
|
f = flags.front();
|
||||||
|
}
|
||||||
|
|
||||||
|
f.enabled = enabled ? 1 : 0;
|
||||||
|
f.flag_name = content_flag_name;
|
||||||
|
|
||||||
|
if (!flags.empty()) {
|
||||||
|
ContentFlagsRepository::UpdateOne(*GetDatabase(), f);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ContentFlagsRepository::InsertOne(*GetDatabase(), f);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReloadContentFlags();
|
||||||
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "../loottable.h"
|
||||||
|
#include "../repositories/content_flags_repository.h"
|
||||||
|
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
@@ -52,7 +54,7 @@ namespace Expansion {
|
|||||||
VeilOfAlaris,
|
VeilOfAlaris,
|
||||||
RainOfFear,
|
RainOfFear,
|
||||||
CallOfTheForsaken,
|
CallOfTheForsaken,
|
||||||
TheDarkendSea,
|
TheDarkenedSea,
|
||||||
TheBrokenMirror,
|
TheBrokenMirror,
|
||||||
EmpiresOfKunark,
|
EmpiresOfKunark,
|
||||||
RingOfScale,
|
RingOfScale,
|
||||||
@@ -125,7 +127,7 @@ public:
|
|||||||
bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsVeilOfAlarisEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::VeilOfAlaris || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsRainOfFearEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RainOfFear || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsCallOfTheForsakenEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::CallOfTheForsaken || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
bool IsTheDarkendSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkendSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsTheDarkenedSeaEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheDarkenedSea || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsTheBrokenMirrorEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::TheBrokenMirror || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsEmpiresOfKunarkEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::EmpiresOfKunark || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
bool IsRingOfScaleEnabled() { return GetCurrentExpansion() >= Expansion::ExpansionNumber::RingOfScale || GetCurrentExpansion() == Expansion::EXPANSION_ALL; }
|
||||||
@@ -153,22 +155,35 @@ public:
|
|||||||
bool IsCurrentExpansionVeilOfAlaris() { return current_expansion == Expansion::ExpansionNumber::VeilOfAlaris; }
|
bool IsCurrentExpansionVeilOfAlaris() { return current_expansion == Expansion::ExpansionNumber::VeilOfAlaris; }
|
||||||
bool IsCurrentExpansionRainOfFear() { return current_expansion == Expansion::ExpansionNumber::RainOfFear; }
|
bool IsCurrentExpansionRainOfFear() { return current_expansion == Expansion::ExpansionNumber::RainOfFear; }
|
||||||
bool IsCurrentExpansionCallOfTheForsaken() { return current_expansion == Expansion::ExpansionNumber::CallOfTheForsaken; }
|
bool IsCurrentExpansionCallOfTheForsaken() { return current_expansion == Expansion::ExpansionNumber::CallOfTheForsaken; }
|
||||||
bool IsCurrentExpansionTheDarkendSea() { return current_expansion == Expansion::ExpansionNumber::TheDarkendSea; }
|
bool IsCurrentExpansionTheDarkenedSea() { return current_expansion == Expansion::ExpansionNumber::TheDarkenedSea; }
|
||||||
bool IsCurrentExpansionTheBrokenMirror() { return current_expansion == Expansion::ExpansionNumber::TheBrokenMirror; }
|
bool IsCurrentExpansionTheBrokenMirror() { return current_expansion == Expansion::ExpansionNumber::TheBrokenMirror; }
|
||||||
bool IsCurrentExpansionEmpiresOfKunark() { return current_expansion == Expansion::ExpansionNumber::EmpiresOfKunark; }
|
bool IsCurrentExpansionEmpiresOfKunark() { return current_expansion == Expansion::ExpansionNumber::EmpiresOfKunark; }
|
||||||
bool IsCurrentExpansionRingOfScale() { return current_expansion == Expansion::ExpansionNumber::RingOfScale; }
|
bool IsCurrentExpansionRingOfScale() { return current_expansion == Expansion::ExpansionNumber::RingOfScale; }
|
||||||
bool IsCurrentExpansionTheBurningLands() { return current_expansion == Expansion::ExpansionNumber::TheBurningLands; }
|
bool IsCurrentExpansionTheBurningLands() { return current_expansion == Expansion::ExpansionNumber::TheBurningLands; }
|
||||||
bool IsCurrentExpansionTormentOfVelious() { return current_expansion == Expansion::ExpansionNumber::TormentOfVelious; }
|
bool IsCurrentExpansionTormentOfVelious() { return current_expansion == Expansion::ExpansionNumber::TormentOfVelious; }
|
||||||
|
|
||||||
|
const std::vector<ContentFlagsRepository::ContentFlags> &GetContentFlags() const;
|
||||||
|
std::vector<std::string> GetContentFlagsEnabled();
|
||||||
|
std::vector<std::string> GetContentFlagsDisabled();
|
||||||
|
bool IsContentFlagEnabled(const std::string& content_flag);
|
||||||
|
bool IsContentFlagDisabled(const std::string& content_flag);
|
||||||
|
void SetContentFlags(std::vector<ContentFlagsRepository::ContentFlags> content_flags);
|
||||||
|
void ReloadContentFlags();
|
||||||
|
WorldContentService * SetExpansionContext();
|
||||||
|
|
||||||
|
bool DoesPassContentFiltering(const ContentFlags& f);
|
||||||
|
|
||||||
|
WorldContentService * SetDatabase(Database *database);
|
||||||
|
Database *GetDatabase() const;
|
||||||
|
|
||||||
|
void SetContentFlag(const std::string &content_flag_name, bool enabled);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int current_expansion{};
|
int current_expansion{};
|
||||||
std::vector<std::string> content_flags;
|
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
||||||
public:
|
|
||||||
const std::vector<std::string> &GetContentFlags() const;
|
// reference to database
|
||||||
bool IsContentFlagEnabled(const std::string& content_flag);
|
Database *m_database;
|
||||||
void SetContentFlags(std::vector<std::string> content_flags);
|
|
||||||
void ReloadContentFlags(Database &db);
|
|
||||||
void SetExpansionContext();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WorldContentService content_service;
|
extern WorldContentService content_service;
|
||||||
|
|||||||
+61
-2
@@ -2,6 +2,48 @@
|
|||||||
#include "eqemu_logsys.h"
|
#include "eqemu_logsys.h"
|
||||||
#include "crash.h"
|
#include "crash.h"
|
||||||
|
|
||||||
|
inline std::string random_string(size_t length)
|
||||||
|
{
|
||||||
|
auto randchar = []() -> char {
|
||||||
|
const char charset[] = "0123456789"
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
|
"abcdefghijklmnopqrstuvwxyz";
|
||||||
|
const size_t max_index = (sizeof(charset) - 1);
|
||||||
|
return charset[static_cast<size_t>(std::rand()) % max_index];
|
||||||
|
};
|
||||||
|
std::string str(length, 0);
|
||||||
|
std::generate_n(str.begin(), length, randchar);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string execute(const std::string &cmd, bool return_result = true)
|
||||||
|
{
|
||||||
|
std::string random = "/tmp/" + random_string(25);
|
||||||
|
const char *file_name = random.c_str();
|
||||||
|
|
||||||
|
if (return_result) {
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#else
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
std::system((cmd).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
|
||||||
|
if (return_result) {
|
||||||
|
std::ifstream file(file_name);
|
||||||
|
result = {std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>()};
|
||||||
|
std::remove(file_name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(_WINDOWS) && defined(CRASH_LOGGING)
|
#if defined(_WINDOWS) && defined(CRASH_LOGGING)
|
||||||
#include "StackWalker.h"
|
#include "StackWalker.h"
|
||||||
|
|
||||||
@@ -125,10 +167,28 @@ void set_exception_handler() {
|
|||||||
|
|
||||||
void print_trace()
|
void print_trace()
|
||||||
{
|
{
|
||||||
auto uid = geteuid();
|
bool does_gdb_exist = execute("gdb -v").find("GNU") != std::string::npos;
|
||||||
|
if (!does_gdb_exist) {
|
||||||
|
LogCrash(
|
||||||
|
"[Error] GDB is not installed, if you want crash dumps on Linux to work properly you will need GDB installed"
|
||||||
|
);
|
||||||
|
std::exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto uid = geteuid();
|
||||||
std::string temp_output_file = "/tmp/dump-output";
|
std::string temp_output_file = "/tmp/dump-output";
|
||||||
|
|
||||||
|
// check for passwordless sudo if not root
|
||||||
|
if (uid != 0) {
|
||||||
|
bool has_passwordless_sudo = execute("sudo -n true").find("a password is required") == std::string::npos;
|
||||||
|
if (!has_passwordless_sudo) {
|
||||||
|
LogCrash(
|
||||||
|
"[Error] Current user does not have passwordless sudo installed. It is required to automatically process crash dumps with GDB as non-root."
|
||||||
|
);
|
||||||
|
std::exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char pid_buf[30];
|
char pid_buf[30];
|
||||||
sprintf(pid_buf, "%d", getpid());
|
sprintf(pid_buf, "%d", getpid());
|
||||||
char name_buf[512];
|
char name_buf[512];
|
||||||
@@ -136,7 +196,6 @@ void print_trace()
|
|||||||
int child_pid = fork();
|
int child_pid = fork();
|
||||||
if (!child_pid) {
|
if (!child_pid) {
|
||||||
int fd = open(temp_output_file.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
int fd = open(temp_output_file.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
||||||
|
|
||||||
dup2(fd, 1); // redirect output to stderr
|
dup2(fd, 1); // redirect output to stderr
|
||||||
fprintf(stdout, "stack trace for %s pid=%s\n", name_buf, pid_buf);
|
fprintf(stdout, "stack trace for %s pid=%s\n", name_buf, pid_buf);
|
||||||
if (uid == 0) {
|
if (uid == 0) {
|
||||||
|
|||||||
+214
-321
@@ -45,11 +45,14 @@
|
|||||||
#include "database.h"
|
#include "database.h"
|
||||||
#include "eq_packet_structs.h"
|
#include "eq_packet_structs.h"
|
||||||
#include "extprofile.h"
|
#include "extprofile.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
#include "database_schema.h"
|
#include "database_schema.h"
|
||||||
#include "http/httplib.h"
|
#include "http/httplib.h"
|
||||||
#include "http/uri.h"
|
#include "http/uri.h"
|
||||||
|
|
||||||
|
#include "repositories/zone_repository.h"
|
||||||
|
#include "zone_store.h"
|
||||||
|
|
||||||
extern Client client;
|
extern Client client;
|
||||||
|
|
||||||
Database::Database () {
|
Database::Database () {
|
||||||
@@ -92,112 +95,123 @@ Database::~Database()
|
|||||||
*/
|
*/
|
||||||
uint32 Database::CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus) {
|
uint32 Database::CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus) {
|
||||||
|
|
||||||
if(strlen(name) >= 50 || strlen(password) >= 50)
|
if (strlen(name) >= 50 || strlen(password) >= 50)
|
||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
char tmpUN[100];
|
char temporary_username[100];
|
||||||
char tmpPW[100];
|
char temporary_password[100];
|
||||||
|
|
||||||
DoEscapeString(tmpUN, name, strlen(name));
|
DoEscapeString(temporary_username, name, strlen(name));
|
||||||
DoEscapeString(tmpPW, password, strlen(password));
|
DoEscapeString(temporary_password, password, strlen(password));
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT id, status FROM account WHERE `name`='%s' AND ls_id='%s' AND password is not null "
|
std::string query = fmt::format(
|
||||||
"and length(password) > 0 and (password='%s' or password=MD5('%s'))",
|
"SELECT id, status FROM account WHERE `name` = '{}' AND ls_id = '{}' AND password is NOT NULL "
|
||||||
tmpUN, EscapeString(loginserver).c_str(), tmpPW, tmpPW);
|
"AND length(password) > 0 AND (password = '{}' OR password = MD5('{}'))",
|
||||||
|
temporary_username,
|
||||||
|
Strings::Escape(loginserver),
|
||||||
|
temporary_password,
|
||||||
|
temporary_password
|
||||||
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success() || !results.RowCount()) {
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(results.RowCount() == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
|
||||||
uint32 id = atoi(row[0]);
|
auto id = std::stoul(row[0]);
|
||||||
|
|
||||||
if (oStatus)
|
if (oStatus) {
|
||||||
*oStatus = atoi(row[1]);
|
*oStatus = std::stoi(row[1]);
|
||||||
|
}
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get Banned IP Address List - Only return false if the incoming connection's IP address is not present in the banned_ips table.
|
//Get Banned IP Address List - Only return false if the incoming connection's IP address is not present in the banned_ips table.
|
||||||
bool Database::CheckBannedIPs(const char* loginIP)
|
bool Database::CheckBannedIPs(std::string login_ip)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat("SELECT ip_address FROM banned_ips WHERE ip_address='%s'", loginIP);
|
auto query = fmt::format(
|
||||||
|
"SELECT ip_address FROM banned_ips WHERE ip_address = '{}'",
|
||||||
|
login_ip
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success() || results.RowCount() != 0) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() != 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::AddBannedIP(char* bannedIP, const char* notes) {
|
bool Database::AddBannedIP(std::string banned_ip, std::string notes) {
|
||||||
std::string query = StringFormat("INSERT into banned_ips SET ip_address='%s', notes='%s'", bannedIP, notes);
|
auto query = fmt::format(
|
||||||
|
"INSERT into banned_ips SET ip_address = '{}', notes = '{}'",
|
||||||
|
Strings::Escape(banned_ip),
|
||||||
|
Strings::Escape(notes)
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::CheckGMIPs(const char* ip_address, uint32 account_id) {
|
bool Database::CheckGMIPs(std::string login_ip, uint32 account_id) {
|
||||||
std::string query = StringFormat("SELECT * FROM `gm_ips` WHERE `ip_address` = '%s' AND `account_id` = %i", ip_address, account_id);
|
auto query = fmt::format(
|
||||||
|
"SELECT * FROM `gm_ips` WHERE `ip_address` = '{}' AND `account_id` = {}",
|
||||||
|
login_ip,
|
||||||
|
account_id
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (results.RowCount() == 1)
|
if (results.RowCount() == 1) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::AddGMIP(char* ip_address, char* name) {
|
void Database::LoginIP(uint32 account_id, std::string login_ip) {
|
||||||
std::string query = StringFormat("INSERT into `gm_ips` SET `ip_address` = '%s', `name` = '%s'", ip_address, name);
|
auto query = fmt::format(
|
||||||
auto results = QueryDatabase(query);
|
"INSERT INTO account_ip SET accid = {}, ip = '{}' ON DUPLICATE KEY UPDATE count=count+1, lastused=now()",
|
||||||
return results.Success();
|
account_id,
|
||||||
}
|
login_ip
|
||||||
|
);
|
||||||
void Database::LoginIP(uint32 AccountID, const char* LoginIP) {
|
|
||||||
std::string query = StringFormat("INSERT INTO account_ip SET accid=%i, ip='%s' ON DUPLICATE KEY UPDATE count=count+1, lastused=now()", AccountID, LoginIP);
|
|
||||||
QueryDatabase(query);
|
QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16 Database::CheckStatus(uint32 account_id)
|
int16 Database::CheckStatus(uint32 account_id)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat(
|
auto query = fmt::format(
|
||||||
"SELECT `status`, TIMESTAMPDIFF(SECOND, NOW(), `suspendeduntil`) FROM `account` WHERE `id` = %i",
|
"SELECT `status`, TIMESTAMPDIFF(SECOND, NOW(), `suspendeduntil`) FROM `account` WHERE `id` = {}",
|
||||||
account_id);
|
account_id
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (results.RowCount() != 1)
|
if (!results.Success() || results.RowCount() != 1) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
int16 status = atoi(row[0]);
|
int16 status = std::stoi(row[0]);
|
||||||
int32 date_diff = 0;
|
int32 date_diff = 0;
|
||||||
|
|
||||||
if (row[1] != nullptr)
|
if (row[1]) {
|
||||||
date_diff = atoi(row[1]);
|
date_diff = std::stoi(row[1]);
|
||||||
|
}
|
||||||
|
|
||||||
if (date_diff > 0)
|
if (date_diff > 0) {
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -267,7 +281,7 @@ bool Database::DeleteAccount(const char* name, const char *loginserver) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Database::SetLocalPassword(uint32 accid, const char* password) {
|
bool Database::SetLocalPassword(uint32 accid, const char* password) {
|
||||||
std::string query = StringFormat("UPDATE account SET password=MD5('%s') where id=%i;", EscapeString(password).c_str(), accid);
|
std::string query = StringFormat("UPDATE account SET password=MD5('%s') where id=%i;", Strings::Escape(password).c_str(), accid);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
@@ -307,9 +321,7 @@ bool Database::SetAccountStatus(const std::string& account_name, int16 status)
|
|||||||
LogInfo("Account [{}] is attempting to be set to status [{}]", account_name, status);
|
LogInfo("Account [{}] is attempting to be set to status [{}]", account_name, status);
|
||||||
|
|
||||||
std::string query = fmt::format(
|
std::string query = fmt::format(
|
||||||
SQL(
|
"UPDATE account SET status = {} WHERE name = '{}'",
|
||||||
UPDATE account SET status = {} WHERE name = '{}'
|
|
||||||
),
|
|
||||||
status,
|
status,
|
||||||
account_name
|
account_name
|
||||||
);
|
);
|
||||||
@@ -608,8 +620,8 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
|||||||
")",
|
")",
|
||||||
character_id, // " id, "
|
character_id, // " id, "
|
||||||
account_id, // " account_id, "
|
account_id, // " account_id, "
|
||||||
EscapeString(pp->name).c_str(), // " `name`, "
|
Strings::Escape(pp->name).c_str(), // " `name`, "
|
||||||
EscapeString(pp->last_name).c_str(), // " last_name, "
|
Strings::Escape(pp->last_name).c_str(), // " last_name, "
|
||||||
pp->gender, // " gender, "
|
pp->gender, // " gender, "
|
||||||
pp->race, // " race, "
|
pp->race, // " race, "
|
||||||
pp->class_, // " class, "
|
pp->class_, // " class, "
|
||||||
@@ -633,8 +645,8 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
|||||||
pp->ability_number, // " ability_number, "
|
pp->ability_number, // " ability_number, "
|
||||||
pp->ability_time_minutes, // " ability_time_minutes, "
|
pp->ability_time_minutes, // " ability_time_minutes, "
|
||||||
pp->ability_time_hours, // " ability_time_hours, "
|
pp->ability_time_hours, // " ability_time_hours, "
|
||||||
EscapeString(pp->title).c_str(), // " title, "
|
Strings::Escape(pp->title).c_str(), // " title, "
|
||||||
EscapeString(pp->suffix).c_str(), // " suffix, "
|
Strings::Escape(pp->suffix).c_str(), // " suffix, "
|
||||||
pp->exp, // " exp, "
|
pp->exp, // " exp, "
|
||||||
pp->points, // " points, "
|
pp->points, // " points, "
|
||||||
pp->mana, // " mana, "
|
pp->mana, // " mana, "
|
||||||
@@ -716,7 +728,7 @@ bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, Playe
|
|||||||
/* HoTT Ability */
|
/* HoTT Ability */
|
||||||
if(RuleB(Character, GrantHoTTOnCreate))
|
if(RuleB(Character, GrantHoTTOnCreate))
|
||||||
{
|
{
|
||||||
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, rank) VALUES (%u, %i, %i)", character_id, 14, 1);
|
query = StringFormat("INSERT INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%u, %i, %i)", character_id, 14, 1);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +782,7 @@ uint32 Database::GetCharacterID(const char *name) {
|
|||||||
Zero will also be returned if there is a database error.
|
Zero will also be returned if there is a database error.
|
||||||
*/
|
*/
|
||||||
uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
|
uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
|
||||||
std::string query = StringFormat("SELECT `account_id`, `id` FROM `character_data` WHERE name='%s'", EscapeString(charname).c_str());
|
std::string query = StringFormat("SELECT `account_id`, `id` FROM `character_data` WHERE name='%s'", Strings::Escape(charname).c_str());
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
@@ -807,36 +819,34 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) {
|
|||||||
return atoi(row[0]);
|
return atoi(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Database::GetAccountIDByName(const char* accname, const char *loginserver, int16* status, uint32* lsid) {
|
uint32 Database::GetAccountIDByName(std::string account_name, std::string loginserver, int16* status, uint32* lsid) {
|
||||||
if (!isAlphaNumeric(accname))
|
if (!isAlphaNumeric(account_name.c_str())) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT `id`, `status`, `lsaccount_id` FROM `account` WHERE `name` = '%s' AND `ls_id`='%s' LIMIT 1",
|
auto query = fmt::format(
|
||||||
EscapeString(accname).c_str(), EscapeString(loginserver).c_str());
|
"SELECT `id`, `status`, `lsaccount_id` FROM `account` WHERE `name` = '{}' AND `ls_id` = '{}' LIMIT 1",
|
||||||
|
Strings::Escape(account_name),
|
||||||
|
Strings::Escape(loginserver)
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success() || !results.RowCount()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() != 1)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
|
auto account_id = std::stoul(row[0]);
|
||||||
|
|
||||||
uint32 id = atoi(row[0]);
|
if (status) {
|
||||||
|
*status = static_cast<int16>(std::stoi(row[1]));
|
||||||
if (status)
|
|
||||||
*status = atoi(row[1]);
|
|
||||||
|
|
||||||
if (lsid) {
|
|
||||||
if (row[2])
|
|
||||||
*lsid = atoi(row[2]);
|
|
||||||
else
|
|
||||||
*lsid = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
if (lsid) {
|
||||||
|
*lsid = row[2] ? std::stoul(row[2]) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return account_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID) {
|
void Database::GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID) {
|
||||||
@@ -973,8 +983,8 @@ bool Database::GetVariable(std::string varname, std::string &varvalue)
|
|||||||
|
|
||||||
bool Database::SetVariable(const std::string varname, const std::string &varvalue)
|
bool Database::SetVariable(const std::string varname, const std::string &varvalue)
|
||||||
{
|
{
|
||||||
std::string escaped_name = EscapeString(varname);
|
std::string escaped_name = Strings::Escape(varname);
|
||||||
std::string escaped_value = EscapeString(varvalue);
|
std::string escaped_value = Strings::Escape(varvalue);
|
||||||
std::string query = StringFormat("Update variables set value='%s' WHERE varname like '%s'", escaped_value.c_str(), escaped_name.c_str());
|
std::string query = StringFormat("Update variables set value='%s' WHERE varname like '%s'", escaped_value.c_str(), escaped_name.c_str());
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
@@ -997,110 +1007,16 @@ bool Database::SetVariable(const std::string varname, const std::string &varvalu
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get zone starting points from DB
|
void Database::SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum)
|
||||||
bool Database::GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x, float* safe_y, float* safe_z, float* safe_heading, int16* min_status, uint8* min_level, char *flag_needed) {
|
{
|
||||||
|
QueryDatabase(
|
||||||
if (zone_short_name == nullptr)
|
fmt::format(
|
||||||
return false;
|
"UPDATE `account` SET `{}` = '{}' WHERE `id` = {}",
|
||||||
|
field_name,
|
||||||
std::string query = fmt::format(
|
checksum,
|
||||||
SQL(
|
account_id
|
||||||
SELECT
|
)
|
||||||
`safe_x`, `safe_y`, `safe_z`, `safe_heading`, `min_status`, `min_level`, `flag_needed`
|
|
||||||
FROM
|
|
||||||
zone
|
|
||||||
WHERE
|
|
||||||
`short_name` = '{}'
|
|
||||||
AND
|
|
||||||
(`version` = {} OR `version` = 0)
|
|
||||||
ORDER BY `version` DESC
|
|
||||||
), zone_short_name, instance_version
|
|
||||||
);
|
);
|
||||||
auto results = QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
|
|
||||||
if (safe_x != nullptr)
|
|
||||||
*safe_x = atof(row[0]);
|
|
||||||
|
|
||||||
if (safe_y != nullptr)
|
|
||||||
*safe_y = atof(row[1]);
|
|
||||||
|
|
||||||
if (safe_z != nullptr)
|
|
||||||
*safe_z = atof(row[2]);
|
|
||||||
|
|
||||||
if (safe_heading != nullptr)
|
|
||||||
*safe_heading = atof(row[3]);
|
|
||||||
|
|
||||||
if (min_status != nullptr)
|
|
||||||
*min_status = atoi(row[4]);
|
|
||||||
|
|
||||||
if (min_level != nullptr)
|
|
||||||
*min_level = atoi(row[5]);
|
|
||||||
|
|
||||||
if (flag_needed != nullptr)
|
|
||||||
strcpy(flag_needed, row[6]);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Database::GetZoneLongName(const char* short_name, char** long_name, char* file_name, float* safe_x, float* safe_y, float* safe_z, uint32* graveyard_id, uint32* maxclients) {
|
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT long_name, file_name, safe_x, safe_y, safe_z, graveyard_id, maxclients FROM zone WHERE short_name='%s' AND version=0", short_name);
|
|
||||||
auto results = QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
|
|
||||||
if (long_name != nullptr)
|
|
||||||
*long_name = strcpy(new char[strlen(row[0])+1], row[0]);
|
|
||||||
|
|
||||||
if (file_name != nullptr) {
|
|
||||||
if (row[1] == nullptr)
|
|
||||||
strcpy(file_name, short_name);
|
|
||||||
else
|
|
||||||
strcpy(file_name, row[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (safe_x != nullptr)
|
|
||||||
*safe_x = atof(row[2]);
|
|
||||||
if (safe_y != nullptr)
|
|
||||||
*safe_y = atof(row[3]);
|
|
||||||
if (safe_z != nullptr)
|
|
||||||
*safe_z = atof(row[4]);
|
|
||||||
if (graveyard_id != nullptr)
|
|
||||||
*graveyard_id = atoi(row[5]);
|
|
||||||
if (maxclients != nullptr)
|
|
||||||
*maxclients = atoi(row[6]);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32 Database::GetZoneGraveyardID(uint32 zone_id, uint32 version) {
|
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT graveyard_id FROM zone WHERE zoneidnumber='%u' AND (version=%i OR version=0) ORDER BY version DESC", zone_id, version);
|
|
||||||
auto results = QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
return atoi(row[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid, float* graveyard_x, float* graveyard_y, float* graveyard_z, float* graveyard_heading) {
|
bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid, float* graveyard_x, float* graveyard_y, float* graveyard_z, float* graveyard_heading) {
|
||||||
@@ -1131,108 +1047,74 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){
|
uint8 Database::GetPEQZone(uint32 zone_id, uint32 version){
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT peqzone from zone where zoneidnumber='%i' AND (version=%i OR version=0) ORDER BY version DESC", zoneID, version);
|
auto z = GetZoneVersionWithFallback(zone_id, version);
|
||||||
auto results = QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success()) {
|
return z ? z->peqzone : 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results.RowCount() == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
auto row = results.begin();
|
|
||||||
|
|
||||||
return atoi(row[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::CheckNameFilter(const char* name, bool surname)
|
bool Database::CheckNameFilter(std::string name, bool surname)
|
||||||
{
|
{
|
||||||
std::string str_name = name;
|
name = Strings::ToLower(name);
|
||||||
|
|
||||||
// the minimum 4 is enforced by the client too
|
// the minimum 4 is enforced by the client too
|
||||||
if (!name || strlen(name) < 4)
|
if (name.empty() || name.size() < 4) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given name length is enforced by the client too
|
// Given name length is enforced by the client too
|
||||||
if (!surname && strlen(name) > 15)
|
if (!surname && name.size() > 15) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < str_name.size(); i++)
|
for (size_t i = 0; i < name.size(); i++) {
|
||||||
{
|
if (!isalpha(name[i])) {
|
||||||
if(!isalpha(str_name[i]))
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(size_t x = 0; x < str_name.size(); ++x)
|
|
||||||
{
|
|
||||||
str_name[x] = tolower(str_name[x]);
|
|
||||||
}
|
|
||||||
|
|
||||||
char c = '\0';
|
char c = '\0';
|
||||||
uint8 num_c = 0;
|
uint8 num_c = 0;
|
||||||
for(size_t x = 0; x < str_name.size(); ++x)
|
for (size_t x = 0; x < name.size(); ++x) {
|
||||||
{
|
if (name[x] == c) {
|
||||||
if(str_name[x] == c)
|
|
||||||
{
|
|
||||||
num_c++;
|
num_c++;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
num_c = 1;
|
num_c = 1;
|
||||||
c = str_name[x];
|
c = name[x];
|
||||||
}
|
}
|
||||||
if(num_c > 2)
|
|
||||||
{
|
if (num_c > 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string query = "SELECT name FROM name_filter";
|
||||||
std::string query("SELECT name FROM name_filter");
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success()) {
|
||||||
if (!results.Success())
|
|
||||||
{
|
|
||||||
// false through to true? shouldn't it be falls through to false?
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto row = results.begin();row != results.end();++row)
|
for (auto row : results) {
|
||||||
{
|
std::string current_row = Strings::ToLower(row[0]);
|
||||||
std::string current_row = row[0];
|
if (name.find(current_row) != std::string::npos) {
|
||||||
|
|
||||||
for(size_t x = 0; x < current_row.size(); ++x)
|
|
||||||
current_row[x] = tolower(current_row[x]);
|
|
||||||
|
|
||||||
if(str_name.find(current_row) != std::string::npos)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::AddToNameFilter(const char* name) {
|
bool Database::AddToNameFilter(std::string name) {
|
||||||
|
auto query = fmt::format(
|
||||||
std::string query = StringFormat("INSERT INTO name_filter (name) values ('%s')", name);
|
"INSERT INTO name_filter (name) values ('{}')",
|
||||||
|
name
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success() || !results.RowsAffected()) {
|
||||||
if (!results.Success())
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowsAffected() == 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1320,16 +1202,16 @@ bool Database::UpdateName(const char* oldname, const char* newname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the name is used or an error occurs, it returns false, otherwise it returns true
|
// If the name is used or an error occurs, it returns false, otherwise it returns true
|
||||||
bool Database::CheckUsedName(const char* name) {
|
bool Database::CheckUsedName(std::string name) {
|
||||||
std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name` = '%s'", name);
|
auto query = fmt::format(
|
||||||
|
"SELECT `id` FROM `character_data` WHERE `name` = '{}'",
|
||||||
|
name
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success() || results.RowCount()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.RowCount() > 0)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1487,41 +1369,25 @@ uint8 Database::GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16
|
|||||||
return base_cap;
|
return base_cap;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Database::GetCharacterInfo(
|
uint32 Database::GetCharacterInfo(std::string character_name, uint32 *account_id, uint32 *zone_id, uint32 *instance_id)
|
||||||
const char *iName,
|
|
||||||
uint32 *oAccID,
|
|
||||||
uint32 *oZoneID,
|
|
||||||
uint32 *oInstanceID,
|
|
||||||
float *oX,
|
|
||||||
float *oY,
|
|
||||||
float *oZ
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
std::string query = StringFormat(
|
auto query = fmt::format(
|
||||||
"SELECT `id`, `account_id`, `zone_id`, `zone_instance`, `x`, `y`, `z` FROM `character_data` WHERE `name` = '%s'",
|
"SELECT `id`, `account_id`, `zone_id`, `zone_instance` FROM `character_data` WHERE `name` = '{}'",
|
||||||
EscapeString(iName).c_str()
|
Strings::Escape(character_name)
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
if (!results.Success() || !results.RowCount()) {
|
||||||
if (!results.Success()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (results.RowCount() != 1) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
uint32 charid = atoi(row[0]);
|
auto character_id = std::stoul(row[0]);
|
||||||
if (oAccID) { *oAccID = atoi(row[1]); }
|
*account_id = std::stoul(row[1]);
|
||||||
if (oZoneID) { *oZoneID = atoi(row[2]); }
|
*zone_id = std::stoul(row[2]);
|
||||||
if (oInstanceID) { *oInstanceID = atoi(row[3]); }
|
*instance_id = std::stoul(row[3]);
|
||||||
if (oX) { *oX = atof(row[4]); }
|
|
||||||
if (oY) { *oY = atof(row[5]); }
|
|
||||||
if (oZ) { *oZ = atof(row[6]); }
|
|
||||||
|
|
||||||
return charid;
|
return character_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Database::UpdateLiveChar(char* charname, uint32 account_id) {
|
bool Database::UpdateLiveChar(char* charname, uint32 account_id) {
|
||||||
@@ -1580,7 +1446,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines
|
|||||||
auto escape_str = new char[lines.size() * 2 + 1];
|
auto escape_str = new char[lines.size() * 2 + 1];
|
||||||
DoEscapeString(escape_str, lines.c_str(), lines.size());
|
DoEscapeString(escape_str, lines.c_str(), lines.size());
|
||||||
|
|
||||||
std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", EscapeString(who).c_str(), EscapeString(against).c_str(), escape_str);
|
std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", Strings::Escape(who).c_str(), Strings::Escape(against).c_str(), escape_str);
|
||||||
QueryDatabase(query);
|
QueryDatabase(query);
|
||||||
safe_delete_array(escape_str);
|
safe_delete_array(escape_str);
|
||||||
}
|
}
|
||||||
@@ -1645,33 +1511,40 @@ uint32 Database::GetGroupID(const char* name){
|
|||||||
return atoi(row[0]);
|
return atoi(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Is this really getting used properly... A half implementation ? Akkadius */
|
std::string Database::GetGroupLeaderForLogin(std::string character_name) {
|
||||||
char* Database::GetGroupLeaderForLogin(const char* name, char* leaderbuf) {
|
|
||||||
strcpy(leaderbuf, "");
|
|
||||||
uint32 group_id = 0;
|
uint32 group_id = 0;
|
||||||
|
|
||||||
std::string query = StringFormat("SELECT `groupid` FROM `group_id` WHERE `name` = '%s'", name);
|
auto query = fmt::format(
|
||||||
|
"SELECT `groupid` FROM `group_id` WHERE `name` = '{}'",
|
||||||
|
character_name
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row)
|
if (results.Success() && results.RowCount()) {
|
||||||
if (row[0])
|
auto row = results.begin();
|
||||||
group_id = atoi(row[0]);
|
group_id = std::stoul(row[0]);
|
||||||
|
}
|
||||||
|
|
||||||
if (group_id == 0)
|
if (!group_id) {
|
||||||
return leaderbuf;
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
query = StringFormat("SELECT `leadername` FROM `group_leaders` WHERE `gid` = '%u' LIMIT 1", group_id);
|
query = fmt::format(
|
||||||
|
"SELECT `leadername` FROM `group_leaders` WHERE `gid` = {} LIMIT 1",
|
||||||
|
group_id
|
||||||
|
);
|
||||||
results = QueryDatabase(query);
|
results = QueryDatabase(query);
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row)
|
if (results.Success() && results.RowCount()) {
|
||||||
if (row[0])
|
auto row = results.begin();
|
||||||
strcpy(leaderbuf, row[0]);
|
return row[0];
|
||||||
|
}
|
||||||
|
|
||||||
return leaderbuf;
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
||||||
std::string query = StringFormat("UPDATE group_leaders SET leadername = '%s' WHERE gid = %u", EscapeString(name).c_str(), gid);
|
std::string query = StringFormat("UPDATE group_leaders SET leadername = '%s' WHERE gid = %u", Strings::Escape(name).c_str(), gid);
|
||||||
auto result = QueryDatabase(query);
|
auto result = QueryDatabase(query);
|
||||||
|
|
||||||
if(result.RowsAffected() != 0) {
|
if(result.RowsAffected() != 0) {
|
||||||
@@ -1679,7 +1552,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
query = StringFormat("REPLACE INTO group_leaders(gid, leadername, marknpc, leadershipaa, maintank, assist, puller, mentoree, mentor_percent) VALUES(%u, '%s', '', '', '', '', '', '', '0')",
|
query = StringFormat("REPLACE INTO group_leaders(gid, leadername, marknpc, leadershipaa, maintank, assist, puller, mentoree, mentor_percent) VALUES(%u, '%s', '', '', '', '', '', '', '0')",
|
||||||
gid, EscapeString(name).c_str());
|
gid, Strings::Escape(name).c_str());
|
||||||
result = QueryDatabase(query);
|
result = QueryDatabase(query);
|
||||||
|
|
||||||
if(!result.Success()) {
|
if(!result.Success()) {
|
||||||
@@ -2262,28 +2135,32 @@ bool Database::SaveTime(int8 minute, int8 hour, int8 day, int8 month, int16 year
|
|||||||
}
|
}
|
||||||
|
|
||||||
int Database::GetIPExemption(std::string account_ip) {
|
int Database::GetIPExemption(std::string account_ip) {
|
||||||
std::string query = StringFormat("SELECT `exemption_amount` FROM `ip_exemptions` WHERE `exemption_ip` = '%s'", account_ip.c_str());
|
auto query = fmt::format(
|
||||||
auto results = QueryDatabase(query);
|
"SELECT `exemption_amount` FROM `ip_exemptions` WHERE `exemption_ip` = '{}'",
|
||||||
|
|
||||||
if (results.Success() && results.RowCount() > 0) {
|
|
||||||
auto row = results.begin();
|
|
||||||
return atoi(row[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return RuleI(World, MaxClientsPerIP);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Database::SetIPExemption(std::string account_ip, int exemption_amount) {
|
|
||||||
std::string query = fmt::format(
|
|
||||||
"SELECT `exemption_id` FROM `ip_exemptions` WHERE `exemption_ip` = '{}'",
|
|
||||||
account_ip
|
account_ip
|
||||||
);
|
);
|
||||||
|
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
uint32 exemption_id = 0;
|
if (!results.Success() || !results.RowCount()) {
|
||||||
if (results.Success() && results.RowCount() > 0) {
|
return RuleI(World, MaxClientsPerIP);
|
||||||
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
exemption_id = atoi(row[0]);
|
return std::stoi(row[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Database::SetIPExemption(std::string account_ip, int exemption_amount) {
|
||||||
|
auto query = fmt::format(
|
||||||
|
"SELECT `exemption_id` FROM `ip_exemptions` WHERE `exemption_ip` = '{}'",
|
||||||
|
account_ip
|
||||||
|
);
|
||||||
|
|
||||||
|
uint32 exemption_id = 0;
|
||||||
|
|
||||||
|
auto results = QueryDatabase(query);
|
||||||
|
if (results.Success() && results.RowCount()) {
|
||||||
|
auto row = results.begin();
|
||||||
|
exemption_id = std::stoul(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
@@ -2292,13 +2169,14 @@ void Database::SetIPExemption(std::string account_ip, int exemption_amount) {
|
|||||||
exemption_amount
|
exemption_amount
|
||||||
);
|
);
|
||||||
|
|
||||||
if (exemption_id != 0) {
|
if (exemption_id) {
|
||||||
query = fmt::format(
|
query = fmt::format(
|
||||||
"UPDATE `ip_exemptions` SET `exemption_amount` = {} WHERE `exemption_ip` = '{}'",
|
"UPDATE `ip_exemptions` SET `exemption_amount` = {} WHERE `exemption_ip` = '{}'",
|
||||||
exemption_amount,
|
exemption_amount,
|
||||||
account_ip
|
account_ip
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryDatabase(query);
|
QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2321,9 +2199,9 @@ int Database::GetInstanceID(uint32 char_id, uint32 zone_id) {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
bool Database::CopyCharacter(
|
bool Database::CopyCharacter(
|
||||||
std::string source_character_name,
|
const std::string& source_character_name,
|
||||||
std::string destination_character_name,
|
const std::string& destination_character_name,
|
||||||
std::string destination_account_name
|
const std::string& destination_account_name
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
auto results = QueryDatabase(
|
auto results = QueryDatabase(
|
||||||
@@ -2335,6 +2213,7 @@ bool Database::CopyCharacter(
|
|||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
LogError("No character found with name [{}]", source_character_name);
|
LogError("No character found with name [{}]", source_character_name);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto row = results.begin();
|
||||||
@@ -2349,6 +2228,7 @@ bool Database::CopyCharacter(
|
|||||||
|
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
LogError("No account found with name [{}]", destination_account_name);
|
LogError("No account found with name [{}]", destination_account_name);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
row = results.begin();
|
row = results.begin();
|
||||||
@@ -2380,7 +2260,7 @@ bool Database::CopyCharacter(
|
|||||||
results = QueryDatabase(
|
results = QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"SELECT {} FROM {} WHERE {} = {}",
|
"SELECT {} FROM {} WHERE {} = {}",
|
||||||
implode(",", wrap(columns, "`")),
|
Strings::Implode(",", Strings::Wrap(columns, "`")),
|
||||||
table_name,
|
table_name,
|
||||||
character_id_column_name,
|
character_id_column_name,
|
||||||
source_character_id
|
source_character_id
|
||||||
@@ -2416,7 +2296,7 @@ bool Database::CopyCharacter(
|
|||||||
std::vector<std::string> insert_rows;
|
std::vector<std::string> insert_rows;
|
||||||
|
|
||||||
for (auto &r: new_rows) {
|
for (auto &r: new_rows) {
|
||||||
std::string insert_row = "(" + implode(",", wrap(r, "'")) + ")";
|
std::string insert_row = "(" + Strings::Implode(",", Strings::Wrap(r, "'")) + ")";
|
||||||
insert_rows.emplace_back(insert_row);
|
insert_rows.emplace_back(insert_row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2434,8 +2314,8 @@ bool Database::CopyCharacter(
|
|||||||
fmt::format(
|
fmt::format(
|
||||||
"INSERT INTO {} ({}) VALUES {}",
|
"INSERT INTO {} ({}) VALUES {}",
|
||||||
table_name,
|
table_name,
|
||||||
implode(",", wrap(columns, "`")),
|
Strings::Implode(",", Strings::Wrap(columns, "`")),
|
||||||
implode(",", insert_rows)
|
Strings::Implode(",", insert_rows)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2487,8 +2367,8 @@ void Database::SourceDatabaseTableFromUrl(std::string table_name, std::string ur
|
|||||||
|
|
||||||
if (auto res = cli.Get(request_uri.get_path().c_str())) {
|
if (auto res = cli.Get(request_uri.get_path().c_str())) {
|
||||||
if (res->status == 200) {
|
if (res->status == 200) {
|
||||||
for (auto &s: SplitString(res->body, ';')) {
|
for (auto &s: Strings::Split(res->body, ';')) {
|
||||||
if (!trim(s).empty()) {
|
if (!Strings::Trim(s).empty()) {
|
||||||
auto results = QueryDatabase(s);
|
auto results = QueryDatabase(s);
|
||||||
if (!results.ErrorMessage().empty()) {
|
if (!results.ErrorMessage().empty()) {
|
||||||
LogError("Error sourcing SQL [{}]", results.ErrorMessage());
|
LogError("Error sourcing SQL [{}]", results.ErrorMessage());
|
||||||
@@ -2516,3 +2396,16 @@ void Database::SourceDatabaseTableFromUrl(std::string table_name, std::string ur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8 Database::GetMinStatus(uint32 zone_id, uint32 instance_version)
|
||||||
|
{
|
||||||
|
auto zones = ZoneRepository::GetWhere(
|
||||||
|
*this,
|
||||||
|
fmt::format(
|
||||||
|
"zoneidnumber = {} AND (version = {} OR version = 0) ORDER BY version DESC LIMIT 1",
|
||||||
|
zone_id,
|
||||||
|
instance_version
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return !zones.empty() ? zones[0].min_status : 0;
|
||||||
|
}
|
||||||
|
|||||||
+17
-19
@@ -88,7 +88,6 @@ public:
|
|||||||
|
|
||||||
/* Character Creation */
|
/* Character Creation */
|
||||||
|
|
||||||
bool AddToNameFilter(const char *name);
|
|
||||||
bool CreateCharacter(
|
bool CreateCharacter(
|
||||||
uint32 account_id,
|
uint32 account_id,
|
||||||
char *name,
|
char *name,
|
||||||
@@ -114,25 +113,25 @@ public:
|
|||||||
bool SetMQDetectionFlag(const char *accountname, const char *charactername, const std::string &hacked, const char *zone);
|
bool SetMQDetectionFlag(const char *accountname, const char *charactername, const std::string &hacked, const char *zone);
|
||||||
bool UpdateName(const char *oldname, const char *newname);
|
bool UpdateName(const char *oldname, const char *newname);
|
||||||
bool CopyCharacter(
|
bool CopyCharacter(
|
||||||
std::string source_character_name,
|
const std::string& source_character_name,
|
||||||
std::string destination_character_name,
|
const std::string& destination_character_name,
|
||||||
std::string destination_account_name
|
const std::string& destination_account_name
|
||||||
);
|
);
|
||||||
|
|
||||||
/* General Information Queries */
|
/* General Information Queries */
|
||||||
|
|
||||||
bool AddBannedIP(char* bannedIP, const char* notes); //Add IP address to the banned_ips table.
|
bool AddBannedIP(std::string banned_ip, std::string notes); //Add IP address to the banned_ips table.
|
||||||
bool AddGMIP(char* ip_address, char* name);
|
bool AddToNameFilter(std::string name);
|
||||||
bool CheckBannedIPs(const char* loginIP); //Check incoming connection against banned IP table.
|
bool CheckBannedIPs(std::string login_ip); //Check incoming connection against banned IP table.
|
||||||
bool CheckGMIPs(const char* loginIP, uint32 account_id);
|
bool CheckGMIPs(std::string login_ip, uint32 account_id);
|
||||||
bool CheckNameFilter(const char* name, bool surname = false);
|
bool CheckNameFilter(std::string name, bool surname = false);
|
||||||
bool CheckUsedName(const char* name);
|
bool CheckUsedName(std::string name);
|
||||||
|
|
||||||
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
|
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
|
||||||
uint32 GetAccountIDByChar(uint32 char_id);
|
uint32 GetAccountIDByChar(uint32 char_id);
|
||||||
uint32 GetAccountIDByName(const char* accname, const char *loginserver, int16* status = 0, uint32* lsid = 0);
|
uint32 GetAccountIDByName(std::string account_name, std::string loginserver, int16* status = 0, uint32* lsid = 0);
|
||||||
uint32 GetCharacterID(const char *name);
|
uint32 GetCharacterID(const char *name);
|
||||||
uint32 GetCharacterInfo(const char* iName, uint32* oAccID = 0, uint32* oZoneID = 0, uint32* oInstanceID = 0, float* oX = 0, float* oY = 0, float* oZ = 0);
|
uint32 GetCharacterInfo(std::string character_name, uint32 *account_id, uint32 *zone_id, uint32 *instance_id);
|
||||||
uint32 GetGuildIDByCharID(uint32 char_id);
|
uint32 GetGuildIDByCharID(uint32 char_id);
|
||||||
uint32 GetGroupIDByCharID(uint32 char_id);
|
uint32 GetGroupIDByCharID(uint32 char_id);
|
||||||
uint32 GetRaidIDByCharID(uint32 char_id);
|
uint32 GetRaidIDByCharID(uint32 char_id);
|
||||||
@@ -142,7 +141,7 @@ public:
|
|||||||
std::string GetCharNameByID(uint32 char_id);
|
std::string GetCharNameByID(uint32 char_id);
|
||||||
std::string GetNPCNameByID(uint32 npc_id);
|
std::string GetNPCNameByID(uint32 npc_id);
|
||||||
std::string GetCleanNPCNameByID(uint32 npc_id);
|
std::string GetCleanNPCNameByID(uint32 npc_id);
|
||||||
void LoginIP(uint32 AccountID, const char* LoginIP);
|
void LoginIP(uint32 account_id, std::string login_ip);
|
||||||
|
|
||||||
/* Instancing */
|
/* Instancing */
|
||||||
|
|
||||||
@@ -190,6 +189,8 @@ public:
|
|||||||
|
|
||||||
int16 CheckStatus(uint32 account_id);
|
int16 CheckStatus(uint32 account_id);
|
||||||
|
|
||||||
|
void SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum);
|
||||||
|
|
||||||
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
uint32 CheckLogin(const char* name, const char* password, const char *loginserver, int16* oStatus = 0);
|
||||||
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
uint32 CreateAccount(const char* name, const char* password, int16 status, const char* loginserver, uint32 lsaccount_id);
|
||||||
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
|
uint32 GetAccountIDFromLSID(const std::string& in_loginserver_id, uint32 in_loginserver_account_id, char* in_account_name = 0, int16* in_status = 0);
|
||||||
@@ -206,7 +207,7 @@ public:
|
|||||||
|
|
||||||
/* Groups */
|
/* Groups */
|
||||||
|
|
||||||
char* GetGroupLeaderForLogin(const char* name,char* leaderbuf);
|
std::string GetGroupLeaderForLogin(std::string character_name);
|
||||||
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
|
char* GetGroupLeadershipInfo(uint32 gid, char* leaderbuf, char* maintank = nullptr, char* assist = nullptr, char* puller = nullptr, char *marknpc = nullptr, char *mentoree = nullptr, int *mentor_percent = nullptr, GroupLeadershipAA_Struct* GLAA = nullptr);
|
||||||
|
|
||||||
uint32 GetGroupID(const char* name);
|
uint32 GetGroupID(const char* name);
|
||||||
@@ -245,14 +246,11 @@ public:
|
|||||||
|
|
||||||
/* General Queries */
|
/* General Queries */
|
||||||
|
|
||||||
bool GetSafePoints(const char* zone_short_name, uint32 instance_version, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, float* safe_heading = 0, int16* minstatus = 0, uint8* minlevel = 0, char *flag_needed = nullptr);
|
|
||||||
bool GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid = 0, float* graveyard_x = 0, float* graveyard_y = 0, float* graveyard_z = 0, float* graveyard_heading = 0);
|
bool GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zoneid = 0, float* graveyard_x = 0, float* graveyard_y = 0, float* graveyard_z = 0, float* graveyard_heading = 0);
|
||||||
bool GetZoneLongName(const char* short_name, char** long_name, char* file_name = 0, float* safe_x = 0, float* safe_y = 0, float* safe_z = 0, uint32* graveyard_id = 0, uint32* maxclients = 0);
|
|
||||||
bool LoadPTimers(uint32 charid, PTimerList &into);
|
bool LoadPTimers(uint32 charid, PTimerList &into);
|
||||||
|
|
||||||
uint32 GetZoneGraveyardID(uint32 zone_id, uint32 version);
|
uint8 GetPEQZone(uint32 zone_id, uint32 version);
|
||||||
|
uint8 GetMinStatus(uint32 zone_id, uint32 instance_version);
|
||||||
uint8 GetPEQZone(uint32 zoneID, uint32 version);
|
|
||||||
uint8 GetRaceSkill(uint8 skillid, uint8 in_race);
|
uint8 GetRaceSkill(uint8 skillid, uint8 in_race);
|
||||||
uint8 GetServerType();
|
uint8 GetServerType();
|
||||||
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
|
uint8 GetSkillCap(uint8 skillid, uint8 in_race, uint8 in_class, uint16 in_level);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include "database_dump_service.h"
|
#include "database_dump_service.h"
|
||||||
#include "../eqemu_logsys.h"
|
#include "../eqemu_logsys.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../eqemu_config.h"
|
#include "../eqemu_config.h"
|
||||||
#include "../database_schema.h"
|
#include "../database_schema.h"
|
||||||
#include "../file_util.h"
|
#include "../file_util.h"
|
||||||
@@ -119,7 +119,7 @@ std::string DatabaseDumpService::GetMySQLVersion()
|
|||||||
{
|
{
|
||||||
std::string version_output = execute("mysql --version");
|
std::string version_output = execute("mysql --version");
|
||||||
|
|
||||||
return trim(version_output);
|
return Strings::Trim(version_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,7 +160,21 @@ std::string DatabaseDumpService::GetPlayerTablesList()
|
|||||||
tables_list += table + " ";
|
tables_list += table + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim(tables_list);
|
return Strings::Trim(tables_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
std::string DatabaseDumpService::GetBotTablesList()
|
||||||
|
{
|
||||||
|
std::string tables_list;
|
||||||
|
std::vector<std::string> tables = DatabaseSchema::GetBotTables();
|
||||||
|
for (const auto &table : tables) {
|
||||||
|
tables_list += table + " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return Strings::Trim(tables_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -174,7 +188,7 @@ std::string DatabaseDumpService::GetLoginTableList()
|
|||||||
tables_list += table + " ";
|
tables_list += table + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim(tables_list);
|
return Strings::Trim(tables_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -188,7 +202,7 @@ std::string DatabaseDumpService::GetQueryServTables()
|
|||||||
tables_list += table + " ";
|
tables_list += table + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim(tables_list);
|
return Strings::Trim(tables_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,7 +222,7 @@ std::string DatabaseDumpService::GetSystemTablesList()
|
|||||||
tables_list += table + " ";
|
tables_list += table + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim(tables_list);
|
return Strings::Trim(tables_list);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
@@ -222,7 +236,7 @@ std::string DatabaseDumpService::GetStateTablesList()
|
|||||||
tables_list += table + " ";
|
tables_list += table + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim(tables_list);
|
return Strings::Trim(tables_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -237,7 +251,7 @@ std::string DatabaseDumpService::GetContentTablesList()
|
|||||||
tables_list += table + " ";
|
tables_list += table + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim(tables_list);
|
return Strings::Trim(tables_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -318,6 +332,11 @@ void DatabaseDumpService::Dump()
|
|||||||
dump_descriptor += "-player";
|
dump_descriptor += "-player";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsDumpBotTables()) {
|
||||||
|
tables_to_dump += GetBotTablesList() + " ";
|
||||||
|
dump_descriptor += "-bots";
|
||||||
|
}
|
||||||
|
|
||||||
if (IsDumpSystemTables()) {
|
if (IsDumpSystemTables()) {
|
||||||
tables_to_dump += GetSystemTablesList() + " ";
|
tables_to_dump += GetSystemTablesList() + " ";
|
||||||
dump_descriptor += "-system";
|
dump_descriptor += "-system";
|
||||||
@@ -369,7 +388,7 @@ void DatabaseDumpService::Dump()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsDumpDropTableSyntaxOnly()) {
|
if (IsDumpDropTableSyntaxOnly()) {
|
||||||
std::vector<std::string> tables = SplitString(tables_to_dump, ' ');
|
std::vector<std::string> tables = Strings::Split(tables_to_dump, ' ');
|
||||||
|
|
||||||
for (auto &table : tables) {
|
for (auto &table : tables) {
|
||||||
std::cout << "DROP TABLE IF EXISTS `" << table << "`;" << std::endl;
|
std::cout << "DROP TABLE IF EXISTS `" << table << "`;" << std::endl;
|
||||||
@@ -436,6 +455,7 @@ void DatabaseDumpService::Dump()
|
|||||||
// LogDebug("[{}] login", (IsDumpLoginServerTables() ? "true" : "false"));
|
// LogDebug("[{}] login", (IsDumpLoginServerTables() ? "true" : "false"));
|
||||||
// LogDebug("[{}] player", (IsDumpPlayerTables() ? "true" : "false"));
|
// LogDebug("[{}] player", (IsDumpPlayerTables() ? "true" : "false"));
|
||||||
// LogDebug("[{}] system", (IsDumpSystemTables() ? "true" : "false"));
|
// LogDebug("[{}] system", (IsDumpSystemTables() ? "true" : "false"));
|
||||||
|
// LogDebug("[{}] bot", (IsDumpBotTables() ? "true" : "false"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseDumpService::IsDumpSystemTables() const
|
bool DatabaseDumpService::IsDumpSystemTables() const
|
||||||
@@ -577,3 +597,13 @@ void DatabaseDumpService::SetDumpStateTables(bool dump_state_tables)
|
|||||||
{
|
{
|
||||||
DatabaseDumpService::dump_state_tables = dump_state_tables;
|
DatabaseDumpService::dump_state_tables = dump_state_tables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DatabaseDumpService::IsDumpBotTables() const
|
||||||
|
{
|
||||||
|
return dump_bot_tables;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DatabaseDumpService::SetDumpBotTables(bool dump_bot_tables)
|
||||||
|
{
|
||||||
|
DatabaseDumpService::dump_bot_tables = dump_bot_tables;
|
||||||
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public:
|
|||||||
void SetDumpDropTableSyntaxOnly(bool dump_drop_table_syntax_only);
|
void SetDumpDropTableSyntaxOnly(bool dump_drop_table_syntax_only);
|
||||||
bool IsDumpStateTables() const;
|
bool IsDumpStateTables() const;
|
||||||
void SetDumpStateTables(bool dump_state_tables);
|
void SetDumpStateTables(bool dump_state_tables);
|
||||||
|
bool IsDumpBotTables() const;
|
||||||
|
void SetDumpBotTables(bool dump_bot_tables);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool dump_all_tables = false;
|
bool dump_all_tables = false;
|
||||||
@@ -67,6 +69,7 @@ private:
|
|||||||
bool dump_with_compression = false;
|
bool dump_with_compression = false;
|
||||||
bool dump_output_to_console = false;
|
bool dump_output_to_console = false;
|
||||||
bool dump_drop_table_syntax_only = false;
|
bool dump_drop_table_syntax_only = false;
|
||||||
|
bool dump_bot_tables = false;
|
||||||
std::string dump_path;
|
std::string dump_path;
|
||||||
std::string dump_file_name;
|
std::string dump_file_name;
|
||||||
|
|
||||||
@@ -75,6 +78,7 @@ private:
|
|||||||
std::string GetMySQLVersion();
|
std::string GetMySQLVersion();
|
||||||
std::string GetBaseMySQLDumpCommand();
|
std::string GetBaseMySQLDumpCommand();
|
||||||
std::string GetPlayerTablesList();
|
std::string GetPlayerTablesList();
|
||||||
|
std::string GetBotTablesList();
|
||||||
std::string GetSystemTablesList();
|
std::string GetSystemTablesList();
|
||||||
std::string GetStateTablesList();
|
std::string GetStateTablesList();
|
||||||
std::string GetContentTablesList();
|
std::string GetContentTablesList();
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/strings.h"
|
||||||
#include "../common/timer.h"
|
#include "../common/timer.h"
|
||||||
|
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
@@ -476,7 +476,7 @@ bool Database::CheckDatabaseConversions() {
|
|||||||
CheckDatabaseConvertCorpseDeblob();
|
CheckDatabaseConvertCorpseDeblob();
|
||||||
|
|
||||||
/* Run EQEmu Server script (Checks for database updates) */
|
/* Run EQEmu Server script (Checks for database updates) */
|
||||||
if(system("perl eqemu_server.pl ran_from_world"));
|
system("perl eqemu_server.pl ran_from_world");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -961,7 +961,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
|||||||
std::string rquery = StringFormat("REPLACE INTO `character_inspect_messages` (id, inspect_message)"
|
std::string rquery = StringFormat("REPLACE INTO `character_inspect_messages` (id, inspect_message)"
|
||||||
"VALUES (%u, '%s')",
|
"VALUES (%u, '%s')",
|
||||||
character_id,
|
character_id,
|
||||||
EscapeString(inspectmessage).c_str()
|
Strings::Escape(inspectmessage).c_str()
|
||||||
);
|
);
|
||||||
auto results = QueryDatabase(rquery);
|
auto results = QueryDatabase(rquery);
|
||||||
}
|
}
|
||||||
@@ -1198,8 +1198,8 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
|||||||
")",
|
")",
|
||||||
character_id,
|
character_id,
|
||||||
account_id,
|
account_id,
|
||||||
EscapeString(pp->name).c_str(),
|
Strings::Escape(pp->name).c_str(),
|
||||||
EscapeString(pp->last_name).c_str(),
|
Strings::Escape(pp->last_name).c_str(),
|
||||||
pp->gender,
|
pp->gender,
|
||||||
pp->race,
|
pp->race,
|
||||||
pp->class_,
|
pp->class_,
|
||||||
@@ -1223,8 +1223,8 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
|||||||
pp->ability_number,
|
pp->ability_number,
|
||||||
pp->ability_time_minutes,
|
pp->ability_time_minutes,
|
||||||
pp->ability_time_hours,
|
pp->ability_time_hours,
|
||||||
EscapeString(pp->title).c_str(),
|
Strings::Escape(pp->title).c_str(),
|
||||||
EscapeString(pp->suffix).c_str(),
|
Strings::Escape(pp->suffix).c_str(),
|
||||||
pp->exp,
|
pp->exp,
|
||||||
pp->points,
|
pp->points,
|
||||||
pp->mana,
|
pp->mana,
|
||||||
@@ -1452,7 +1452,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
|||||||
for (i = 0; i < MAX_LEADERSHIP_AA_ARRAY; i++){
|
for (i = 0; i < MAX_LEADERSHIP_AA_ARRAY; i++){
|
||||||
if (pp->leader_abilities.ranks[i] > 0 && pp->leader_abilities.ranks[i] < 6){
|
if (pp->leader_abilities.ranks[i] > 0 && pp->leader_abilities.ranks[i] < 6){
|
||||||
if (first_entry != 1){
|
if (first_entry != 1){
|
||||||
rquery = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, rank) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
rquery = StringFormat("REPLACE INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||||
first_entry = 1;
|
first_entry = 1;
|
||||||
}
|
}
|
||||||
rquery = rquery + StringFormat(", (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
rquery = rquery + StringFormat(", (%i, %u, %u)", character_id, i, pp->leader_abilities.ranks[i]);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/strings.h"
|
||||||
#include "../common/timer.h"
|
#include "../common/timer.h"
|
||||||
#include "../common/repositories/dynamic_zone_members_repository.h"
|
#include "../common/repositories/dynamic_zone_members_repository.h"
|
||||||
#include "../common/repositories/dynamic_zones_repository.h"
|
#include "../common/repositories/dynamic_zones_repository.h"
|
||||||
@@ -580,7 +580,7 @@ void Database::PurgeExpiredInstances()
|
|||||||
instance_ids.emplace_back(row[0]);
|
instance_ids.emplace_back(row[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string imploded_instance_ids = implode(",", instance_ids);
|
std::string imploded_instance_ids = Strings::Implode(",", instance_ids);
|
||||||
|
|
||||||
QueryDatabase(fmt::format("DELETE FROM instance_list WHERE id IN ({})", imploded_instance_ids));
|
QueryDatabase(fmt::format("DELETE FROM instance_list WHERE id IN ({})", imploded_instance_ids));
|
||||||
QueryDatabase(fmt::format("DELETE FROM instance_list_player WHERE id IN ({})", imploded_instance_ids));
|
QueryDatabase(fmt::format("DELETE FROM instance_list_player WHERE id IN ({})", imploded_instance_ids));
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ namespace DatabaseSchema {
|
|||||||
{"character_pet_buffs", "char_id"},
|
{"character_pet_buffs", "char_id"},
|
||||||
{"character_pet_info", "char_id"},
|
{"character_pet_info", "char_id"},
|
||||||
{"character_pet_inventory", "char_id"},
|
{"character_pet_inventory", "char_id"},
|
||||||
|
{"character_peqzone_flags", "id"},
|
||||||
{"character_potionbelt", "id"},
|
{"character_potionbelt", "id"},
|
||||||
{"character_skills", "id"},
|
{"character_skills", "id"},
|
||||||
{"character_spells", "id"},
|
{"character_spells", "id"},
|
||||||
@@ -82,7 +83,6 @@ namespace DatabaseSchema {
|
|||||||
{"player_titlesets", "char_id"},
|
{"player_titlesets", "char_id"},
|
||||||
{"quest_globals", "charid"},
|
{"quest_globals", "charid"},
|
||||||
{"timers", "char_id"},
|
{"timers", "char_id"},
|
||||||
{"titles", "char_id"},
|
|
||||||
{"trader", "char_id"},
|
{"trader", "char_id"},
|
||||||
{"zone_flags", "charID"}
|
{"zone_flags", "charID"}
|
||||||
};
|
};
|
||||||
@@ -130,6 +130,7 @@ namespace DatabaseSchema {
|
|||||||
"character_pet_buffs",
|
"character_pet_buffs",
|
||||||
"character_pet_info",
|
"character_pet_info",
|
||||||
"character_pet_inventory",
|
"character_pet_inventory",
|
||||||
|
"character_peqzone_flags",
|
||||||
"character_potionbelt",
|
"character_potionbelt",
|
||||||
"character_skills",
|
"character_skills",
|
||||||
"character_spells",
|
"character_spells",
|
||||||
@@ -158,7 +159,6 @@ namespace DatabaseSchema {
|
|||||||
"spell_buckets",
|
"spell_buckets",
|
||||||
"spell_globals",
|
"spell_globals",
|
||||||
"timers",
|
"timers",
|
||||||
"titles",
|
|
||||||
"trader",
|
"trader",
|
||||||
"trader_audit",
|
"trader_audit",
|
||||||
"zone_flags"
|
"zone_flags"
|
||||||
@@ -189,13 +189,14 @@ namespace DatabaseSchema {
|
|||||||
"char_create_point_allocations",
|
"char_create_point_allocations",
|
||||||
"damageshieldtypes",
|
"damageshieldtypes",
|
||||||
"doors",
|
"doors",
|
||||||
|
"dynamic_zone_templates",
|
||||||
|
"faction_association",
|
||||||
"faction_base_data",
|
"faction_base_data",
|
||||||
"faction_list",
|
"faction_list",
|
||||||
"faction_list_mod",
|
"faction_list_mod",
|
||||||
"fishing",
|
"fishing",
|
||||||
"forage",
|
"forage",
|
||||||
"global_loot",
|
"global_loot",
|
||||||
"goallists",
|
|
||||||
"graveyard",
|
"graveyard",
|
||||||
"grid",
|
"grid",
|
||||||
"grid_entries",
|
"grid_entries",
|
||||||
@@ -224,7 +225,6 @@ namespace DatabaseSchema {
|
|||||||
"pets_beastlord_data",
|
"pets_beastlord_data",
|
||||||
"pets_equipmentset",
|
"pets_equipmentset",
|
||||||
"pets_equipmentset_entries",
|
"pets_equipmentset_entries",
|
||||||
"proximities",
|
|
||||||
"skill_caps",
|
"skill_caps",
|
||||||
"spawn2",
|
"spawn2",
|
||||||
"spawn_conditions",
|
"spawn_conditions",
|
||||||
@@ -270,6 +270,7 @@ namespace DatabaseSchema {
|
|||||||
"perl_event_export_settings",
|
"perl_event_export_settings",
|
||||||
"profanity_list",
|
"profanity_list",
|
||||||
"rule_sets",
|
"rule_sets",
|
||||||
|
"titles",
|
||||||
"rule_values",
|
"rule_values",
|
||||||
"variables",
|
"variables",
|
||||||
};
|
};
|
||||||
@@ -317,6 +318,7 @@ namespace DatabaseSchema {
|
|||||||
"completed_shared_task_activity_state",
|
"completed_shared_task_activity_state",
|
||||||
"completed_shared_task_members",
|
"completed_shared_task_members",
|
||||||
"completed_shared_tasks",
|
"completed_shared_tasks",
|
||||||
|
"discord_webhooks",
|
||||||
"dynamic_zone_members",
|
"dynamic_zone_members",
|
||||||
"dynamic_zones",
|
"dynamic_zones",
|
||||||
"eventlog",
|
"eventlog",
|
||||||
@@ -375,6 +377,40 @@ namespace DatabaseSchema {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description Gets all player bot tables
|
||||||
|
* @note These tables have no content in the PEQ daily dump
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
static std::vector<std::string> GetBotTables()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"bot_buffs",
|
||||||
|
"bot_command_settings",
|
||||||
|
"bot_create_combinations",
|
||||||
|
"bot_data",
|
||||||
|
"bot_group_members",
|
||||||
|
"bot_groups",
|
||||||
|
"bot_guild_members",
|
||||||
|
"bot_heal_rotation_members",
|
||||||
|
"bot_heal_rotation_targets",
|
||||||
|
"bot_heal_rotations",
|
||||||
|
"bot_inspect_messages",
|
||||||
|
"bot_inventories",
|
||||||
|
"bot_owner_options",
|
||||||
|
"bot_pet_buffs",
|
||||||
|
"bot_pet_inventories",
|
||||||
|
"bot_pets",
|
||||||
|
"bot_spell_casting_chances",
|
||||||
|
"bot_spells_entries",
|
||||||
|
"bot_stances",
|
||||||
|
"bot_timers",
|
||||||
|
"vw_bot_character_mobs",
|
||||||
|
"vw_bot_groups"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //EQEMU_DATABASE_SCHEMA_H
|
#endif //EQEMU_DATABASE_SCHEMA_H
|
||||||
|
|||||||
+2
-2
@@ -167,7 +167,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
|||||||
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
|
||||||
if ((strncasecmp(query, "select", 6) == 0)) {
|
if ((strncasecmp(query, "select", 6) == 0)) {
|
||||||
LogMySQLQuery(
|
LogMySQLQuery(
|
||||||
"{0} ({1} row{2} returned) ({3}s)",
|
"{0}; -- ({1} row{2} returned) ({3}s)",
|
||||||
query,
|
query,
|
||||||
requestResult.RowCount(),
|
requestResult.RowCount(),
|
||||||
requestResult.RowCount() == 1 ? "" : "s",
|
requestResult.RowCount() == 1 ? "" : "s",
|
||||||
@@ -176,7 +176,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogMySQLQuery(
|
LogMySQLQuery(
|
||||||
"{0} ({1} row{2} affected) ({3}s)",
|
"{0}; -- ({1} row{2} affected) ({3}s)",
|
||||||
query,
|
query,
|
||||||
requestResult.RowsAffected(),
|
requestResult.RowsAffected(),
|
||||||
requestResult.RowsAffected() == 1 ? "" : "s",
|
requestResult.RowsAffected() == 1 ? "" : "s",
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
#include "discord.h"
|
||||||
|
#include "../http/httplib.h"
|
||||||
|
#include "../json/json.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "../eqemu_logsys.h"
|
||||||
|
|
||||||
|
constexpr int MAX_RETRIES = 10;
|
||||||
|
|
||||||
|
void Discord::SendWebhookMessage(const std::string &message, const std::string &webhook_url)
|
||||||
|
{
|
||||||
|
// validate
|
||||||
|
if (webhook_url.empty()) {
|
||||||
|
LogDiscord("[webhook_url] is empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// validate
|
||||||
|
if (webhook_url.find("http://") == std::string::npos && webhook_url.find("https://") == std::string::npos) {
|
||||||
|
LogDiscord("[webhook_url] [{}] does not contain a valid http/s prefix.", webhook_url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// split
|
||||||
|
auto s = Strings::Split(webhook_url, '/');
|
||||||
|
|
||||||
|
// url
|
||||||
|
std::string base_url = fmt::format("{}//{}", s[0], s[2]);
|
||||||
|
std::string endpoint = Strings::Replace(webhook_url, base_url, "");
|
||||||
|
|
||||||
|
// client
|
||||||
|
httplib::Client cli(base_url.c_str());
|
||||||
|
cli.set_connection_timeout(0, 15000000); // 15 sec
|
||||||
|
cli.set_read_timeout(15, 0); // 15 seconds
|
||||||
|
cli.set_write_timeout(15, 0); // 15 seconds
|
||||||
|
httplib::Headers headers = {
|
||||||
|
{"Content-Type", "application/json"}
|
||||||
|
};
|
||||||
|
|
||||||
|
// payload
|
||||||
|
Json::Value p;
|
||||||
|
p["content"] = message;
|
||||||
|
std::stringstream payload;
|
||||||
|
payload << p;
|
||||||
|
|
||||||
|
bool retry = true;
|
||||||
|
int retries = 0;
|
||||||
|
int retry_timer = 1000;
|
||||||
|
while (retry) {
|
||||||
|
if (auto res = cli.Post(endpoint.c_str(), payload.str(), "application/json")) {
|
||||||
|
if (res->status != 200 && res->status != 204) {
|
||||||
|
LogError("[Discord Client] Code [{}] Error [{}]", res->status, res->body);
|
||||||
|
}
|
||||||
|
if (res->status == 429) {
|
||||||
|
if (!res->body.empty()) {
|
||||||
|
std::stringstream ss(res->body);
|
||||||
|
Json::Value response;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ss >> response;
|
||||||
|
}
|
||||||
|
catch (std::exception const &ex) {
|
||||||
|
LogDiscord("JSON serialization failure [{}] via [{}]", ex.what(), res->body);
|
||||||
|
}
|
||||||
|
|
||||||
|
retry_timer = std::stoi(response["retry_after"].asString()) + 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogDiscord("Rate limited... retrying message in [{}ms]", retry_timer);
|
||||||
|
std::this_thread::sleep_for(std::chrono::milliseconds(retry_timer + 500));
|
||||||
|
}
|
||||||
|
if (res->status == 204) {
|
||||||
|
retry = false;
|
||||||
|
}
|
||||||
|
if (retries > MAX_RETRIES) {
|
||||||
|
LogDiscord("Retries exceeded for message [{}]", message);
|
||||||
|
retry = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
retries++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Discord::FormatDiscordMessage(uint16 category_id, const std::string &message)
|
||||||
|
{
|
||||||
|
if (category_id == Logs::LogCategory::MySQLQuery) {
|
||||||
|
return fmt::format("```sql\n{}\n```", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return message + "\n";
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef EQEMU_DISCORD_H
|
||||||
|
#define EQEMU_DISCORD_H
|
||||||
|
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include "../types.h"
|
||||||
|
|
||||||
|
class Discord {
|
||||||
|
public:
|
||||||
|
static void SendWebhookMessage(const std::string& message, const std::string& webhook_url);
|
||||||
|
static std::string FormatDiscordMessage(uint16 category_id, const std::string& message);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //EQEMU_DISCORD_H
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
#include "discord_manager.h"
|
||||||
|
#include "../common/discord/discord.h"
|
||||||
|
#include "../common/eqemu_logsys.h"
|
||||||
|
#include "../common/strings.h"
|
||||||
|
|
||||||
|
void DiscordManager::QueueWebhookMessage(uint32 webhook_id, const std::string &message)
|
||||||
|
{
|
||||||
|
webhook_queue_lock.lock();
|
||||||
|
webhook_message_queue[webhook_id].emplace_back(message);
|
||||||
|
webhook_queue_lock.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr int MAX_MESSAGE_LENGTH = 1900;
|
||||||
|
|
||||||
|
void DiscordManager::ProcessMessageQueue()
|
||||||
|
{
|
||||||
|
if (webhook_message_queue.empty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
webhook_queue_lock.lock();
|
||||||
|
for (auto &q: webhook_message_queue) {
|
||||||
|
LogDiscord("Processing [{}] messages in queue for webhook ID [{}]...", q.second.size(), q.first);
|
||||||
|
|
||||||
|
if (q.first >= MAX_DISCORD_WEBHOOK_ID) {
|
||||||
|
LogDiscord("Out of bounds webhook ID [{}] max [{}]", q.first, MAX_DISCORD_WEBHOOK_ID);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto webhook = LogSys.GetDiscordWebhooks()[q.first];
|
||||||
|
std::string message;
|
||||||
|
|
||||||
|
for (auto &m: q.second) {
|
||||||
|
// next message would become too large
|
||||||
|
bool next_message_too_large = ((int) m.length() + (int) message.length()) > MAX_MESSAGE_LENGTH;
|
||||||
|
if (next_message_too_large) {
|
||||||
|
Discord::SendWebhookMessage(
|
||||||
|
message,
|
||||||
|
webhook.webhook_url
|
||||||
|
);
|
||||||
|
message = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
message += m;
|
||||||
|
|
||||||
|
// one single message was too large
|
||||||
|
// this should rarely happen but the message will need to be split
|
||||||
|
if ((int) message.length() > MAX_MESSAGE_LENGTH) {
|
||||||
|
for (unsigned mi = 0; mi < message.length(); mi += MAX_MESSAGE_LENGTH) {
|
||||||
|
Discord::SendWebhookMessage(
|
||||||
|
message.substr(mi, MAX_MESSAGE_LENGTH),
|
||||||
|
webhook.webhook_url
|
||||||
|
);
|
||||||
|
}
|
||||||
|
message = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// final flush
|
||||||
|
if (!message.empty()) {
|
||||||
|
Discord::SendWebhookMessage(
|
||||||
|
message,
|
||||||
|
webhook.webhook_url
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
webhook_message_queue.clear();
|
||||||
|
webhook_queue_lock.unlock();
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef EQEMU_DISCORD_MANAGER_H
|
||||||
|
#define EQEMU_DISCORD_MANAGER_H
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include "../common/types.h"
|
||||||
|
|
||||||
|
class DiscordManager {
|
||||||
|
public:
|
||||||
|
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
|
||||||
|
void ProcessMessageQueue();
|
||||||
|
private:
|
||||||
|
std::mutex webhook_queue_lock{};
|
||||||
|
std::map<uint32, std::vector<std::string>> webhook_message_queue{};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -79,6 +79,7 @@ void DynamicZoneBase::LoadRepositoryResult(DynamicZonesRepository::DynamicZoneIn
|
|||||||
m_max_players = dz_entry.max_players;
|
m_max_players = dz_entry.max_players;
|
||||||
m_instance_id = dz_entry.instance_id;
|
m_instance_id = dz_entry.instance_id;
|
||||||
m_type = static_cast<DynamicZoneType>(dz_entry.type);
|
m_type = static_cast<DynamicZoneType>(dz_entry.type);
|
||||||
|
m_dz_switch_id = dz_entry.dz_switch_id;
|
||||||
m_compass.zone_id = dz_entry.compass_zone_id;
|
m_compass.zone_id = dz_entry.compass_zone_id;
|
||||||
m_compass.x = dz_entry.compass_x;
|
m_compass.x = dz_entry.compass_x;
|
||||||
m_compass.y = dz_entry.compass_y;
|
m_compass.y = dz_entry.compass_y;
|
||||||
@@ -129,6 +130,7 @@ uint32_t DynamicZoneBase::SaveToDatabase()
|
|||||||
insert_dz.max_players = m_max_players;
|
insert_dz.max_players = m_max_players;
|
||||||
insert_dz.instance_id = m_instance_id,
|
insert_dz.instance_id = m_instance_id,
|
||||||
insert_dz.type = static_cast<int>(m_type);
|
insert_dz.type = static_cast<int>(m_type);
|
||||||
|
insert_dz.dz_switch_id = m_dz_switch_id;
|
||||||
insert_dz.compass_zone_id = m_compass.zone_id;
|
insert_dz.compass_zone_id = m_compass.zone_id;
|
||||||
insert_dz.compass_x = m_compass.x;
|
insert_dz.compass_x = m_compass.x;
|
||||||
insert_dz.compass_y = m_compass.y;
|
insert_dz.compass_y = m_compass.y;
|
||||||
@@ -316,6 +318,17 @@ void DynamicZoneBase::SetZoneInLocation(float x, float y, float z, float heading
|
|||||||
SetZoneInLocation({ 0, x, y, z, heading }, update_db);
|
SetZoneInLocation({ 0, x, y, z, heading }, update_db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DynamicZoneBase::SetSwitchID(int dz_switch_id, bool update_db)
|
||||||
|
{
|
||||||
|
m_dz_switch_id = dz_switch_id;
|
||||||
|
|
||||||
|
if (update_db)
|
||||||
|
{
|
||||||
|
DynamicZonesRepository::UpdateSwitchID(GetDatabase(), m_id, dz_switch_id);
|
||||||
|
SendServerPacket(CreateServerDzSwitchIDPacket().get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DynamicZoneBase::SetLeader(const DynamicZoneMember& new_leader, bool update_db)
|
void DynamicZoneBase::SetLeader(const DynamicZoneMember& new_leader, bool update_db)
|
||||||
{
|
{
|
||||||
m_leader = new_leader;
|
m_leader = new_leader;
|
||||||
@@ -403,6 +416,17 @@ std::unique_ptr<ServerPacket> DynamicZoneBase::CreateServerDzLocationPacket(
|
|||||||
return pack;
|
return pack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<ServerPacket> DynamicZoneBase::CreateServerDzSwitchIDPacket()
|
||||||
|
{
|
||||||
|
constexpr uint32_t pack_size = sizeof(ServerDzSwitchID_Struct);
|
||||||
|
auto pack = std::make_unique<ServerPacket>(ServerOP_DzSetSwitchID, pack_size);
|
||||||
|
auto buf = reinterpret_cast<ServerDzSwitchID_Struct*>(pack->pBuffer);
|
||||||
|
buf->dz_id = GetID();
|
||||||
|
buf->dz_switch_id = GetSwitchID();
|
||||||
|
|
||||||
|
return pack;
|
||||||
|
}
|
||||||
|
|
||||||
std::unique_ptr<ServerPacket> DynamicZoneBase::CreateServerMemberStatusPacket(
|
std::unique_ptr<ServerPacket> DynamicZoneBase::CreateServerMemberStatusPacket(
|
||||||
uint32_t character_id, DynamicZoneMemberStatus status)
|
uint32_t character_id, DynamicZoneMemberStatus status)
|
||||||
{
|
{
|
||||||
@@ -561,8 +585,9 @@ std::string DynamicZoneBase::GetDynamicZoneTypeName(DynamicZoneType dz_type)
|
|||||||
return "Mission";
|
return "Mission";
|
||||||
case DynamicZoneType::Quest:
|
case DynamicZoneType::Quest:
|
||||||
return "Quest";
|
return "Quest";
|
||||||
}
|
default:
|
||||||
return "Unknown";
|
return "Unknown";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EQ::Net::DynamicPacket DynamicZoneBase::GetSerializedDzPacket()
|
EQ::Net::DynamicPacket DynamicZoneBase::GetSerializedDzPacket()
|
||||||
@@ -597,3 +622,28 @@ void DynamicZoneBase::LoadSerializedDzPacket(char* cereal_data, uint32_t cereal_
|
|||||||
cereal::BinaryInputArchive archive(ss);
|
cereal::BinaryInputArchive archive(ss);
|
||||||
archive(*this);
|
archive(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DynamicZoneBase::LoadTemplate(const DynamicZoneTemplatesRepository::DynamicZoneTemplates& dz_template)
|
||||||
|
{
|
||||||
|
m_zone_id = dz_template.zone_id;
|
||||||
|
m_zone_version = dz_template.zone_version;
|
||||||
|
m_name = dz_template.name;
|
||||||
|
m_min_players = dz_template.min_players;
|
||||||
|
m_max_players = dz_template.max_players;
|
||||||
|
m_duration = std::chrono::seconds(dz_template.duration_seconds);
|
||||||
|
m_dz_switch_id = dz_template.dz_switch_id;
|
||||||
|
m_compass.zone_id = dz_template.compass_zone_id;
|
||||||
|
m_compass.x = dz_template.compass_x;
|
||||||
|
m_compass.y = dz_template.compass_y;
|
||||||
|
m_compass.z = dz_template.compass_z;
|
||||||
|
m_safereturn.zone_id = dz_template.return_zone_id;
|
||||||
|
m_safereturn.x = dz_template.return_x;
|
||||||
|
m_safereturn.y = dz_template.return_y;
|
||||||
|
m_safereturn.z = dz_template.return_z;
|
||||||
|
m_safereturn.heading = dz_template.return_h;
|
||||||
|
m_has_zonein = dz_template.override_zone_in;
|
||||||
|
m_zonein.x = dz_template.zone_in_x;
|
||||||
|
m_zonein.y = dz_template.zone_in_y;
|
||||||
|
m_zonein.z = dz_template.zone_in_z;
|
||||||
|
m_zonein.heading = dz_template.zone_in_h;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "net/packet.h"
|
#include "net/packet.h"
|
||||||
#include "repositories/dynamic_zones_repository.h"
|
#include "repositories/dynamic_zones_repository.h"
|
||||||
#include "repositories/dynamic_zone_members_repository.h"
|
#include "repositories/dynamic_zone_members_repository.h"
|
||||||
|
#include "repositories/dynamic_zone_templates_repository.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -74,6 +75,7 @@ public:
|
|||||||
|
|
||||||
virtual void SetSecondsRemaining(uint32_t seconds_remaining) = 0;
|
virtual void SetSecondsRemaining(uint32_t seconds_remaining) = 0;
|
||||||
|
|
||||||
|
int GetDuration() const { return static_cast<int>(m_duration.count()); }
|
||||||
uint64_t GetExpireTime() const { return std::chrono::system_clock::to_time_t(m_expire_time); }
|
uint64_t GetExpireTime() const { return std::chrono::system_clock::to_time_t(m_expire_time); }
|
||||||
uint32_t GetID() const { return m_id; }
|
uint32_t GetID() const { return m_id; }
|
||||||
uint16_t GetInstanceID() const { return static_cast<uint16_t>(m_instance_id); }
|
uint16_t GetInstanceID() const { return static_cast<uint16_t>(m_instance_id); }
|
||||||
@@ -85,6 +87,7 @@ public:
|
|||||||
uint16_t GetZoneID() const { return static_cast<uint16_t>(m_zone_id); }
|
uint16_t GetZoneID() const { return static_cast<uint16_t>(m_zone_id); }
|
||||||
uint32_t GetZoneIndex() const { return (m_instance_id << 16) | (m_zone_id & 0xffff); }
|
uint32_t GetZoneIndex() const { return (m_instance_id << 16) | (m_zone_id & 0xffff); }
|
||||||
uint32_t GetZoneVersion() const { return m_zone_version; }
|
uint32_t GetZoneVersion() const { return m_zone_version; }
|
||||||
|
int GetSwitchID() const { return m_dz_switch_id; }
|
||||||
DynamicZoneType GetType() const { return m_type; }
|
DynamicZoneType GetType() const { return m_type; }
|
||||||
const std::string& GetLeaderName() const { return m_leader.name; }
|
const std::string& GetLeaderName() const { return m_leader.name; }
|
||||||
const std::string& GetName() const { return m_name; }
|
const std::string& GetName() const { return m_name; }
|
||||||
@@ -112,6 +115,7 @@ public:
|
|||||||
bool IsValid() const { return m_instance_id != 0; }
|
bool IsValid() const { return m_instance_id != 0; }
|
||||||
bool IsSameDz(uint32_t zone_id, uint32_t instance_id) const { return zone_id == m_zone_id && instance_id == m_instance_id; }
|
bool IsSameDz(uint32_t zone_id, uint32_t instance_id) const { return zone_id == m_zone_id && instance_id == m_instance_id; }
|
||||||
void LoadSerializedDzPacket(char* cereal_data, uint32_t cereal_size);
|
void LoadSerializedDzPacket(char* cereal_data, uint32_t cereal_size);
|
||||||
|
void LoadTemplate(const DynamicZoneTemplatesRepository::DynamicZoneTemplates& dz_template);
|
||||||
void RemoveAllMembers();
|
void RemoveAllMembers();
|
||||||
bool RemoveMember(uint32_t character_id);
|
bool RemoveMember(uint32_t character_id);
|
||||||
bool RemoveMember(const std::string& character_name);
|
bool RemoveMember(const std::string& character_name);
|
||||||
@@ -127,6 +131,7 @@ public:
|
|||||||
void SetName(const std::string& name) { m_name = name; }
|
void SetName(const std::string& name) { m_name = name; }
|
||||||
void SetSafeReturn(const DynamicZoneLocation& location, bool update_db = false);
|
void SetSafeReturn(const DynamicZoneLocation& location, bool update_db = false);
|
||||||
void SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db = false);
|
void SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading, bool update_db = false);
|
||||||
|
void SetSwitchID(int dz_switch_id, bool update_db = false);
|
||||||
void SetType(DynamicZoneType type) { m_type = type; }
|
void SetType(DynamicZoneType type) { m_type = type; }
|
||||||
void SetUUID(std::string uuid) { m_uuid = std::move(uuid); }
|
void SetUUID(std::string uuid) { m_uuid = std::move(uuid); }
|
||||||
void SetZoneInLocation(const DynamicZoneLocation& location, bool update_db = false);
|
void SetZoneInLocation(const DynamicZoneLocation& location, bool update_db = false);
|
||||||
@@ -141,6 +146,7 @@ protected:
|
|||||||
virtual void ProcessMemberAddRemove(const DynamicZoneMember& member, bool removed);
|
virtual void ProcessMemberAddRemove(const DynamicZoneMember& member, bool removed);
|
||||||
virtual bool ProcessMemberStatusChange(uint32_t member_id, DynamicZoneMemberStatus status);
|
virtual bool ProcessMemberStatusChange(uint32_t member_id, DynamicZoneMemberStatus status);
|
||||||
virtual void ProcessRemoveAllMembers(bool silent = false) { m_members.clear(); }
|
virtual void ProcessRemoveAllMembers(bool silent = false) { m_members.clear(); }
|
||||||
|
virtual void ProcessSetSwitchID(int dz_switch_id) { m_dz_switch_id = dz_switch_id; }
|
||||||
virtual bool SendServerPacket(ServerPacket* packet) = 0;
|
virtual bool SendServerPacket(ServerPacket* packet) = 0;
|
||||||
|
|
||||||
void AddInternalMember(const DynamicZoneMember& member);
|
void AddInternalMember(const DynamicZoneMember& member);
|
||||||
@@ -153,6 +159,7 @@ protected:
|
|||||||
|
|
||||||
std::unique_ptr<ServerPacket> CreateServerDzCreatePacket(uint16_t origin_zone_id, uint16_t origin_instance_id);
|
std::unique_ptr<ServerPacket> CreateServerDzCreatePacket(uint16_t origin_zone_id, uint16_t origin_instance_id);
|
||||||
std::unique_ptr<ServerPacket> CreateServerDzLocationPacket(uint16_t server_opcode, const DynamicZoneLocation& location);
|
std::unique_ptr<ServerPacket> CreateServerDzLocationPacket(uint16_t server_opcode, const DynamicZoneLocation& location);
|
||||||
|
std::unique_ptr<ServerPacket> CreateServerDzSwitchIDPacket();
|
||||||
std::unique_ptr<ServerPacket> CreateServerMemberAddRemovePacket(const DynamicZoneMember& member, bool removed);
|
std::unique_ptr<ServerPacket> CreateServerMemberAddRemovePacket(const DynamicZoneMember& member, bool removed);
|
||||||
std::unique_ptr<ServerPacket> CreateServerMemberStatusPacket(uint32_t character_id, DynamicZoneMemberStatus status);
|
std::unique_ptr<ServerPacket> CreateServerMemberStatusPacket(uint32_t character_id, DynamicZoneMemberStatus status);
|
||||||
std::unique_ptr<ServerPacket> CreateServerMemberSwapPacket(const DynamicZoneMember& remove_member, const DynamicZoneMember& add_member);
|
std::unique_ptr<ServerPacket> CreateServerMemberSwapPacket(const DynamicZoneMember& remove_member, const DynamicZoneMember& add_member);
|
||||||
@@ -164,6 +171,7 @@ protected:
|
|||||||
uint32_t m_zone_version = 0;
|
uint32_t m_zone_version = 0;
|
||||||
uint32_t m_min_players = 0;
|
uint32_t m_min_players = 0;
|
||||||
uint32_t m_max_players = 0;
|
uint32_t m_max_players = 0;
|
||||||
|
int m_dz_switch_id = 0;
|
||||||
bool m_never_expires = false;
|
bool m_never_expires = false;
|
||||||
bool m_has_zonein = false;
|
bool m_has_zonein = false;
|
||||||
bool m_has_member_statuses = false;
|
bool m_has_member_statuses = false;
|
||||||
@@ -190,6 +198,7 @@ public:
|
|||||||
m_zone_version,
|
m_zone_version,
|
||||||
m_min_players,
|
m_min_players,
|
||||||
m_max_players,
|
m_max_players,
|
||||||
|
m_dz_switch_id,
|
||||||
m_never_expires,
|
m_never_expires,
|
||||||
m_has_zonein,
|
m_has_zonein,
|
||||||
m_has_member_statuses,
|
m_has_member_statuses,
|
||||||
|
|||||||
+321
-5
@@ -18,8 +18,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
#include "bodytypes.h"
|
||||||
|
#include "data_verification.h"
|
||||||
|
#include "eqemu_logsys.h"
|
||||||
|
#include "eqemu_logsys_log_aliases.h"
|
||||||
#include "languages.h"
|
#include "languages.h"
|
||||||
|
#include "rulesys.h"
|
||||||
|
|
||||||
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
||||||
static const int16 local_array[] = {
|
static const int16 local_array[] = {
|
||||||
@@ -148,8 +152,9 @@ const char *EQ::constants::GetStanceName(StanceType stance_type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
int EQ::constants::ConvertStanceTypeToIndex(StanceType stance_type) {
|
||||||
if (stance_type >= EQ::constants::stancePassive && stance_type <= EQ::constants::stanceBurnAE)
|
if (EQ::ValueWithin(stance_type, EQ::constants::stancePassive, EQ::constants::stanceBurnAE)) {
|
||||||
return (stance_type - EQ::constants::stancePassive);
|
return (stance_type - EQ::constants::stancePassive);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -186,14 +191,325 @@ const std::map<int, std::string>& EQ::constants::GetLanguageMap()
|
|||||||
{ LANG_HADAL, "Hadal" },
|
{ LANG_HADAL, "Hadal" },
|
||||||
{ LANG_UNKNOWN, "Unknown" }
|
{ LANG_UNKNOWN, "Unknown" }
|
||||||
};
|
};
|
||||||
|
|
||||||
return language_map;
|
return language_map;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string EQ::constants::GetLanguageName(int language_id)
|
std::string EQ::constants::GetLanguageName(int language_id)
|
||||||
{
|
{
|
||||||
if (language_id >= LANG_COMMON_TONGUE && language_id <= LANG_UNKNOWN) {
|
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
|
||||||
auto languages = EQ::constants::GetLanguageMap();
|
return EQ::constants::GetLanguageMap().find(language_id)->second;
|
||||||
return languages[language_id];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint32, std::string>& EQ::constants::GetLDoNThemeMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint32, std::string> ldon_theme_map = {
|
||||||
|
{ LDoNThemes::Unused, "Unused" },
|
||||||
|
{ LDoNThemes::GUK, "Deepest Guk" },
|
||||||
|
{ LDoNThemes::MIR, "Miragul's Menagerie" },
|
||||||
|
{ LDoNThemes::MMC, "Mistmoore Catacombs" },
|
||||||
|
{ LDoNThemes::RUJ, "Rujarkian Hills" },
|
||||||
|
{ LDoNThemes::TAK, "Takish-Hiz" },
|
||||||
|
};
|
||||||
|
|
||||||
|
return ldon_theme_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetLDoNThemeName(uint32 theme_id)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(theme_id, LDoNThemes::Unused, LDoNThemes::TAK)) {
|
||||||
|
return EQ::constants::GetLDoNThemeMap().find(theme_id)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<int8, std::string>& EQ::constants::GetFlyModeMap()
|
||||||
|
{
|
||||||
|
static const std::map<int8, std::string> flymode_map = {
|
||||||
|
{ GravityBehavior::Ground, "Ground" },
|
||||||
|
{ GravityBehavior::Flying, "Flying" },
|
||||||
|
{ GravityBehavior::Levitating, "Levitating" },
|
||||||
|
{ GravityBehavior::Water, "Water" },
|
||||||
|
{ GravityBehavior::Floating, "Floating" },
|
||||||
|
{ GravityBehavior::LevitateWhileRunning, "Levitating While Running" },
|
||||||
|
};
|
||||||
|
|
||||||
|
return flymode_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetFlyModeName(int8 flymode_id)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(flymode_id, GravityBehavior::Ground, GravityBehavior::LevitateWhileRunning)) {
|
||||||
|
return EQ::constants::GetFlyModeMap().find(flymode_id)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<bodyType, std::string>& EQ::constants::GetBodyTypeMap()
|
||||||
|
{
|
||||||
|
static const std::map<bodyType, std::string> bodytype_map = {
|
||||||
|
{ BT_Humanoid, "Humanoid" },
|
||||||
|
{ BT_Lycanthrope, "Lycanthrope" },
|
||||||
|
{ BT_Undead, "Undead" },
|
||||||
|
{ BT_Giant, "Giant" },
|
||||||
|
{ BT_Construct, "Construct" },
|
||||||
|
{ BT_Extraplanar, "Extraplanar" },
|
||||||
|
{ BT_Magical, "Magical" },
|
||||||
|
{ BT_SummonedUndead, "Summoned Undead" },
|
||||||
|
{ BT_RaidGiant, "Raid Giant" },
|
||||||
|
{ BT_RaidColdain, "Raid Coldain" },
|
||||||
|
{ BT_NoTarget, "Untargetable" },
|
||||||
|
{ BT_Vampire, "Vampire" },
|
||||||
|
{ BT_Atenha_Ra, "Aten Ha Ra" },
|
||||||
|
{ BT_Greater_Akheva, "Greater Akheva" },
|
||||||
|
{ BT_Khati_Sha, "Khati Sha" },
|
||||||
|
{ BT_Seru, "Seru" },
|
||||||
|
{ BT_Grieg_Veneficus, "Grieg Veneficus" },
|
||||||
|
{ BT_Draz_Nurakk, "Draz Nurakk" },
|
||||||
|
{ BT_Zek, "Zek" },
|
||||||
|
{ BT_Luggald, "Luggald" },
|
||||||
|
{ BT_Animal, "Animal" },
|
||||||
|
{ BT_Insect, "Insect" },
|
||||||
|
{ BT_Monster, "Monster" },
|
||||||
|
{ BT_Summoned, "Summoned" },
|
||||||
|
{ BT_Plant, "Plant" },
|
||||||
|
{ BT_Dragon, "Dragon" },
|
||||||
|
{ BT_Summoned2, "Summoned 2" },
|
||||||
|
{ BT_Summoned3, "Summoned 3" },
|
||||||
|
{ BT_Dragon2, "Dragon 2" },
|
||||||
|
{ BT_VeliousDragon, "Velious Dragon" },
|
||||||
|
{ BT_Familiar, "Familiar" },
|
||||||
|
{ BT_Dragon3, "Dragon 3" },
|
||||||
|
{ BT_Boxes, "Boxes" },
|
||||||
|
{ BT_Muramite, "Muramite" },
|
||||||
|
{ BT_NoTarget2, "Untargetable 2" },
|
||||||
|
{ BT_SwarmPet, "Swarm Pet" },
|
||||||
|
{ BT_MonsterSummon, "Monster Summon" },
|
||||||
|
{ BT_InvisMan, "Invisible Man" },
|
||||||
|
{ BT_Special, "Special" },
|
||||||
|
};
|
||||||
|
|
||||||
|
return bodytype_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetBodyTypeName(bodyType bodytype_id)
|
||||||
|
{
|
||||||
|
if (EQ::constants::GetBodyTypeMap().find(bodytype_id) != EQ::constants::GetBodyTypeMap().end()) {
|
||||||
|
return EQ::constants::GetBodyTypeMap().find(bodytype_id)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint8, std::string>& EQ::constants::GetAccountStatusMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint8, std::string> account_status_map = {
|
||||||
|
{ AccountStatus::Player, "Player" },
|
||||||
|
{ AccountStatus::Steward, "Steward" },
|
||||||
|
{ AccountStatus::ApprenticeGuide, "Apprentice Guide" },
|
||||||
|
{ AccountStatus::Guide, "Guide" },
|
||||||
|
{ AccountStatus::QuestTroupe, "Quest Troupe" },
|
||||||
|
{ AccountStatus::SeniorGuide, "Senior Guide" },
|
||||||
|
{ AccountStatus::GMTester, "GM Tester" },
|
||||||
|
{ AccountStatus::EQSupport, "EQ Support" },
|
||||||
|
{ AccountStatus::GMStaff, "GM Staff" },
|
||||||
|
{ AccountStatus::GMAdmin, "GM Admin" },
|
||||||
|
{ AccountStatus::GMLeadAdmin, "GM Lead Admin" },
|
||||||
|
{ AccountStatus::QuestMaster, "Quest Master" },
|
||||||
|
{ AccountStatus::GMAreas, "GM Areas" },
|
||||||
|
{ AccountStatus::GMCoder, "GM Coder" },
|
||||||
|
{ AccountStatus::GMMgmt, "GM Mgmt" },
|
||||||
|
{ AccountStatus::GMImpossible, "GM Impossible" },
|
||||||
|
{ AccountStatus::Max, "GM Max" }
|
||||||
|
};
|
||||||
|
|
||||||
|
return account_status_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetAccountStatusName(uint8 account_status)
|
||||||
|
{
|
||||||
|
for (
|
||||||
|
auto status_level = EQ::constants::GetAccountStatusMap().rbegin();
|
||||||
|
status_level != EQ::constants::GetAccountStatusMap().rend();
|
||||||
|
++status_level
|
||||||
|
) {
|
||||||
|
if (account_status >= status_level->first) {
|
||||||
|
return status_level->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint8, std::string>& EQ::constants::GetConsiderLevelMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint8, std::string> consider_level_map = {
|
||||||
|
{ ConsiderLevel::Ally, "Ally" },
|
||||||
|
{ ConsiderLevel::Warmly, "Warmly" },
|
||||||
|
{ ConsiderLevel::Kindly, "Kindly" },
|
||||||
|
{ ConsiderLevel::Amiably, "Amiably" },
|
||||||
|
{ ConsiderLevel::Indifferently, "Indifferently" },
|
||||||
|
{ ConsiderLevel::Apprehensively, "Apprehensively" },
|
||||||
|
{ ConsiderLevel::Dubiously, "Dubiously" },
|
||||||
|
{ ConsiderLevel::Threateningly, "Threateningly" },
|
||||||
|
{ ConsiderLevel::Scowls, "Scowls" }
|
||||||
|
};
|
||||||
|
|
||||||
|
return consider_level_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetConsiderLevelName(uint8 faction_consider_level)
|
||||||
|
{
|
||||||
|
if (EQ::constants::GetConsiderLevelMap().find(faction_consider_level) != EQ::constants::GetConsiderLevelMap().end()) {
|
||||||
|
return EQ::constants::GetConsiderLevelMap().find(faction_consider_level)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint8, std::string>& EQ::constants::GetEnvironmentalDamageMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint8, std::string> damage_type_map = {
|
||||||
|
{ EnvironmentalDamage::Lava, "Lava" },
|
||||||
|
{ EnvironmentalDamage::Drowning, "Drowning" },
|
||||||
|
{ EnvironmentalDamage::Falling, "Falling" },
|
||||||
|
{ EnvironmentalDamage::Trap, "Trap" }
|
||||||
|
};
|
||||||
|
|
||||||
|
return damage_type_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetEnvironmentalDamageName(uint8 damage_type)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(damage_type, EnvironmentalDamage::Lava, EnvironmentalDamage::Trap)) {
|
||||||
|
return EQ::constants::GetEnvironmentalDamageMap().find(damage_type)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint8, std::string>& EQ::constants::GetStuckBehaviorMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint8, std::string> stuck_behavior_map = {
|
||||||
|
{ StuckBehavior::RunToTarget, "Run To Target" },
|
||||||
|
{ StuckBehavior::WarpToTarget, "Warp To Target" },
|
||||||
|
{ StuckBehavior::TakeNoAction, "Take No Action" },
|
||||||
|
{ StuckBehavior::EvadeCombat, "Evade Combat" }
|
||||||
|
};
|
||||||
|
|
||||||
|
return stuck_behavior_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetStuckBehaviorName(uint8 behavior_id)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(behavior_id, StuckBehavior::RunToTarget, StuckBehavior::EvadeCombat)) {
|
||||||
|
return EQ::constants::GetStuckBehaviorMap().find(behavior_id)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint8, std::string>& EQ::constants::GetSpawnAnimationMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint8, std::string> spawn_animation_map = {
|
||||||
|
{ SpawnAnimations::Standing, "Standing" },
|
||||||
|
{ SpawnAnimations::Sitting, "Sitting" },
|
||||||
|
{ SpawnAnimations::Crouching, "Crouching" },
|
||||||
|
{ SpawnAnimations::Laying, "Laying" },
|
||||||
|
{ SpawnAnimations::Looting, "Looting" }
|
||||||
|
};
|
||||||
|
|
||||||
|
return spawn_animation_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetSpawnAnimationName(uint8 animation_id)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(animation_id, SpawnAnimations::Standing, SpawnAnimations::Looting)) {
|
||||||
|
return EQ::constants::GetSpawnAnimationMap().find(animation_id)->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<int, std::string>& EQ::constants::GetObjectTypeMap()
|
||||||
|
{
|
||||||
|
static const std::map<int, std::string> object_type_map = {
|
||||||
|
{ ObjectTypes::SmallBag, "Small Bag" },
|
||||||
|
{ ObjectTypes::LargeBag, "Large Bag" },
|
||||||
|
{ ObjectTypes::Quiver, "Quiver" },
|
||||||
|
{ ObjectTypes::BeltPouch, "Belt Pouch" },
|
||||||
|
{ ObjectTypes::WristPouch, "Wrist Pouch" },
|
||||||
|
{ ObjectTypes::Backpack, "Backpack" },
|
||||||
|
{ ObjectTypes::SmallChest, "Small Chest" },
|
||||||
|
{ ObjectTypes::LargeChest, "Large Chest" },
|
||||||
|
{ ObjectTypes::Bandolier, "Bandolier" },
|
||||||
|
{ ObjectTypes::Medicine, "Medicine" },
|
||||||
|
{ ObjectTypes::Tinkering, "Tinkering" },
|
||||||
|
{ ObjectTypes::Lexicon, "Lexicon" },
|
||||||
|
{ ObjectTypes::PoisonMaking, "Mortar and Pestle" },
|
||||||
|
{ ObjectTypes::Quest, "Quest" },
|
||||||
|
{ ObjectTypes::MixingBowl, "Mixing Bowl" },
|
||||||
|
{ ObjectTypes::Baking, "Baking" },
|
||||||
|
{ ObjectTypes::Tailoring, "Tailoring" },
|
||||||
|
{ ObjectTypes::Blacksmithing, "Blacksmithing" },
|
||||||
|
{ ObjectTypes::Fletching, "Fletching" },
|
||||||
|
{ ObjectTypes::Brewing, "Brewing" },
|
||||||
|
{ ObjectTypes::JewelryMaking, "Jewelry Making" },
|
||||||
|
{ ObjectTypes::Pottery, "Pottery" },
|
||||||
|
{ ObjectTypes::Kiln, "Kiln" },
|
||||||
|
{ ObjectTypes::KeyMaker, "Key Maker" },
|
||||||
|
{ ObjectTypes::ResearchWIZ, "Lexicon" },
|
||||||
|
{ ObjectTypes::ResearchMAG, "Lexicon" },
|
||||||
|
{ ObjectTypes::ResearchNEC, "Lexicon" },
|
||||||
|
{ ObjectTypes::ResearchENC, "Lexicon" },
|
||||||
|
{ ObjectTypes::Unknown, "Unknown" },
|
||||||
|
{ ObjectTypes::ResearchPractice, "Lexicon" },
|
||||||
|
{ ObjectTypes::Alchemy, "Alchemy" },
|
||||||
|
{ ObjectTypes::HighElfForge, "High Elf Forge" },
|
||||||
|
{ ObjectTypes::DarkElfForge, "Dark Elf Forge" },
|
||||||
|
{ ObjectTypes::OgreForge, "Ogre Forge" },
|
||||||
|
{ ObjectTypes::DwarfForge, "Dwarf Forge" },
|
||||||
|
{ ObjectTypes::GnomeForge, "Gnome Forge" },
|
||||||
|
{ ObjectTypes::BarbarianForge, "Barbarian Forge" },
|
||||||
|
{ ObjectTypes::IksarForge, "Iksar Forge" },
|
||||||
|
{ ObjectTypes::HumanForgeOne, "Human Forge" },
|
||||||
|
{ ObjectTypes::HumanForgeTwo, "Human Forge" },
|
||||||
|
{ ObjectTypes::HalflingTailoringOne, "Halfling Tailoring" },
|
||||||
|
{ ObjectTypes::HalflingTailoringTwo, "Halfling Tailoring" },
|
||||||
|
{ ObjectTypes::EruditeTailoring, "Erudite Tailoring" },
|
||||||
|
{ ObjectTypes::WoodElfTailoring, "Wood Elf Tailoring" },
|
||||||
|
{ ObjectTypes::WoodElfFletching, "Wood Elf Fletching" },
|
||||||
|
{ ObjectTypes::IksarPottery, "Iksar Pottery" },
|
||||||
|
{ ObjectTypes::Fishing, "Fishing" },
|
||||||
|
{ ObjectTypes::TrollForge, "Troll Forge" },
|
||||||
|
{ ObjectTypes::WoodElfForge, "Wood Elf Forge" },
|
||||||
|
{ ObjectTypes::HalflingForge, "Halfling Forge" },
|
||||||
|
{ ObjectTypes::EruditeForge, "Erudite Forge" },
|
||||||
|
{ ObjectTypes::Merchant, "Merchant" },
|
||||||
|
{ ObjectTypes::FroglokForge, "Froglok Forge" },
|
||||||
|
{ ObjectTypes::Augmenter, "Augmenter" },
|
||||||
|
{ ObjectTypes::Churn, "Churn" },
|
||||||
|
{ ObjectTypes::TransformationMold, "Transformation Mold" },
|
||||||
|
{ ObjectTypes::DetransformationMold, "Detransformation Mold" },
|
||||||
|
{ ObjectTypes::Unattuner, "Unattuner" },
|
||||||
|
{ ObjectTypes::TradeskillBag, "Tradeskill Bag" },
|
||||||
|
{ ObjectTypes::CollectibleBag, "Collectible Bag" },
|
||||||
|
{ ObjectTypes::NoDeposit, "No Deposit" }
|
||||||
|
};
|
||||||
|
|
||||||
|
return object_type_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetObjectTypeName(int object_type)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(object_type, ObjectTypes::SmallBag, ObjectTypes::NoDeposit)) {
|
||||||
|
return EQ::constants::GetObjectTypeMap().find(object_type)->second;
|
||||||
|
}
|
||||||
|
|
||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|||||||
+202
-11
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "eq_limits.h"
|
#include "eq_limits.h"
|
||||||
#include "emu_versions.h"
|
#include "emu_versions.h"
|
||||||
|
#include "bodytypes.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -32,10 +33,6 @@ namespace EQ
|
|||||||
using RoF2::IINVALID;
|
using RoF2::IINVALID;
|
||||||
using RoF2::INULL;
|
using RoF2::INULL;
|
||||||
|
|
||||||
namespace inventory {
|
|
||||||
|
|
||||||
} /*inventory*/
|
|
||||||
|
|
||||||
namespace invtype {
|
namespace invtype {
|
||||||
using namespace RoF2::invtype::enum_;
|
using namespace RoF2::invtype::enum_;
|
||||||
|
|
||||||
@@ -220,12 +217,134 @@ namespace EQ
|
|||||||
stanceBurnAE
|
stanceBurnAE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum GravityBehavior : int8 {
|
||||||
|
Ground,
|
||||||
|
Flying,
|
||||||
|
Levitating,
|
||||||
|
Water,
|
||||||
|
Floating,
|
||||||
|
LevitateWhileRunning
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EnvironmentalDamage : uint8 {
|
||||||
|
Lava = 250,
|
||||||
|
Drowning,
|
||||||
|
Falling,
|
||||||
|
Trap
|
||||||
|
};
|
||||||
|
|
||||||
|
enum StuckBehavior : uint8 {
|
||||||
|
RunToTarget,
|
||||||
|
WarpToTarget,
|
||||||
|
TakeNoAction,
|
||||||
|
EvadeCombat
|
||||||
|
};
|
||||||
|
|
||||||
|
enum SpawnAnimations : uint8 {
|
||||||
|
Standing,
|
||||||
|
Sitting,
|
||||||
|
Crouching,
|
||||||
|
Laying,
|
||||||
|
Looting
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ObjectTypes : int {
|
||||||
|
SmallBag,
|
||||||
|
LargeBag,
|
||||||
|
Quiver,
|
||||||
|
BeltPouch,
|
||||||
|
WristPouch,
|
||||||
|
Backpack,
|
||||||
|
SmallChest,
|
||||||
|
LargeChest,
|
||||||
|
Bandolier,
|
||||||
|
Medicine,
|
||||||
|
Tinkering,
|
||||||
|
Lexicon,
|
||||||
|
PoisonMaking,
|
||||||
|
Quest,
|
||||||
|
MixingBowl,
|
||||||
|
Baking,
|
||||||
|
Tailoring,
|
||||||
|
Blacksmithing,
|
||||||
|
Fletching,
|
||||||
|
Brewing,
|
||||||
|
JewelryMaking,
|
||||||
|
Pottery,
|
||||||
|
Kiln,
|
||||||
|
KeyMaker,
|
||||||
|
ResearchWIZ,
|
||||||
|
ResearchMAG,
|
||||||
|
ResearchNEC,
|
||||||
|
ResearchENC,
|
||||||
|
Unknown,
|
||||||
|
ResearchPractice,
|
||||||
|
Alchemy,
|
||||||
|
HighElfForge,
|
||||||
|
DarkElfForge,
|
||||||
|
OgreForge,
|
||||||
|
DwarfForge,
|
||||||
|
GnomeForge,
|
||||||
|
BarbarianForge,
|
||||||
|
IksarForge,
|
||||||
|
HumanForgeOne,
|
||||||
|
HumanForgeTwo,
|
||||||
|
HalflingTailoringOne,
|
||||||
|
HalflingTailoringTwo,
|
||||||
|
EruditeTailoring,
|
||||||
|
WoodElfTailoring,
|
||||||
|
WoodElfFletching,
|
||||||
|
IksarPottery,
|
||||||
|
Fishing,
|
||||||
|
TrollForge,
|
||||||
|
WoodElfForge,
|
||||||
|
HalflingForge,
|
||||||
|
EruditeForge,
|
||||||
|
Merchant,
|
||||||
|
FroglokForge,
|
||||||
|
Augmenter,
|
||||||
|
Churn,
|
||||||
|
TransformationMold,
|
||||||
|
DetransformationMold,
|
||||||
|
Unattuner,
|
||||||
|
TradeskillBag,
|
||||||
|
CollectibleBag,
|
||||||
|
NoDeposit
|
||||||
|
};
|
||||||
|
|
||||||
const char *GetStanceName(StanceType stance_type);
|
const char *GetStanceName(StanceType stance_type);
|
||||||
int ConvertStanceTypeToIndex(StanceType stance_type);
|
int ConvertStanceTypeToIndex(StanceType stance_type);
|
||||||
|
|
||||||
extern const std::map<int, std::string>& GetLanguageMap();
|
extern const std::map<int, std::string>& GetLanguageMap();
|
||||||
std::string GetLanguageName(int language_id);
|
std::string GetLanguageName(int language_id);
|
||||||
|
|
||||||
|
extern const std::map<uint32, std::string>& GetLDoNThemeMap();
|
||||||
|
std::string GetLDoNThemeName(uint32 theme_id);
|
||||||
|
|
||||||
|
extern const std::map<int8, std::string>& GetFlyModeMap();
|
||||||
|
std::string GetFlyModeName(int8 flymode_id);
|
||||||
|
|
||||||
|
extern const std::map<bodyType, std::string>& GetBodyTypeMap();
|
||||||
|
std::string GetBodyTypeName(bodyType bodytype_id);
|
||||||
|
|
||||||
|
extern const std::map<uint8, std::string>& GetAccountStatusMap();
|
||||||
|
std::string GetAccountStatusName(uint8 account_status);
|
||||||
|
|
||||||
|
extern const std::map<uint8, std::string>& GetConsiderLevelMap();
|
||||||
|
std::string GetConsiderLevelName(uint8 consider_level);
|
||||||
|
|
||||||
|
extern const std::map<uint8, std::string>& GetEnvironmentalDamageMap();
|
||||||
|
std::string GetEnvironmentalDamageName(uint8 damage_type);
|
||||||
|
|
||||||
|
extern const std::map<uint8, std::string>& GetStuckBehaviorMap();
|
||||||
|
std::string GetStuckBehaviorName(uint8 behavior_id);
|
||||||
|
|
||||||
|
extern const std::map<uint8, std::string>& GetSpawnAnimationMap();
|
||||||
|
std::string GetSpawnAnimationName(uint8 animation_id);
|
||||||
|
|
||||||
|
extern const std::map<int, std::string>& GetObjectTypeMap();
|
||||||
|
std::string GetObjectTypeName(int object_type);
|
||||||
|
|
||||||
const int STANCE_TYPE_FIRST = stancePassive;
|
const int STANCE_TYPE_FIRST = stancePassive;
|
||||||
const int STANCE_TYPE_LAST = stanceBurnAE;
|
const int STANCE_TYPE_LAST = stanceBurnAE;
|
||||||
const int STANCE_TYPE_COUNT = stanceBurnAE;
|
const int STANCE_TYPE_COUNT = stanceBurnAE;
|
||||||
@@ -328,13 +447,85 @@ namespace EQ
|
|||||||
Guild
|
Guild
|
||||||
};
|
};
|
||||||
}; // namespace consent
|
}; // namespace consent
|
||||||
|
|
||||||
} /*EQEmu*/
|
} /*EQEmu*/
|
||||||
|
|
||||||
|
enum ServerLockType : int {
|
||||||
|
List,
|
||||||
|
Lock,
|
||||||
|
Unlock
|
||||||
|
};
|
||||||
|
|
||||||
|
enum AccountStatus : uint8 {
|
||||||
|
Player = 0,
|
||||||
|
Steward = 10,
|
||||||
|
ApprenticeGuide = 20,
|
||||||
|
Guide = 50,
|
||||||
|
QuestTroupe = 80,
|
||||||
|
SeniorGuide = 81,
|
||||||
|
GMTester = 85,
|
||||||
|
EQSupport = 90,
|
||||||
|
GMStaff = 95,
|
||||||
|
GMAdmin = 100,
|
||||||
|
GMLeadAdmin = 150,
|
||||||
|
QuestMaster = 160,
|
||||||
|
GMAreas = 170,
|
||||||
|
GMCoder = 180,
|
||||||
|
GMMgmt = 200,
|
||||||
|
GMImpossible = 250,
|
||||||
|
Max = 255
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Invisibility : uint8 {
|
||||||
|
Visible,
|
||||||
|
Invisible,
|
||||||
|
Special = 255
|
||||||
|
};
|
||||||
|
|
||||||
|
enum AugmentActions : int {
|
||||||
|
Insert,
|
||||||
|
Remove,
|
||||||
|
Swap,
|
||||||
|
Destroy
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ConsiderLevel : uint8 {
|
||||||
|
Ally = 1,
|
||||||
|
Warmly,
|
||||||
|
Kindly,
|
||||||
|
Amiably,
|
||||||
|
Indifferently,
|
||||||
|
Apprehensively,
|
||||||
|
Dubiously,
|
||||||
|
Threateningly,
|
||||||
|
Scowls
|
||||||
|
};
|
||||||
|
|
||||||
|
enum TargetDescriptionType : uint8 {
|
||||||
|
LCSelf,
|
||||||
|
UCSelf,
|
||||||
|
LCYou,
|
||||||
|
UCYou,
|
||||||
|
LCYour,
|
||||||
|
UCYour
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ReloadWorld : uint8 {
|
||||||
|
NoRepop = 0,
|
||||||
|
Repop,
|
||||||
|
ForceRepop
|
||||||
|
};
|
||||||
|
|
||||||
|
enum MerchantBucketComparison : uint8 {
|
||||||
|
BucketEqualTo = 0,
|
||||||
|
BucketNotEqualTo,
|
||||||
|
BucketGreaterThanOrEqualTo,
|
||||||
|
BucketLesserThanOrEqualTo,
|
||||||
|
BucketGreaterThan,
|
||||||
|
BucketLesserThan,
|
||||||
|
BucketIsAny,
|
||||||
|
BucketIsNotAny,
|
||||||
|
BucketIsBetween,
|
||||||
|
BucketIsNotBetween
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EMU_CONSTANTS_H*/
|
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||||
|
|
||||||
/* hack list to prevent circular references
|
|
||||||
|
|
||||||
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|||||||
+6
-2
@@ -71,6 +71,7 @@ N(OP_Camp),
|
|||||||
N(OP_CancelSneakHide),
|
N(OP_CancelSneakHide),
|
||||||
N(OP_CancelTask),
|
N(OP_CancelTask),
|
||||||
N(OP_CancelTrade),
|
N(OP_CancelTrade),
|
||||||
|
N(OP_CashReward),
|
||||||
N(OP_CastSpell),
|
N(OP_CastSpell),
|
||||||
N(OP_ChangeSize),
|
N(OP_ChangeSize),
|
||||||
N(OP_ChannelMessage),
|
N(OP_ChannelMessage),
|
||||||
@@ -129,8 +130,8 @@ N(OP_DisciplineTimer),
|
|||||||
N(OP_DisciplineUpdate),
|
N(OP_DisciplineUpdate),
|
||||||
N(OP_DiscordMerchantInventory),
|
N(OP_DiscordMerchantInventory),
|
||||||
N(OP_DoGroupLeadershipAbility),
|
N(OP_DoGroupLeadershipAbility),
|
||||||
N(OP_DuelResponse),
|
N(OP_DuelDecline),
|
||||||
N(OP_DuelResponse2),
|
N(OP_DuelAccept),
|
||||||
N(OP_DumpName),
|
N(OP_DumpName),
|
||||||
N(OP_Dye),
|
N(OP_Dye),
|
||||||
N(OP_DynamicWall),
|
N(OP_DynamicWall),
|
||||||
@@ -303,6 +304,7 @@ N(OP_LockoutTimerInfo),
|
|||||||
N(OP_Login),
|
N(OP_Login),
|
||||||
N(OP_LoginAccepted),
|
N(OP_LoginAccepted),
|
||||||
N(OP_LoginComplete),
|
N(OP_LoginComplete),
|
||||||
|
N(OP_LoginExpansionPacketData), //added for Rof2 client to send expansion data packet. Requires login_opcodes_sod.conf to be updated.
|
||||||
N(OP_LoginUnknown1),
|
N(OP_LoginUnknown1),
|
||||||
N(OP_LoginUnknown2),
|
N(OP_LoginUnknown2),
|
||||||
N(OP_Logout),
|
N(OP_Logout),
|
||||||
@@ -455,6 +457,7 @@ N(OP_ServerListResponse),
|
|||||||
N(OP_SessionReady),
|
N(OP_SessionReady),
|
||||||
N(OP_SetChatServer),
|
N(OP_SetChatServer),
|
||||||
N(OP_SetChatServer2),
|
N(OP_SetChatServer2),
|
||||||
|
N(OP_SetFace),
|
||||||
N(OP_SetGroupTarget),
|
N(OP_SetGroupTarget),
|
||||||
N(OP_SetGuildMOTD),
|
N(OP_SetGuildMOTD),
|
||||||
N(OP_SetGuildRank),
|
N(OP_SetGuildRank),
|
||||||
@@ -558,6 +561,7 @@ N(OP_WhoAllRequest),
|
|||||||
N(OP_WhoAllResponse),
|
N(OP_WhoAllResponse),
|
||||||
N(OP_World_Client_CRC1),
|
N(OP_World_Client_CRC1),
|
||||||
N(OP_World_Client_CRC2),
|
N(OP_World_Client_CRC2),
|
||||||
|
N(OP_World_Client_CRC3),
|
||||||
N(OP_WorldClientReady),
|
N(OP_WorldClientReady),
|
||||||
N(OP_WorldComplete),
|
N(OP_WorldComplete),
|
||||||
N(OP_WorldLogout),
|
N(OP_WorldLogout),
|
||||||
|
|||||||
@@ -1009,4 +1009,11 @@ enum StartZoneIndex {
|
|||||||
SharVahl
|
SharVahl
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum FVNoDropFlagRule
|
||||||
|
{
|
||||||
|
Disabled = 0,
|
||||||
|
Enabled = 1,
|
||||||
|
AdminOnly = 2
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
static bool global_dictionary_init = false;
|
static bool global_dictionary_init = false;
|
||||||
void EQ::InitializeDynamicLookups() {
|
void EQ::InitializeDynamicLookups() {
|
||||||
if (global_dictionary_init == true)
|
if (global_dictionary_init)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
constants::InitializeDynamicLookups();
|
constants::InitializeDynamicLookups();
|
||||||
|
|||||||
+33
-13
@@ -378,14 +378,14 @@ struct NewZone_Struct {
|
|||||||
// Titanium doesn't have a translator, but we can still safely add stuff under here without issues since client memcpy's only what it knows
|
// Titanium doesn't have a translator, but we can still safely add stuff under here without issues since client memcpy's only what it knows
|
||||||
// Just wastes some bandwidth sending to tit clients /shrug
|
// Just wastes some bandwidth sending to tit clients /shrug
|
||||||
/*0700*/ float fog_density;
|
/*0700*/ float fog_density;
|
||||||
/*0704*/ uint32 SuspendBuffs;
|
/*0704*/ uint32 suspend_buffs;
|
||||||
/*0708*/ uint32 FastRegenHP;
|
/*0708*/ uint32 fast_regen_hp;
|
||||||
/*0712*/ uint32 FastRegenMana;
|
/*0712*/ uint32 fast_regen_mana;
|
||||||
/*0716*/ uint32 FastRegenEndurance;
|
/*0716*/ uint32 fast_regen_endurance;
|
||||||
/*0720*/ uint32 NPCAggroMaxDist;
|
/*0720*/ uint32 npc_aggro_max_dist;
|
||||||
/*0724*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, if this value is 0, it prevents you from running off edges that would end up underworld
|
/*0724*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, if this value is 0, it prevents you from running off edges that would end up underworld
|
||||||
/*0728*/ uint32 LavaDamage; // Seen 50
|
/*0728*/ uint32 lava_damage; // Seen 50
|
||||||
/*0732*/ uint32 MinLavaDamage; // Seen 10
|
/*0732*/ uint32 min_lava_damage; // Seen 10
|
||||||
/*0736*/
|
/*0736*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -448,6 +448,7 @@ struct ManaChange_Struct
|
|||||||
/*08*/ uint32 spell_id;
|
/*08*/ uint32 spell_id;
|
||||||
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
|
/*12*/ uint8 keepcasting; // won't stop the cast. Change mana while casting?
|
||||||
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
|
/*13*/ uint8 padding[3]; // client doesn't read it, garbage data seems like
|
||||||
|
/*16*/ int32 slot; // -1 normal, otherwise clear ETA and GCD
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SwapSpell_Struct
|
struct SwapSpell_Struct
|
||||||
@@ -2191,11 +2192,19 @@ struct QuestReward_Struct
|
|||||||
/*068*/
|
/*068*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CashReward_Struct
|
||||||
|
{
|
||||||
|
/*000*/ uint32 copper;
|
||||||
|
/*004*/ uint32 silver;
|
||||||
|
/*008*/ uint32 gold;
|
||||||
|
/*012*/ uint32 platinum;
|
||||||
|
};
|
||||||
|
|
||||||
// Size: 8
|
// Size: 8
|
||||||
struct Camera_Struct
|
struct Camera_Struct
|
||||||
{
|
{
|
||||||
uint32 duration; // Duration in ms
|
uint32 duration; // Duration in ms
|
||||||
uint32 intensity; // Between 1023410176 and 1090519040
|
float intensity;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ZonePoint_Entry {
|
struct ZonePoint_Entry {
|
||||||
@@ -2315,9 +2324,12 @@ struct FaceChange_Struct {
|
|||||||
/*004*/ uint8 hairstyle;
|
/*004*/ uint8 hairstyle;
|
||||||
/*005*/ uint8 beard;
|
/*005*/ uint8 beard;
|
||||||
/*006*/ uint8 face;
|
/*006*/ uint8 face;
|
||||||
/*007*/ uint32 drakkin_heritage;
|
/*007*/ uint8 unused_padding;
|
||||||
/*011*/ uint32 drakkin_tattoo;
|
/*008*/ uint32 drakkin_heritage;
|
||||||
/*015*/ uint32 drakkin_details;
|
/*012*/ uint32 drakkin_tattoo;
|
||||||
|
/*016*/ uint32 drakkin_details;
|
||||||
|
/*020*/ uint32 entity_id;
|
||||||
|
/*024*/
|
||||||
//there are only 10 faces for barbs changing woad just
|
//there are only 10 faces for barbs changing woad just
|
||||||
//increase the face value by ten so if there were 8 woad
|
//increase the face value by ten so if there were 8 woad
|
||||||
//designs then there would be 80 barb faces
|
//designs then there would be 80 barb faces
|
||||||
@@ -2761,7 +2773,7 @@ struct EnvDamage2_Struct {
|
|||||||
/*0004*/ uint16 unknown4;
|
/*0004*/ uint16 unknown4;
|
||||||
/*0006*/ uint32 damage;
|
/*0006*/ uint32 damage;
|
||||||
/*0010*/ uint8 unknown10[12];
|
/*0010*/ uint8 unknown10[12];
|
||||||
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
|
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||||
/*0023*/ uint8 unknown2[4];
|
/*0023*/ uint8 unknown2[4];
|
||||||
/*0027*/ uint16 constant; //Always FFFF
|
/*0027*/ uint16 constant; //Always FFFF
|
||||||
/*0029*/ uint16 unknown29;
|
/*0029*/ uint16 unknown29;
|
||||||
@@ -3628,6 +3640,9 @@ struct MerchantList {
|
|||||||
uint16 alt_currency_cost;
|
uint16 alt_currency_cost;
|
||||||
uint32 classes_required;
|
uint32 classes_required;
|
||||||
uint8 probability;
|
uint8 probability;
|
||||||
|
std::string bucket_name;
|
||||||
|
std::string bucket_value;
|
||||||
|
uint8 bucket_comparison;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TempMerchantList {
|
struct TempMerchantList {
|
||||||
@@ -4991,7 +5006,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
@@ -5581,6 +5596,11 @@ struct SayLinkBodyFrame_Struct {
|
|||||||
/*056*/
|
/*056*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Checksum_Struct {
|
||||||
|
uint64 checksum;
|
||||||
|
uint8 data[2048];
|
||||||
|
};
|
||||||
|
|
||||||
struct UpdateMovementEntry {
|
struct UpdateMovementEntry {
|
||||||
/* 00 */ float Y;
|
/* 00 */ float Y;
|
||||||
/* 04 */ float X;
|
/* 04 */ float X;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "op_codes.h"
|
#include "op_codes.h"
|
||||||
#include "crc16.h"
|
#include "crc16.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ void EQEmuConfig::parse_config()
|
|||||||
WorldHTTPEnabled = true;
|
WorldHTTPEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_root["server"].get("disable_config_checks", "false").asString() == "true") {
|
||||||
|
DisableConfigChecks = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UCS
|
* UCS
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ class EQEmuConfig
|
|||||||
uint16 WorldHTTPPort;
|
uint16 WorldHTTPPort;
|
||||||
std::string WorldHTTPMimeFile;
|
std::string WorldHTTPMimeFile;
|
||||||
std::string SharedKey;
|
std::string SharedKey;
|
||||||
|
bool DisableConfigChecks;
|
||||||
|
|
||||||
// From <chatserver/>
|
// From <chatserver/>
|
||||||
std::string ChatHost;
|
std::string ChatHost;
|
||||||
|
|||||||
+135
-85
@@ -21,8 +21,10 @@
|
|||||||
#include "eqemu_logsys.h"
|
#include "eqemu_logsys.h"
|
||||||
#include "rulesys.h"
|
#include "rulesys.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "discord/discord.h"
|
||||||
|
#include "repositories/discord_webhooks_repository.h"
|
||||||
#include "repositories/logsys_categories_repository.h"
|
#include "repositories/logsys_categories_repository.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -46,6 +48,7 @@ std::ofstream process_log;
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -88,8 +91,8 @@ namespace Console {
|
|||||||
*/
|
*/
|
||||||
EQEmuLogSys::EQEmuLogSys()
|
EQEmuLogSys::EQEmuLogSys()
|
||||||
{
|
{
|
||||||
on_log_gmsay_hook = [](uint16 log_type, const std::string &) {};
|
m_on_log_gmsay_hook = [](uint16 log_type, const std::string &) {};
|
||||||
on_log_console_hook = [](uint16 debug_level, uint16 log_type, const std::string &) {};
|
m_on_log_console_hook = [](uint16 log_type, const std::string &) {};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,16 +105,17 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
/**
|
/**
|
||||||
* Get Executable platform currently running this code (Zone/World/etc)
|
* Get Executable platform currently running this code (Zone/World/etc)
|
||||||
*/
|
*/
|
||||||
log_platform = GetExecutablePlatformInt();
|
m_log_platform = GetExecutablePlatformInt();
|
||||||
|
|
||||||
for (int log_category_id = Logs::AA; log_category_id != Logs::MaxCategoryID; log_category_id++) {
|
for (int log_category_id = Logs::AA; log_category_id != Logs::MaxCategoryID; log_category_id++) {
|
||||||
log_settings[log_category_id].log_to_console = 0;
|
log_settings[log_category_id].log_to_console = 0;
|
||||||
log_settings[log_category_id].log_to_file = 0;
|
log_settings[log_category_id].log_to_file = 0;
|
||||||
log_settings[log_category_id].log_to_gmsay = 0;
|
log_settings[log_category_id].log_to_gmsay = 0;
|
||||||
|
log_settings[log_category_id].log_to_discord = 0;
|
||||||
log_settings[log_category_id].is_category_enabled = 0;
|
log_settings[log_category_id].is_category_enabled = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
file_logs_enabled = false;
|
m_file_logs_enabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Defaults
|
* Set Defaults
|
||||||
@@ -132,6 +136,10 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::Cheat].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::HTTP].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::HTTP].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::HTTP].log_to_gmsay = static_cast<uint8>(Logs::General);
|
log_settings[Logs::HTTP].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::ChecksumVerification].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::ChecksumVerification].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::CombatRecord].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
|
log_settings[Logs::Discord].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RFC 5424
|
* RFC 5424
|
||||||
@@ -151,7 +159,8 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
const bool log_to_console = log_settings[log_category_id].log_to_console > 0;
|
const bool log_to_console = log_settings[log_category_id].log_to_console > 0;
|
||||||
const bool log_to_file = log_settings[log_category_id].log_to_file > 0;
|
const bool log_to_file = log_settings[log_category_id].log_to_file > 0;
|
||||||
const bool log_to_gmsay = log_settings[log_category_id].log_to_gmsay > 0;
|
const bool log_to_gmsay = log_settings[log_category_id].log_to_gmsay > 0;
|
||||||
const bool is_category_enabled = log_to_console || log_to_file || log_to_gmsay;
|
const bool log_to_discord = log_settings[log_category_id].log_to_discord > 0;
|
||||||
|
const bool is_category_enabled = log_to_console || log_to_file || log_to_gmsay || log_to_discord;
|
||||||
if (is_category_enabled) {
|
if (is_category_enabled) {
|
||||||
log_settings[log_category_id].is_category_enabled = 1;
|
log_settings[log_category_id].is_category_enabled = 1;
|
||||||
}
|
}
|
||||||
@@ -160,26 +169,26 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
/**
|
/**
|
||||||
* Declare process file names for log writing=
|
* Declare process file names for log writing=
|
||||||
*/
|
*/
|
||||||
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld) {
|
if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformWorld) {
|
||||||
platform_file_name = "world";
|
m_platform_file_name = "world";
|
||||||
}
|
}
|
||||||
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ) {
|
else if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformQueryServ) {
|
||||||
platform_file_name = "query_server";
|
m_platform_file_name = "query_server";
|
||||||
}
|
}
|
||||||
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone) {
|
else if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformZone) {
|
||||||
platform_file_name = "zone";
|
m_platform_file_name = "zone";
|
||||||
}
|
}
|
||||||
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformUCS) {
|
else if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformUCS) {
|
||||||
platform_file_name = "ucs";
|
m_platform_file_name = "ucs";
|
||||||
}
|
}
|
||||||
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin) {
|
else if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformLogin) {
|
||||||
platform_file_name = "login";
|
m_platform_file_name = "login";
|
||||||
}
|
}
|
||||||
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLaunch) {
|
else if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformLaunch) {
|
||||||
platform_file_name = "launcher";
|
m_platform_file_name = "launcher";
|
||||||
}
|
}
|
||||||
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformHC) {
|
else if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformHC) {
|
||||||
platform_file_name = "hc";
|
m_platform_file_name = "hc";
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
@@ -218,41 +227,12 @@ std::string EQEmuLogSys::FormatOutMessageString(
|
|||||||
return return_string + "[" + Logs::LogCategoryName[log_category] + "] " + in_message;
|
return return_string + "[" + Logs::LogCategoryName[log_category] + "] " + in_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param debug_level
|
|
||||||
* @param log_category
|
|
||||||
* @param message
|
|
||||||
*/
|
|
||||||
void EQEmuLogSys::ProcessGMSay(
|
|
||||||
uint16 debug_level,
|
|
||||||
uint16 log_category,
|
|
||||||
const std::string &message
|
|
||||||
)
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Enabling Netcode based GMSay output creates a feedback loop that ultimately ends in a crash
|
|
||||||
*/
|
|
||||||
if (log_category == Logs::LogCategory::Netcode) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Processes that actually support hooks
|
|
||||||
*/
|
|
||||||
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone ||
|
|
||||||
EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld
|
|
||||||
) {
|
|
||||||
on_log_gmsay_hook(log_category, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param debug_level
|
* @param debug_level
|
||||||
* @param log_category
|
* @param log_category
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
void EQEmuLogSys::ProcessLogWrite(
|
void EQEmuLogSys::ProcessLogWrite(
|
||||||
uint16 debug_level,
|
|
||||||
uint16 log_category,
|
uint16 log_category,
|
||||||
const std::string &message
|
const std::string &message
|
||||||
)
|
)
|
||||||
@@ -263,17 +243,16 @@ void EQEmuLogSys::ProcessLogWrite(
|
|||||||
std::ofstream crash_log;
|
std::ofstream crash_log;
|
||||||
EQEmuLogSys::MakeDirectory("logs/crashes");
|
EQEmuLogSys::MakeDirectory("logs/crashes");
|
||||||
crash_log.open(
|
crash_log.open(
|
||||||
StringFormat("logs/crashes/crash_%s_%i.log", platform_file_name.c_str(), getpid()),
|
StringFormat("logs/crashes/crash_%s_%i.log", m_platform_file_name.c_str(), getpid()),
|
||||||
std::ios_base::app | std::ios_base::out
|
std::ios_base::app | std::ios_base::out
|
||||||
);
|
);
|
||||||
crash_log << time_stamp << " " << message << "\n";
|
crash_log << time_stamp << " " << message << "\n";
|
||||||
crash_log.close();
|
crash_log.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process_log) {
|
||||||
char time_stamp[80];
|
char time_stamp[80];
|
||||||
EQEmuLogSys::SetCurrentTimeStamp(time_stamp);
|
EQEmuLogSys::SetCurrentTimeStamp(time_stamp);
|
||||||
|
|
||||||
if (process_log) {
|
|
||||||
process_log << time_stamp << " " << message << std::endl;
|
process_log << time_stamp << " " << message << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,7 +348,7 @@ uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category)
|
|||||||
* @param log_category
|
* @param log_category
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string &message)
|
void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string &message)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
HANDLE console_handle;
|
HANDLE console_handle;
|
||||||
@@ -387,7 +366,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category,
|
|||||||
std::cout << EQEmuLogSys::GetLinuxConsoleColorFromCategory(log_category) << message << LC_RESET << std::endl;
|
std::cout << EQEmuLogSys::GetLinuxConsoleColorFromCategory(log_category) << message << LC_RESET << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
on_log_console_hook(debug_level, log_category, message);
|
m_on_log_console_hook(log_category, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -444,28 +423,28 @@ void EQEmuLogSys::Out(
|
|||||||
...
|
...
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
bool log_to_console = true;
|
bool log_to_console = log_settings[log_category].log_to_console > 0 &&
|
||||||
if (log_settings[log_category].log_to_console < debug_level) {
|
log_settings[log_category].log_to_console >= debug_level;
|
||||||
log_to_console = false;
|
bool log_to_file = log_settings[log_category].log_to_file > 0 &&
|
||||||
}
|
log_settings[log_category].log_to_file >= debug_level;
|
||||||
|
bool log_to_gmsay = log_settings[log_category].log_to_gmsay > 0 &&
|
||||||
|
log_settings[log_category].log_to_gmsay >= debug_level &&
|
||||||
|
log_category != Logs::LogCategory::Netcode &&
|
||||||
|
(EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformZone ||
|
||||||
|
EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformWorld);
|
||||||
|
bool log_to_discord = EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformZone &&
|
||||||
|
log_settings[log_category].log_to_discord > 0 &&
|
||||||
|
log_settings[log_category].log_to_discord >= debug_level &&
|
||||||
|
log_settings[log_category].discord_webhook_id > 0 &&
|
||||||
|
log_settings[log_category].discord_webhook_id < MAX_DISCORD_WEBHOOK_ID;
|
||||||
|
|
||||||
bool log_to_file = true;
|
// bail out if nothing to log
|
||||||
if (log_settings[log_category].log_to_file < debug_level) {
|
const bool nothing_to_log = !log_to_console && !log_to_file && !log_to_gmsay && !log_to_discord;
|
||||||
log_to_file = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool log_to_gmsay = true;
|
|
||||||
if (log_settings[log_category].log_to_gmsay < debug_level) {
|
|
||||||
log_to_gmsay = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const bool nothing_to_log = !log_to_console && !log_to_file && !log_to_gmsay;
|
|
||||||
if (nothing_to_log) {
|
if (nothing_to_log) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string prefix;
|
std::string prefix;
|
||||||
|
|
||||||
if (RuleB(Logging, PrintFileFunctionAndLine)) {
|
if (RuleB(Logging, PrintFileFunctionAndLine)) {
|
||||||
prefix = fmt::format("[{0}::{1}:{2}] ", base_file_name(file), func, line);
|
prefix = fmt::format("[{0}::{1}:{2}] ", base_file_name(file), func, line);
|
||||||
}
|
}
|
||||||
@@ -478,13 +457,16 @@ void EQEmuLogSys::Out(
|
|||||||
std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, prefix + output_message);
|
std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, prefix + output_message);
|
||||||
|
|
||||||
if (log_to_console) {
|
if (log_to_console) {
|
||||||
EQEmuLogSys::ProcessConsoleMessage(debug_level, log_category, output_debug_message);
|
EQEmuLogSys::ProcessConsoleMessage(log_category, output_debug_message);
|
||||||
}
|
}
|
||||||
if (log_to_gmsay) {
|
if (log_to_gmsay) {
|
||||||
EQEmuLogSys::ProcessGMSay(debug_level, log_category, output_debug_message);
|
m_on_log_gmsay_hook(log_category, output_message);
|
||||||
}
|
}
|
||||||
if (log_to_file) {
|
if (log_to_file) {
|
||||||
EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_debug_message);
|
EQEmuLogSys::ProcessLogWrite(log_category, output_debug_message);
|
||||||
|
}
|
||||||
|
if (log_to_discord && m_on_log_discord_hook) {
|
||||||
|
m_on_log_discord_hook(log_category, log_settings[log_category].discord_webhook_id, output_message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -536,23 +518,23 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
|||||||
/**
|
/**
|
||||||
* When loading settings, we must have been given a reason in category based logging to output to a file in order to even create or open one...
|
* When loading settings, we must have been given a reason in category based logging to output to a file in order to even create or open one...
|
||||||
*/
|
*/
|
||||||
if (!file_logs_enabled) {
|
if (!m_file_logs_enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Zone
|
* Zone
|
||||||
*/
|
*/
|
||||||
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone) {
|
if (EQEmuLogSys::m_log_platform == EQEmuExePlatform::ExePlatformZone) {
|
||||||
if (!log_name.empty()) {
|
if (!log_name.empty()) {
|
||||||
platform_file_name = log_name;
|
m_platform_file_name = log_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform_file_name.empty()) {
|
if (m_platform_file_name.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("Starting File Log [logs/{}_{}.log]", platform_file_name.c_str(), getpid());
|
LogInfo("Starting File Log [logs/{}_{}.log]", m_platform_file_name.c_str(), getpid());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make directory if not exists
|
* Make directory if not exists
|
||||||
@@ -563,7 +545,7 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
|||||||
* Open file pointer
|
* Open file pointer
|
||||||
*/
|
*/
|
||||||
process_log.open(
|
process_log.open(
|
||||||
StringFormat("logs/zone/%s_%i.log", platform_file_name.c_str(), getpid()),
|
StringFormat("logs/zone/%s_%i.log", m_platform_file_name.c_str(), getpid()),
|
||||||
std::ios_base::app | std::ios_base::out
|
std::ios_base::app | std::ios_base::out
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -572,17 +554,17 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
|
|||||||
/**
|
/**
|
||||||
* All other processes
|
* All other processes
|
||||||
*/
|
*/
|
||||||
if (platform_file_name.empty()) {
|
if (m_platform_file_name.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogInfo("Starting File Log [logs/{}_{}.log]", platform_file_name.c_str(), getpid());
|
LogInfo("Starting File Log [logs/{}_{}.log]", m_platform_file_name.c_str(), getpid());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open file pointer
|
* Open file pointer
|
||||||
*/
|
*/
|
||||||
process_log.open(
|
process_log.open(
|
||||||
StringFormat("logs/%s_%i.log", platform_file_name.c_str(), getpid()),
|
StringFormat("logs/%s_%i.log", m_platform_file_name.c_str(), getpid()),
|
||||||
std::ios_base::app | std::ios_base::out
|
std::ios_base::app | std::ios_base::out
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -612,6 +594,8 @@ void EQEmuLogSys::EnableConsoleLogging()
|
|||||||
|
|
||||||
EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
||||||
{
|
{
|
||||||
|
InjectTablesIfNotExist();
|
||||||
|
|
||||||
auto categories = LogsysCategoriesRepository::GetWhere(
|
auto categories = LogsysCategoriesRepository::GetWhere(
|
||||||
*m_database,
|
*m_database,
|
||||||
"TRUE ORDER BY log_category_id"
|
"TRUE ORDER BY log_category_id"
|
||||||
@@ -630,13 +614,17 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
|||||||
log_settings[c.log_category_id].log_to_console = static_cast<uint8>(c.log_to_console);
|
log_settings[c.log_category_id].log_to_console = static_cast<uint8>(c.log_to_console);
|
||||||
log_settings[c.log_category_id].log_to_file = static_cast<uint8>(c.log_to_file);
|
log_settings[c.log_category_id].log_to_file = static_cast<uint8>(c.log_to_file);
|
||||||
log_settings[c.log_category_id].log_to_gmsay = static_cast<uint8>(c.log_to_gmsay);
|
log_settings[c.log_category_id].log_to_gmsay = static_cast<uint8>(c.log_to_gmsay);
|
||||||
|
log_settings[c.log_category_id].log_to_discord = static_cast<uint8>(c.log_to_discord);
|
||||||
|
log_settings[c.log_category_id].discord_webhook_id = c.discord_webhook_id;
|
||||||
|
|
||||||
// Determine if any output method is enabled for the category
|
// Determine if any output method is enabled for the category
|
||||||
// and set it to 1 so it can used to check if category is enabled
|
// and set it to 1 so it can used to check if category is enabled
|
||||||
const bool log_to_console = log_settings[c.log_category_id].log_to_console > 0;
|
const bool log_to_console = log_settings[c.log_category_id].log_to_console > 0;
|
||||||
const bool log_to_file = log_settings[c.log_category_id].log_to_file > 0;
|
const bool log_to_file = log_settings[c.log_category_id].log_to_file > 0;
|
||||||
const bool log_to_gmsay = log_settings[c.log_category_id].log_to_gmsay > 0;
|
const bool log_to_gmsay = log_settings[c.log_category_id].log_to_gmsay > 0;
|
||||||
const bool is_category_enabled = log_to_console || log_to_file || log_to_gmsay;
|
const bool log_to_discord = log_settings[c.log_category_id].log_to_discord > 0 &&
|
||||||
|
log_settings[c.log_category_id].discord_webhook_id > 0;
|
||||||
|
const bool is_category_enabled = log_to_console || log_to_file || log_to_gmsay || log_to_discord;
|
||||||
|
|
||||||
if (is_category_enabled) {
|
if (is_category_enabled) {
|
||||||
log_settings[c.log_category_id].is_category_enabled = 1;
|
log_settings[c.log_category_id].is_category_enabled = 1;
|
||||||
@@ -646,7 +634,7 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
|||||||
// If we go through this whole loop and nothing is set to any debug level, there
|
// If we go through this whole loop and nothing is set to any debug level, there
|
||||||
// is no point to create a file or keep anything open
|
// is no point to create a file or keep anything open
|
||||||
if (log_settings[c.log_category_id].log_to_file > 0) {
|
if (log_settings[c.log_category_id].log_to_file > 0) {
|
||||||
LogSys.file_logs_enabled = true;
|
LogSys.m_file_logs_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
db_categories.emplace_back(c.log_category_id);
|
db_categories.emplace_back(c.log_category_id);
|
||||||
@@ -662,10 +650,11 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
|||||||
|
|
||||||
auto new_category = LogsysCategoriesRepository::NewEntity();
|
auto new_category = LogsysCategoriesRepository::NewEntity();
|
||||||
new_category.log_category_id = i;
|
new_category.log_category_id = i;
|
||||||
new_category.log_category_description = EscapeString(Logs::LogCategoryName[i]);
|
new_category.log_category_description = Strings::Escape(Logs::LogCategoryName[i]);
|
||||||
new_category.log_to_console = log_settings[i].log_to_console;
|
new_category.log_to_console = log_settings[i].log_to_console;
|
||||||
new_category.log_to_gmsay = log_settings[i].log_to_gmsay;
|
new_category.log_to_gmsay = log_settings[i].log_to_gmsay;
|
||||||
new_category.log_to_file = log_settings[i].log_to_file;
|
new_category.log_to_file = log_settings[i].log_to_file;
|
||||||
|
new_category.log_to_discord = log_settings[i].log_to_discord;
|
||||||
|
|
||||||
LogsysCategoriesRepository::InsertOne(*m_database, new_category);
|
LogsysCategoriesRepository::InsertOne(*m_database, new_category);
|
||||||
}
|
}
|
||||||
@@ -673,6 +662,14 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings()
|
|||||||
|
|
||||||
LogInfo("Loaded [{}] log categories", categories.size());
|
LogInfo("Loaded [{}] log categories", categories.size());
|
||||||
|
|
||||||
|
auto webhooks = DiscordWebhooksRepository::GetWhere(*m_database, fmt::format("id < {}", MAX_DISCORD_WEBHOOK_ID));
|
||||||
|
if (!webhooks.empty()) {
|
||||||
|
for (auto &w: webhooks) {
|
||||||
|
m_discord_webhooks[w.id] = {w.id, w.webhook_name, w.webhook_url};
|
||||||
|
}
|
||||||
|
LogInfo("Loaded [{}] Discord webhooks", webhooks.size());
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -682,3 +679,56 @@ EQEmuLogSys *EQEmuLogSys::SetDatabase(Database *db)
|
|||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EQEmuLogSys::InjectTablesIfNotExist()
|
||||||
|
{
|
||||||
|
// do not run injections for zone as its unnecessary hits every time a zone boots
|
||||||
|
// other processes less frequently ran can pick up injection
|
||||||
|
if (m_log_platform == EQEmuExePlatform::ExePlatformZone) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// inject discord_webhooks
|
||||||
|
if (!m_database->DoesTableExist("discord_webhooks")) {
|
||||||
|
LogInfo("Creating table [discord_webhooks]");
|
||||||
|
m_database->QueryDatabase(
|
||||||
|
SQL(
|
||||||
|
CREATE TABLE discord_webhooks
|
||||||
|
(
|
||||||
|
id INT auto_increment primary key NULL,
|
||||||
|
webhook_name varchar(100) NULL,
|
||||||
|
webhook_url varchar(255) NULL,
|
||||||
|
created_at DATETIME NULL,
|
||||||
|
deleted_at DATETIME NULL
|
||||||
|
) ENGINE=InnoDB
|
||||||
|
DEFAULT CHARSET=utf8mb4
|
||||||
|
COLLATE=utf8mb4_general_ci;
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// inject logsys_categories
|
||||||
|
if (!m_database->DoesTableExist("logsys_categories")) {
|
||||||
|
LogInfo("Creating table [logsys_categories]");
|
||||||
|
m_database->QueryDatabase(
|
||||||
|
SQL(
|
||||||
|
CREATE TABLE `logsys_categories` (
|
||||||
|
`log_category_id` int(11) NOT NULL,
|
||||||
|
`log_category_description` varchar(150) DEFAULT NULL,
|
||||||
|
`log_to_console` smallint(11) DEFAULT 0,
|
||||||
|
`log_to_file` smallint(11) DEFAULT 0,
|
||||||
|
`log_to_gmsay` smallint(11) DEFAULT 0,
|
||||||
|
`log_to_discord` smallint(11) DEFAULT 0,
|
||||||
|
`discord_webhook_id` int(11) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`log_category_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const EQEmuLogSys::DiscordWebhooks *EQEmuLogSys::GetDiscordWebhooks() const
|
||||||
|
{
|
||||||
|
return m_discord_webhooks;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+48
-14
@@ -127,6 +127,11 @@ namespace Logs {
|
|||||||
DiaWind,
|
DiaWind,
|
||||||
HTTP,
|
HTTP,
|
||||||
Saylink,
|
Saylink,
|
||||||
|
ChecksumVerification,
|
||||||
|
CombatRecord,
|
||||||
|
Hate,
|
||||||
|
Discord,
|
||||||
|
Faction,
|
||||||
MaxCategoryID /* Don't Remove this */
|
MaxCategoryID /* Don't Remove this */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -212,6 +217,11 @@ namespace Logs {
|
|||||||
"DialogueWindow",
|
"DialogueWindow",
|
||||||
"HTTP",
|
"HTTP",
|
||||||
"Saylink",
|
"Saylink",
|
||||||
|
"ChecksumVerification",
|
||||||
|
"CombatRecord",
|
||||||
|
"Hate",
|
||||||
|
"Discord",
|
||||||
|
"Faction",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,6 +229,8 @@ namespace Logs {
|
|||||||
|
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
|
constexpr uint16 MAX_DISCORD_WEBHOOK_ID = 300;
|
||||||
|
|
||||||
class EQEmuLogSys {
|
class EQEmuLogSys {
|
||||||
public:
|
public:
|
||||||
EQEmuLogSys();
|
EQEmuLogSys();
|
||||||
@@ -281,9 +293,19 @@ public:
|
|||||||
uint8 log_to_file;
|
uint8 log_to_file;
|
||||||
uint8 log_to_console;
|
uint8 log_to_console;
|
||||||
uint8 log_to_gmsay;
|
uint8 log_to_gmsay;
|
||||||
|
uint8 log_to_discord;
|
||||||
|
int discord_webhook_id;
|
||||||
uint8 is_category_enabled; /* When any log output in a category > 0, set this to 1 as (Enabled) */
|
uint8 is_category_enabled; /* When any log output in a category > 0, set this to 1 as (Enabled) */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct OriginationInfo {
|
||||||
|
std::string zone_short_name;
|
||||||
|
std::string zone_long_name;
|
||||||
|
int instance_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
OriginationInfo origination_info{};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internally used memory reference for all log settings per category
|
* Internally used memory reference for all log settings per category
|
||||||
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
|
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
|
||||||
@@ -291,28 +313,36 @@ public:
|
|||||||
*/
|
*/
|
||||||
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
|
||||||
|
|
||||||
bool file_logs_enabled = false;
|
struct DiscordWebhooks {
|
||||||
|
int id;
|
||||||
int log_platform = 0;
|
std::string webhook_name;
|
||||||
std::string platform_file_name;
|
std::string webhook_url;
|
||||||
|
};
|
||||||
|
|
||||||
|
const DiscordWebhooks *GetDiscordWebhooks() const;
|
||||||
|
|
||||||
// gmsay
|
// gmsay
|
||||||
uint16 GetGMSayColorFromCategory(uint16 log_category);
|
uint16 GetGMSayColorFromCategory(uint16 log_category);
|
||||||
|
|
||||||
EQEmuLogSys * SetGMSayHandler(std::function<void(uint16 log_type, const std::string &)> f) {
|
EQEmuLogSys *SetGMSayHandler(std::function<void(uint16 log_type, const std::string &)> f)
|
||||||
on_log_gmsay_hook = f;
|
{
|
||||||
|
m_on_log_gmsay_hook = f;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
EQEmuLogSys *SetDiscordHandler(std::function<void(uint16 log_category, int webhook_id, const std::string &)> f)
|
||||||
|
{
|
||||||
|
m_on_log_discord_hook = f;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// console
|
// console
|
||||||
void SetConsoleHandler(
|
void SetConsoleHandler(
|
||||||
std::function<void(
|
std::function<void(
|
||||||
uint16 debug_level,
|
|
||||||
uint16 log_type,
|
uint16 log_type,
|
||||||
const std::string &
|
const std::string &
|
||||||
)> f
|
)> f
|
||||||
) { on_log_console_hook = f; }
|
) { m_on_log_console_hook = f; }
|
||||||
void SilenceConsoleLogging();
|
void SilenceConsoleLogging();
|
||||||
void EnableConsoleLogging();
|
void EnableConsoleLogging();
|
||||||
|
|
||||||
@@ -323,18 +353,22 @@ private:
|
|||||||
|
|
||||||
// reference to database
|
// reference to database
|
||||||
Database *m_database;
|
Database *m_database;
|
||||||
|
std::function<void(uint16 log_category, const std::string &)> m_on_log_gmsay_hook;
|
||||||
std::function<void(uint16 log_category, const std::string &)> on_log_gmsay_hook;
|
std::function<void(uint16 log_category, int webhook_id, const std::string &)> m_on_log_discord_hook;
|
||||||
std::function<void(uint16 debug_level, uint16 log_category, const std::string &)> on_log_console_hook;
|
std::function<void(uint16 log_category, const std::string &)> m_on_log_console_hook;
|
||||||
|
DiscordWebhooks m_discord_webhooks[MAX_DISCORD_WEBHOOK_ID]{};
|
||||||
|
bool m_file_logs_enabled = false;
|
||||||
|
int m_log_platform = 0;
|
||||||
|
std::string m_platform_file_name;
|
||||||
|
|
||||||
std::string FormatOutMessageString(uint16 log_category, const std::string &in_message);
|
std::string FormatOutMessageString(uint16 log_category, const std::string &in_message);
|
||||||
std::string GetLinuxConsoleColorFromCategory(uint16 log_category);
|
std::string GetLinuxConsoleColorFromCategory(uint16 log_category);
|
||||||
uint16 GetWindowsConsoleColorFromCategory(uint16 log_category);
|
uint16 GetWindowsConsoleColorFromCategory(uint16 log_category);
|
||||||
|
|
||||||
void ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string &message);
|
void ProcessConsoleMessage(uint16 log_category, const std::string &message);
|
||||||
void ProcessGMSay(uint16 debug_level, uint16 log_category, const std::string &message);
|
void ProcessLogWrite(uint16 log_category, const std::string &message);
|
||||||
void ProcessLogWrite(uint16 debug_level, uint16 log_category, const std::string &message);
|
|
||||||
bool IsRfc5424LogCategory(uint16 log_category);
|
bool IsRfc5424LogCategory(uint16 log_category);
|
||||||
|
void InjectTablesIfNotExist();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern EQEmuLogSys LogSys;
|
extern EQEmuLogSys LogSys;
|
||||||
|
|||||||
@@ -696,6 +696,56 @@
|
|||||||
OutF(LogSys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogChecksumVerification(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::ChecksumVerification].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogChecksumVerificationDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::ChecksumVerification].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogCombatRecord(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::CombatRecord].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::CombatRecord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogCombatRecordDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::CombatRecord].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::CombatRecord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHate(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Hate].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::Hate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHateDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Hate].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::Hate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogDiscord(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Discord].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::Discord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogDiscordDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Discord].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::Discord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogFaction(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Faction].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::Faction, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define LogFactionDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Faction].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::Faction, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while(0)
|
||||||
|
|
||||||
#define Log(debug_level, log_category, message, ...) do {\
|
#define Log(debug_level, log_category, message, ...) do {\
|
||||||
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
if (LogSys.log_settings[log_category].is_category_enabled == 1)\
|
||||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
@@ -1092,6 +1142,60 @@
|
|||||||
#define LogHTTPDetail(message, ...) do {\
|
#define LogHTTPDetail(message, ...) do {\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSaylink(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSaylinkDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogScheduler(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSchedulerDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogCheat(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogCheatDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogLoot(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogLootDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogFood(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogFoodDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogChecksumVerification(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogChecksumVerificationDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogCombatRecord(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogCombatRecordDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHate(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHateDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogFaction(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogFactionDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define Log(debug_level, log_category, message, ...) do {\
|
#define Log(debug_level, log_category, message, ...) do {\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,14 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include <any>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include "event_loop.h"
|
#include "event_loop.h"
|
||||||
#include "../any.h"
|
|
||||||
|
|
||||||
namespace EQ {
|
namespace EQ {
|
||||||
class Task
|
class Task
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::function<void(const EQ::Any&)> ResolveFn;
|
typedef std::function<void(const std::any&)> ResolveFn;
|
||||||
typedef std::function<void(const std::exception&)> RejectFn;
|
typedef std::function<void(const std::exception&)> RejectFn;
|
||||||
typedef std::function<void()> FinallyFn;
|
typedef std::function<void()> FinallyFn;
|
||||||
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
|
typedef std::function<void(ResolveFn, RejectFn)> TaskFn;
|
||||||
@@ -19,7 +19,7 @@ namespace EQ {
|
|||||||
RejectFn on_catch;
|
RejectFn on_catch;
|
||||||
FinallyFn on_finally;
|
FinallyFn on_finally;
|
||||||
bool has_result;
|
bool has_result;
|
||||||
EQ::Any result;
|
std::any result;
|
||||||
bool has_error;
|
bool has_error;
|
||||||
std::exception error;
|
std::exception error;
|
||||||
};
|
};
|
||||||
@@ -63,7 +63,7 @@ namespace EQ {
|
|||||||
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
|
uv_queue_work(EventLoop::Get().Handle(), m_work, [](uv_work_t* req) {
|
||||||
TaskBaton *baton = (TaskBaton*)req->data;
|
TaskBaton *baton = (TaskBaton*)req->data;
|
||||||
|
|
||||||
baton->fn([baton](const EQ::Any& result) {
|
baton->fn([baton](const std::any& result) {
|
||||||
baton->has_error = false;
|
baton->has_error = false;
|
||||||
baton->has_result = true;
|
baton->has_result = true;
|
||||||
baton->result = result;
|
baton->result = result;
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ namespace EQ
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Fn, typename... Args>
|
template<typename Fn, typename... Args>
|
||||||
auto Enqueue(Fn&& fn, Args&&... args) -> std::future<typename std::result_of<Fn(Args...)>::type> {
|
auto Enqueue(Fn&& fn, Args&&... args) -> std::future<typename std::invoke_result<Fn, Args...>::type> {
|
||||||
using return_type = typename std::result_of<Fn(Args...)>::type;
|
using return_type = typename std::invoke_result<Fn, Args...>::type;
|
||||||
|
|
||||||
auto task = std::make_shared<std::packaged_task<return_type()>>(
|
auto task = std::make_shared<std::packaged_task<return_type()>>(
|
||||||
std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...)
|
std::bind(std::forward<Fn>(fn), std::forward<Args>(args)...)
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "expedition_lockout_timer.h"
|
#include "expedition_lockout_timer.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/strings.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/util/uuid.h"
|
#include "../common/util/uuid.h"
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|||||||
+22
-22
@@ -20,31 +20,31 @@
|
|||||||
#include "races.h"
|
#include "races.h"
|
||||||
#include "rulesys.h"
|
#include "rulesys.h"
|
||||||
|
|
||||||
const char *FactionValueToString(FACTION_VALUE fv)
|
const char *FactionValueToString(FACTION_VALUE faction_value)
|
||||||
{
|
{
|
||||||
switch (fv) {
|
switch (faction_value) {
|
||||||
case FACTION_ALLY:
|
case FACTION_ALLY:
|
||||||
return ("Ally");
|
return "Ally";
|
||||||
case FACTION_WARMLY:
|
case FACTION_WARMLY:
|
||||||
return ("Warmly");
|
return "Warmly";
|
||||||
case FACTION_KINDLY:
|
case FACTION_KINDLY:
|
||||||
return ("Kindly");
|
return "Kindly";
|
||||||
case FACTION_AMIABLE:
|
case FACTION_AMIABLY:
|
||||||
return ("Amiable");
|
return "Amiably";
|
||||||
case FACTION_INDIFFERENT:
|
case FACTION_INDIFFERENTLY:
|
||||||
return ("Indifferent");
|
return "Indifferently";
|
||||||
case FACTION_APPREHENSIVE:
|
case FACTION_APPREHENSIVELY:
|
||||||
return ("Apprehensive");
|
return "Apprehensively";
|
||||||
case FACTION_DUBIOUS:
|
case FACTION_DUBIOUSLY:
|
||||||
return ("Dubious");
|
return "Dubiously";
|
||||||
case FACTION_THREATENLY:
|
case FACTION_THREATENINGLY:
|
||||||
return ("Threatenly");
|
return "Threateningly";
|
||||||
case FACTION_SCOWLS:
|
case FACTION_SCOWLS:
|
||||||
return ("Scowls, ready to attack.");
|
return "Scowls";
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ("Unknown Faction Con");
|
return "Unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -70,19 +70,19 @@ FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
|
|||||||
return FACTION_KINDLY;
|
return FACTION_KINDLY;
|
||||||
}
|
}
|
||||||
if (character_value >= RuleI(Faction, AmiablyFactionMinimum)) {
|
if (character_value >= RuleI(Faction, AmiablyFactionMinimum)) {
|
||||||
return FACTION_AMIABLE;
|
return FACTION_AMIABLY;
|
||||||
}
|
}
|
||||||
if (character_value >= RuleI(Faction, IndifferentlyFactionMinimum)) {
|
if (character_value >= RuleI(Faction, IndifferentlyFactionMinimum)) {
|
||||||
return FACTION_INDIFFERENT;
|
return FACTION_INDIFFERENTLY;
|
||||||
}
|
}
|
||||||
if (character_value >= RuleI(Faction, ApprehensivelyFactionMinimum)) {
|
if (character_value >= RuleI(Faction, ApprehensivelyFactionMinimum)) {
|
||||||
return FACTION_APPREHENSIVE;
|
return FACTION_APPREHENSIVELY;
|
||||||
}
|
}
|
||||||
if (character_value >= RuleI(Faction, DubiouslyFactionMinimum)) {
|
if (character_value >= RuleI(Faction, DubiouslyFactionMinimum)) {
|
||||||
return FACTION_DUBIOUS;
|
return FACTION_DUBIOUSLY;
|
||||||
}
|
}
|
||||||
if (character_value >= RuleI(Faction, ThreateninglyFactionMinimum)) {
|
if (character_value >= RuleI(Faction, ThreateninglyFactionMinimum)) {
|
||||||
return FACTION_THREATENLY;
|
return FACTION_THREATENINGLY;
|
||||||
}
|
}
|
||||||
return FACTION_SCOWLS;
|
return FACTION_SCOWLS;
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-6
@@ -27,13 +27,13 @@ enum FACTION_VALUE {
|
|||||||
FACTION_ALLY = 1,
|
FACTION_ALLY = 1,
|
||||||
FACTION_WARMLY = 2,
|
FACTION_WARMLY = 2,
|
||||||
FACTION_KINDLY = 3,
|
FACTION_KINDLY = 3,
|
||||||
FACTION_AMIABLE = 4,
|
FACTION_AMIABLY = 4,
|
||||||
|
|
||||||
FACTION_INDIFFERENT = 5,
|
FACTION_INDIFFERENTLY = 5,
|
||||||
|
|
||||||
FACTION_APPREHENSIVE = 6,
|
FACTION_APPREHENSIVELY = 6,
|
||||||
FACTION_DUBIOUS = 7,
|
FACTION_DUBIOUSLY = 7,
|
||||||
FACTION_THREATENLY = 8,
|
FACTION_THREATENINGLY = 8,
|
||||||
FACTION_SCOWLS = 9
|
FACTION_SCOWLS = 9
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,6 +75,23 @@ struct NPCFaction
|
|||||||
uint8 temp;
|
uint8 temp;
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *FactionValueToString(FACTION_VALUE fv);
|
// Faction Associations give a much more live like faction system
|
||||||
|
// Basically the primary faction and magnitude of a faction hit will generate the rest of them
|
||||||
|
|
||||||
|
// Largest faction I could find quickly was Lord Inquisitor Seru with 9 total hits (8 associations) so 8 + 2 for max for now
|
||||||
|
#define MAX_FACTION_ASSOC 10
|
||||||
|
|
||||||
|
// this is the ID of a faction association and it's multiplier
|
||||||
|
struct FactionAssociationHit {
|
||||||
|
int id;
|
||||||
|
float multiplier;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FactionAssociations {
|
||||||
|
// maybe there should be more data here, fine for now
|
||||||
|
FactionAssociationHit hits[MAX_FACTION_ASSOC];
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *FactionValueToString(FACTION_VALUE faction_value);
|
||||||
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value);
|
FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -204,7 +204,7 @@ enum { //some random constants
|
|||||||
#define MIN_LEVEL_ALCHEMY 25
|
#define MIN_LEVEL_ALCHEMY 25
|
||||||
|
|
||||||
//chance ratio that a
|
//chance ratio that a
|
||||||
#define THREATENLY_ARRGO_CHANCE 32 // 32/128 (25%) chance that a mob will arrgo on con Threatenly
|
#define THREATENINGLY_AGGRO_CHANCE 32 // 32/128 (25%) chance that a mob will arrgo on con Threatenly
|
||||||
|
|
||||||
//max factions per npc faction list
|
//max factions per npc faction list
|
||||||
#define MAX_NPC_FACTIONS 20
|
#define MAX_NPC_FACTIONS 20
|
||||||
|
|||||||
@@ -65,3 +65,8 @@ void FileUtil::mkdir(const std::string& directory_name)
|
|||||||
::mkdir(directory_name.c_str(), 0755);
|
::mkdir(directory_name.c_str(), 0755);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool file_exists(const std::string& name) {
|
||||||
|
std::ifstream f(name.c_str());
|
||||||
|
return f.good();
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,5 +28,6 @@ public:
|
|||||||
static void mkdir(const std::string& directory_name);
|
static void mkdir(const std::string& directory_name);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool file_exists(const std::string& name);
|
||||||
|
|
||||||
#endif //EQEMU_FILE_UTIL_H
|
#endif //EQEMU_FILE_UTIL_H
|
||||||
|
|||||||
+67
-7
@@ -20,7 +20,7 @@
|
|||||||
#include "database.h"
|
#include "database.h"
|
||||||
|
|
||||||
//#include "misc_functions.h"
|
//#include "misc_functions.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ bool BaseGuildManager::LoadGuilds() {
|
|||||||
for (auto row=results.begin();row!=results.end();++row)
|
for (auto row=results.begin();row!=results.end();++row)
|
||||||
_CreateGuild(atoi(row[0]), row[1], atoi(row[2]), atoi(row[3]), row[4], row[5], row[6], row[7]);
|
_CreateGuild(atoi(row[0]), row[1], atoi(row[2]), atoi(row[3]), row[4], row[5], row[6], row[7]);
|
||||||
|
|
||||||
query = "SELECT guild_id,rank,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace FROM guild_ranks";
|
query = "SELECT guild_id,`rank`,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace FROM guild_ranks";
|
||||||
results = m_db->QueryDatabase(query);
|
results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success())
|
if (!results.Success())
|
||||||
@@ -131,7 +131,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) {
|
|||||||
|
|
||||||
info = _CreateGuild(guild_id, row[0], atoi(row[1]), atoi(row[2]), row[3], row[4], row[5], row[6]);
|
info = _CreateGuild(guild_id, row[0], atoi(row[1]), atoi(row[2]), row[3], row[4], row[5], row[6]);
|
||||||
|
|
||||||
query = StringFormat("SELECT guild_id, rank, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
|
query = StringFormat("SELECT guild_id, `rank`, title, can_hear, can_speak, can_invite, can_remove, can_promote, can_demote, can_motd, can_warpeace "
|
||||||
"FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
|
"FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id);
|
||||||
results = m_db->QueryDatabase(query);
|
results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) {
|
|||||||
m_db->DoEscapeString(title_esc, rankInfo.name.c_str(), rankInfo.name.length());
|
m_db->DoEscapeString(title_esc, rankInfo.name.c_str(), rankInfo.name.length());
|
||||||
|
|
||||||
query = StringFormat("INSERT INTO guild_ranks "
|
query = StringFormat("INSERT INTO guild_ranks "
|
||||||
"(guild_id,rank,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace)"
|
"(guild_id,`rank`,title,can_hear,can_speak,can_invite,can_remove,can_promote,can_demote,can_motd,can_warpeace)"
|
||||||
" VALUES(%d,%d,'%s',%d,%d,%d,%d,%d,%d,%d,%d)",
|
" VALUES(%d,%d,'%s',%d,%d,%d,%d,%d,%d,%d,%d)",
|
||||||
guild_id, rank, title_esc,
|
guild_id, rank, title_esc,
|
||||||
rankInfo.permissions[GUILD_HEAR],
|
rankInfo.permissions[GUILD_HEAR],
|
||||||
@@ -738,7 +738,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
|||||||
std::string query;
|
std::string query;
|
||||||
|
|
||||||
if(guild_id != GUILD_NONE) {
|
if(guild_id != GUILD_NONE) {
|
||||||
query = StringFormat("REPLACE INTO guild_members (char_id,guild_id,rank,public_note) VALUES(%d,%d,%d,'')", charid, guild_id, rank);
|
query = StringFormat("REPLACE INTO guild_members (char_id,guild_id,`rank`,public_note) VALUES(%d,%d,%d,'')", charid, guild_id, rank);
|
||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
@@ -758,7 +758,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BaseGuildManager::DBSetGuildRank(uint32 charid, uint8 rank) {
|
bool BaseGuildManager::DBSetGuildRank(uint32 charid, uint8 rank) {
|
||||||
std::string query = StringFormat("UPDATE guild_members SET rank=%d WHERE char_id=%d", rank, charid);
|
std::string query = StringFormat("UPDATE guild_members SET `rank`=%d WHERE char_id=%d", rank, charid);
|
||||||
return(QueryWithLogging(query, "setting a guild member's rank"));
|
return(QueryWithLogging(query, "setting a guild member's rank"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1208,7 +1208,7 @@ BaseGuildManager::RankInfo::RankInfo() {
|
|||||||
|
|
||||||
BaseGuildManager::GuildInfo::GuildInfo() {
|
BaseGuildManager::GuildInfo::GuildInfo() {
|
||||||
leader_char_id = 0;
|
leader_char_id = 0;
|
||||||
minstatus = 0;
|
minstatus = AccountStatus::Player;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
|
uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
|
||||||
@@ -1225,6 +1225,66 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID)
|
|||||||
return results.RowCount();
|
return results.RowCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string BaseGuildManager::GetGuildNameByID(uint32 guild_id) const {
|
||||||
|
if(guild_id == GUILD_NONE) {
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||||
|
res = m_guilds.find(guild_id);
|
||||||
|
if(res == m_guilds.end()) {
|
||||||
|
return "Invalid Guild";
|
||||||
|
}
|
||||||
|
|
||||||
|
return res->second->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string BaseGuildManager::GetGuildRankName(uint32 guild_id, uint8 rank) const
|
||||||
|
{
|
||||||
|
if(rank > GUILD_MAX_RANK) {
|
||||||
|
return "Invalid Rank";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::map<uint32, GuildInfo *>::const_iterator res;
|
||||||
|
res = m_guilds.find(guild_id);
|
||||||
|
if(res == m_guilds.end()) {
|
||||||
|
return "Invalid Guild Rank";
|
||||||
|
}
|
||||||
|
|
||||||
|
return res->second->ranks[rank].name;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 BaseGuildManager::GetGuildIDByCharacterID(uint32 character_id)
|
||||||
|
{
|
||||||
|
if(!m_db) {
|
||||||
|
return GUILD_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string query = fmt::format(
|
||||||
|
"SELECT `guild_id` FROM `guild_members` WHERE char_id = {} LIMIT 1",
|
||||||
|
character_id
|
||||||
|
);
|
||||||
|
auto results = m_db->QueryDatabase(query);
|
||||||
|
if(!results.Success() || !results.RowCount()) {
|
||||||
|
return GUILD_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
auto guild_id = std::stoul(row[0]);
|
||||||
|
return guild_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BaseGuildManager::IsCharacterInGuild(uint32 character_id, uint32 guild_id)
|
||||||
|
{
|
||||||
|
auto current_guild_id = GetGuildIDByCharacterID(character_id);
|
||||||
|
|
||||||
|
if (current_guild_id == GUILD_NONE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (guild_id && current_guild_id != guild_id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|||||||
@@ -76,8 +76,12 @@ class BaseGuildManager
|
|||||||
bool GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const;
|
bool GetGuildChannel(uint32 GuildID, char *ChannelBuffer) const;
|
||||||
const char *GetRankName(uint32 guild_id, uint8 rank) const;
|
const char *GetRankName(uint32 guild_id, uint8 rank) const;
|
||||||
const char *GetGuildName(uint32 guild_id) const;
|
const char *GetGuildName(uint32 guild_id) const;
|
||||||
|
std::string GetGuildNameByID(uint32 guild_id) const;
|
||||||
|
std::string GetGuildRankName(uint32 guild_id, uint8 rank) const;
|
||||||
|
bool IsCharacterInGuild(uint32 character_id, uint32 guild_id = 0);
|
||||||
bool GetGuildNameByID(uint32 guild_id, std::string &into) const;
|
bool GetGuildNameByID(uint32 guild_id, std::string &into) const;
|
||||||
uint32 GetGuildIDByName(const char *GuildName);
|
uint32 GetGuildIDByName(const char *GuildName);
|
||||||
|
uint32 GetGuildIDByCharacterID(uint32 character_id);
|
||||||
bool IsGuildLeader(uint32 guild_id, uint32 char_id) const;
|
bool IsGuildLeader(uint32 guild_id, uint32 char_id) const;
|
||||||
uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const;
|
uint8 GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 char_id) const;
|
||||||
bool CheckGMStatus(uint32 guild_id, uint8 status) const;
|
bool CheckGMStatus(uint32 guild_id, uint8 status) const;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
//#include "races.h"
|
//#include "races.h"
|
||||||
//#include "rulesys.h"
|
//#include "rulesys.h"
|
||||||
//#include "shareddb.h"
|
//#include "shareddb.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
|
|
||||||
#include "../common/light_source.h"
|
#include "../common/light_source.h"
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ bool EQ::InventoryProfile::SwapItem(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove item from inventory (with memory delete)
|
// Remove item from inventory (with memory delete)
|
||||||
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) {
|
bool EQ::InventoryProfile::DeleteItem(int16 slot_id, int16 quantity) {
|
||||||
// Pop item out of inventory map (or queue)
|
// Pop item out of inventory map (or queue)
|
||||||
ItemInstance *item_to_delete = PopItem(slot_id);
|
ItemInstance *item_to_delete = PopItem(slot_id);
|
||||||
|
|
||||||
@@ -590,6 +590,68 @@ bool EQ::InventoryProfile::HasSpaceForItem(const ItemData *ItemToTry, int16 Quan
|
|||||||
// Checks that user has at least 'quantity' number of items in a given inventory slot
|
// Checks that user has at least 'quantity' number of items in a given inventory slot
|
||||||
// Returns first slot it was found in, or SLOT_INVALID if not found
|
// Returns first slot it was found in, or SLOT_INVALID if not found
|
||||||
|
|
||||||
|
bool EQ::InventoryProfile::HasAugmentEquippedByID(uint32 item_id)
|
||||||
|
{
|
||||||
|
bool has_equipped = false;
|
||||||
|
ItemInstance* item = nullptr;
|
||||||
|
|
||||||
|
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||||
|
item = GetItem(slot_id);
|
||||||
|
if (item && item->ContainsAugmentByID(item_id)) {
|
||||||
|
has_equipped = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return has_equipped;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::InventoryProfile::CountAugmentEquippedByID(uint32 item_id)
|
||||||
|
{
|
||||||
|
int quantity = 0;
|
||||||
|
ItemInstance* item = nullptr;
|
||||||
|
|
||||||
|
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||||
|
item = GetItem(slot_id);
|
||||||
|
if (item && item->ContainsAugmentByID(item_id)) {
|
||||||
|
quantity += item->CountAugmentByID(item_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EQ::InventoryProfile::HasItemEquippedByID(uint32 item_id)
|
||||||
|
{
|
||||||
|
bool has_equipped = false;
|
||||||
|
ItemInstance* item = nullptr;
|
||||||
|
|
||||||
|
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||||
|
item = GetItem(slot_id);
|
||||||
|
if (item && item->GetID() == item_id) {
|
||||||
|
has_equipped = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return has_equipped;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::InventoryProfile::CountItemEquippedByID(uint32 item_id)
|
||||||
|
{
|
||||||
|
int quantity = 0;
|
||||||
|
ItemInstance* item = nullptr;
|
||||||
|
|
||||||
|
for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) {
|
||||||
|
item = GetItem(slot_id);
|
||||||
|
if (item && item->GetID() == item_id) {
|
||||||
|
quantity += item->IsStackable() ? item->GetCharges() : 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
//This function has a flaw in that it only returns the last stack that it looked at
|
//This function has a flaw in that it only returns the last stack that it looked at
|
||||||
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
|
//when quantity is greater than 1 and not all of quantity can be found in 1 stack.
|
||||||
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
int16 EQ::InventoryProfile::HasItem(uint32 item_id, uint8 quantity, uint8 where)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ namespace EQ
|
|||||||
bool SwapItem(int16 source_slot, int16 destination_slot, SwapItemFailState& fail_state, uint16 race_id = 0, uint8 class_id = 0, uint16 deity_id = 0, uint8 level = 0);
|
bool SwapItem(int16 source_slot, int16 destination_slot, SwapItemFailState& fail_state, uint16 race_id = 0, uint8 class_id = 0, uint16 deity_id = 0, uint8 level = 0);
|
||||||
|
|
||||||
// Remove item from inventory
|
// Remove item from inventory
|
||||||
bool DeleteItem(int16 slot_id, uint8 quantity = 0);
|
bool DeleteItem(int16 slot_id, int16 quantity = 0);
|
||||||
|
|
||||||
// Checks All items in a bag for No Drop
|
// Checks All items in a bag for No Drop
|
||||||
bool CheckNoDrop(int16 slot_id, bool recurse = true);
|
bool CheckNoDrop(int16 slot_id, bool recurse = true);
|
||||||
@@ -140,6 +140,18 @@ namespace EQ
|
|||||||
// Remove item from inventory (and take control of memory)
|
// Remove item from inventory (and take control of memory)
|
||||||
ItemInstance* PopItem(int16 slot_id);
|
ItemInstance* PopItem(int16 slot_id);
|
||||||
|
|
||||||
|
// Check if player has a specific item equipped by Item ID
|
||||||
|
bool HasItemEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
|
// Check how many of a specific item the player has equipped by Item ID
|
||||||
|
int CountItemEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
|
// Check if player has a specific augment equipped by Item ID
|
||||||
|
bool HasAugmentEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
|
// Check how many of a specific augment the player has equipped by Item ID
|
||||||
|
int CountAugmentEquippedByID(uint32 item_id);
|
||||||
|
|
||||||
// Check whether there is space for the specified number of the specified item.
|
// Check whether there is space for the specified number of the specified item.
|
||||||
bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
|
bool HasSpaceForItem(const ItemData *ItemToTry, int16 Quantity);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "inventory_slot.h"
|
#include "inventory_slot.h"
|
||||||
#include "textures.h"
|
#include "textures.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
|
|
||||||
|
|
||||||
int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
int8 EQ::inventory::ConvertEquipmentIndexToTextureIndex(int16 slot_index)
|
||||||
|
|||||||
@@ -18,7 +18,17 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
#include <fmt/format.h>
|
||||||
|
#include <csignal>
|
||||||
|
#include <vector>
|
||||||
#include "ip_util.h"
|
#include "ip_util.h"
|
||||||
|
#include "http/httplib.h"
|
||||||
|
#include "http/uri.h"
|
||||||
|
#include "eqemu_logsys.h"
|
||||||
|
#include "event/event_loop.h"
|
||||||
|
#include "net/dns.h"
|
||||||
|
#include "event/task_scheduler.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ip
|
* @param ip
|
||||||
@@ -70,3 +80,148 @@ bool IpUtil::IsIpInPrivateRfc1918(const std::string &ip)
|
|||||||
IpUtil::IsIpInRange(ip, "192.168.0.0", "255.255.0.0")
|
IpUtil::IsIpInRange(ip, "192.168.0.0", "255.255.0.0")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets local address - pings google to inspect what interface was used locally
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
std::string IpUtil::GetLocalIPAddress()
|
||||||
|
{
|
||||||
|
char my_ip_address[16];
|
||||||
|
unsigned int my_port;
|
||||||
|
struct sockaddr_in server_address{};
|
||||||
|
struct sockaddr_in my_address{};
|
||||||
|
int sockfd;
|
||||||
|
|
||||||
|
// Connect to server
|
||||||
|
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set server_addr
|
||||||
|
memset(&server_address, 0, sizeof(server_address));
|
||||||
|
server_address.sin_family = AF_INET;
|
||||||
|
server_address.sin_addr.s_addr = inet_addr("172.217.160.99");
|
||||||
|
server_address.sin_port = htons(80);
|
||||||
|
|
||||||
|
// Connect to server
|
||||||
|
if (connect(sockfd, (struct sockaddr *) &server_address, sizeof(server_address)) < 0) {
|
||||||
|
close(sockfd);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get my ip address and port
|
||||||
|
memset(&my_address, 0, sizeof(my_address));
|
||||||
|
socklen_t len = sizeof(my_address);
|
||||||
|
getsockname(sockfd, (struct sockaddr *) &my_address, &len);
|
||||||
|
inet_ntop(AF_INET, &my_address.sin_addr, my_ip_address, sizeof(my_ip_address));
|
||||||
|
my_port = ntohs(my_address.sin_port);
|
||||||
|
|
||||||
|
return fmt::format("{}", my_ip_address);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets public address
|
||||||
|
* Uses various websites as options to return raw public IP back to the client
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
std::string IpUtil::GetPublicIPAddress()
|
||||||
|
{
|
||||||
|
std::vector<std::string> endpoints = {
|
||||||
|
"http://ifconfig.me",
|
||||||
|
"http://api.ipify.org",
|
||||||
|
"http://ipinfo.io/ip",
|
||||||
|
"http://ipecho.net/plain",
|
||||||
|
};
|
||||||
|
|
||||||
|
for (auto &s: endpoints) {
|
||||||
|
// http get request
|
||||||
|
uri u(s);
|
||||||
|
|
||||||
|
httplib::Client r(
|
||||||
|
fmt::format(
|
||||||
|
"{}://{}",
|
||||||
|
u.get_scheme(),
|
||||||
|
u.get_host()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
httplib::Headers headers = {
|
||||||
|
{"Content-type", "text/plain; charset=utf-8"},
|
||||||
|
{"User-Agent", "curl/7.81.0"}
|
||||||
|
};
|
||||||
|
|
||||||
|
r.set_connection_timeout(1, 0);
|
||||||
|
r.set_read_timeout(1, 0);
|
||||||
|
r.set_write_timeout(1, 0);
|
||||||
|
|
||||||
|
if (auto res = r.Get(fmt::format("/{}", u.get_path()).c_str(), headers)) {
|
||||||
|
if (res->status == 200) {
|
||||||
|
if (res->body.find('.') != std::string::npos) {
|
||||||
|
return res->body;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string IpUtil::DNSLookupSync(const std::string &addr, int port)
|
||||||
|
{
|
||||||
|
auto task_runner = new EQ::Event::TaskScheduler();
|
||||||
|
auto res = task_runner->Enqueue(
|
||||||
|
[&]() -> std::string {
|
||||||
|
bool running = true;
|
||||||
|
std::string ret;
|
||||||
|
|
||||||
|
EQ::Net::DNSLookup(
|
||||||
|
addr, port, false, [&](const std::string &addr) {
|
||||||
|
ret = addr;
|
||||||
|
if (addr.empty()) {
|
||||||
|
ret = "";
|
||||||
|
running = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
|
auto &loop = EQ::EventLoop::Get();
|
||||||
|
while (running) {
|
||||||
|
if (!ret.empty()) {
|
||||||
|
running = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
|
||||||
|
if (std::chrono::duration_cast<std::chrono::milliseconds>(end - begin).count() > 1500) {
|
||||||
|
LogInfo(
|
||||||
|
"[DNSLookupSync] Deadline exceeded [{}]",
|
||||||
|
1500
|
||||||
|
);
|
||||||
|
running = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
loop.Process();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
std::string result = res.get();
|
||||||
|
safe_delete(task_runner);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IpUtil::IsIPAddress(const std::string &ip_address)
|
||||||
|
{
|
||||||
|
struct sockaddr_in sa{};
|
||||||
|
int result = inet_pton(AF_INET, ip_address.c_str(), &(sa.sin_addr));
|
||||||
|
return result != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,13 @@ public:
|
|||||||
static uint32_t IPToUInt(const std::string &ip);
|
static uint32_t IPToUInt(const std::string &ip);
|
||||||
static bool IsIpInRange(const std::string &ip, const std::string &network, const std::string &mask);
|
static bool IsIpInRange(const std::string &ip, const std::string &network, const std::string &mask);
|
||||||
static bool IsIpInPrivateRfc1918(const std::string &ip);
|
static bool IsIpInPrivateRfc1918(const std::string &ip);
|
||||||
|
static std::string GetLocalIPAddress();
|
||||||
|
static std::string GetPublicIPAddress();
|
||||||
|
static std::string DNSLookupSync(
|
||||||
|
const std::string &addr,
|
||||||
|
int port
|
||||||
|
);
|
||||||
|
static bool IsIPAddress(const std::string &ip_address);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -370,7 +370,7 @@ namespace EQ
|
|||||||
uint32 Slots; // Bitfield for which slots this item can be used in
|
uint32 Slots; // Bitfield for which slots this item can be used in
|
||||||
uint32 Price; // Item cost (?)
|
uint32 Price; // Item cost (?)
|
||||||
uint32 Icon; // Icon Number
|
uint32 Icon; // Icon Number
|
||||||
uint32 LoreGroup; // Later items use LoreGroup instead of LoreFlag. we might want to see about changing this to int32 since it is commonly -1 and is constantly being cast from signed (-1) to unsigned (4294967295)
|
int32 LoreGroup; // Later items use LoreGroup instead of LoreFlag. we might want to see about changing this to int32 since it is commonly -1 and is constantly being cast from signed (-1) to unsigned (4294967295)
|
||||||
bool LoreFlag; // This will be true if LoreGroup is non-zero
|
bool LoreFlag; // This will be true if LoreGroup is non-zero
|
||||||
bool PendingLoreFlag;
|
bool PendingLoreFlag;
|
||||||
bool ArtifactFlag;
|
bool ArtifactFlag;
|
||||||
@@ -473,14 +473,14 @@ namespace EQ
|
|||||||
uint32 LDoNSold;
|
uint32 LDoNSold;
|
||||||
uint32 BaneDmgRaceAmt;
|
uint32 BaneDmgRaceAmt;
|
||||||
uint32 AugRestrict;
|
uint32 AugRestrict;
|
||||||
uint32 Endur;
|
int32 Endur;
|
||||||
uint32 DotShielding;
|
int32 DotShielding;
|
||||||
uint32 Attack;
|
int32 Attack;
|
||||||
uint32 Regen;
|
int32 Regen;
|
||||||
uint32 ManaRegen;
|
int32 ManaRegen;
|
||||||
uint32 EnduranceRegen;
|
int32 EnduranceRegen;
|
||||||
uint32 Haste;
|
int32 Haste;
|
||||||
uint32 DamageShield;
|
int32 DamageShield;
|
||||||
uint32 RecastDelay;
|
uint32 RecastDelay;
|
||||||
int RecastType;
|
int RecastType;
|
||||||
uint32 AugDistiller;
|
uint32 AugDistiller;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
//#include "races.h"
|
//#include "races.h"
|
||||||
#include "rulesys.h"
|
#include "rulesys.h"
|
||||||
#include "shareddb.h"
|
#include "shareddb.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
|
|
||||||
//#include "../common/light_source.h"
|
//#include "../common/light_source.h"
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ EQ::ItemInstance* EQ::ItemInstance::GetOrnamentationAug(int32 ornamentationAugty
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return this->GetAugment(i);
|
return GetAugment(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -689,6 +689,45 @@ bool EQ::ItemInstance::IsAugmented()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EQ::ItemInstance::ContainsAugmentByID(uint32 item_id)
|
||||||
|
{
|
||||||
|
if (!m_item || !m_item->IsClassCommon()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item_id) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
|
||||||
|
if (GetAugmentItemID(augment_slot) == item_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int EQ::ItemInstance::CountAugmentByID(uint32 item_id)
|
||||||
|
{
|
||||||
|
int quantity = 0;
|
||||||
|
if (!m_item || !m_item->IsClassCommon()) {
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!item_id) {
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
|
||||||
|
if (GetAugmentItemID(augment_slot) == item_id) {
|
||||||
|
quantity++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
// Has attack/delay?
|
// Has attack/delay?
|
||||||
bool EQ::ItemInstance::IsWeapon() const
|
bool EQ::ItemInstance::IsWeapon() const
|
||||||
{
|
{
|
||||||
@@ -1058,7 +1097,7 @@ int EQ::ItemInstance::GetItemElementalFlag(bool augments) const
|
|||||||
|
|
||||||
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
|
int EQ::ItemInstance::GetItemElementalDamage(bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int64 damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
damage = item->ElemDmgAmt;
|
damage = item->ElemDmgAmt;
|
||||||
@@ -1123,7 +1162,7 @@ int EQ::ItemInstance::GetItemRequiredLevel(bool augments) const
|
|||||||
|
|
||||||
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
|
int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int64 damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
damage = item->Damage;
|
damage = item->Damage;
|
||||||
@@ -1139,7 +1178,7 @@ int EQ::ItemInstance::GetItemWeaponDamage(bool augments) const
|
|||||||
|
|
||||||
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
|
int EQ::ItemInstance::GetItemBackstabDamage(bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int64 damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
damage = item->BackstabDmg;
|
damage = item->BackstabDmg;
|
||||||
@@ -1197,7 +1236,7 @@ int EQ::ItemInstance::GetItemBaneDamageRace(bool augments) const
|
|||||||
|
|
||||||
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
|
int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int64 damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
if (item->BaneDmgBody == against)
|
if (item->BaneDmgBody == against)
|
||||||
@@ -1214,7 +1253,7 @@ int EQ::ItemInstance::GetItemBaneDamageBody(bodyType against, bool augments) con
|
|||||||
|
|
||||||
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
|
int EQ::ItemInstance::GetItemBaneDamageRace(uint16 against, bool augments) const
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int64 damage = 0;
|
||||||
const auto item = GetItem();
|
const auto item = GetItem();
|
||||||
if (item) {
|
if (item) {
|
||||||
if (item->BaneDmgRace == against)
|
if (item->BaneDmgRace == against)
|
||||||
|
|||||||
@@ -132,6 +132,8 @@ namespace EQ
|
|||||||
void DeleteAugment(uint8 slot);
|
void DeleteAugment(uint8 slot);
|
||||||
ItemInstance* RemoveAugment(uint8 index);
|
ItemInstance* RemoveAugment(uint8 index);
|
||||||
bool IsAugmented();
|
bool IsAugmented();
|
||||||
|
bool ContainsAugmentByID(uint32 item_id);
|
||||||
|
int CountAugmentByID(uint32 item_id);
|
||||||
ItemInstance* GetOrnamentationAug(int32 ornamentationAugtype) const;
|
ItemInstance* GetOrnamentationAug(int32 ornamentationAugtype) const;
|
||||||
bool UpdateOrnamentationInfo();
|
bool UpdateOrnamentationInfo();
|
||||||
static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
|
static bool CanTransform(const ItemData *ItemToTry, const ItemData *Container, bool AllowAll = false);
|
||||||
|
|||||||
@@ -30,11 +30,19 @@ struct LootTableEntries_Struct {
|
|||||||
float probability;
|
float probability;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ContentFlags {
|
||||||
|
int16 min_expansion;
|
||||||
|
int16 max_expansion;
|
||||||
|
char content_flags[100];
|
||||||
|
char content_flags_disabled[100];
|
||||||
|
};
|
||||||
|
|
||||||
struct LootTable_Struct {
|
struct LootTable_Struct {
|
||||||
uint32 mincash;
|
uint32 mincash;
|
||||||
uint32 maxcash;
|
uint32 maxcash;
|
||||||
uint32 avgcoin;
|
uint32 avgcoin;
|
||||||
uint32 NumEntries;
|
uint32 NumEntries;
|
||||||
|
ContentFlags content_flags;
|
||||||
LootTableEntries_Struct Entries[0];
|
LootTableEntries_Struct Entries[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,6 +60,7 @@ struct LootDropEntries_Struct {
|
|||||||
|
|
||||||
struct LootDrop_Struct {
|
struct LootDrop_Struct {
|
||||||
uint32 NumEntries;
|
uint32 NumEntries;
|
||||||
|
ContentFlags content_flags;
|
||||||
LootDropEntries_Struct Entries[0];
|
LootDropEntries_Struct Entries[0];
|
||||||
};
|
};
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|||||||
+2
-2
@@ -9,7 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <string.h> /* for memcpy() */
|
#include <string.h> /* for memcpy() */
|
||||||
#include "../common/md5.h"
|
#include "../common/md5.h"
|
||||||
#include "../common/string_util.h"
|
#include "../common/strings.h"
|
||||||
#include "../common/seperator.h"
|
#include "../common/seperator.h"
|
||||||
|
|
||||||
MD5::MD5() {
|
MD5::MD5() {
|
||||||
@@ -194,7 +194,7 @@ void MD5::Final(uint8 digest[16], MD5Context *ctx) {
|
|||||||
|
|
||||||
/* The heart of the MD5 algorithm. */
|
/* The heart of the MD5 algorithm. */
|
||||||
void MD5::Transform(uint32 hash[4], const uint32 input[16]) {
|
void MD5::Transform(uint32 hash[4], const uint32 input[16]) {
|
||||||
register uint32 a = hash[0], b = hash[1], c = hash[2], d = hash[3];
|
uint32 a = hash[0], b = hash[1], c = hash[2], d = hash[3];
|
||||||
|
|
||||||
MD5STEP(F1, a, b, c, d, input[ 0]+0xd76aa478, 7);
|
MD5STEP(F1, a, b, c, d, input[ 0]+0xd76aa478, 7);
|
||||||
MD5STEP(F1, d, a, b, c, input[ 1]+0xe8c7b756, 12);
|
MD5STEP(F1, d, a, b, c, input[ 1]+0xe8c7b756, 12);
|
||||||
|
|||||||
@@ -10,8 +10,14 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
class MySQLRequestRow : public std::iterator<std::input_iterator_tag, MYSQL_ROW>
|
class MySQLRequestRow
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
using iterator_category = std::input_iterator_tag;
|
||||||
|
using value_type = MYSQL_ROW;
|
||||||
|
using difference_type = std::ptrdiff_t;
|
||||||
|
using pointer = MYSQL_ROW*;
|
||||||
|
using reference = MYSQL_ROW&;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MYSQL_RES* m_Result;
|
MYSQL_RES* m_Result;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "console_server.h"
|
#include "console_server.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port)
|
EQ::Net::ConsoleServer::ConsoleServer(const std::string &addr, int port)
|
||||||
@@ -52,11 +52,11 @@ void EQ::Net::ConsoleServer::ConnectionDisconnected(ConsoleServerConnection *c)
|
|||||||
|
|
||||||
void EQ::Net::ConsoleServer::ProcessCommand(ConsoleServerConnection *c, const std::string &cmd)
|
void EQ::Net::ConsoleServer::ProcessCommand(ConsoleServerConnection *c, const std::string &cmd)
|
||||||
{
|
{
|
||||||
auto split = SplitString(cmd, ' ');
|
auto split = Strings::Split(cmd, ' ');
|
||||||
|
|
||||||
if (split.size() > 0) {
|
if (split.size() > 0) {
|
||||||
auto command = split[0];
|
auto command = split[0];
|
||||||
ToLowerString(command);
|
command = Strings::ToLower(command);
|
||||||
|
|
||||||
if (command == "help" || command == "?") {
|
if (command == "help" || command == "?") {
|
||||||
c->SendLine("Commands:");
|
c->SendLine("Commands:");
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
|
|||||||
memset(m_line, 0, MaxConsoleLineLength);
|
memset(m_line, 0, MaxConsoleLineLength);
|
||||||
m_accept_messages = false;
|
m_accept_messages = false;
|
||||||
m_user_id = 0;
|
m_user_id = 0;
|
||||||
m_admin = 0;
|
m_admin = AccountStatus::Player;
|
||||||
|
|
||||||
m_connection->OnRead(std::bind(&ConsoleServerConnection::OnRead, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
m_connection->OnRead(std::bind(&ConsoleServerConnection::OnRead, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
m_connection->OnDisconnect(std::bind(&ConsoleServerConnection::OnDisconnect, this, std::placeholders::_1));
|
m_connection->OnDisconnect(std::bind(&ConsoleServerConnection::OnDisconnect, this, std::placeholders::_1));
|
||||||
@@ -29,7 +29,7 @@ EQ::Net::ConsoleServerConnection::ConsoleServerConnection(ConsoleServer *parent,
|
|||||||
if (addr.find("127.0.0.1") != std::string::npos || addr.find("::0") != std::string::npos) {
|
if (addr.find("127.0.0.1") != std::string::npos || addr.find("::0") != std::string::npos) {
|
||||||
SendLine("Connection established from localhost, assuming admin");
|
SendLine("Connection established from localhost, assuming admin");
|
||||||
m_status = ConsoleStatusLoggedIn;
|
m_status = ConsoleStatusLoggedIn;
|
||||||
m_admin = 255;
|
m_admin = AccountStatus::Max;
|
||||||
SendPrompt();
|
SendPrompt();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -116,43 +116,42 @@ bool EQ::Net::ConsoleServerConnection::SendChannelMessage(const ServerChannelMes
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (scm->chan_num) {
|
switch (scm->chan_num) {
|
||||||
case 4: {
|
case ChatChannel_Guild: {
|
||||||
|
QueueMessage(fmt::format("{} tells the guild [{}], '{}'", scm->from, scm->guilddbid, scm->message));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ChatChannel_Auction: {
|
||||||
if (RuleB(Chat, ServerWideAuction)) {
|
if (RuleB(Chat, ServerWideAuction)) {
|
||||||
QueueMessage(fmt::format("{0} auctions, '{1}'", scm->from, scm->message));
|
QueueMessage(fmt::format("{} auctions, '{}'", scm->from, scm->message));
|
||||||
break;
|
break;
|
||||||
} else { // I think we want default action in this case?
|
} else { // I think we want default action in this case?
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case ChatChannel_OOC: {
|
||||||
case 5: {
|
|
||||||
if (RuleB(Chat, ServerWideOOC)) {
|
if (RuleB(Chat, ServerWideOOC)) {
|
||||||
QueueMessage(fmt::format("{0} says ooc, '{1}'", scm->from, scm->message));
|
QueueMessage(fmt::format("{} says ooc, '{}'", scm->from, scm->message));
|
||||||
break;
|
break;
|
||||||
} else { // I think we want default action in this case?
|
} else { // I think we want default action in this case?
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case ChatChannel_Broadcast: {
|
||||||
case 6: {
|
QueueMessage(fmt::format("{} BROADCASTS, '{}'", scm->from, scm->message));
|
||||||
QueueMessage(fmt::format("{0} BROADCASTS, '{1}'", scm->from, scm->message));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ChatChannel_Tell: {
|
||||||
case 7: {
|
QueueMessage(fmt::format("[{}] tells {}, '{}'", scm->from, scm->to, scm->message));
|
||||||
QueueMessage(fmt::format("[{0}] tells you, '{1}'", scm->from, scm->message));
|
|
||||||
if (onTell) {
|
if (onTell) {
|
||||||
onTell();
|
onTell();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ChatChannel_GMSAY: {
|
||||||
case 11: {
|
QueueMessage(fmt::format("{} GMSAYS, '{}'", scm->from, scm->message));
|
||||||
QueueMessage(fmt::format("{0} GMSAYS, '{1}'", scm->from, scm->message));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1394,7 +1394,7 @@ void EQ::Net::DaybreakConnection::InternalQueuePacket(Packet &p, int stream_id,
|
|||||||
first_header.total_size = (uint32_t)HostToNetwork((uint32_t)length);
|
first_header.total_size = (uint32_t)HostToNetwork((uint32_t)length);
|
||||||
|
|
||||||
size_t used = 0;
|
size_t used = 0;
|
||||||
size_t sublen = m_max_packet_size - m_crc_bytes - DaybreakReliableFragmentHeader::size();
|
size_t sublen = m_max_packet_size - m_crc_bytes - DaybreakReliableFragmentHeader::size() - 1; // -1 for compress flag
|
||||||
DynamicPacket first_packet;
|
DynamicPacket first_packet;
|
||||||
first_packet.PutSerialize(0, first_header);
|
first_packet.PutSerialize(0, first_header);
|
||||||
first_packet.PutData(DaybreakReliableFragmentHeader::size(), (char*)p.Data() + used, sublen);
|
first_packet.PutData(DaybreakReliableFragmentHeader::size(), (char*)p.Data() + used, sublen);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include "../emu_constants.h"
|
||||||
|
|
||||||
struct MethodHandlerEntry
|
struct MethodHandlerEntry
|
||||||
{
|
{
|
||||||
@@ -174,13 +175,13 @@ Json::Value EQ::Net::WebsocketServer::Login(WebsocketServerConnection *connectio
|
|||||||
auto r = _impl->login_handler(connection, user, pass);
|
auto r = _impl->login_handler(connection, user, pass);
|
||||||
|
|
||||||
if (r.logged_in) {
|
if (r.logged_in) {
|
||||||
connection->SetAuthorized(true, r.account_name, r.account_id, 255);
|
connection->SetAuthorized(true, r.account_name, r.account_id, AccountStatus::Max);
|
||||||
ret["status"] = "Ok";
|
ret["status"] = "Ok";
|
||||||
}
|
}
|
||||||
else if (user == "admin" && (connection->RemoteIP() == "127.0.0.1" || connection->RemoteIP() == "::")) {
|
else if (user == "admin" && (connection->RemoteIP() == "127.0.0.1" || connection->RemoteIP() == "::")) {
|
||||||
r.logged_in = true;
|
r.logged_in = true;
|
||||||
r.account_id = 0;
|
r.account_id = 0;
|
||||||
connection->SetAuthorized(true, r.account_name, r.account_id, 255);
|
connection->SetAuthorized(true, r.account_name, r.account_id, AccountStatus::Max);
|
||||||
ret["status"] = "Ok";
|
ret["status"] = "Ok";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ IN(OP_GMTraining, GMTrainee_Struct);
|
|||||||
IN(OP_GMEndTraining, GMTrainEnd_Struct);
|
IN(OP_GMEndTraining, GMTrainEnd_Struct);
|
||||||
IN(OP_GMTrainSkill, GMSkillChange_Struct);
|
IN(OP_GMTrainSkill, GMSkillChange_Struct);
|
||||||
IN(OP_RequestDuel, Duel_Struct);
|
IN(OP_RequestDuel, Duel_Struct);
|
||||||
IN(OP_DuelResponse, DuelResponse_Struct);
|
IN(OP_DuelDecline, DuelResponse_Struct);
|
||||||
IN(OP_DuelResponse2, Duel_Struct);
|
IN(OP_DuelAccept, Duel_Struct);
|
||||||
IN(OP_SpawnAppearance, SpawnAppearance_Struct);
|
IN(OP_SpawnAppearance, SpawnAppearance_Struct);
|
||||||
IN(OP_BazaarInspect, BazaarInspect_Struct);
|
IN(OP_BazaarInspect, BazaarInspect_Struct);
|
||||||
IN(OP_Death, Death_Struct);
|
IN(OP_Death, Death_Struct);
|
||||||
|
|||||||
@@ -240,8 +240,8 @@ void load_opcode_names()
|
|||||||
opcode_map[0x00a1] = "LiveOP_SaveOnZoneReq";
|
opcode_map[0x00a1] = "LiveOP_SaveOnZoneReq";
|
||||||
opcode_map[0x0185] = "LiveOP_Logout";
|
opcode_map[0x0185] = "LiveOP_Logout";
|
||||||
opcode_map[0x0298] = "LiveOP_RequestDuel";
|
opcode_map[0x0298] = "LiveOP_RequestDuel";
|
||||||
opcode_map[0x0a5d] = "LiveOP_DuelResponse";
|
opcode_map[0x0a5d] = "LiveOP_DuelDecline";
|
||||||
opcode_map[0x016e] = "LiveOP_DuelResponse2";
|
opcode_map[0x016e] = "LiveOP_DuelAccept";
|
||||||
opcode_map[0x007c] = "LiveOP_InstillDoubt";
|
opcode_map[0x007c] = "LiveOP_InstillDoubt";
|
||||||
opcode_map[0x00ac] = "LiveOP_SafeFallSuccess";
|
opcode_map[0x00ac] = "LiveOP_SafeFallSuccess";
|
||||||
opcode_map[0x02fb] = "LiveOP_DisciplineUpdate";
|
opcode_map[0x02fb] = "LiveOP_DisciplineUpdate";
|
||||||
|
|||||||
+9
-47
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "../eq_packet_structs.h"
|
#include "../eq_packet_structs.h"
|
||||||
#include "../misc_functions.h"
|
#include "../misc_functions.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../inventory_profile.h"
|
#include "../inventory_profile.h"
|
||||||
#include "rof_structs.h"
|
#include "rof_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
@@ -736,30 +736,6 @@ namespace RoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_DzCompass)
|
|
||||||
{
|
|
||||||
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
|
|
||||||
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
|
|
||||||
sizeof(structs::DynamicZoneCompass_Struct) +
|
|
||||||
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
|
|
||||||
);
|
|
||||||
|
|
||||||
OUT(client_id);
|
|
||||||
OUT(count);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < emu->count; ++i)
|
|
||||||
{
|
|
||||||
OUT(entries[i].dz_zone_id);
|
|
||||||
OUT(entries[i].dz_instance_id);
|
|
||||||
OUT(entries[i].dz_type);
|
|
||||||
OUT(entries[i].x);
|
|
||||||
OUT(entries[i].y);
|
|
||||||
OUT(entries[i].z);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_DzExpeditionEndsWarning)
|
ENCODE(OP_DzExpeditionEndsWarning)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
||||||
@@ -1634,20 +1610,6 @@ namespace RoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
@@ -1852,10 +1814,10 @@ namespace RoF
|
|||||||
OUT_str(zone_short_name2);
|
OUT_str(zone_short_name2);
|
||||||
OUT(zone_id);
|
OUT(zone_id);
|
||||||
OUT(zone_instance);
|
OUT(zone_instance);
|
||||||
OUT(SuspendBuffs);
|
OUT(suspend_buffs);
|
||||||
OUT(FastRegenHP);
|
OUT(fast_regen_hp);
|
||||||
OUT(FastRegenMana);
|
OUT(fast_regen_mana);
|
||||||
OUT(FastRegenEndurance);
|
OUT(fast_regen_endurance);
|
||||||
OUT(underworld_teleport_index);
|
OUT(underworld_teleport_index);
|
||||||
|
|
||||||
eq->FogDensity = emu->fog_density;
|
eq->FogDensity = emu->fog_density;
|
||||||
@@ -1863,8 +1825,8 @@ namespace RoF
|
|||||||
/*fill in some unknowns with observed values, hopefully it will help */
|
/*fill in some unknowns with observed values, hopefully it will help */
|
||||||
eq->unknown800 = -1;
|
eq->unknown800 = -1;
|
||||||
eq->unknown844 = 600;
|
eq->unknown844 = 600;
|
||||||
OUT(LavaDamage);
|
OUT(lava_damage);
|
||||||
OUT(MinLavaDamage);
|
OUT(min_lava_damage);
|
||||||
eq->unknown888 = 1;
|
eq->unknown888 = 1;
|
||||||
eq->unknown889 = 0;
|
eq->unknown889 = 0;
|
||||||
eq->unknown890 = 1;
|
eq->unknown890 = 1;
|
||||||
@@ -6137,7 +6099,7 @@ namespace RoF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(serverSayLink, '\x12');
|
auto segments = Strings::Split(serverSayLink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
@@ -6176,7 +6138,7 @@ namespace RoF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(rofSayLink, '\x12');
|
auto segments = Strings::Split(rofSayLink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
|
|||||||
+16
-54
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "../eq_packet_structs.h"
|
#include "../eq_packet_structs.h"
|
||||||
#include "../misc_functions.h"
|
#include "../misc_functions.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../inventory_profile.h"
|
#include "../inventory_profile.h"
|
||||||
#include "rof2_structs.h"
|
#include "rof2_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
@@ -785,30 +785,6 @@ namespace RoF2
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_DzCompass)
|
|
||||||
{
|
|
||||||
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
|
|
||||||
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
|
|
||||||
sizeof(structs::DynamicZoneCompass_Struct) +
|
|
||||||
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
|
|
||||||
);
|
|
||||||
|
|
||||||
OUT(client_id);
|
|
||||||
OUT(count);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < emu->count; ++i)
|
|
||||||
{
|
|
||||||
OUT(entries[i].dz_zone_id);
|
|
||||||
OUT(entries[i].dz_instance_id);
|
|
||||||
OUT(entries[i].dz_type);
|
|
||||||
OUT(entries[i].x);
|
|
||||||
OUT(entries[i].y);
|
|
||||||
OUT(entries[i].z);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_DzExpeditionEndsWarning)
|
ENCODE(OP_DzExpeditionEndsWarning)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
||||||
@@ -1683,20 +1659,6 @@ namespace RoF2
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
@@ -1901,13 +1863,13 @@ namespace RoF2
|
|||||||
OUT_str(zone_short_name2);
|
OUT_str(zone_short_name2);
|
||||||
OUT(zone_id);
|
OUT(zone_id);
|
||||||
OUT(zone_instance);
|
OUT(zone_instance);
|
||||||
OUT(SuspendBuffs);
|
OUT(suspend_buffs);
|
||||||
OUT(FastRegenHP);
|
OUT(fast_regen_hp);
|
||||||
OUT(FastRegenMana);
|
OUT(fast_regen_mana);
|
||||||
OUT(FastRegenEndurance);
|
OUT(fast_regen_endurance);
|
||||||
OUT(underworld_teleport_index);
|
OUT(underworld_teleport_index);
|
||||||
|
|
||||||
eq->FogDensity = emu->fog_density;
|
eq->fog_density = emu->fog_density;
|
||||||
|
|
||||||
/*fill in some unknowns with observed values, hopefully it will help */
|
/*fill in some unknowns with observed values, hopefully it will help */
|
||||||
eq->ZoneTimeZone = 0;
|
eq->ZoneTimeZone = 0;
|
||||||
@@ -1919,8 +1881,8 @@ namespace RoF2
|
|||||||
eq->SkyRelated2 = -1;
|
eq->SkyRelated2 = -1;
|
||||||
eq->NPCAggroMaxDist = 600;
|
eq->NPCAggroMaxDist = 600;
|
||||||
eq->FilterID = 2008; // Guild Lobby observed value
|
eq->FilterID = 2008; // Guild Lobby observed value
|
||||||
OUT(LavaDamage);
|
OUT(lava_damage);
|
||||||
OUT(MinLavaDamage);
|
OUT(min_lava_damage);
|
||||||
eq->bDisallowManaStone = 1;
|
eq->bDisallowManaStone = 1;
|
||||||
eq->bNoBind = 0;
|
eq->bNoBind = 0;
|
||||||
eq->bNoAttack = 0;
|
eq->bNoAttack = 0;
|
||||||
@@ -1929,12 +1891,12 @@ namespace RoF2
|
|||||||
eq->bNoFear = 0;
|
eq->bNoFear = 0;
|
||||||
eq->fall_damage = 0; // 0 = Fall Damage on, 1 = Fall Damage off
|
eq->fall_damage = 0; // 0 = Fall Damage on, 1 = Fall Damage off
|
||||||
eq->unknown895 = 0;
|
eq->unknown895 = 0;
|
||||||
eq->CanPlaceCampsite = 2;
|
eq->can_place_campsite = 2;
|
||||||
eq->CanPlaceGuildBanner = 2;
|
eq->can_place_guild_banner = 2;
|
||||||
eq->FishingRelated = -1; // Set from PoK Example
|
eq->fishing_related = -1; // Set from PoK Example
|
||||||
eq->ForageRelated = -1; // Set from PoK Example
|
eq->forage_related = -1; // Set from PoK Example
|
||||||
eq->bNoLevitate = 0;
|
eq->b_no_levitate = 0;
|
||||||
eq->Blooming = 1.0; // Set from PoK Example
|
eq->blooming = 1.0; // Set from PoK Example
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
@@ -6360,7 +6322,7 @@ namespace RoF2
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(server_saylink, '\x12');
|
auto segments = Strings::Split(server_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
@@ -6392,7 +6354,7 @@ namespace RoF2
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(rof2_saylink, '\x12');
|
auto segments = Strings::Split(rof2_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "rof2_limits.h"
|
#include "rof2_limits.h"
|
||||||
|
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
|
|
||||||
|
|
||||||
int16 RoF2::invtype::GetInvTypeSize(int16 inv_type)
|
int16 RoF2::invtype::GetInvTypeSize(int16 inv_type)
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ E(OP_DeleteItem)
|
|||||||
E(OP_DeleteSpawn)
|
E(OP_DeleteSpawn)
|
||||||
E(OP_DisciplineUpdate)
|
E(OP_DisciplineUpdate)
|
||||||
E(OP_DzChooseZone)
|
E(OP_DzChooseZone)
|
||||||
E(OP_DzCompass)
|
|
||||||
E(OP_DzExpeditionEndsWarning)
|
E(OP_DzExpeditionEndsWarning)
|
||||||
E(OP_DzExpeditionInfo)
|
E(OP_DzExpeditionInfo)
|
||||||
E(OP_DzExpeditionInvite)
|
E(OP_DzExpeditionInvite)
|
||||||
@@ -93,7 +92,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@@ -630,9 +630,9 @@ struct NewZone_Struct {
|
|||||||
/*0864*/ uint32 scriptIDSomething;
|
/*0864*/ uint32 scriptIDSomething;
|
||||||
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
||||||
/*0872*/ uint32 scriptIDSomething3;
|
/*0872*/ uint32 scriptIDSomething3;
|
||||||
/*0876*/ uint32 SuspendBuffs; // padded bool
|
/*0876*/ uint32 suspend_buffs; // padded bool
|
||||||
/*0880*/ uint32 LavaDamage; // LavaDamage value
|
/*0880*/ uint32 lava_damage; // lava_damage value
|
||||||
/*0884*/ uint32 MinLavaDamage; // min cap after resist calcs
|
/*0884*/ uint32 min_lava_damage; // min cap after resist calcs
|
||||||
/*0888*/ uint8 bDisallowManaStone; // can't use manastone in this zone
|
/*0888*/ uint8 bDisallowManaStone; // can't use manastone in this zone
|
||||||
/*0889*/ uint8 bNoBind; // can't bind even if outdoor says we can!
|
/*0889*/ uint8 bNoBind; // can't bind even if outdoor says we can!
|
||||||
/*0890*/ uint8 bNoAttack; // non-attack zone
|
/*0890*/ uint8 bNoAttack; // non-attack zone
|
||||||
@@ -641,19 +641,19 @@ struct NewZone_Struct {
|
|||||||
/*0893*/ uint8 bNoFear; // fear spells no worky
|
/*0893*/ uint8 bNoFear; // fear spells no worky
|
||||||
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off MQ2 calls bNoEncumber
|
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off MQ2 calls bNoEncumber
|
||||||
/*0895*/ uint8 unknown895; // padding
|
/*0895*/ uint8 unknown895; // padding
|
||||||
/*0896*/ uint32 FastRegenHP; // percentage I think?
|
/*0896*/ uint32 fast_regen_hp; // percentage I think?
|
||||||
/*0900*/ uint32 FastRegenMana; // percentage I think?
|
/*0900*/ uint32 fast_regen_mana; // percentage I think?
|
||||||
/*0904*/ uint32 FastRegenEndurance; // percentage I think?
|
/*0904*/ uint32 fast_regen_endurance; // percentage I think?
|
||||||
/*0908*/ uint32 CanPlaceCampsite; // 0 = no, 1 = can place, 2 = place and goto
|
/*0908*/ uint32 can_place_campsite; // 0 = no, 1 = can place, 2 = place and goto
|
||||||
/*0912*/ uint32 CanPlaceGuildBanner; // ^
|
/*0912*/ uint32 can_place_guild_banner; // ^
|
||||||
/*0916*/ float FogDensity; // Most zones have this set to 0.33 Blightfire had 0.16
|
/*0916*/ float fog_density; // Most zones have this set to 0.33 Blightfire had 0.16
|
||||||
/*0920*/ uint32 bAdjustGamma; // padded bool
|
/*0920*/ uint32 b_adjust_gamma; // padded bool
|
||||||
/*0924*/ uint32 TimeStringID; // Seen 0
|
/*0924*/ uint32 time_string_id; // Seen 0
|
||||||
/*0928*/ uint32 bNoMercenaries; // padded bool
|
/*0928*/ uint32 b_no_mercenaries; // padded bool
|
||||||
/*0932*/ int32 FishingRelated; // Seen -1 idk
|
/*0932*/ int32 fishing_related; // Seen -1 idk
|
||||||
/*0936*/ int32 ForageRelated; // Seen -1 idk
|
/*0936*/ int32 forage_related; // Seen -1 idk
|
||||||
/*0940*/ uint32 bNoLevitate; // padded bool
|
/*0940*/ uint32 b_no_levitate; // padded bool
|
||||||
/*0944*/ float Blooming; // Seen 1.0 in PoK, and 0.25 in Guild Lobby
|
/*0944*/ float blooming; // Seen 1.0 in PoK, and 0.25 in Guild Lobby
|
||||||
/*0948*/
|
/*0948*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2649,11 +2649,11 @@ struct FaceChange_Struct {
|
|||||||
/*004*/ uint8 hairstyle;
|
/*004*/ uint8 hairstyle;
|
||||||
/*005*/ uint8 beard;
|
/*005*/ uint8 beard;
|
||||||
/*006*/ uint8 face;
|
/*006*/ uint8 face;
|
||||||
/*007*/ uint8 unknown007;
|
/*007*/ uint8 unused_padding;
|
||||||
/*008*/ uint32 drakkin_heritage;
|
/*008*/ uint32 drakkin_heritage;
|
||||||
/*012*/ uint32 drakkin_tattoo;
|
/*012*/ uint32 drakkin_tattoo;
|
||||||
/*016*/ uint32 drakkin_details;
|
/*016*/ uint32 drakkin_details;
|
||||||
/*020*/ uint32 unknown020;
|
/*020*/ uint32 entity_id;
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
//there are only 10 faces for barbs changing woad just
|
//there are only 10 faces for barbs changing woad just
|
||||||
@@ -3061,7 +3061,7 @@ struct EnvDamage2_Struct {
|
|||||||
/*0006*/ uint32 damage;
|
/*0006*/ uint32 damage;
|
||||||
/*0010*/ float unknown10; // New to Underfoot - Seen 1
|
/*0010*/ float unknown10; // New to Underfoot - Seen 1
|
||||||
/*0014*/ uint8 unknown14[12];
|
/*0014*/ uint8 unknown14[12];
|
||||||
/*0026*/ uint8 dmgtype; // FA = Lava; FC = Falling
|
/*0026*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||||
/*0027*/ uint8 unknown27[4];
|
/*0027*/ uint8 unknown27[4];
|
||||||
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
|
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
|
||||||
/*0033*/ uint16 constant; // Always FFFF
|
/*0033*/ uint16 constant; // Always FFFF
|
||||||
@@ -4989,7 +4989,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
@@ -5218,6 +5218,11 @@ struct SayLinkBodyFrame_Struct {
|
|||||||
/*056*/
|
/*056*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Checksum_Struct {
|
||||||
|
uint64_t checksum;
|
||||||
|
uint8_t data[2048];
|
||||||
|
};
|
||||||
|
|
||||||
}; /*structs*/
|
}; /*structs*/
|
||||||
|
|
||||||
}; /*RoF2*/
|
}; /*RoF2*/
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "rof_limits.h"
|
#include "rof_limits.h"
|
||||||
|
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
|
|
||||||
|
|
||||||
int16 RoF::invtype::GetInvTypeSize(int16 inv_type)
|
int16 RoF::invtype::GetInvTypeSize(int16 inv_type)
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ E(OP_DeleteItem)
|
|||||||
E(OP_DeleteSpawn)
|
E(OP_DeleteSpawn)
|
||||||
E(OP_DisciplineUpdate)
|
E(OP_DisciplineUpdate)
|
||||||
E(OP_DzChooseZone)
|
E(OP_DzChooseZone)
|
||||||
E(OP_DzCompass)
|
|
||||||
E(OP_DzExpeditionEndsWarning)
|
E(OP_DzExpeditionEndsWarning)
|
||||||
E(OP_DzExpeditionInfo)
|
E(OP_DzExpeditionInfo)
|
||||||
E(OP_DzExpeditionInvite)
|
E(OP_DzExpeditionInvite)
|
||||||
@@ -79,7 +78,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@@ -580,9 +580,9 @@ struct NewZone_Struct {
|
|||||||
/*0864*/ uint32 scriptIDSomething;
|
/*0864*/ uint32 scriptIDSomething;
|
||||||
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
||||||
/*0872*/ uint32 scriptIDSomething3;
|
/*0872*/ uint32 scriptIDSomething3;
|
||||||
/*0876*/ uint32 SuspendBuffs;
|
/*0876*/ uint32 suspend_buffs;
|
||||||
/*0880*/ uint32 LavaDamage; // Seen 50
|
/*0880*/ uint32 lava_damage; // Seen 50
|
||||||
/*0884*/ uint32 MinLavaDamage; // Seen 10
|
/*0884*/ uint32 min_lava_damage; // Seen 10
|
||||||
/*0888*/ uint8 unknown888; // Seen 1
|
/*0888*/ uint8 unknown888; // Seen 1
|
||||||
/*0889*/ uint8 unknown889; // Seen 0 (POK) or 1 (rujj)
|
/*0889*/ uint8 unknown889; // Seen 0 (POK) or 1 (rujj)
|
||||||
/*0890*/ uint8 unknown890; // Seen 1
|
/*0890*/ uint8 unknown890; // Seen 1
|
||||||
@@ -591,9 +591,9 @@ struct NewZone_Struct {
|
|||||||
/*0893*/ uint8 unknown893; // Seen 0 - 00
|
/*0893*/ uint8 unknown893; // Seen 0 - 00
|
||||||
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
||||||
/*0895*/ uint8 unknown895; // Seen 0 - 00
|
/*0895*/ uint8 unknown895; // Seen 0 - 00
|
||||||
/*0896*/ uint32 FastRegenHP; // Seen 180
|
/*0896*/ uint32 fast_regen_hp; // Seen 180
|
||||||
/*0900*/ uint32 FastRegenMana; // Seen 180
|
/*0900*/ uint32 fast_regen_mana; // Seen 180
|
||||||
/*0904*/ uint32 FastRegenEndurance; // Seen 180
|
/*0904*/ uint32 fast_regen_endurance; // Seen 180
|
||||||
/*0908*/ uint32 unknown908; // Seen 2
|
/*0908*/ uint32 unknown908; // Seen 2
|
||||||
/*0912*/ uint32 unknown912; // Seen 2
|
/*0912*/ uint32 unknown912; // Seen 2
|
||||||
/*0916*/ float FogDensity; // Most zones have this set to 0.33 Blightfire had 0.16
|
/*0916*/ float FogDensity; // Most zones have this set to 0.33 Blightfire had 0.16
|
||||||
@@ -2622,11 +2622,11 @@ struct FaceChange_Struct {
|
|||||||
/*004*/ uint8 hairstyle;
|
/*004*/ uint8 hairstyle;
|
||||||
/*005*/ uint8 beard;
|
/*005*/ uint8 beard;
|
||||||
/*006*/ uint8 face;
|
/*006*/ uint8 face;
|
||||||
/*007*/ uint8 unknown007;
|
/*007*/ uint8 unused_padding;
|
||||||
/*008*/ uint32 drakkin_heritage;
|
/*008*/ uint32 drakkin_heritage;
|
||||||
/*012*/ uint32 drakkin_tattoo;
|
/*012*/ uint32 drakkin_tattoo;
|
||||||
/*016*/ uint32 drakkin_details;
|
/*016*/ uint32 drakkin_details;
|
||||||
/*020*/ uint32 unknown020;
|
/*020*/ uint32 entity_id;
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
//there are only 10 faces for barbs changing woad just
|
//there are only 10 faces for barbs changing woad just
|
||||||
@@ -3032,7 +3032,7 @@ struct EnvDamage2_Struct {
|
|||||||
/*0006*/ uint32 damage;
|
/*0006*/ uint32 damage;
|
||||||
/*0010*/ float unknown10; // New to Underfoot - Seen 1
|
/*0010*/ float unknown10; // New to Underfoot - Seen 1
|
||||||
/*0014*/ uint8 unknown14[12];
|
/*0014*/ uint8 unknown14[12];
|
||||||
/*0026*/ uint8 dmgtype; // FA = Lava; FC = Falling
|
/*0026*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||||
/*0027*/ uint8 unknown27[4];
|
/*0027*/ uint8 unknown27[4];
|
||||||
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
|
/*0031*/ uint16 unknown31; // New to Underfoot - Seen 66
|
||||||
/*0033*/ uint16 constant; // Always FFFF
|
/*0033*/ uint16 constant; // Always FFFF
|
||||||
@@ -4921,7 +4921,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
|
|||||||
+10
-48
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "../eq_packet_structs.h"
|
#include "../eq_packet_structs.h"
|
||||||
#include "../misc_functions.h"
|
#include "../misc_functions.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "sod_structs.h"
|
#include "sod_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
@@ -509,30 +509,6 @@ namespace SoD
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_DzCompass)
|
|
||||||
{
|
|
||||||
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
|
|
||||||
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
|
|
||||||
sizeof(structs::DynamicZoneCompass_Struct) +
|
|
||||||
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
|
|
||||||
);
|
|
||||||
|
|
||||||
OUT(client_id);
|
|
||||||
OUT(count);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < emu->count; ++i)
|
|
||||||
{
|
|
||||||
OUT(entries[i].dz_zone_id);
|
|
||||||
OUT(entries[i].dz_instance_id);
|
|
||||||
OUT(entries[i].dz_type);
|
|
||||||
OUT(entries[i].x);
|
|
||||||
OUT(entries[i].y);
|
|
||||||
OUT(entries[i].z);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_DzExpeditionEndsWarning)
|
ENCODE(OP_DzExpeditionEndsWarning)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
||||||
@@ -1170,20 +1146,6 @@ namespace SoD
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
@@ -1379,17 +1341,17 @@ namespace SoD
|
|||||||
OUT_str(zone_short_name2);
|
OUT_str(zone_short_name2);
|
||||||
OUT(zone_id);
|
OUT(zone_id);
|
||||||
OUT(zone_instance);
|
OUT(zone_instance);
|
||||||
OUT(SuspendBuffs);
|
OUT(suspend_buffs);
|
||||||
OUT(FastRegenHP);
|
OUT(fast_regen_hp);
|
||||||
OUT(FastRegenMana);
|
OUT(fast_regen_mana);
|
||||||
OUT(FastRegenEndurance);
|
OUT(fast_regen_endurance);
|
||||||
OUT(underworld_teleport_index);
|
OUT(underworld_teleport_index);
|
||||||
|
|
||||||
/*fill in some unknowns with observed values, hopefully it will help */
|
/*fill in some unknowns with observed values, hopefully it will help */
|
||||||
eq->unknown800 = -1;
|
eq->unknown800 = -1;
|
||||||
eq->unknown844 = 600;
|
eq->unknown844 = 600;
|
||||||
OUT(LavaDamage);
|
OUT(lava_damage);
|
||||||
OUT(MinLavaDamage);
|
OUT(min_lava_damage);
|
||||||
eq->unknown888 = 1;
|
eq->unknown888 = 1;
|
||||||
eq->unknown889 = 0;
|
eq->unknown889 = 0;
|
||||||
eq->unknown890 = 1;
|
eq->unknown890 = 1;
|
||||||
@@ -1400,7 +1362,7 @@ namespace SoD
|
|||||||
eq->unknown895 = 0;
|
eq->unknown895 = 0;
|
||||||
eq->unknown908 = 2;
|
eq->unknown908 = 2;
|
||||||
eq->unknown912 = 2;
|
eq->unknown912 = 2;
|
||||||
eq->FogDensity = emu->fog_density;
|
eq->fog_density = emu->fog_density;
|
||||||
|
|
||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
@@ -4075,7 +4037,7 @@ namespace SoD
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(server_saylink, '\x12');
|
auto segments = Strings::Split(server_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
@@ -4115,7 +4077,7 @@ namespace SoD
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(sod_saylink, '\x12');
|
auto segments = Strings::Split(sod_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "sod_limits.h"
|
#include "sod_limits.h"
|
||||||
|
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
|
|
||||||
|
|
||||||
int16 SoD::invtype::GetInvTypeSize(int16 inv_type)
|
int16 SoD::invtype::GetInvTypeSize(int16 inv_type)
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ E(OP_Damage)
|
|||||||
E(OP_DeleteCharge)
|
E(OP_DeleteCharge)
|
||||||
E(OP_DeleteItem)
|
E(OP_DeleteItem)
|
||||||
E(OP_DzChooseZone)
|
E(OP_DzChooseZone)
|
||||||
E(OP_DzCompass)
|
|
||||||
E(OP_DzExpeditionEndsWarning)
|
E(OP_DzExpeditionEndsWarning)
|
||||||
E(OP_DzExpeditionInfo)
|
E(OP_DzExpeditionInfo)
|
||||||
E(OP_DzExpeditionInvite)
|
E(OP_DzExpeditionInvite)
|
||||||
@@ -63,7 +62,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
@@ -449,9 +449,9 @@ struct NewZone_Struct {
|
|||||||
/*0864*/ uint32 scriptIDSomething;
|
/*0864*/ uint32 scriptIDSomething;
|
||||||
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
||||||
/*0872*/ uint32 scriptIDSomething3;
|
/*0872*/ uint32 scriptIDSomething3;
|
||||||
/*0876*/ uint32 SuspendBuffs;
|
/*0876*/ uint32 suspend_buffs;
|
||||||
/*0880*/ uint32 LavaDamage; //seen 50
|
/*0880*/ uint32 lava_damage; //seen 50
|
||||||
/*0884*/ uint32 MinLavaDamage; //seen 10
|
/*0884*/ uint32 min_lava_damage; //seen 10
|
||||||
/*0888*/ uint8 unknown888; //seen 1
|
/*0888*/ uint8 unknown888; //seen 1
|
||||||
/*0889*/ uint8 unknown889; //seen 0 (POK) or 1 (rujj)
|
/*0889*/ uint8 unknown889; //seen 0 (POK) or 1 (rujj)
|
||||||
/*0890*/ uint8 unknown890; //seen 1
|
/*0890*/ uint8 unknown890; //seen 1
|
||||||
@@ -460,12 +460,12 @@ struct NewZone_Struct {
|
|||||||
/*0893*/ uint8 unknown893; //seen 0 - 00
|
/*0893*/ uint8 unknown893; //seen 0 - 00
|
||||||
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
||||||
/*0895*/ uint8 unknown895; //seen 0 - 00
|
/*0895*/ uint8 unknown895; //seen 0 - 00
|
||||||
/*0896*/ uint32 FastRegenHP; //seen 180
|
/*0896*/ uint32 fast_regen_hp; //seen 180
|
||||||
/*0900*/ uint32 FastRegenMana; //seen 180
|
/*0900*/ uint32 fast_regen_mana; //seen 180
|
||||||
/*0904*/ uint32 FastRegenEndurance; //seen 180
|
/*0904*/ uint32 fast_regen_endurance; //seen 180
|
||||||
/*0908*/ uint32 unknown908; //seen 2
|
/*0908*/ uint32 unknown908; //seen 2
|
||||||
/*0912*/ uint32 unknown912; //seen 2
|
/*0912*/ uint32 unknown912; //seen 2
|
||||||
/*0916*/ float FogDensity; //Of about 10 or so zones tested, all but one have this set to 0.33 Blightfire had 0.16
|
/*0916*/ float fog_density; //Of about 10 or so zones tested, all but one have this set to 0.33 Blightfire had 0.16
|
||||||
/*0920*/ uint32 unknown920; //seen 0
|
/*0920*/ uint32 unknown920; //seen 0
|
||||||
/*0924*/ uint32 unknown924; //seen 0
|
/*0924*/ uint32 unknown924; //seen 0
|
||||||
/*0928*/ uint32 unknown928; //seen 0
|
/*0928*/ uint32 unknown928; //seen 0
|
||||||
@@ -2136,11 +2136,11 @@ struct FaceChange_Struct {
|
|||||||
/*004*/ uint8 hairstyle;
|
/*004*/ uint8 hairstyle;
|
||||||
/*005*/ uint8 beard;
|
/*005*/ uint8 beard;
|
||||||
/*006*/ uint8 face;
|
/*006*/ uint8 face;
|
||||||
/*007*/ uint8 unknown007;
|
/*007*/ uint8 unused_padding;
|
||||||
/*008*/ uint32 drakkin_heritage;
|
/*008*/ uint32 drakkin_heritage;
|
||||||
/*012*/ uint32 drakkin_tattoo;
|
/*012*/ uint32 drakkin_tattoo;
|
||||||
/*016*/ uint32 drakkin_details;
|
/*016*/ uint32 drakkin_details;
|
||||||
/*020*/ uint32 unknown020;
|
/*020*/ uint32 entity_id;
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
//there are only 10 faces for barbs changing woad just
|
//there are only 10 faces for barbs changing woad just
|
||||||
@@ -2539,7 +2539,7 @@ struct EnvDamage2_Struct {
|
|||||||
/*0004*/ uint16 unknown4;
|
/*0004*/ uint16 unknown4;
|
||||||
/*0006*/ uint32 damage;
|
/*0006*/ uint32 damage;
|
||||||
/*0010*/ uint8 unknown10[12];
|
/*0010*/ uint8 unknown10[12];
|
||||||
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
|
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||||
/*0023*/ uint8 unknown2[4];
|
/*0023*/ uint8 unknown2[4];
|
||||||
/*0027*/ uint16 constant; //Always FFFF
|
/*0027*/ uint16 constant; //Always FFFF
|
||||||
/*0029*/ uint16 unknown29;
|
/*0029*/ uint16 unknown29;
|
||||||
@@ -4276,7 +4276,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
|
|||||||
+9
-47
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "../eq_packet_structs.h"
|
#include "../eq_packet_structs.h"
|
||||||
#include "../misc_functions.h"
|
#include "../misc_functions.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "sof_structs.h"
|
#include "sof_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
@@ -497,30 +497,6 @@ namespace SoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_DzCompass)
|
|
||||||
{
|
|
||||||
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
|
|
||||||
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
|
|
||||||
sizeof(structs::DynamicZoneCompass_Struct) +
|
|
||||||
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
|
|
||||||
);
|
|
||||||
|
|
||||||
OUT(client_id);
|
|
||||||
OUT(count);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < emu->count; ++i)
|
|
||||||
{
|
|
||||||
OUT(entries[i].dz_zone_id);
|
|
||||||
OUT(entries[i].dz_instance_id);
|
|
||||||
OUT(entries[i].dz_type);
|
|
||||||
OUT(entries[i].x);
|
|
||||||
OUT(entries[i].y);
|
|
||||||
OUT(entries[i].z);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_DzExpeditionEndsWarning)
|
ENCODE(OP_DzExpeditionEndsWarning)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
||||||
@@ -966,20 +942,6 @@ namespace SoF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MemorizeSpell)
|
ENCODE(OP_MemorizeSpell)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
||||||
@@ -1057,17 +1019,17 @@ namespace SoF
|
|||||||
OUT_str(zone_short_name2);
|
OUT_str(zone_short_name2);
|
||||||
OUT(zone_id);
|
OUT(zone_id);
|
||||||
OUT(zone_instance);
|
OUT(zone_instance);
|
||||||
OUT(SuspendBuffs);
|
OUT(suspend_buffs);
|
||||||
OUT(FastRegenHP);
|
OUT(fast_regen_hp);
|
||||||
OUT(FastRegenMana);
|
OUT(fast_regen_mana);
|
||||||
OUT(FastRegenEndurance);
|
OUT(fast_regen_endurance);
|
||||||
OUT(underworld_teleport_index);
|
OUT(underworld_teleport_index);
|
||||||
|
|
||||||
/*fill in some unknowns with observed values, hopefully it will help */
|
/*fill in some unknowns with observed values, hopefully it will help */
|
||||||
eq->unknown796 = -1;
|
eq->unknown796 = -1;
|
||||||
eq->unknown840 = 600;
|
eq->unknown840 = 600;
|
||||||
OUT(LavaDamage);
|
OUT(lava_damage);
|
||||||
OUT(MinLavaDamage);
|
OUT(min_lava_damage);
|
||||||
eq->unknown884 = 1;
|
eq->unknown884 = 1;
|
||||||
eq->unknown885 = 0;
|
eq->unknown885 = 0;
|
||||||
eq->unknown886 = 1;
|
eq->unknown886 = 1;
|
||||||
@@ -3479,7 +3441,7 @@ namespace SoF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(server_saylink, '\x12');
|
auto segments = Strings::Split(server_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
@@ -3519,7 +3481,7 @@ namespace SoF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(sof_saylink, '\x12');
|
auto segments = Strings::Split(sof_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "sof_limits.h"
|
#include "sof_limits.h"
|
||||||
|
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
|
|
||||||
|
|
||||||
int16 SoF::invtype::GetInvTypeSize(int16 inv_type)
|
int16 SoF::invtype::GetInvTypeSize(int16 inv_type)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ E(OP_DeleteCharge)
|
|||||||
E(OP_DeleteItem)
|
E(OP_DeleteItem)
|
||||||
E(OP_DeleteSpawn)
|
E(OP_DeleteSpawn)
|
||||||
E(OP_DzChooseZone)
|
E(OP_DzChooseZone)
|
||||||
E(OP_DzCompass)
|
|
||||||
E(OP_DzExpeditionEndsWarning)
|
E(OP_DzExpeditionEndsWarning)
|
||||||
E(OP_DzExpeditionInfo)
|
E(OP_DzExpeditionInfo)
|
||||||
E(OP_DzExpeditionInvite)
|
E(OP_DzExpeditionInvite)
|
||||||
@@ -59,7 +58,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MemorizeSpell)
|
E(OP_MemorizeSpell)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
E(OP_NewSpawn)
|
E(OP_NewSpawn)
|
||||||
|
|||||||
@@ -453,9 +453,9 @@ struct NewZone_Struct {
|
|||||||
/*0860*/ uint32 scriptIDSomething;
|
/*0860*/ uint32 scriptIDSomething;
|
||||||
/*0864*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
/*0864*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
||||||
/*0868*/ uint32 scriptIDSomething3;
|
/*0868*/ uint32 scriptIDSomething3;
|
||||||
/*0872*/ uint32 SuspendBuffs;
|
/*0872*/ uint32 suspend_buffs;
|
||||||
/*0876*/ uint32 LavaDamage; //seen 50
|
/*0876*/ uint32 lava_damage; //seen 50
|
||||||
/*0880*/ uint32 MinLavaDamage; //seen 10
|
/*0880*/ uint32 min_lava_damage; //seen 10
|
||||||
/*0884*/ uint8 unknown884; //seen 1
|
/*0884*/ uint8 unknown884; //seen 1
|
||||||
/*0885*/ uint8 unknown885; //seen 0 (POK) or 1 (rujj)
|
/*0885*/ uint8 unknown885; //seen 0 (POK) or 1 (rujj)
|
||||||
/*0886*/ uint8 unknown886; //seen 1
|
/*0886*/ uint8 unknown886; //seen 1
|
||||||
@@ -464,9 +464,9 @@ struct NewZone_Struct {
|
|||||||
/*0893*/ uint8 unknown889; //seen 0 - 00
|
/*0893*/ uint8 unknown889; //seen 0 - 00
|
||||||
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
||||||
/*0895*/ uint8 unknown891; //seen 0 - 00
|
/*0895*/ uint8 unknown891; //seen 0 - 00
|
||||||
/*0892*/ uint32 FastRegenHP; //seen 180
|
/*0892*/ uint32 fast_regen_hp; //seen 180
|
||||||
/*0896*/ uint32 FastRegenMana; //seen 180
|
/*0896*/ uint32 fast_regen_mana; //seen 180
|
||||||
/*0900*/ uint32 FastRegenEndurance; //seen 180
|
/*0900*/ uint32 fast_regen_endurance; //seen 180
|
||||||
/*0904*/ uint32 unknown904; //seen 2
|
/*0904*/ uint32 unknown904; //seen 2
|
||||||
/*0908*/ uint32 unknown908; //seen 2
|
/*0908*/ uint32 unknown908; //seen 2
|
||||||
/*0912*/
|
/*0912*/
|
||||||
@@ -2106,11 +2106,11 @@ struct FaceChange_Struct {
|
|||||||
/*004*/ uint8 hairstyle;
|
/*004*/ uint8 hairstyle;
|
||||||
/*005*/ uint8 beard;
|
/*005*/ uint8 beard;
|
||||||
/*006*/ uint8 face;
|
/*006*/ uint8 face;
|
||||||
/*007*/ uint8 unknown007;
|
/*007*/ uint8 unused_padding;
|
||||||
/*008*/ uint32 drakkin_heritage;
|
/*008*/ uint32 drakkin_heritage;
|
||||||
/*012*/ uint32 drakkin_tattoo;
|
/*012*/ uint32 drakkin_tattoo;
|
||||||
/*016*/ uint32 drakkin_details;
|
/*016*/ uint32 drakkin_details;
|
||||||
/*020*/ uint32 unknown020;
|
/*020*/ uint32 entity_id;
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
//there are only 10 faces for barbs changing woad just
|
//there are only 10 faces for barbs changing woad just
|
||||||
@@ -2509,7 +2509,7 @@ struct EnvDamage2_Struct {
|
|||||||
/*0004*/ uint16 unknown4;
|
/*0004*/ uint16 unknown4;
|
||||||
/*0006*/ uint32 damage;
|
/*0006*/ uint32 damage;
|
||||||
/*0010*/ uint8 unknown10[12];
|
/*0010*/ uint8 unknown10[12];
|
||||||
/*0022*/ uint8 dmgtype; //FA = Lava; FC = Falling
|
/*0022*/ uint8 dmgtype; // FA = Lava, FB = Drowning, FC = Falling, FD = Trap
|
||||||
/*0023*/ uint8 unknown2[4];
|
/*0023*/ uint8 unknown2[4];
|
||||||
/*0027*/ uint16 constant; //Always FFFF
|
/*0027*/ uint16 constant; //Always FFFF
|
||||||
/*0029*/ uint16 unknown29;
|
/*0029*/ uint16 unknown29;
|
||||||
@@ -4186,7 +4186,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
|
|||||||
+40
-27
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "../eq_packet_structs.h"
|
#include "../eq_packet_structs.h"
|
||||||
#include "../misc_functions.h"
|
#include "../misc_functions.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "titanium_structs.h"
|
#include "titanium_structs.h"
|
||||||
|
|
||||||
@@ -440,30 +440,6 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_DzCompass)
|
|
||||||
{
|
|
||||||
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
|
|
||||||
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
|
|
||||||
sizeof(structs::DynamicZoneCompass_Struct) +
|
|
||||||
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
|
|
||||||
);
|
|
||||||
|
|
||||||
OUT(client_id);
|
|
||||||
OUT(count);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < emu->count; ++i)
|
|
||||||
{
|
|
||||||
OUT(entries[i].dz_zone_id);
|
|
||||||
OUT(entries[i].dz_instance_id);
|
|
||||||
OUT(entries[i].dz_type);
|
|
||||||
OUT(entries[i].x);
|
|
||||||
OUT(entries[i].y);
|
|
||||||
OUT(entries[i].z);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_DzExpeditionEndsWarning)
|
ENCODE(OP_DzExpeditionEndsWarning)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
||||||
@@ -932,6 +908,19 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_ManaChange)
|
||||||
|
{
|
||||||
|
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
||||||
|
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
||||||
|
|
||||||
|
OUT(new_mana);
|
||||||
|
OUT(stamina);
|
||||||
|
OUT(spell_id);
|
||||||
|
OUT(keepcasting);
|
||||||
|
|
||||||
|
FINISH_ENCODE();
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_MemorizeSpell)
|
ENCODE(OP_MemorizeSpell)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
ENCODE_LENGTH_EXACT(MemorizeSpell_Struct);
|
||||||
@@ -1451,6 +1440,30 @@ namespace Titanium
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ENCODE(OP_SetFace)
|
||||||
|
{
|
||||||
|
auto emu = reinterpret_cast<FaceChange_Struct*>((*p)->pBuffer);
|
||||||
|
|
||||||
|
EQApplicationPacket outapp(OP_Illusion, sizeof(structs::Illusion_Struct));
|
||||||
|
auto buf = reinterpret_cast<structs::Illusion_Struct*>(outapp.pBuffer);
|
||||||
|
|
||||||
|
buf->spawnid = emu->entity_id;
|
||||||
|
buf->race = -1; // unchanged
|
||||||
|
buf->gender = -1; // unchanged
|
||||||
|
buf->texture = -1; // unchanged
|
||||||
|
buf->helmtexture = -1; // unchanged
|
||||||
|
buf->face = emu->face;
|
||||||
|
buf->hairstyle = emu->hairstyle;
|
||||||
|
buf->haircolor = emu->haircolor;
|
||||||
|
buf->beard = emu->beard;
|
||||||
|
buf->beardcolor = emu->beardcolor;
|
||||||
|
buf->size = 0.0f; // unchanged
|
||||||
|
|
||||||
|
safe_delete(*p); // not using the original packet
|
||||||
|
|
||||||
|
dest->QueuePacket(&outapp, ack_req);
|
||||||
|
}
|
||||||
|
|
||||||
ENCODE(OP_ShopPlayerSell)
|
ENCODE(OP_ShopPlayerSell)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(Merchant_Purchase_Struct);
|
ENCODE_LENGTH_EXACT(Merchant_Purchase_Struct);
|
||||||
@@ -2808,7 +2821,7 @@ namespace Titanium
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(server_saylink, '\x12');
|
auto segments = Strings::Split(server_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
@@ -2848,7 +2861,7 @@ namespace Titanium
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(titanium_saylink, '\x12');
|
auto segments = Strings::Split(titanium_saylink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "titanium_limits.h"
|
#include "titanium_limits.h"
|
||||||
|
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
|
|
||||||
|
|
||||||
int16 Titanium::invtype::GetInvTypeSize(int16 inv_type)
|
int16 Titanium::invtype::GetInvTypeSize(int16 inv_type)
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ E(OP_DeleteCharge)
|
|||||||
E(OP_DeleteItem)
|
E(OP_DeleteItem)
|
||||||
E(OP_DeleteSpawn)
|
E(OP_DeleteSpawn)
|
||||||
E(OP_DzChooseZone)
|
E(OP_DzChooseZone)
|
||||||
E(OP_DzCompass)
|
|
||||||
E(OP_DzExpeditionEndsWarning)
|
E(OP_DzExpeditionEndsWarning)
|
||||||
E(OP_DzExpeditionInfo)
|
E(OP_DzExpeditionInfo)
|
||||||
E(OP_DzExpeditionInvite)
|
E(OP_DzExpeditionInvite)
|
||||||
@@ -55,6 +54,7 @@ E(OP_ItemPacket)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LFGuild)
|
E(OP_LFGuild)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
|
E(OP_ManaChange)
|
||||||
E(OP_MemorizeSpell)
|
E(OP_MemorizeSpell)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
E(OP_OnLevelMessage)
|
E(OP_OnLevelMessage)
|
||||||
@@ -65,6 +65,7 @@ E(OP_ReadBook)
|
|||||||
E(OP_RespondAA)
|
E(OP_RespondAA)
|
||||||
E(OP_SendCharInfo)
|
E(OP_SendCharInfo)
|
||||||
E(OP_SendAATable)
|
E(OP_SendAATable)
|
||||||
|
E(OP_SetFace)
|
||||||
E(OP_ShopPlayerSell)
|
E(OP_ShopPlayerSell)
|
||||||
E(OP_SpecialMesg)
|
E(OP_SpecialMesg)
|
||||||
E(OP_TaskDescription)
|
E(OP_TaskDescription)
|
||||||
|
|||||||
@@ -1761,8 +1761,7 @@ struct AdventureRequestResponse_Struct{
|
|||||||
struct Illusion_Struct {
|
struct Illusion_Struct {
|
||||||
/*000*/ uint32 spawnid;
|
/*000*/ uint32 spawnid;
|
||||||
/*004*/ char charname[64];
|
/*004*/ char charname[64];
|
||||||
/*068*/ uint16 race;
|
/*068*/ int race;
|
||||||
/*070*/ char unknown070[2];
|
|
||||||
/*072*/ uint8 gender;
|
/*072*/ uint8 gender;
|
||||||
/*073*/ uint8 texture;
|
/*073*/ uint8 texture;
|
||||||
/*074*/ uint8 helmtexture;
|
/*074*/ uint8 helmtexture;
|
||||||
@@ -3397,7 +3396,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
|
|||||||
+10
-48
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#include "../eq_packet_structs.h"
|
#include "../eq_packet_structs.h"
|
||||||
#include "../misc_functions.h"
|
#include "../misc_functions.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "../item_instance.h"
|
#include "../item_instance.h"
|
||||||
#include "uf_structs.h"
|
#include "uf_structs.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
@@ -639,30 +639,6 @@ namespace UF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_DzCompass)
|
|
||||||
{
|
|
||||||
SETUP_VAR_ENCODE(DynamicZoneCompass_Struct);
|
|
||||||
ALLOC_VAR_ENCODE(structs::DynamicZoneCompass_Struct,
|
|
||||||
sizeof(structs::DynamicZoneCompass_Struct) +
|
|
||||||
sizeof(structs::DynamicZoneCompassEntry_Struct) * emu->count
|
|
||||||
);
|
|
||||||
|
|
||||||
OUT(client_id);
|
|
||||||
OUT(count);
|
|
||||||
|
|
||||||
for (uint32 i = 0; i < emu->count; ++i)
|
|
||||||
{
|
|
||||||
OUT(entries[i].dz_zone_id);
|
|
||||||
OUT(entries[i].dz_instance_id);
|
|
||||||
OUT(entries[i].dz_type);
|
|
||||||
OUT(entries[i].x);
|
|
||||||
OUT(entries[i].y);
|
|
||||||
OUT(entries[i].z);
|
|
||||||
}
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_DzExpeditionEndsWarning)
|
ENCODE(OP_DzExpeditionEndsWarning)
|
||||||
{
|
{
|
||||||
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
ENCODE_LENGTH_EXACT(ExpeditionExpireWarning);
|
||||||
@@ -1390,20 +1366,6 @@ namespace UF
|
|||||||
FINISH_ENCODE();
|
FINISH_ENCODE();
|
||||||
}
|
}
|
||||||
|
|
||||||
ENCODE(OP_ManaChange)
|
|
||||||
{
|
|
||||||
ENCODE_LENGTH_EXACT(ManaChange_Struct);
|
|
||||||
SETUP_DIRECT_ENCODE(ManaChange_Struct, structs::ManaChange_Struct);
|
|
||||||
|
|
||||||
OUT(new_mana);
|
|
||||||
OUT(stamina);
|
|
||||||
OUT(spell_id);
|
|
||||||
OUT(keepcasting);
|
|
||||||
eq->slot = -1; // this is spell gem slot. It's -1 in normal operation
|
|
||||||
|
|
||||||
FINISH_ENCODE();
|
|
||||||
}
|
|
||||||
|
|
||||||
ENCODE(OP_MercenaryDataResponse)
|
ENCODE(OP_MercenaryDataResponse)
|
||||||
{
|
{
|
||||||
//consume the packet
|
//consume the packet
|
||||||
@@ -1603,19 +1565,19 @@ namespace UF
|
|||||||
OUT_str(zone_short_name2);
|
OUT_str(zone_short_name2);
|
||||||
OUT(zone_id);
|
OUT(zone_id);
|
||||||
OUT(zone_instance);
|
OUT(zone_instance);
|
||||||
OUT(SuspendBuffs);
|
OUT(suspend_buffs);
|
||||||
OUT(FastRegenHP);
|
OUT(fast_regen_hp);
|
||||||
OUT(FastRegenMana);
|
OUT(fast_regen_mana);
|
||||||
OUT(FastRegenEndurance);
|
OUT(fast_regen_endurance);
|
||||||
OUT(underworld_teleport_index);
|
OUT(underworld_teleport_index);
|
||||||
|
|
||||||
eq->FogDensity = emu->fog_density;
|
eq->fog_density = emu->fog_density;
|
||||||
|
|
||||||
/*fill in some unknowns with observed values, hopefully it will help */
|
/*fill in some unknowns with observed values, hopefully it will help */
|
||||||
eq->unknown800 = -1;
|
eq->unknown800 = -1;
|
||||||
eq->unknown844 = 600;
|
eq->unknown844 = 600;
|
||||||
OUT(LavaDamage);
|
OUT(lava_damage);
|
||||||
OUT(MinLavaDamage);
|
OUT(min_lava_damage);
|
||||||
eq->unknown888 = 1;
|
eq->unknown888 = 1;
|
||||||
eq->unknown889 = 0;
|
eq->unknown889 = 0;
|
||||||
eq->unknown890 = 1;
|
eq->unknown890 = 1;
|
||||||
@@ -4434,7 +4396,7 @@ namespace UF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(serverSayLink, '\x12');
|
auto segments = Strings::Split(serverSayLink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
@@ -4474,7 +4436,7 @@ namespace UF
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto segments = SplitString(ufSayLink, '\x12');
|
auto segments = Strings::Split(ufSayLink, '\x12');
|
||||||
|
|
||||||
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
for (size_t segment_iter = 0; segment_iter < segments.size(); ++segment_iter) {
|
||||||
if (segment_iter & 1) {
|
if (segment_iter & 1) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "uf_limits.h"
|
#include "uf_limits.h"
|
||||||
|
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
|
|
||||||
|
|
||||||
int16 UF::invtype::GetInvTypeSize(int16 inv_type)
|
int16 UF::invtype::GetInvTypeSize(int16 inv_type)
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ E(OP_DeleteCharge)
|
|||||||
E(OP_DeleteItem)
|
E(OP_DeleteItem)
|
||||||
E(OP_DisciplineUpdate)
|
E(OP_DisciplineUpdate)
|
||||||
E(OP_DzChooseZone)
|
E(OP_DzChooseZone)
|
||||||
E(OP_DzCompass)
|
|
||||||
E(OP_DzExpeditionEndsWarning)
|
E(OP_DzExpeditionEndsWarning)
|
||||||
E(OP_DzExpeditionInfo)
|
E(OP_DzExpeditionInfo)
|
||||||
E(OP_DzExpeditionInvite)
|
E(OP_DzExpeditionInvite)
|
||||||
@@ -68,7 +67,6 @@ E(OP_ItemVerifyReply)
|
|||||||
E(OP_LeadershipExpUpdate)
|
E(OP_LeadershipExpUpdate)
|
||||||
E(OP_LogServer)
|
E(OP_LogServer)
|
||||||
E(OP_LootItem)
|
E(OP_LootItem)
|
||||||
E(OP_ManaChange)
|
|
||||||
E(OP_MercenaryDataResponse)
|
E(OP_MercenaryDataResponse)
|
||||||
E(OP_MercenaryDataUpdate)
|
E(OP_MercenaryDataUpdate)
|
||||||
E(OP_MoveItem)
|
E(OP_MoveItem)
|
||||||
|
|||||||
+10
-10
@@ -449,9 +449,9 @@ struct NewZone_Struct {
|
|||||||
/*0864*/ uint32 scriptIDSomething;
|
/*0864*/ uint32 scriptIDSomething;
|
||||||
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
|
||||||
/*0872*/ uint32 scriptIDSomething3;
|
/*0872*/ uint32 scriptIDSomething3;
|
||||||
/*0876*/ uint32 SuspendBuffs;
|
/*0876*/ uint32 suspend_buffs;
|
||||||
/*0880*/ uint32 LavaDamage; //seen 50
|
/*0880*/ uint32 lava_damage; //seen 50
|
||||||
/*0884*/ uint32 MinLavaDamage; //seen 10
|
/*0884*/ uint32 min_lava_damage; //seen 10
|
||||||
/*0888*/ uint8 unknown888; //seen 1
|
/*0888*/ uint8 unknown888; //seen 1
|
||||||
/*0889*/ uint8 unknown889; //seen 0 (POK) or 1 (rujj)
|
/*0889*/ uint8 unknown889; //seen 0 (POK) or 1 (rujj)
|
||||||
/*0890*/ uint8 unknown890; //seen 1
|
/*0890*/ uint8 unknown890; //seen 1
|
||||||
@@ -460,12 +460,12 @@ struct NewZone_Struct {
|
|||||||
/*0893*/ uint8 unknown893; //seen 0 - 00
|
/*0893*/ uint8 unknown893; //seen 0 - 00
|
||||||
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
/*0894*/ uint8 fall_damage; // 0 = Fall Damage on, 1 = Fall Damage off
|
||||||
/*0895*/ uint8 unknown895; //seen 0 - 00
|
/*0895*/ uint8 unknown895; //seen 0 - 00
|
||||||
/*0896*/ uint32 FastRegenHP; //seen 180
|
/*0896*/ uint32 fast_regen_hp; //seen 180
|
||||||
/*0900*/ uint32 FastRegenMana; //seen 180
|
/*0900*/ uint32 fast_regen_mana; //seen 180
|
||||||
/*0904*/ uint32 FastRegenEndurance; //seen 180
|
/*0904*/ uint32 fast_regen_endurance; //seen 180
|
||||||
/*0908*/ uint32 unknown908; //seen 2
|
/*0908*/ uint32 unknown908; //seen 2
|
||||||
/*0912*/ uint32 unknown912; //seen 2
|
/*0912*/ uint32 unknown912; //seen 2
|
||||||
/*0916*/ float FogDensity; //Of about 10 or so zones tested, all but one have this set to 0.33 Blightfire had 0.16
|
/*0916*/ float fog_density; //Of about 10 or so zones tested, all but one have this set to 0.33 Blightfire had 0.16
|
||||||
/*0920*/ uint32 unknown920; //seen 0
|
/*0920*/ uint32 unknown920; //seen 0
|
||||||
/*0924*/ uint32 unknown924; //seen 0
|
/*0924*/ uint32 unknown924; //seen 0
|
||||||
/*0928*/ uint32 unknown928; //seen 0
|
/*0928*/ uint32 unknown928; //seen 0
|
||||||
@@ -2185,11 +2185,11 @@ struct FaceChange_Struct {
|
|||||||
/*004*/ uint8 hairstyle;
|
/*004*/ uint8 hairstyle;
|
||||||
/*005*/ uint8 beard;
|
/*005*/ uint8 beard;
|
||||||
/*006*/ uint8 face;
|
/*006*/ uint8 face;
|
||||||
/*007*/ uint8 unknown007;
|
/*007*/ uint8 unused_padding;
|
||||||
/*008*/ uint32 drakkin_heritage;
|
/*008*/ uint32 drakkin_heritage;
|
||||||
/*012*/ uint32 drakkin_tattoo;
|
/*012*/ uint32 drakkin_tattoo;
|
||||||
/*016*/ uint32 drakkin_details;
|
/*016*/ uint32 drakkin_details;
|
||||||
/*020*/ uint32 unknown020;
|
/*020*/ uint32 entity_id;
|
||||||
/*024*/
|
/*024*/
|
||||||
};
|
};
|
||||||
//there are only 10 faces for barbs changing woad just
|
//there are only 10 faces for barbs changing woad just
|
||||||
@@ -4357,7 +4357,7 @@ struct DynamicZoneCompassEntry_Struct
|
|||||||
/*000*/ uint16 dz_zone_id; // target dz id pair
|
/*000*/ uint16 dz_zone_id; // target dz id pair
|
||||||
/*002*/ uint16 dz_instance_id;
|
/*002*/ uint16 dz_instance_id;
|
||||||
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
/*004*/ uint32 dz_type; // 1: Expedition, 2: Tutorial (purple), 3: Task, 4: Mission, 5: Quest (green)
|
||||||
/*008*/ uint32 unknown008;
|
/*008*/ uint32 dz_switch_id;
|
||||||
/*012*/ float y;
|
/*012*/ float y;
|
||||||
/*016*/ float x;
|
/*016*/ float x;
|
||||||
/*020*/ float z;
|
/*020*/ float z;
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ XS(XS_EQDB_field_count)
|
|||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
RETVAL = THIS->field_count();
|
RETVAL = THIS->field_count();
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH;
|
||||||
|
PUSHu((UV) RETVAL);
|
||||||
}
|
}
|
||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
@@ -84,7 +85,8 @@ XS(XS_EQDB_affected_rows)
|
|||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
RETVAL = THIS->affected_rows();
|
RETVAL = THIS->affected_rows();
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH;
|
||||||
|
PUSHu((UV) RETVAL);
|
||||||
}
|
}
|
||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
@@ -110,7 +112,8 @@ XS(XS_EQDB_insert_id)
|
|||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
RETVAL = THIS->insert_id();
|
RETVAL = THIS->insert_id();
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH;
|
||||||
|
PUSHu((UV) RETVAL);
|
||||||
}
|
}
|
||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
@@ -136,7 +139,8 @@ XS(XS_EQDB_get_errno)
|
|||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
RETVAL = THIS->get_errno();
|
RETVAL = THIS->get_errno();
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH;
|
||||||
|
PUSHu((UV) RETVAL);
|
||||||
}
|
}
|
||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
@@ -221,9 +225,6 @@ XS(XS_EQDB_escape_string)
|
|||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
#endif
|
|
||||||
XS(boot_EQDB); /* prototype to pass -Wmissing-prototypes */
|
XS(boot_EQDB); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(boot_EQDB)
|
XS(boot_EQDB)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ XS(XS_EQDBRes_num_rows)
|
|||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
RETVAL = THIS->num_rows();
|
RETVAL = THIS->num_rows();
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH;
|
||||||
|
PUSHu((UV) RETVAL);
|
||||||
}
|
}
|
||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
@@ -80,7 +81,8 @@ XS(XS_EQDBRes_num_fields)
|
|||||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
RETVAL = THIS->num_fields();
|
RETVAL = THIS->num_fields();
|
||||||
XSprePUSH; PUSHu((UV)RETVAL);
|
XSprePUSH;
|
||||||
|
PUSHu((UV) RETVAL);
|
||||||
}
|
}
|
||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
@@ -260,9 +262,6 @@ XS(XS_EQDBRes_fetch_lengths)
|
|||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
#endif
|
|
||||||
XS(boot_EQDBRes); /* prototype to pass -Wmissing-prototypes */
|
XS(boot_EQDBRes); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(boot_EQDBRes)
|
XS(boot_EQDBRes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "profanity_manager.h"
|
#include "profanity_manager.h"
|
||||||
#include "dbcore.h"
|
#include "dbcore.h"
|
||||||
|
#include "strings.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@@ -34,15 +35,17 @@ bool EQ::ProfanityManager::LoadProfanityList(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!load_database_entries(db))
|
if (!load_database_entries(db)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::UpdateProfanityList(DBcore *db) {
|
bool EQ::ProfanityManager::UpdateProfanityList(DBcore *db) {
|
||||||
if (!load_database_entries(db))
|
if (!load_database_entries(db)) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
update_originator_flag = true;
|
update_originator_flag = true;
|
||||||
|
|
||||||
@@ -58,53 +61,60 @@ bool EQ::ProfanityManager::DeleteProfanityList(DBcore *db) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::AddProfanity(DBcore *db, const char *profanity) {
|
bool EQ::ProfanityManager::AddProfanity(DBcore *db, std::string profanity) {
|
||||||
if (!db || !profanity)
|
if (!db || profanity.empty()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string entry(profanity);
|
std::string entry = Strings::ToLower(profanity);
|
||||||
|
|
||||||
std::transform(entry.begin(), entry.end(), entry.begin(), [](unsigned char c) -> unsigned char { return tolower(c); });
|
if (check_for_existing_entry(entry)) {
|
||||||
|
|
||||||
if (check_for_existing_entry(entry.c_str()))
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (entry.length() < REDACTION_LENGTH_MIN)
|
if (entry.length() < REDACTION_LENGTH_MIN) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
profanity_list.push_back(entry);
|
profanity_list.push_back(entry);
|
||||||
|
|
||||||
std::string query = "REPLACE INTO `profanity_list` (`word`) VALUES ('";
|
auto query = fmt::format(
|
||||||
query.append(entry);
|
"REPLACE INTO `profanity_list` (`word`) VALUES ('{}')",
|
||||||
query.append("')");
|
profanity
|
||||||
|
);
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
|
||||||
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
update_originator_flag = true;
|
update_originator_flag = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
|
bool EQ::ProfanityManager::RemoveProfanity(DBcore *db, std::string profanity) {
|
||||||
if (!db || !profanity)
|
if (!db || profanity.empty()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string entry(profanity);
|
std::string entry = Strings::ToLower(profanity);
|
||||||
|
|
||||||
std::transform(entry.begin(), entry.end(), entry.begin(), [](unsigned char c) -> unsigned char { return tolower(c); });
|
if (!check_for_existing_entry(entry)) {
|
||||||
|
|
||||||
if (!check_for_existing_entry(entry.c_str()))
|
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
profanity_list.remove(entry);
|
profanity_list.remove(entry);
|
||||||
|
|
||||||
std::string query = "DELETE FROM `profanity_list` WHERE `word` LIKE '";
|
auto query = fmt::format(
|
||||||
query.append(entry);
|
"DELETE FROM `profanity_list` WHERE `word` = '{}'",
|
||||||
query.append("'");
|
entry
|
||||||
|
);
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
|
||||||
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
update_originator_flag = true;
|
update_originator_flag = true;
|
||||||
|
|
||||||
@@ -112,16 +122,16 @@ bool EQ::ProfanityManager::RemoveProfanity(DBcore *db, const char *profanity) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EQ::ProfanityManager::RedactMessage(char *message) {
|
void EQ::ProfanityManager::RedactMessage(char *message) {
|
||||||
if (!message)
|
if (!message) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string test_message(message);
|
std::string test_message = Strings::ToLower(message);
|
||||||
// hard-coded max length based on channel message buffer size (4096 bytes)..
|
// hard-coded max length based on channel message buffer size (4096 bytes)..
|
||||||
// ..will need to change or remove if other sources are used for redaction
|
// ..will need to change or remove if other sources are used for redaction
|
||||||
if (test_message.length() < REDACTION_LENGTH_MIN || test_message.length() >= 4096)
|
if (test_message.length() < REDACTION_LENGTH_MIN || test_message.length() >= 4096) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
std::transform(test_message.begin(), test_message.end(), test_message.begin(), [](unsigned char c) -> unsigned char { return tolower(c); });
|
|
||||||
|
|
||||||
for (const auto &iter : profanity_list) { // consider adding textlink checks if it becomes an issue
|
for (const auto &iter : profanity_list) { // consider adding textlink checks if it becomes an issue
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
@@ -129,13 +139,18 @@ void EQ::ProfanityManager::RedactMessage(char *message) {
|
|||||||
|
|
||||||
while (pos != std::string::npos) {
|
while (pos != std::string::npos) {
|
||||||
pos = test_message.find(iter, start_pos);
|
pos = test_message.find(iter, start_pos);
|
||||||
if (pos == std::string::npos)
|
if (pos == std::string::npos) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((pos + iter.length()) == test_message.length() || !isalpha(test_message.at(pos + iter.length()))) {
|
if (
|
||||||
if (pos == 0 || !isalpha(test_message.at(pos - 1)))
|
(pos + iter.length()) == test_message.length() ||
|
||||||
|
!isalpha(test_message.at(pos + iter.length()))
|
||||||
|
) {
|
||||||
|
if (pos == 0 || !isalpha(test_message.at(pos - 1))) {
|
||||||
memset((message + pos), REDACTION_CHARACTER, iter.length());
|
memset((message + pos), REDACTION_CHARACTER, iter.length());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
start_pos = (pos + iter.length());
|
start_pos = (pos + iter.length());
|
||||||
}
|
}
|
||||||
@@ -143,51 +158,49 @@ void EQ::ProfanityManager::RedactMessage(char *message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void EQ::ProfanityManager::RedactMessage(std::string &message) {
|
void EQ::ProfanityManager::RedactMessage(std::string &message) {
|
||||||
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
|
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string test_message(const_cast<const std::string&>(message));
|
std::string test_message = Strings::ToLower(message);
|
||||||
|
|
||||||
std::transform(test_message.begin(), test_message.end(), test_message.begin(), [](unsigned char c) -> unsigned char { return tolower(c); });
|
for (const auto &iter : profanity_list) {
|
||||||
|
|
||||||
for (const auto &iter : profanity_list) { // consider adding textlink checks if it becomes an issue
|
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
size_t start_pos = 0;
|
size_t start_pos = 0;
|
||||||
|
|
||||||
while (pos != std::string::npos) {
|
while (pos != std::string::npos) {
|
||||||
pos = test_message.find(iter, start_pos);
|
pos = test_message.find(iter, start_pos);
|
||||||
if (pos == std::string::npos)
|
if (pos == std::string::npos) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((pos + iter.length()) == test_message.length() || !isalpha(test_message.at(pos + iter.length()))) {
|
if (
|
||||||
if (pos == 0 || !isalpha(test_message.at(pos - 1)))
|
(pos + iter.length()) == test_message.length() ||
|
||||||
|
!isalpha(test_message.at(pos + iter.length()))
|
||||||
|
) {
|
||||||
|
if (pos == 0 || !isalpha(test_message.at(pos - 1))) {
|
||||||
message.replace(pos, iter.length(), iter.length(), REDACTION_CHARACTER);
|
message.replace(pos, iter.length(), iter.length(), REDACTION_CHARACTER);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
start_pos = (pos + iter.length());
|
start_pos = (pos + iter.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::ContainsCensoredLanguage(const char *message) {
|
|
||||||
if (!message)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return ContainsCensoredLanguage(std::string(message));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool EQ::ProfanityManager::ContainsCensoredLanguage(const std::string &message) {
|
bool EQ::ProfanityManager::ContainsCensoredLanguage(const std::string &message) {
|
||||||
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096)
|
if (message.length() < REDACTION_LENGTH_MIN || message.length() >= 4096) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
std::string test_message(message);
|
std::string test_message = Strings::ToLower(message);
|
||||||
|
|
||||||
std::transform(test_message.begin(), test_message.end(), test_message.begin(), [](unsigned char c) -> unsigned char { return tolower(c); });
|
|
||||||
|
|
||||||
for (const auto &iter : profanity_list) {
|
for (const auto &iter : profanity_list) {
|
||||||
if (test_message.find(iter) != std::string::npos)
|
if (test_message.find(iter) != std::string::npos) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -197,26 +210,28 @@ const std::list<std::string> &EQ::ProfanityManager::GetProfanityList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::IsCensorshipActive() {
|
bool EQ::ProfanityManager::IsCensorshipActive() {
|
||||||
return (profanity_list.size() != 0);
|
return profanity_list.size() != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::load_database_entries(DBcore *db) {
|
bool EQ::ProfanityManager::load_database_entries(DBcore *db) {
|
||||||
if (!db)
|
if (!db) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
profanity_list.clear();
|
profanity_list.clear();
|
||||||
|
|
||||||
std::string query = "SELECT `word` FROM `profanity_list`";
|
std::string query = "SELECT `word` FROM `profanity_list`";
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row : results) {
|
||||||
if (std::strlen(row[0]) >= REDACTION_LENGTH_MIN) {
|
std::string entry = Strings::ToLower(row[0]);
|
||||||
std::string entry(row[0]);
|
if (entry.length() >= REDACTION_LENGTH_MIN) {
|
||||||
std::transform(entry.begin(), entry.end(), entry.begin(), [](unsigned char c) -> unsigned char { return tolower(c); });
|
if (!check_for_existing_entry(entry)) {
|
||||||
if (!check_for_existing_entry(entry.c_str()))
|
profanity_list.push_back(entry);
|
||||||
profanity_list.push_back((std::string)entry);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,27 +239,32 @@ bool EQ::ProfanityManager::load_database_entries(DBcore *db) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::clear_database_entries(DBcore *db) {
|
bool EQ::ProfanityManager::clear_database_entries(DBcore *db) {
|
||||||
if (!db)
|
if (!db) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
profanity_list.clear();
|
profanity_list.clear();
|
||||||
|
|
||||||
std::string query = "DELETE FROM `profanity_list`";
|
std::string query = "DELETE FROM `profanity_list`";
|
||||||
auto results = db->QueryDatabase(query);
|
auto results = db->QueryDatabase(query);
|
||||||
if (!results.Success())
|
|
||||||
|
if (!results.Success()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EQ::ProfanityManager::check_for_existing_entry(const char *profanity) {
|
bool EQ::ProfanityManager::check_for_existing_entry(std::string profanity) {
|
||||||
if (!profanity)
|
if (profanity.empty()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &iter : profanity_list) {
|
for (const auto &iter : profanity_list) {
|
||||||
if (iter.compare(profanity) == 0)
|
if (!iter.compare(profanity)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
|
||||||
class DBcore;
|
class DBcore;
|
||||||
@@ -34,13 +35,12 @@ namespace EQ
|
|||||||
static bool UpdateProfanityList(DBcore *db);
|
static bool UpdateProfanityList(DBcore *db);
|
||||||
static bool DeleteProfanityList(DBcore *db);
|
static bool DeleteProfanityList(DBcore *db);
|
||||||
|
|
||||||
static bool AddProfanity(DBcore *db, const char *profanity);
|
static bool AddProfanity(DBcore *db, std::string profanity);
|
||||||
static bool RemoveProfanity(DBcore *db, const char *profanity);
|
static bool RemoveProfanity(DBcore *db, std::string profanity);
|
||||||
|
|
||||||
static void RedactMessage(char *message);
|
static void RedactMessage(char *message);
|
||||||
static void RedactMessage(std::string &message);
|
static void RedactMessage(std::string &message);
|
||||||
|
|
||||||
static bool ContainsCensoredLanguage(const char *message);
|
|
||||||
static bool ContainsCensoredLanguage(const std::string &message);
|
static bool ContainsCensoredLanguage(const std::string &message);
|
||||||
|
|
||||||
static const std::list<std::string> &GetProfanityList();
|
static const std::list<std::string> &GetProfanityList();
|
||||||
@@ -53,7 +53,7 @@ namespace EQ
|
|||||||
private:
|
private:
|
||||||
static bool load_database_entries(DBcore *db);
|
static bool load_database_entries(DBcore *db);
|
||||||
static bool clear_database_entries(DBcore *db);
|
static bool clear_database_entries(DBcore *db);
|
||||||
static bool check_for_existing_entry(const char *profanity);
|
static bool check_for_existing_entry(std::string profanity);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "ptimer.h"
|
#include "ptimer.h"
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
#include "string_util.h"
|
#include "strings.h"
|
||||||
|
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|||||||
@@ -1,28 +1,8 @@
|
|||||||
/**
|
|
||||||
* EQEmulator: Everquest Server Emulator
|
|
||||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; version 2 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
* are required to give you total support for your newly bought product;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EQEMU_AA_ABILITY_REPOSITORY_H
|
#ifndef EQEMU_AA_ABILITY_REPOSITORY_H
|
||||||
#define EQEMU_AA_ABILITY_REPOSITORY_H
|
#define EQEMU_AA_ABILITY_REPOSITORY_H
|
||||||
|
|
||||||
#include "../database.h"
|
#include "../database.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "base/base_aa_ability_repository.h"
|
#include "base/base_aa_ability_repository.h"
|
||||||
|
|
||||||
class AaAbilityRepository: public BaseAaAbilityRepository {
|
class AaAbilityRepository: public BaseAaAbilityRepository {
|
||||||
|
|||||||
@@ -1,28 +1,8 @@
|
|||||||
/**
|
|
||||||
* EQEmulator: Everquest Server Emulator
|
|
||||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; version 2 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
* are required to give you total support for your newly bought product;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
|
#ifndef EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
|
||||||
#define EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
|
#define EQEMU_AA_RANK_EFFECTS_REPOSITORY_H
|
||||||
|
|
||||||
#include "../database.h"
|
#include "../database.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "base/base_aa_rank_effects_repository.h"
|
#include "base/base_aa_rank_effects_repository.h"
|
||||||
|
|
||||||
class AaRankEffectsRepository: public BaseAaRankEffectsRepository {
|
class AaRankEffectsRepository: public BaseAaRankEffectsRepository {
|
||||||
|
|||||||
@@ -1,28 +1,8 @@
|
|||||||
/**
|
|
||||||
* EQEmulator: Everquest Server Emulator
|
|
||||||
* Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; version 2 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
* are required to give you total support for your newly bought product;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
||||||
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EQEMU_AA_RANK_PREREQS_REPOSITORY_H
|
#ifndef EQEMU_AA_RANK_PREREQS_REPOSITORY_H
|
||||||
#define EQEMU_AA_RANK_PREREQS_REPOSITORY_H
|
#define EQEMU_AA_RANK_PREREQS_REPOSITORY_H
|
||||||
|
|
||||||
#include "../database.h"
|
#include "../database.h"
|
||||||
#include "../string_util.h"
|
#include "../strings.h"
|
||||||
#include "base/base_aa_rank_prereqs_repository.h"
|
#include "base/base_aa_rank_prereqs_repository.h"
|
||||||
|
|
||||||
class AaRankPrereqsRepository: public BaseAaRankPrereqsRepository {
|
class AaRankPrereqsRepository: public BaseAaRankPrereqsRepository {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user