mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
Compare commits
549 Commits
hp-fix
...
xackery/test
| Author | SHA1 | Date | |
|---|---|---|---|
| f37e0c3214 | |||
| 01b498f9c2 | |||
| e0f9d9a8db | |||
| 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 | |||
| 27f8ae3999 | |||
| 80a891e541 | |||
| 776449aa3d | |||
| cef352f0ac | |||
| e8607a0c78 | |||
| 9c55cf9a8e | |||
| a9d1034298 | |||
| 8b83a13560 | |||
| 3c87480553 | |||
| 1a69218045 | |||
| e870ee5e0e | |||
| 908c6c18af | |||
| f591378ed3 | |||
| 0997a8a31e | |||
| 0bf6627fb0 | |||
| fb8539e679 | |||
| f8c2e85f3e | |||
| 110d2a0e10 | |||
| 8d9415191a | |||
| 7178a7e55d | |||
| 9e8d03d92d | |||
| f4a70eff43 | |||
| f9ec45c7ff | |||
| cf8bf9e4fc | |||
| 575237d764 | |||
| e12e8df3ef | |||
| 8d7b7d6cc4 | |||
| 6f79ea117c | |||
| 7b022502da | |||
| 4a376b7859 | |||
| 87cdf7feb1 | |||
| caf32290b8 | |||
| 7d495c56b3 | |||
| dc1c7bb284 | |||
| a6c85babfc | |||
| cbea7045fa | |||
| 099759c477 | |||
| 65197ac027 | |||
| e4bd6f5bd2 | |||
| acf5836253 | |||
| 17c8e8414c | |||
| 239033a269 | |||
| fa07064466 | |||
| 994ef712b2 | |||
| 33c30d3cbb | |||
| d9c8e80bca | |||
| 990729fe21 | |||
| aac0dd2993 | |||
| b17c24d2df | |||
| 32d606c667 | |||
| 6661672e2d | |||
| b5391b9110 | |||
| e306059f43 | |||
| a64e326c68 | |||
| 605b3d3a27 | |||
| 248e6d44db | |||
| 328a94e2d4 | |||
| 211196a722 | |||
| 0b283e60db | |||
| 90871cb3d9 | |||
| bf92845a4a | |||
| f8cbc2faed | |||
| 30fdb18945 | |||
| 062fb73f03 | |||
| 194c71727d | |||
| e1de3d2ae0 | |||
| 7f497f9d32 | |||
| 1cdb1816a2 | |||
| bc82b897c5 | |||
| beb4de0b45 | |||
| 785926a584 | |||
| 5c7972345a | |||
| 886f00ed50 | |||
| b983fac860 | |||
| 7b6decaef3 | |||
| 8d8301fbd7 | |||
| b4aa401210 | |||
| f1bfd6bc2a | |||
| 8c95323728 | |||
| 5874deeffc | |||
| 18cc648c8d | |||
| 9d515b20f2 | |||
| 17aaab1f9d | |||
| 6e26e8953c | |||
| e4138b871b | |||
| 4ac525afc2 | |||
| 05782433b8 | |||
| 9af7122b1d | |||
| 9e7a763482 | |||
| 1231d44b55 | |||
| 873f1f7f34 | |||
| d87db648c3 | |||
| 119c3d14b7 | |||
| 3cda32c213 | |||
| df3161455a | |||
| 4389f84ea5 | |||
| f9855fd097 | |||
| f912814e13 | |||
| 5738958a2a | |||
| d36d11653a | |||
| 7230714cbc | |||
| 6e5bf4b941 | |||
| fb66afd565 | |||
| ef5124d756 | |||
| 987de17e93 | |||
| 060be606e7 | |||
| 1c5f9f2e0f | |||
| 62253cc016 | |||
| 0b18671e91 | |||
| c98f3cfb4c | |||
| 624d11de4e | |||
| 5eb95a95d0 | |||
| da01156673 | |||
| 6a244f16e1 | |||
| 36d10462f7 | |||
| c30dbf6628 | |||
| 657cbbcabe | |||
| 81e7cf5a32 | |||
| edf298685e | |||
| efab0c4b6b | |||
| c838564023 | |||
| d197ee631e | |||
| 3dcddcba04 | |||
| 7823ff5336 | |||
| 11c335a015 | |||
| 07d96ad921 | |||
| 5d522b149b | |||
| 234bd89ed5 | |||
| af5cfb9bed | |||
| 426f9c337b | |||
| 5235dcee95 | |||
| 203ba2d340 | |||
| 9c67421ccc | |||
| 6669fc8214 | |||
| cef873f793 | |||
| 6a962f2591 | |||
| 91adf9c0eb | |||
| 9887580f9a | |||
| b7c62b5242 | |||
| 89a40272c6 | |||
| db369c98c8 | |||
| 10ba5d6046 | |||
| dd1a869531 | |||
| a9e23cf83a | |||
| 783c12590e | |||
| 6689b57a52 | |||
| 7029c699a0 | |||
| 3b9574af14 | |||
| 740f84dc22 | |||
| 55d45f9a98 | |||
| 61d1eeab6f | |||
| 133c1e866c | |||
| b730461894 | |||
| 8b08e22dbc | |||
| fc7c99fb0a | |||
| f1d267bb2d | |||
| 07664eedc0 | |||
| 64b8d7c874 | |||
| ccab07bd66 | |||
| 3a76d9a28e | |||
| 5720a5020d | |||
| b3e9e2099a | |||
| 93acf50bb4 | |||
| ff46a854f9 | |||
| 8c5f26ca5e | |||
| 5560b198ca | |||
| 9a413cf553 | |||
| bb5c491794 | |||
| 2f5d360e53 | |||
| 92e03dccb9 | |||
| 5ffe6284ca | |||
| fb98349bbd | |||
| 00a22ca12e | |||
| 3883adcefc | |||
| 0762ffa3dc | |||
| b70dc64d96 | |||
| 859751f74d | |||
| 91c451b6c5 | |||
| 30c7ed7e45 | |||
| 509b6f2056 | |||
| 558bebe710 | |||
| 08a85c5dae | |||
| d22f9ee294 | |||
| 0aeaf7c3b7 | |||
| c04bcef273 | |||
| 7fcea371c2 | |||
| dd765238f7 | |||
| 2c98a11696 | |||
| d4f14efaa0 | |||
| 27787c247b | |||
| ea9c07aa98 | |||
| 5cd9bfeb70 | |||
| b699196299 | |||
| e89c2aec4a | |||
| 456fb56e82 | |||
| 03ac828134 | |||
| 34b2264d5d | |||
| 933ede40f9 | |||
| 881dc33c9b | |||
| 3faa0d2603 | |||
| 1ce5087e2a | |||
| bf8d94eb35 | |||
| 9aac12f517 | |||
| 7b969173f4 | |||
| ca77d22035 | |||
| ad3bf35397 | |||
| 9b06221be0 | |||
| c0de178173 | |||
| 6a5face0aa | |||
| c15c54e920 | |||
| 24c079dca4 | |||
| 8eef7bb283 | |||
| 80493719f2 | |||
| df9d6bc506 | |||
| 71870cbd1c | |||
| f715ccd368 | |||
| 46edd56acc | |||
| 442850aebb | |||
| d4e752987e | |||
| 9c6a85ff16 | |||
| fa8d8eccc2 | |||
| 6e76f89ca2 | |||
| 9589bf6bf8 | |||
| ce5fa9502f | |||
| 7b1b05a35c | |||
| 38a86edc70 | |||
| 56b9b6f2c4 | |||
| 97dcba70cf | |||
| 6b93130c13 | |||
| 94c1a50cc8 | |||
| 31ab1d4287 | |||
| b6ba493450 | |||
| c613db2338 | |||
| 05ac8499df | |||
| 69244a094d | |||
| 1155673642 | |||
| 930079959c |
@@ -54,3 +54,5 @@ bin/
|
|||||||
/Win32
|
/Win32
|
||||||
/x64
|
/x64
|
||||||
/client_files/**/CMakeFiles/
|
/client_files/**/CMakeFiles/
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|||||||
Vendored
+116
@@ -0,0 +1,116 @@
|
|||||||
|
{
|
||||||
|
//"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*"
|
||||||
|
"testMate.cpp.test.executables": "{build,Build,BUILD,out,Out,OUT}/**/*zone{test,Test,TEST}*",
|
||||||
|
"cmake.configureSettings": {
|
||||||
|
//"EQEMU_BUILD_SERVER": "ON",
|
||||||
|
"EQEMU_BUILD_LUA": "ON"
|
||||||
|
},
|
||||||
|
"files.associations": {
|
||||||
|
"chrono": "cpp",
|
||||||
|
"functional": "cpp",
|
||||||
|
"algorithm": "cpp",
|
||||||
|
"any": "cpp",
|
||||||
|
"array": "cpp",
|
||||||
|
"atomic": "cpp",
|
||||||
|
"bit": "cpp",
|
||||||
|
"bitset": "cpp",
|
||||||
|
"cctype": "cpp",
|
||||||
|
"cfenv": "cpp",
|
||||||
|
"charconv": "cpp",
|
||||||
|
"cinttypes": "cpp",
|
||||||
|
"clocale": "cpp",
|
||||||
|
"cmath": "cpp",
|
||||||
|
"codecvt": "cpp",
|
||||||
|
"compare": "cpp",
|
||||||
|
"complex": "cpp",
|
||||||
|
"concepts": "cpp",
|
||||||
|
"condition_variable": "cpp",
|
||||||
|
"coroutine": "cpp",
|
||||||
|
"csetjmp": "cpp",
|
||||||
|
"csignal": "cpp",
|
||||||
|
"cstdarg": "cpp",
|
||||||
|
"cstddef": "cpp",
|
||||||
|
"cstdint": "cpp",
|
||||||
|
"cstdio": "cpp",
|
||||||
|
"cstdlib": "cpp",
|
||||||
|
"cstring": "cpp",
|
||||||
|
"ctime": "cpp",
|
||||||
|
"cwchar": "cpp",
|
||||||
|
"cwctype": "cpp",
|
||||||
|
"deque": "cpp",
|
||||||
|
"exception": "cpp",
|
||||||
|
"execution": "cpp",
|
||||||
|
"resumable": "cpp",
|
||||||
|
"filesystem": "cpp",
|
||||||
|
"format": "cpp",
|
||||||
|
"forward_list": "cpp",
|
||||||
|
"fstream": "cpp",
|
||||||
|
"future": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"iomanip": "cpp",
|
||||||
|
"ios": "cpp",
|
||||||
|
"iosfwd": "cpp",
|
||||||
|
"iostream": "cpp",
|
||||||
|
"istream": "cpp",
|
||||||
|
"iterator": "cpp",
|
||||||
|
"limits": "cpp",
|
||||||
|
"list": "cpp",
|
||||||
|
"locale": "cpp",
|
||||||
|
"map": "cpp",
|
||||||
|
"memory": "cpp",
|
||||||
|
"memory_resource": "cpp",
|
||||||
|
"mutex": "cpp",
|
||||||
|
"new": "cpp",
|
||||||
|
"numeric": "cpp",
|
||||||
|
"optional": "cpp",
|
||||||
|
"ostream": "cpp",
|
||||||
|
"queue": "cpp",
|
||||||
|
"random": "cpp",
|
||||||
|
"ratio": "cpp",
|
||||||
|
"regex": "cpp",
|
||||||
|
"scoped_allocator": "cpp",
|
||||||
|
"set": "cpp",
|
||||||
|
"shared_mutex": "cpp",
|
||||||
|
"source_location": "cpp",
|
||||||
|
"sstream": "cpp",
|
||||||
|
"stack": "cpp",
|
||||||
|
"stdexcept": "cpp",
|
||||||
|
"stop_token": "cpp",
|
||||||
|
"streambuf": "cpp",
|
||||||
|
"string": "cpp",
|
||||||
|
"strstream": "cpp",
|
||||||
|
"system_error": "cpp",
|
||||||
|
"thread": "cpp",
|
||||||
|
"tuple": "cpp",
|
||||||
|
"type_traits": "cpp",
|
||||||
|
"typeindex": "cpp",
|
||||||
|
"typeinfo": "cpp",
|
||||||
|
"unordered_map": "cpp",
|
||||||
|
"unordered_set": "cpp",
|
||||||
|
"utility": "cpp",
|
||||||
|
"valarray": "cpp",
|
||||||
|
"variant": "cpp",
|
||||||
|
"vector": "cpp",
|
||||||
|
"xfacet": "cpp",
|
||||||
|
"xhash": "cpp",
|
||||||
|
"xiosbase": "cpp",
|
||||||
|
"xlocale": "cpp",
|
||||||
|
"xlocbuf": "cpp",
|
||||||
|
"xlocinfo": "cpp",
|
||||||
|
"xlocmes": "cpp",
|
||||||
|
"xlocmon": "cpp",
|
||||||
|
"xlocnum": "cpp",
|
||||||
|
"xloctime": "cpp",
|
||||||
|
"xmemory": "cpp",
|
||||||
|
"xstddef": "cpp",
|
||||||
|
"xstring": "cpp",
|
||||||
|
"xtr1common": "cpp",
|
||||||
|
"xtree": "cpp",
|
||||||
|
"xutility": "cpp",
|
||||||
|
"*.tcc": "cpp",
|
||||||
|
"string_view": "cpp",
|
||||||
|
"rope": "cpp",
|
||||||
|
"slist": "cpp",
|
||||||
|
"*.ipp": "cpp"
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
-1
@@ -127,7 +127,7 @@ 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)
|
||||||
OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
|
OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON)
|
||||||
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
|
OPTION(EQEMU_BUILD_HC "Build the headless client." OFF)
|
||||||
OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF)
|
OPTION(EQEMU_BUILD_TESTS "Build zone tests." ON)
|
||||||
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
|
||||||
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
|
OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF)
|
||||||
|
|
||||||
@@ -224,6 +224,9 @@ IF(OpenSSL_FOUND AND MBEDTLS_FOUND)
|
|||||||
SET(TLS_LIBRARY_LIBS ${OPENSSL_LIBRARIES})
|
SET(TLS_LIBRARY_LIBS ${OPENSSL_LIBRARIES})
|
||||||
SET(TLS_LIBRARY_INCLUDE ${OPENSSL_INCLUDE_DIR})
|
SET(TLS_LIBRARY_INCLUDE ${OPENSSL_INCLUDE_DIR})
|
||||||
ADD_DEFINITIONS(-DEQEMU_USE_OPENSSL)
|
ADD_DEFINITIONS(-DEQEMU_USE_OPENSSL)
|
||||||
|
IF(${OPENSSL_VERSION} VERSION_GREATER_EQUAL "1.1.1")
|
||||||
|
ADD_DEFINITIONS(-DCPPHTTPLIB_OPENSSL_SUPPORT)
|
||||||
|
ENDIF()
|
||||||
ELSEIF(TLS_LIBRARY_SELECTION STREQUAL "mbedTLS")
|
ELSEIF(TLS_LIBRARY_SELECTION STREQUAL "mbedTLS")
|
||||||
SET(TLS_LIBRARY_TYPE " mbedTLS")
|
SET(TLS_LIBRARY_TYPE " mbedTLS")
|
||||||
SET(TLS_LIBRARY_ENABLED ON)
|
SET(TLS_LIBRARY_ENABLED ON)
|
||||||
@@ -439,6 +442,7 @@ ENDIF(EQEMU_BUILD_HC)
|
|||||||
|
|
||||||
IF(EQEMU_BUILD_TESTS)
|
IF(EQEMU_BUILD_TESTS)
|
||||||
ADD_SUBDIRECTORY(tests)
|
ADD_SUBDIRECTORY(tests)
|
||||||
|
ADD_SUBDIRECTORY(test)
|
||||||
ENDIF(EQEMU_BUILD_TESTS)
|
ENDIF(EQEMU_BUILD_TESTS)
|
||||||
|
|
||||||
IF(EQEMU_BUILD_CLIENT_FILES)
|
IF(EQEMU_BUILD_CLIENT_FILES)
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
############################################
|
############################################
|
||||||
#
|
#
|
||||||
# New changelog can be found here
|
# New changelog can be found here
|
||||||
# https://eqemu.gitbook.io/changelog/
|
# https://docs.eqemu.io/server/changelog/server
|
||||||
#
|
#
|
||||||
############################################
|
############################################
|
||||||
# Deprecated
|
# Deprecated
|
||||||
|
|||||||
@@ -526,6 +526,7 @@ SET(common_headers
|
|||||||
guild_base.h
|
guild_base.h
|
||||||
guilds.h
|
guilds.h
|
||||||
http/httplib.h
|
http/httplib.h
|
||||||
|
http/uri.h
|
||||||
inventory_profile.h
|
inventory_profile.h
|
||||||
inventory_slot.h
|
inventory_slot.h
|
||||||
ipc_mutex.h
|
ipc_mutex.h
|
||||||
@@ -638,7 +639,8 @@ SET(common_headers
|
|||||||
StackWalker/StackWalker.h
|
StackWalker/StackWalker.h
|
||||||
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
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -92,8 +131,8 @@ void WorldContentService::SetContentFlags(std::vector<std::string> content_flags
|
|||||||
*/
|
*/
|
||||||
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) {
|
||||||
|
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) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we don't have any enabled flag in enabled flags, we fail
|
||||||
|
for (const auto& flag: SplitString(f.content_flags)) {
|
||||||
|
if (!contains(GetContentFlagsEnabled(), flag)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we don't have any disabled flag in disabled flags, we fail
|
||||||
|
for (const auto& flag: SplitString(f.content_flags_disabled)) {
|
||||||
|
if (!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;
|
||||||
|
|
||||||
@@ -160,15 +162,28 @@ public:
|
|||||||
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;
|
||||||
|
|||||||
+137
-27
@@ -39,6 +39,7 @@
|
|||||||
#include "unix.h"
|
#include "unix.h"
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
@@ -46,6 +47,8 @@
|
|||||||
#include "extprofile.h"
|
#include "extprofile.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "database_schema.h"
|
#include "database_schema.h"
|
||||||
|
#include "http/httplib.h"
|
||||||
|
#include "http/uri.h"
|
||||||
|
|
||||||
extern Client client;
|
extern Client client;
|
||||||
|
|
||||||
@@ -713,7 +716,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -994,6 +997,18 @@ bool Database::SetVariable(const std::string varname, const std::string &varvalu
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Database::SetAccountCRCField(uint32 account_id, std::string field_name, uint64 checksum)
|
||||||
|
{
|
||||||
|
QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE `account` SET `{}` = '{}' WHERE `id` = {}",
|
||||||
|
field_name,
|
||||||
|
checksum,
|
||||||
|
account_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Get zone starting points from DB
|
// Get zone starting points from DB
|
||||||
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) {
|
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) {
|
||||||
|
|
||||||
@@ -2039,62 +2054,64 @@ void Database::ClearRaidLeader(uint32 gid, uint32 rid)
|
|||||||
QueryDatabase(query);
|
QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win)
|
void Database::UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win, bool remove)
|
||||||
{
|
{
|
||||||
|
|
||||||
std::string field;
|
std::string field;
|
||||||
|
switch(theme) {
|
||||||
switch(theme)
|
case LDoNThemes::GUK: {
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
field = "guk_";
|
field = "guk_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case LDoNThemes::MIR: {
|
||||||
{
|
|
||||||
field = "mir_";
|
field = "mir_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3:
|
case LDoNThemes::MMC: {
|
||||||
{
|
|
||||||
field = "mmc_";
|
field = "mmc_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case LDoNThemes::RUJ: {
|
||||||
{
|
|
||||||
field = "ruj_";
|
field = "ruj_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 5:
|
case LDoNThemes::TAK: {
|
||||||
{
|
|
||||||
field = "tak_";
|
field = "tak_";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (win)
|
field += win ? "wins" : "losses";
|
||||||
field += "wins";
|
std::string field_operation = remove ? "-" : "+";
|
||||||
else
|
|
||||||
field += "losses";
|
|
||||||
|
|
||||||
std::string query = StringFormat("UPDATE `adventure_stats` SET %s=%s+1 WHERE player_id=%u",field.c_str(), field.c_str(), char_id);
|
std::string query = fmt::format(
|
||||||
|
"UPDATE `adventure_stats` SET {} = {} {} 1 WHERE player_id = {}",
|
||||||
|
field,
|
||||||
|
field,
|
||||||
|
field_operation,
|
||||||
|
char_id
|
||||||
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
|
|
||||||
if (results.RowsAffected() != 0)
|
if (results.RowsAffected() != 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
query = StringFormat("INSERT INTO `adventure_stats` SET %s=1, player_id=%u", field.c_str(), char_id);
|
if (!remove) {
|
||||||
|
query = fmt::format(
|
||||||
|
"INSERT INTO `adventure_stats` SET {} = 1, player_id = {}",
|
||||||
|
field,
|
||||||
|
char_id
|
||||||
|
);
|
||||||
QueryDatabase(query);
|
QueryDatabase(query);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Database::GetAdventureStats(uint32 char_id, AdventureStats_Struct *as)
|
bool Database::GetAdventureStats(uint32 char_id, AdventureStats_Struct *as)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat(
|
std::string query = fmt::format(
|
||||||
"SELECT "
|
"SELECT "
|
||||||
"`guk_wins`, "
|
"`guk_wins`, "
|
||||||
"`mir_wins`, "
|
"`mir_wins`, "
|
||||||
@@ -2109,7 +2126,7 @@ bool Database::GetAdventureStats(uint32 char_id, AdventureStats_Struct *as)
|
|||||||
"FROM "
|
"FROM "
|
||||||
"`adventure_stats` "
|
"`adventure_stats` "
|
||||||
"WHERE "
|
"WHERE "
|
||||||
"player_id = %u ",
|
"player_id = {}",
|
||||||
char_id
|
char_id
|
||||||
);
|
);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@@ -2268,6 +2285,35 @@ int Database::GetIPExemption(std::string account_ip) {
|
|||||||
return RuleI(World, MaxClientsPerIP);
|
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
|
||||||
|
);
|
||||||
|
|
||||||
|
auto results = QueryDatabase(query);
|
||||||
|
uint32 exemption_id = 0;
|
||||||
|
if (results.Success() && results.RowCount() > 0) {
|
||||||
|
auto row = results.begin();
|
||||||
|
exemption_id = atoi(row[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
query = fmt::format(
|
||||||
|
"INSERT INTO `ip_exemptions` (`exemption_ip`, `exemption_amount`) VALUES ('{}', {})",
|
||||||
|
account_ip,
|
||||||
|
exemption_amount
|
||||||
|
);
|
||||||
|
|
||||||
|
if (exemption_id != 0) {
|
||||||
|
query = fmt::format(
|
||||||
|
"UPDATE `ip_exemptions` SET `exemption_amount` = {} WHERE `exemption_ip` = '{}'",
|
||||||
|
exemption_amount,
|
||||||
|
account_ip
|
||||||
|
);
|
||||||
|
}
|
||||||
|
QueryDatabase(query);
|
||||||
|
}
|
||||||
|
|
||||||
int Database::GetInstanceID(uint32 char_id, uint32 zone_id) {
|
int Database::GetInstanceID(uint32 char_id, uint32 zone_id) {
|
||||||
std::string query = StringFormat("SELECT instance_list.id FROM instance_list INNER JOIN instance_list_player ON instance_list.id = instance_list_player.id WHERE instance_list.zone = '%i' AND instance_list_player.charid = '%i'", zone_id, char_id);
|
std::string query = StringFormat("SELECT instance_list.id FROM instance_list INNER JOIN instance_list_player ON instance_list.id = instance_list_player.id WHERE instance_list.zone = '%i' AND instance_list_player.charid = '%i'", zone_id, char_id);
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
@@ -2418,3 +2464,67 @@ bool Database::CopyCharacter(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Database::SourceDatabaseTableFromUrl(std::string table_name, std::string url)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
uri request_uri(url);
|
||||||
|
|
||||||
|
LogHTTP(
|
||||||
|
"[SourceDatabaseTableFromUrl] parsing url [{}] path [{}] host [{}] query_string [{}] protocol [{}] port [{}]",
|
||||||
|
url,
|
||||||
|
request_uri.get_path(),
|
||||||
|
request_uri.get_host(),
|
||||||
|
request_uri.get_query(),
|
||||||
|
request_uri.get_scheme(),
|
||||||
|
request_uri.get_port()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!DoesTableExist(table_name)) {
|
||||||
|
LogMySQLQuery("Table [{}] does not exist. Downloading from Github and installing...", table_name);
|
||||||
|
|
||||||
|
// http get request
|
||||||
|
httplib::Client cli(
|
||||||
|
fmt::format(
|
||||||
|
"{}://{}",
|
||||||
|
request_uri.get_scheme(),
|
||||||
|
request_uri.get_host()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
cli.set_connection_timeout(0, 60000000); // 60 sec
|
||||||
|
cli.set_read_timeout(60, 0); // 60 seconds
|
||||||
|
cli.set_write_timeout(60, 0); // 60 seconds
|
||||||
|
|
||||||
|
int sourced_queries = 0;
|
||||||
|
|
||||||
|
if (auto res = cli.Get(request_uri.get_path().c_str())) {
|
||||||
|
if (res->status == 200) {
|
||||||
|
for (auto &s: SplitString(res->body, ';')) {
|
||||||
|
if (!trim(s).empty()) {
|
||||||
|
auto results = QueryDatabase(s);
|
||||||
|
if (!results.ErrorMessage().empty()) {
|
||||||
|
LogError("Error sourcing SQL [{}]", results.ErrorMessage());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
sourced_queries++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
LogError("Error retrieving URL [{}]", url);
|
||||||
|
}
|
||||||
|
|
||||||
|
LogMySQLQuery(
|
||||||
|
"Table [{}] installed. Sourced [{}] queries",
|
||||||
|
table_name,
|
||||||
|
sourced_queries
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (std::invalid_argument iae) {
|
||||||
|
LogError("[SourceDatabaseTableFromUrl] URI parser error [{}]", iae.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -176,7 +176,7 @@ public:
|
|||||||
|
|
||||||
/* Adventure related. */
|
/* Adventure related. */
|
||||||
|
|
||||||
void UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win);
|
void UpdateAdventureStatsEntry(uint32 char_id, uint8 theme, bool win = false, bool remove = false);
|
||||||
bool GetAdventureStats(uint32 char_id, AdventureStats_Struct *as);
|
bool GetAdventureStats(uint32 char_id, AdventureStats_Struct *as);
|
||||||
|
|
||||||
/* Account Related */
|
/* Account Related */
|
||||||
@@ -190,6 +190,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);
|
||||||
@@ -199,6 +201,7 @@ public:
|
|||||||
void SetAgreementFlag(uint32 acctid);
|
void SetAgreementFlag(uint32 acctid);
|
||||||
|
|
||||||
int GetIPExemption(std::string account_ip);
|
int GetIPExemption(std::string account_ip);
|
||||||
|
void SetIPExemption(std::string account_ip, int exemption_amount);
|
||||||
|
|
||||||
int GetInstanceID(uint32 char_id, uint32 zone_id);
|
int GetInstanceID(uint32 char_id, uint32 zone_id);
|
||||||
|
|
||||||
@@ -269,6 +272,8 @@ public:
|
|||||||
int CountInvSnapshots();
|
int CountInvSnapshots();
|
||||||
void ClearInvSnapshots(bool from_now = false);
|
void ClearInvSnapshots(bool from_now = false);
|
||||||
|
|
||||||
|
void SourceDatabaseTableFromUrl(std::string table_name, std::string url);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -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]);
|
||||||
|
|||||||
@@ -82,7 +82,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"}
|
||||||
};
|
};
|
||||||
@@ -158,7 +157,6 @@ namespace DatabaseSchema {
|
|||||||
"spell_buckets",
|
"spell_buckets",
|
||||||
"spell_globals",
|
"spell_globals",
|
||||||
"timers",
|
"timers",
|
||||||
"titles",
|
|
||||||
"trader",
|
"trader",
|
||||||
"trader_audit",
|
"trader_audit",
|
||||||
"zone_flags"
|
"zone_flags"
|
||||||
@@ -270,6 +268,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",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -561,9 +561,10 @@ 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()
|
||||||
{
|
{
|
||||||
|
|||||||
+231
-1
@@ -18,6 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "emu_constants.h"
|
#include "emu_constants.h"
|
||||||
|
#include "languages.h"
|
||||||
|
#include "data_verification.h"
|
||||||
|
#include "bodytypes.h"
|
||||||
|
|
||||||
|
|
||||||
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
int16 EQ::invtype::GetInvTypeSize(int16 inv_type) {
|
||||||
@@ -147,8 +150,235 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::map<int, std::string>& EQ::constants::GetLanguageMap()
|
||||||
|
{
|
||||||
|
static const std::map<int, std::string> language_map = {
|
||||||
|
{ LANG_COMMON_TONGUE, "Common Tongue" },
|
||||||
|
{ LANG_BARBARIAN, "Barbarian" },
|
||||||
|
{ LANG_ERUDIAN, "Erudian" },
|
||||||
|
{ LANG_ELVISH, "Elvish" },
|
||||||
|
{ LANG_DARK_ELVISH, "Dark Elvish" },
|
||||||
|
{ LANG_DWARVISH, "Dwarvish" },
|
||||||
|
{ LANG_TROLL, "Troll" },
|
||||||
|
{ LANG_OGRE, "Ogre" },
|
||||||
|
{ LANG_GNOMISH, "Gnomish" },
|
||||||
|
{ LANG_HALFLING, "Halfling" },
|
||||||
|
{ LANG_THIEVES_CANT, "Thieves Cant" },
|
||||||
|
{ LANG_OLD_ERUDIAN, "Old Erudian" },
|
||||||
|
{ LANG_ELDER_ELVISH, "Elder Elvish" },
|
||||||
|
{ LANG_FROGLOK, "Froglok" },
|
||||||
|
{ LANG_GOBLIN, "Goblin" },
|
||||||
|
{ LANG_GNOLL, "Gnoll" },
|
||||||
|
{ LANG_COMBINE_TONGUE, "Combine Tongue" },
|
||||||
|
{ LANG_ELDER_TEIRDAL, "Elder Teirdal" },
|
||||||
|
{ LANG_LIZARDMAN, "Lizardman" },
|
||||||
|
{ LANG_ORCISH, "Orcish" },
|
||||||
|
{ LANG_FAERIE, "Faerie" },
|
||||||
|
{ LANG_DRAGON, "Dragon" },
|
||||||
|
{ LANG_ELDER_DRAGON, "Elder Dragon" },
|
||||||
|
{ LANG_DARK_SPEECH, "Dark Speech" },
|
||||||
|
{ LANG_VAH_SHIR, "Vah Shir" },
|
||||||
|
{ LANG_ALARAN, "Alaran" },
|
||||||
|
{ LANG_HADAL, "Hadal" },
|
||||||
|
{ LANG_UNKNOWN, "Unknown" }
|
||||||
|
};
|
||||||
|
return language_map;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string EQ::constants::GetLanguageName(int language_id)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
|
||||||
|
auto languages = EQ::constants::GetLanguageMap();
|
||||||
|
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)) {
|
||||||
|
auto ldon_themes = EQ::constants::GetLDoNThemeMap();
|
||||||
|
return ldon_themes[theme_id];
|
||||||
|
}
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::map<uint8, std::string>& EQ::constants::GetFlyModeMap()
|
||||||
|
{
|
||||||
|
static const std::map<uint8, 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(uint8 flymode_id)
|
||||||
|
{
|
||||||
|
if (EQ::ValueWithin(flymode_id, GravityBehavior::Ground, GravityBehavior::LevitateWhileRunning)) {
|
||||||
|
auto flymodes = EQ::constants::GetFlyModeMap();
|
||||||
|
return flymodes[flymode_id];
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
auto bodytypes = EQ::constants::GetBodyTypeMap();
|
||||||
|
if (!bodytypes[bodytype_id].empty()) {
|
||||||
|
return bodytypes[bodytype_id];
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
auto account_statuses = EQ::constants::GetAccountStatusMap();
|
||||||
|
std::string status_name;
|
||||||
|
for (auto status_level = account_statuses.rbegin(); status_level != account_statuses.rend(); ++status_level) {
|
||||||
|
if (account_status >= status_level->first) {
|
||||||
|
status_name = status_level->second;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return status_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
auto consider_levels = EQ::constants::GetConsiderLevelMap();
|
||||||
|
if (!consider_levels[faction_consider_level].empty()) {
|
||||||
|
return consider_levels[faction_consider_level];
|
||||||
|
}
|
||||||
|
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)) {
|
||||||
|
auto damage_types = EQ::constants::GetEnvironmentalDamageMap();
|
||||||
|
return damage_types[damage_type];
|
||||||
|
}
|
||||||
|
return std::string();
|
||||||
|
}
|
||||||
|
|||||||
+89
-7
@@ -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>
|
||||||
|
|
||||||
@@ -220,9 +221,46 @@ namespace EQ
|
|||||||
stanceBurnAE
|
stanceBurnAE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum GravityBehavior : uint8 {
|
||||||
|
Ground,
|
||||||
|
Flying,
|
||||||
|
Levitating,
|
||||||
|
Water,
|
||||||
|
Floating,
|
||||||
|
LevitateWhileRunning
|
||||||
|
};
|
||||||
|
|
||||||
|
enum EnvironmentalDamage : uint8 {
|
||||||
|
Lava = 250,
|
||||||
|
Drowning,
|
||||||
|
Falling,
|
||||||
|
Trap
|
||||||
|
};
|
||||||
|
|
||||||
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();
|
||||||
|
std::string GetLanguageName(int language_id);
|
||||||
|
|
||||||
|
extern const std::map<uint32, std::string>& GetLDoNThemeMap();
|
||||||
|
std::string GetLDoNThemeName(uint32 theme_id);
|
||||||
|
|
||||||
|
extern const std::map<uint8, std::string>& GetFlyModeMap();
|
||||||
|
std::string GetFlyModeName(uint8 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);
|
||||||
|
|
||||||
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;
|
||||||
@@ -325,13 +363,57 @@ 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
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EMU_CONSTANTS_H*/
|
#endif /*COMMON_EMU_CONSTANTS_H*/
|
||||||
|
|
||||||
/* hack list to prevent circular references
|
|
||||||
|
|
||||||
eq_limits.h:EQ::inventory::LookupEntry::InventoryTypeSize[n];
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|||||||
+3
-2
@@ -129,8 +129,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),
|
||||||
@@ -558,6 +558,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),
|
||||||
|
|||||||
@@ -974,4 +974,39 @@ enum class DynamicZoneMemberStatus : uint8_t
|
|||||||
LinkDead
|
LinkDead
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum LDoNThemes {
|
||||||
|
Unused = 0,
|
||||||
|
GUK,
|
||||||
|
MIR,
|
||||||
|
MMC,
|
||||||
|
RUJ,
|
||||||
|
TAK
|
||||||
|
};
|
||||||
|
|
||||||
|
enum LDoNThemeBits {
|
||||||
|
UnusedBit = 0,
|
||||||
|
GUKBit = 1,
|
||||||
|
MIRBit = 2,
|
||||||
|
MMCBit = 4,
|
||||||
|
RUJBit = 8,
|
||||||
|
TAKBit = 16
|
||||||
|
};
|
||||||
|
|
||||||
|
enum StartZoneIndex {
|
||||||
|
Odus = 0,
|
||||||
|
Qeynos,
|
||||||
|
Halas,
|
||||||
|
Rivervale,
|
||||||
|
Freeport,
|
||||||
|
Neriak,
|
||||||
|
Grobb,
|
||||||
|
Oggok,
|
||||||
|
Kaladim,
|
||||||
|
GreaterFaydark,
|
||||||
|
Felwithe,
|
||||||
|
Akanon,
|
||||||
|
Cabilis,
|
||||||
|
SharVahl
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
@@ -384,7 +384,9 @@ struct NewZone_Struct {
|
|||||||
/*0716*/ uint32 FastRegenEndurance;
|
/*0716*/ uint32 FastRegenEndurance;
|
||||||
/*0720*/ uint32 NPCAggroMaxDist;
|
/*0720*/ uint32 NPCAggroMaxDist;
|
||||||
/*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*/
|
/*0728*/ uint32 LavaDamage; // Seen 50
|
||||||
|
/*0732*/ uint32 MinLavaDamage; // Seen 10
|
||||||
|
/*0736*/
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -446,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
|
||||||
@@ -2759,7 +2762,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;
|
||||||
@@ -4340,8 +4343,8 @@ struct AARankPrereq_Struct
|
|||||||
struct AARankEffect_Struct
|
struct AARankEffect_Struct
|
||||||
{
|
{
|
||||||
int32 effect_id;
|
int32 effect_id;
|
||||||
int32 base1;
|
int32 base_value;
|
||||||
int32 base2;
|
int32 limit_value;
|
||||||
int32 slot;
|
int32 slot;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -4349,8 +4352,8 @@ struct AARankEffect_Struct
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5579,6 +5582,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;
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ void EQEmuConfig::parse_config()
|
|||||||
if (_root["server"]["world"]["loginserver"].get("legacy", "0").asString() == "1") { LoginLegacy = true; }
|
if (_root["server"]["world"]["loginserver"].get("legacy", "0").asString() == "1") { LoginLegacy = true; }
|
||||||
LoginAccount = _root["server"]["world"]["loginserver"].get("account", "").asString();
|
LoginAccount = _root["server"]["world"]["loginserver"].get("account", "").asString();
|
||||||
LoginPassword = _root["server"]["world"]["loginserver"].get("password", "").asString();
|
LoginPassword = _root["server"]["world"]["loginserver"].get("password", "").asString();
|
||||||
|
|
||||||
|
// at least today, this is wrong a majority of the time
|
||||||
|
// remove this if eqemulator ever upgrades its loginserver
|
||||||
|
if (LoginHost.find("login.eqemulator.net") != std::string::npos) {
|
||||||
|
LoginLegacy = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char str[32];
|
char str[32];
|
||||||
@@ -62,6 +68,13 @@ void EQEmuConfig::parse_config()
|
|||||||
|
|
||||||
loginconfig->LoginLegacy = false;
|
loginconfig->LoginLegacy = false;
|
||||||
if (_root["server"]["world"][str].get("legacy", "0").asString() == "1") { loginconfig->LoginLegacy = true; }
|
if (_root["server"]["world"][str].get("legacy", "0").asString() == "1") { loginconfig->LoginLegacy = true; }
|
||||||
|
|
||||||
|
// at least today, this is wrong a majority of the time
|
||||||
|
// remove this if eqemulator ever upgrades its loginserver
|
||||||
|
if (loginconfig->LoginHost.find("login.eqemulator.net") != std::string::npos) {
|
||||||
|
loginconfig->LoginLegacy = true;
|
||||||
|
}
|
||||||
|
|
||||||
loginlist.Insert(loginconfig);
|
loginlist.Insert(loginconfig);
|
||||||
} while (LoginCount < 100);
|
} while (LoginCount < 100);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,10 @@ EQEmuLogSys *EQEmuLogSys::LoadLogSettingsDefaults()
|
|||||||
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
|
log_settings[Logs::Loot].log_to_gmsay = static_cast<uint8>(Logs::General);
|
||||||
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
|
log_settings[Logs::Scheduler].log_to_console = static_cast<uint8>(Logs::General);
|
||||||
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_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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RFC 5424
|
* RFC 5424
|
||||||
@@ -465,7 +469,7 @@ void EQEmuLogSys::Out(
|
|||||||
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}] ", base_file_name(file), line);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|||||||
@@ -125,6 +125,9 @@ namespace Logs {
|
|||||||
Cheat,
|
Cheat,
|
||||||
ClientList,
|
ClientList,
|
||||||
DiaWind,
|
DiaWind,
|
||||||
|
HTTP,
|
||||||
|
Saylink,
|
||||||
|
ChecksumVerification,
|
||||||
MaxCategoryID /* Don't Remove this */
|
MaxCategoryID /* Don't Remove this */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -208,6 +211,9 @@ namespace Logs {
|
|||||||
"Cheat",
|
"Cheat",
|
||||||
"ClientList",
|
"ClientList",
|
||||||
"DialogueWindow",
|
"DialogueWindow",
|
||||||
|
"HTTP",
|
||||||
|
"Saylink",
|
||||||
|
"ChecksumVerification",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -676,6 +676,36 @@
|
|||||||
OutF(LogSys, Logs::Detail, Logs::DiaWind, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
OutF(LogSys, Logs::Detail, Logs::DiaWind, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHTTP(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::HTTP].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::HTTP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHTTPDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::HTTP].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::HTTP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSaylink(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Saylink].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::General, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSaylinkDetail(message, ...) do {\
|
||||||
|
if (LogSys.log_settings[Logs::Saylink].is_category_enabled == 1)\
|
||||||
|
OutF(LogSys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||||
|
} 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 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__);\
|
||||||
@@ -1066,6 +1096,24 @@
|
|||||||
#define LogDiaWindDetail(message, ...) do {\
|
#define LogDiaWindDetail(message, ...) do {\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHTTP(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogHTTPDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSaylink(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogSaylinkDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogChecksumVerification(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LogChecksumVerificationDetail(message, ...) do {\
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define Log(debug_level, log_category, message, ...) do {\
|
#define Log(debug_level, log_category, message, ...) do {\
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
+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;
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-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,6 @@ struct NPCFaction
|
|||||||
uint8 temp;
|
uint8 temp;
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *FactionValueToString(FACTION_VALUE fv);
|
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
|
||||||
|
|||||||
+66
-6
@@ -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;
|
||||||
|
|||||||
@@ -0,0 +1,633 @@
|
|||||||
|
// Copyright (C) 2015 Ben Lewis <benjf5+github@gmail.com>
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
// https://github.com/ben-zen/uri-library
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cctype>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
class uri {
|
||||||
|
/* URIs are broadly divided into two categories: hierarchical and
|
||||||
|
* non-hierarchical. Both hierarchical URIs and non-hierarchical URIs have a
|
||||||
|
* few elements in common; all URIs have a scheme of one or more alphanumeric
|
||||||
|
* characters followed by a colon, and they all may optionally have a query
|
||||||
|
* component preceded by a question mark, and a fragment component preceded by
|
||||||
|
* an octothorpe (hash mark: '#'). The query consists of stanzas separated by
|
||||||
|
* either ampersands ('&') or semicolons (';') (but only one or the other),
|
||||||
|
* and each stanza consists of a key and an optional value; if the value
|
||||||
|
* exists, the key and value must be divided by an equals sign.
|
||||||
|
*
|
||||||
|
* The following is an example from Wikipedia of a hierarchical URI:
|
||||||
|
* scheme:[//[user:password@]domain[:port]][/]path[?query][#fragment]
|
||||||
|
*/
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
enum class scheme_category {
|
||||||
|
Hierarchical,
|
||||||
|
NonHierarchical
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class component {
|
||||||
|
Scheme,
|
||||||
|
Content,
|
||||||
|
Username,
|
||||||
|
Password,
|
||||||
|
Host,
|
||||||
|
Port,
|
||||||
|
Path,
|
||||||
|
Query,
|
||||||
|
Fragment
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class query_argument_separator {
|
||||||
|
ampersand,
|
||||||
|
semicolon
|
||||||
|
};
|
||||||
|
|
||||||
|
uri(
|
||||||
|
char const *uri_text, scheme_category category = scheme_category::Hierarchical,
|
||||||
|
query_argument_separator separator = query_argument_separator::ampersand
|
||||||
|
) :
|
||||||
|
m_category(category),
|
||||||
|
m_path_is_rooted(false),
|
||||||
|
m_port(0),
|
||||||
|
m_separator(separator)
|
||||||
|
{
|
||||||
|
setup(std::string(uri_text), category);
|
||||||
|
};
|
||||||
|
|
||||||
|
uri(
|
||||||
|
std::string const &uri_text, scheme_category category = scheme_category::Hierarchical,
|
||||||
|
query_argument_separator separator = query_argument_separator::ampersand
|
||||||
|
) :
|
||||||
|
m_category(category),
|
||||||
|
m_path_is_rooted(false),
|
||||||
|
m_port(0),
|
||||||
|
m_separator(separator)
|
||||||
|
{
|
||||||
|
setup(uri_text, category);
|
||||||
|
};
|
||||||
|
|
||||||
|
uri(
|
||||||
|
std::map<component, std::string> const &components,
|
||||||
|
scheme_category category,
|
||||||
|
bool rooted_path,
|
||||||
|
query_argument_separator separator = query_argument_separator::ampersand
|
||||||
|
) :
|
||||||
|
m_category(category),
|
||||||
|
m_path_is_rooted(rooted_path),
|
||||||
|
m_separator(separator)
|
||||||
|
{
|
||||||
|
if (components.count(component::Scheme)) {
|
||||||
|
if (components.at(component::Scheme).length() == 0) {
|
||||||
|
throw std::invalid_argument("Scheme cannot be empty.");
|
||||||
|
}
|
||||||
|
m_scheme = components.at(component::Scheme);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw std::invalid_argument("A URI must have a scheme.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (category == scheme_category::Hierarchical) {
|
||||||
|
if (components.count(component::Content)) {
|
||||||
|
throw std::invalid_argument("The content component is only for use in non-hierarchical URIs.");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool has_username = components.count(component::Username);
|
||||||
|
bool has_password = components.count(component::Password);
|
||||||
|
if (has_username && has_password) {
|
||||||
|
m_username = components.at(component::Username);
|
||||||
|
m_password = components.at(component::Password);
|
||||||
|
}
|
||||||
|
else if ((has_username && !has_password) || (!has_username && has_password)) {
|
||||||
|
throw std::invalid_argument("If a username or password is supplied, both must be provided.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (components.count(component::Host)) {
|
||||||
|
m_host = components.at(component::Host);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (components.count(component::Port)) {
|
||||||
|
m_port = std::stoul(components.at(component::Port));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (components.count(component::Path)) {
|
||||||
|
m_path = components.at(component::Path);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw std::invalid_argument("A path is required on a hierarchical URI, even an empty path.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (components.count(component::Username)
|
||||||
|
|| components.count(component::Password)
|
||||||
|
|| components.count(component::Host)
|
||||||
|
|| components.count(component::Port)
|
||||||
|
|| components.count(component::Path)) {
|
||||||
|
throw std::invalid_argument("None of the hierarchical components are allowed in a non-hierarchical URI.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (components.count(component::Content)) {
|
||||||
|
m_content = components.at(component::Content);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"Content is a required component for a non-hierarchical URI, even an empty string."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (components.count(component::Query)) {
|
||||||
|
m_query = components.at(component::Query);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (components.count(component::Fragment)) {
|
||||||
|
m_fragment = components.at(component::Fragment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uri(uri const &other, std::map<component, std::string> const &replacements) :
|
||||||
|
m_category(other.m_category),
|
||||||
|
m_path_is_rooted(other.m_path_is_rooted),
|
||||||
|
m_separator(other.m_separator)
|
||||||
|
{
|
||||||
|
m_scheme = (replacements.count(component::Scheme))
|
||||||
|
? replacements.at(component::Scheme) : other.m_scheme;
|
||||||
|
|
||||||
|
if (m_category == scheme_category::Hierarchical) {
|
||||||
|
m_username = (replacements.count(component::Username))
|
||||||
|
? replacements.at(component::Username) : other.m_username;
|
||||||
|
|
||||||
|
m_password = (replacements.count(component::Password))
|
||||||
|
? replacements.at(component::Password) : other.m_password;
|
||||||
|
|
||||||
|
m_host = (replacements.count(component::Host))
|
||||||
|
? replacements.at(component::Host) : other.m_host;
|
||||||
|
|
||||||
|
m_port = (replacements.count(component::Port))
|
||||||
|
? std::stoul(replacements.at(component::Port)) : other.m_port;
|
||||||
|
|
||||||
|
m_path = (replacements.count(component::Path))
|
||||||
|
? replacements.at(component::Path) : other.m_path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_content = (replacements.count(component::Content))
|
||||||
|
? replacements.at(component::Content) : other.m_content;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_query = (replacements.count(component::Query))
|
||||||
|
? replacements.at(component::Query) : other.m_query;
|
||||||
|
|
||||||
|
m_fragment = (replacements.count(component::Fragment))
|
||||||
|
? replacements.at(component::Fragment) : other.m_fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy constructor; just use the copy assignment operator internally.
|
||||||
|
uri(uri const &other)
|
||||||
|
{
|
||||||
|
*this = other;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Copy assignment operator
|
||||||
|
uri &operator=(uri const &other)
|
||||||
|
{
|
||||||
|
if (this != &other) {
|
||||||
|
m_scheme = other.m_scheme;
|
||||||
|
m_content = other.m_content;
|
||||||
|
m_username = other.m_username;
|
||||||
|
m_password = other.m_password;
|
||||||
|
m_host = other.m_host;
|
||||||
|
m_path = other.m_path;
|
||||||
|
m_query = other.m_query;
|
||||||
|
m_fragment = other.m_fragment;
|
||||||
|
m_query_dict = other.m_query_dict;
|
||||||
|
m_category = other.m_category;
|
||||||
|
m_port = other.m_port;
|
||||||
|
m_path_is_rooted = other.m_path_is_rooted;
|
||||||
|
m_separator = other.m_separator;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
~uri() {};
|
||||||
|
|
||||||
|
std::string const &get_scheme() const
|
||||||
|
{
|
||||||
|
return m_scheme;
|
||||||
|
};
|
||||||
|
|
||||||
|
scheme_category get_scheme_category() const
|
||||||
|
{
|
||||||
|
return m_category;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_content() const
|
||||||
|
{
|
||||||
|
if (m_category != scheme_category::NonHierarchical) {
|
||||||
|
throw std::domain_error("The content component is only valid for non-hierarchical URIs.");
|
||||||
|
}
|
||||||
|
return m_content;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_username() const
|
||||||
|
{
|
||||||
|
if (m_category != scheme_category::Hierarchical) {
|
||||||
|
throw std::domain_error("The username component is only valid for hierarchical URIs.");
|
||||||
|
}
|
||||||
|
return m_username;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_password() const
|
||||||
|
{
|
||||||
|
if (m_category != scheme_category::Hierarchical) {
|
||||||
|
throw std::domain_error("The password component is only valid for hierarchical URIs.");
|
||||||
|
}
|
||||||
|
return m_password;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_host() const
|
||||||
|
{
|
||||||
|
if (m_category != scheme_category::Hierarchical) {
|
||||||
|
throw std::domain_error("The host component is only valid for hierarchical URIs.");
|
||||||
|
}
|
||||||
|
return m_host;
|
||||||
|
};
|
||||||
|
|
||||||
|
unsigned long get_port() const
|
||||||
|
{
|
||||||
|
if (m_category != scheme_category::Hierarchical) {
|
||||||
|
throw std::domain_error("The port component is only valid for hierarchical URIs.");
|
||||||
|
}
|
||||||
|
return m_port;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_path() const
|
||||||
|
{
|
||||||
|
if (m_category != scheme_category::Hierarchical) {
|
||||||
|
throw std::domain_error("The path component is only valid for hierarchical URIs.");
|
||||||
|
}
|
||||||
|
return m_path;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_query() const
|
||||||
|
{
|
||||||
|
return m_query;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::map<std::string, std::string> const &get_query_dictionary() const
|
||||||
|
{
|
||||||
|
return m_query_dict;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string const &get_fragment() const
|
||||||
|
{
|
||||||
|
return m_fragment;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string to_string() const
|
||||||
|
{
|
||||||
|
std::string full_uri;
|
||||||
|
full_uri.append(m_scheme);
|
||||||
|
full_uri.append(":");
|
||||||
|
|
||||||
|
if (m_content.length() > m_path.length()) {
|
||||||
|
full_uri.append("//");
|
||||||
|
if (!(m_username.empty() || m_password.empty())) {
|
||||||
|
full_uri.append(m_username);
|
||||||
|
full_uri.append(":");
|
||||||
|
full_uri.append(m_password);
|
||||||
|
full_uri.append("@");
|
||||||
|
}
|
||||||
|
|
||||||
|
full_uri.append(m_host);
|
||||||
|
|
||||||
|
if (m_port != 0) {
|
||||||
|
full_uri.append(":");
|
||||||
|
full_uri.append(std::to_string(m_port));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_path_is_rooted) {
|
||||||
|
full_uri.append("/");
|
||||||
|
}
|
||||||
|
full_uri.append(m_path);
|
||||||
|
|
||||||
|
if (!m_query.empty()) {
|
||||||
|
full_uri.append("?");
|
||||||
|
full_uri.append(m_query);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_fragment.empty()) {
|
||||||
|
full_uri.append("#");
|
||||||
|
full_uri.append(m_fragment);
|
||||||
|
}
|
||||||
|
|
||||||
|
return full_uri;
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void setup(std::string const &uri_text, scheme_category category)
|
||||||
|
{
|
||||||
|
size_t const uri_length = uri_text.length();
|
||||||
|
|
||||||
|
if (uri_length == 0) {
|
||||||
|
throw std::invalid_argument("URIs cannot be of zero length.");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string::const_iterator cursor = parse_scheme(
|
||||||
|
uri_text,
|
||||||
|
uri_text.begin());
|
||||||
|
// After calling parse_scheme, *cursor == ':'; none of the following parsers
|
||||||
|
// expect a separator character, so we advance the cursor upon calling them.
|
||||||
|
cursor = parse_content(uri_text, (cursor + 1));
|
||||||
|
|
||||||
|
if ((cursor != uri_text.end()) && (*cursor == '?')) {
|
||||||
|
cursor = parse_query(uri_text, (cursor + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((cursor != uri_text.end()) && (*cursor == '#')) {
|
||||||
|
cursor = parse_fragment(uri_text, (cursor + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
init_query_dictionary(); // If the query string is empty, this will be empty too.
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_scheme(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string::const_iterator scheme_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator scheme_end = scheme_start;
|
||||||
|
while ((scheme_end != uri_text.end()) && (*scheme_end != ':')) {
|
||||||
|
if (!(std::isalnum(*scheme_end) || (*scheme_end == '-')
|
||||||
|
|| (*scheme_end == '+') || (*scheme_end == '.'))) {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"Invalid character found in the scheme component. Supplied URI was: \""
|
||||||
|
+ uri_text + "\"."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
++scheme_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scheme_end == uri_text.end()) {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"End of URI found while parsing the scheme. Supplied URI was: \""
|
||||||
|
+ uri_text + "\"."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (scheme_start == scheme_end) {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"Scheme component cannot be zero-length. Supplied URI was: \""
|
||||||
|
+ uri_text + "\"."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_scheme = std::move(std::string(scheme_start, scheme_end));
|
||||||
|
return scheme_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_content(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string::const_iterator content_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator content_end = content_start;
|
||||||
|
while ((content_end != uri_text.end()) && (*content_end != '?') && (*content_end != '#')) {
|
||||||
|
++content_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_content = std::move(std::string(content_start, content_end));
|
||||||
|
|
||||||
|
if ((m_category == scheme_category::Hierarchical) && (m_content.length() > 0)) {
|
||||||
|
// If it's a hierarchical URI, the content should be parsed for the hierarchical components.
|
||||||
|
std::string::const_iterator path_start = m_content.begin();
|
||||||
|
std::string::const_iterator path_end = m_content.end();
|
||||||
|
if (!m_content.compare(0, 2, "//")) {
|
||||||
|
// In this case an authority component is present.
|
||||||
|
std::string::const_iterator authority_cursor = (m_content.begin() + 2);
|
||||||
|
if (m_content.find_first_of('@') != std::string::npos) {
|
||||||
|
std::string::const_iterator userpass_divider = parse_username(
|
||||||
|
uri_text,
|
||||||
|
m_content,
|
||||||
|
authority_cursor
|
||||||
|
);
|
||||||
|
authority_cursor = parse_password(uri_text, m_content, (userpass_divider + 1));
|
||||||
|
// After this call, *authority_cursor == '@', so we skip over it.
|
||||||
|
++authority_cursor;
|
||||||
|
}
|
||||||
|
|
||||||
|
authority_cursor = parse_host(uri_text, m_content, authority_cursor);
|
||||||
|
|
||||||
|
if ((authority_cursor != m_content.end()) && (*authority_cursor == ':')) {
|
||||||
|
authority_cursor = parse_port(uri_text, m_content, (authority_cursor + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((authority_cursor != m_content.end()) && (*authority_cursor == '/')) {
|
||||||
|
// Then the path is rooted, and we should note this.
|
||||||
|
m_path_is_rooted = true;
|
||||||
|
path_start = authority_cursor + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we've reached the end and no path is present then set path_start
|
||||||
|
// to the end.
|
||||||
|
if (authority_cursor == m_content.end()) {
|
||||||
|
path_start = m_content.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!m_content.compare(0, 1, "/")) {
|
||||||
|
m_path_is_rooted = true;
|
||||||
|
++path_start;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We can now build the path based on what remains in the content string,
|
||||||
|
// since that's all that exists after the host and optional port component.
|
||||||
|
m_path = std::move(std::string(path_start, path_end));
|
||||||
|
}
|
||||||
|
return content_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_username(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string const &content,
|
||||||
|
std::string::const_iterator username_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator username_end = username_start;
|
||||||
|
// Since this is only reachable when '@' was in the content string, we can
|
||||||
|
// ignore the end-of-string case.
|
||||||
|
while (*username_end != ':') {
|
||||||
|
if (*username_end == '@') {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"Username must be followed by a password. Supplied URI was: \""
|
||||||
|
+ uri_text + "\"."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
++username_end;
|
||||||
|
}
|
||||||
|
m_username = std::move(std::string(username_start, username_end));
|
||||||
|
return username_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_password(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string const &content,
|
||||||
|
std::string::const_iterator password_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator password_end = password_start;
|
||||||
|
while (*password_end != '@') {
|
||||||
|
++password_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_password = std::move(std::string(password_start, password_end));
|
||||||
|
return password_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_host(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string const &content,
|
||||||
|
std::string::const_iterator host_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator host_end = host_start;
|
||||||
|
// So, the host can contain a few things. It can be a domain, it can be an
|
||||||
|
// IPv4 address, it can be an IPv6 address, or an IPvFuture literal. In the
|
||||||
|
// case of those last two, it's of the form [...] where what's between the
|
||||||
|
// brackets is a matter of which IPv?? version it is.
|
||||||
|
while (host_end != content.end()) {
|
||||||
|
if (*host_end == '[') {
|
||||||
|
// We're parsing an IPv6 or IPvFuture address, so we should handle that
|
||||||
|
// instead of the normal procedure.
|
||||||
|
while ((host_end != content.end()) && (*host_end != ']')) {
|
||||||
|
++host_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (host_end == content.end()) {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"End of content component encountered "
|
||||||
|
"while parsing the host component. "
|
||||||
|
"Supplied URI was: \""
|
||||||
|
+ uri_text + "\"."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
++host_end;
|
||||||
|
break;
|
||||||
|
// We can stop looping, we found the end of the IP literal, which is the
|
||||||
|
// whole of the host component when one's in use.
|
||||||
|
}
|
||||||
|
else if ((*host_end == ':') || (*host_end == '/')) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
++host_end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_host = std::move(std::string(host_start, host_end));
|
||||||
|
return host_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_port(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string const &content,
|
||||||
|
std::string::const_iterator port_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator port_end = port_start;
|
||||||
|
while ((port_end != content.end()) && (*port_end != '/')) {
|
||||||
|
if (!std::isdigit(*port_end)) {
|
||||||
|
throw std::invalid_argument(
|
||||||
|
"Invalid character while parsing the port. "
|
||||||
|
"Supplied URI was: \"" + uri_text + "\"."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
++port_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_port = std::stoul(std::string(port_start, port_end));
|
||||||
|
return port_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_query(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string::const_iterator query_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::string::const_iterator query_end = query_start;
|
||||||
|
while ((query_end != uri_text.end()) && (*query_end != '#')) {
|
||||||
|
// Queries can contain almost any character except hash, which is reserved
|
||||||
|
// for the start of the fragment.
|
||||||
|
++query_end;
|
||||||
|
}
|
||||||
|
m_query = std::move(std::string(query_start, query_end));
|
||||||
|
return query_end;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::string::const_iterator parse_fragment(
|
||||||
|
std::string const &uri_text,
|
||||||
|
std::string::const_iterator fragment_start
|
||||||
|
)
|
||||||
|
{
|
||||||
|
m_fragment = std::move(std::string(fragment_start, uri_text.end()));
|
||||||
|
return uri_text.end();
|
||||||
|
};
|
||||||
|
|
||||||
|
void init_query_dictionary()
|
||||||
|
{
|
||||||
|
if (!m_query.empty()) {
|
||||||
|
// Loop over the query string looking for '&'s, then check each one for
|
||||||
|
// an '=' to find keys and values; if there's not an '=' then the key
|
||||||
|
// will have an empty value in the map.
|
||||||
|
char separator = (m_separator == query_argument_separator::ampersand) ? '&' : ';';
|
||||||
|
size_t carat = 0;
|
||||||
|
size_t stanza_end = m_query.find_first_of(separator);
|
||||||
|
do {
|
||||||
|
std::string stanza = m_query.substr(
|
||||||
|
carat,
|
||||||
|
((stanza_end != std::string::npos) ? (stanza_end - carat) : std::string::npos));
|
||||||
|
size_t key_value_divider = stanza.find_first_of('=');
|
||||||
|
std::string key = stanza.substr(0, key_value_divider);
|
||||||
|
std::string value;
|
||||||
|
if (key_value_divider != std::string::npos) {
|
||||||
|
value = stanza.substr((key_value_divider + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_query_dict.count(key) != 0) {
|
||||||
|
throw std::invalid_argument("Bad key in the query string!");
|
||||||
|
}
|
||||||
|
|
||||||
|
m_query_dict.emplace(key, value);
|
||||||
|
carat = ((stanza_end != std::string::npos) ? (stanza_end + 1)
|
||||||
|
: std::string::npos);
|
||||||
|
stanza_end = m_query.find_first_of(separator, carat);
|
||||||
|
} while ((stanza_end != std::string::npos)
|
||||||
|
|| (carat != std::string::npos));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string m_scheme;
|
||||||
|
std::string m_content;
|
||||||
|
std::string m_username;
|
||||||
|
std::string m_password;
|
||||||
|
std::string m_host;
|
||||||
|
std::string m_path;
|
||||||
|
std::string m_query;
|
||||||
|
std::string m_fragment;
|
||||||
|
|
||||||
|
std::map<std::string, std::string> m_query_dict;
|
||||||
|
|
||||||
|
scheme_category m_category;
|
||||||
|
unsigned long m_port;
|
||||||
|
bool m_path_is_rooted;
|
||||||
|
query_argument_separator m_separator;
|
||||||
|
};
|
||||||
@@ -224,7 +224,7 @@ EQ::ItemInstance* EQ::InventoryProfile::GetItem(int16 slot_id, uint8 bagidx) con
|
|||||||
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
|
return GetItem(InventoryProfile::CalcSlotId(slot_id, bagidx));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put an item snto specified slot
|
// Put an item into specified slot
|
||||||
int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
int16 EQ::InventoryProfile::PutItem(int16 slot_id, const ItemInstance& inst)
|
||||||
{
|
{
|
||||||
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
if (slot_id <= EQ::invslot::POSSESSIONS_END && slot_id >= EQ::invslot::POSSESSIONS_BEGIN) {
|
||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -482,7 +482,7 @@ namespace EQ
|
|||||||
uint32 Haste;
|
uint32 Haste;
|
||||||
uint32 DamageShield;
|
uint32 DamageShield;
|
||||||
uint32 RecastDelay;
|
uint32 RecastDelay;
|
||||||
uint32 RecastType;
|
int RecastType;
|
||||||
uint32 AugDistiller;
|
uint32 AugDistiller;
|
||||||
bool Attuneable;
|
bool Attuneable;
|
||||||
bool NoPet;
|
bool NoPet;
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
+1
-1
@@ -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);
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ EQ::Net::ServertalkServerConnection::ServertalkServerConnection(std::shared_ptr<
|
|||||||
m_connection->OnRead(std::bind(&ServertalkServerConnection::OnRead, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
m_connection->OnRead(std::bind(&ServertalkServerConnection::OnRead, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
m_connection->OnDisconnect(std::bind(&ServertalkServerConnection::OnDisconnect, this, std::placeholders::_1));
|
m_connection->OnDisconnect(std::bind(&ServertalkServerConnection::OnDisconnect, this, std::placeholders::_1));
|
||||||
m_connection->Start();
|
m_connection->Start();
|
||||||
|
m_legacy_mode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EQ::Net::ServertalkServerConnection::~ServertalkServerConnection()
|
EQ::Net::ServertalkServerConnection::~ServertalkServerConnection()
|
||||||
@@ -19,8 +20,63 @@ EQ::Net::ServertalkServerConnection::~ServertalkServerConnection()
|
|||||||
|
|
||||||
void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet & p)
|
void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet & p)
|
||||||
{
|
{
|
||||||
|
if (m_legacy_mode) {
|
||||||
|
if (!m_connection)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (opcode == ServerOP_UsertoWorldReq) {
|
||||||
|
auto req_in = (UsertoWorldRequest_Struct*)p.Data();
|
||||||
|
|
||||||
|
EQ::Net::DynamicPacket req;
|
||||||
|
size_t i = 0;
|
||||||
|
req.PutUInt32(i, req_in->lsaccountid); i += 4;
|
||||||
|
req.PutUInt32(i, req_in->worldid); i += 4;
|
||||||
|
req.PutUInt32(i, req_in->FromID); i += 4;
|
||||||
|
req.PutUInt32(i, req_in->ToID); i += 4;
|
||||||
|
req.PutData(i, req_in->IPAddr, 64); i += 64;
|
||||||
|
|
||||||
|
EQ::Net::DynamicPacket out;
|
||||||
|
out.PutUInt16(0, ServerOP_UsertoWorldReqLeg);
|
||||||
|
out.PutUInt16(2, req.Length() + 4);
|
||||||
|
out.PutPacket(4, req);
|
||||||
|
|
||||||
|
m_connection->Write((const char*)out.Data(), out.Length());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opcode == ServerOP_LSClientAuth) {
|
||||||
|
auto req_in = (ClientAuth_Struct*)p.Data();
|
||||||
|
|
||||||
|
EQ::Net::DynamicPacket req;
|
||||||
|
size_t i = 0;
|
||||||
|
req.PutUInt32(i, req_in->loginserver_account_id); i += 4;
|
||||||
|
req.PutData(i, req_in->account_name, 30); i += 30;
|
||||||
|
req.PutData(i, req_in->key, 30); i += 30;
|
||||||
|
req.PutUInt8(i, req_in->lsadmin); i += 1;
|
||||||
|
req.PutUInt16(i, req_in->is_world_admin); i += 2;
|
||||||
|
req.PutUInt32(i, req_in->ip); i += 4;
|
||||||
|
req.PutUInt8(i, req_in->is_client_from_local_network); i += 1;
|
||||||
|
|
||||||
|
EQ::Net::DynamicPacket out;
|
||||||
|
out.PutUInt16(0, ServerOP_LSClientAuthLeg);
|
||||||
|
out.PutUInt16(2, req.Length() + 4);
|
||||||
|
out.PutPacket(4, req);
|
||||||
|
|
||||||
|
m_connection->Write((const char*)out.Data(), out.Length());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EQ::Net::DynamicPacket out;
|
||||||
|
out.PutUInt16(0, opcode);
|
||||||
|
out.PutUInt16(2, p.Length() + 4);
|
||||||
|
out.PutPacket(4, p);
|
||||||
|
|
||||||
|
m_connection->Write((const char*)out.Data(), out.Length());
|
||||||
|
} else {
|
||||||
// pad zero size packets
|
// pad zero size packets
|
||||||
if (p.Length() == 0) {
|
// pad packets that would cause a collision with legacy identification code
|
||||||
|
// It's unlikely we'd send a 4MB msg for any reason but just incase.
|
||||||
|
if (p.Length() == 0 || p.Length() == 43061256) {
|
||||||
p.PutUInt8(0, 0);
|
p.PutUInt8(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,6 +87,7 @@ void EQ::Net::ServertalkServerConnection::Send(uint16_t opcode, EQ::Net::Packet
|
|||||||
|
|
||||||
InternalSend(ServertalkMessage, out);
|
InternalSend(ServertalkMessage, out);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EQ::Net::ServertalkServerConnection::SendPacket(ServerPacket *p)
|
void EQ::Net::ServertalkServerConnection::SendPacket(ServerPacket *p)
|
||||||
{
|
{
|
||||||
@@ -54,17 +111,41 @@ void EQ::Net::ServertalkServerConnection::OnMessage(std::function<void(uint16_t,
|
|||||||
void EQ::Net::ServertalkServerConnection::OnRead(TCPConnection *c, const unsigned char *data, size_t sz)
|
void EQ::Net::ServertalkServerConnection::OnRead(TCPConnection *c, const unsigned char *data, size_t sz)
|
||||||
{
|
{
|
||||||
m_buffer.insert(m_buffer.end(), (const char*)data, (const char*)data + sz);
|
m_buffer.insert(m_buffer.end(), (const char*)data, (const char*)data + sz);
|
||||||
|
|
||||||
|
if (m_legacy_mode) {
|
||||||
|
ProcessOldReadBuffer();
|
||||||
|
} else {
|
||||||
ProcessReadBuffer();
|
ProcessReadBuffer();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EQ::Net::ServertalkServerConnection::ProcessReadBuffer()
|
void EQ::Net::ServertalkServerConnection::ProcessReadBuffer()
|
||||||
{
|
{
|
||||||
size_t current = 0;
|
size_t current = 0;
|
||||||
size_t total = m_buffer.size();
|
size_t total = m_buffer.size();
|
||||||
|
constexpr size_t ls_info_size = sizeof(ServerNewLSInfo_Struct);
|
||||||
|
|
||||||
while (current < total) {
|
while (current < total) {
|
||||||
auto left = total - current;
|
auto left = total - current;
|
||||||
|
|
||||||
|
if (left < 4) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto leg_opcode = *(uint16_t*)&m_buffer[current];
|
||||||
|
auto leg_size = *(uint16_t*)&m_buffer[current + 2] - 4;
|
||||||
|
|
||||||
|
//this creates a small edge case where the exact size of a
|
||||||
|
//packet from the modern protocol can't be "43061256"
|
||||||
|
//so in send we pad it one byte if that's the case
|
||||||
|
if (leg_opcode == ServerOP_NewLSInfo && leg_size == sizeof(ServerNewLSInfo_Struct)) {
|
||||||
|
m_legacy_mode = true;
|
||||||
|
m_identifier = "World";
|
||||||
|
m_parent->ConnectionIdentified(this);
|
||||||
|
ProcessOldReadBuffer();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//header:
|
//header:
|
||||||
//uint32 length;
|
//uint32 length;
|
||||||
@@ -129,6 +210,57 @@ void EQ::Net::ServertalkServerConnection::ProcessReadBuffer()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EQ::Net::ServertalkServerConnection::ProcessOldReadBuffer()
|
||||||
|
{
|
||||||
|
size_t current = 0;
|
||||||
|
size_t total = m_buffer.size();
|
||||||
|
|
||||||
|
while (current < total) {
|
||||||
|
auto left = total - current;
|
||||||
|
|
||||||
|
/*
|
||||||
|
//header:
|
||||||
|
//uint32 length;
|
||||||
|
//uint8 type;
|
||||||
|
*/
|
||||||
|
uint16_t length = 0;
|
||||||
|
uint16_t opcode = 0;
|
||||||
|
if (left < 4) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
opcode = *(uint16_t*)&m_buffer[current];
|
||||||
|
length = *(uint16_t*)&m_buffer[current + 2];
|
||||||
|
if (length < 4) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
length -= 4;
|
||||||
|
|
||||||
|
if (current + 4 + length > total) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length == 0) {
|
||||||
|
EQ::Net::DynamicPacket p;
|
||||||
|
ProcessMessageOld(opcode, p);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
EQ::Net::StaticPacket p(&m_buffer[current + 4], length);
|
||||||
|
ProcessMessageOld(opcode, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
current += length + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current == total) {
|
||||||
|
m_buffer.clear();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m_buffer.erase(m_buffer.begin(), m_buffer.begin() + current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EQ::Net::ServertalkServerConnection::OnDisconnect(TCPConnection *c)
|
void EQ::Net::ServertalkServerConnection::OnDisconnect(TCPConnection *c)
|
||||||
{
|
{
|
||||||
m_parent->ConnectionDisconnected(this);
|
m_parent->ConnectionDisconnected(this);
|
||||||
@@ -144,7 +276,7 @@ void EQ::Net::ServertalkServerConnection::SendHello()
|
|||||||
|
|
||||||
void EQ::Net::ServertalkServerConnection::InternalSend(ServertalkPacketType type, EQ::Net::Packet &p)
|
void EQ::Net::ServertalkServerConnection::InternalSend(ServertalkPacketType type, EQ::Net::Packet &p)
|
||||||
{
|
{
|
||||||
if (!m_connection)
|
if (!m_connection || m_legacy_mode)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EQ::Net::DynamicPacket out;
|
EQ::Net::DynamicPacket out;
|
||||||
@@ -201,3 +333,20 @@ void EQ::Net::ServertalkServerConnection::ProcessMessage(EQ::Net::Packet &p)
|
|||||||
LogError("Error parsing message from client: {0}", ex.what());
|
LogError("Error parsing message from client: {0}", ex.what());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EQ::Net::ServertalkServerConnection::ProcessMessageOld(uint16_t opcode, EQ::Net::Packet &p)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
auto cb = m_message_callbacks.find(opcode);
|
||||||
|
if (cb != m_message_callbacks.end()) {
|
||||||
|
cb->second(opcode, p);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_message_callback) {
|
||||||
|
m_message_callback(opcode, p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (std::exception &ex) {
|
||||||
|
LogError("Error parsing legacy message from client: {0}", ex.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,11 +27,13 @@ namespace EQ
|
|||||||
private:
|
private:
|
||||||
void OnRead(TCPConnection* c, const unsigned char* data, size_t sz);
|
void OnRead(TCPConnection* c, const unsigned char* data, size_t sz);
|
||||||
void ProcessReadBuffer();
|
void ProcessReadBuffer();
|
||||||
|
void ProcessOldReadBuffer();
|
||||||
void OnDisconnect(TCPConnection* c);
|
void OnDisconnect(TCPConnection* c);
|
||||||
void SendHello();
|
void SendHello();
|
||||||
void InternalSend(ServertalkPacketType type, EQ::Net::Packet &p);
|
void InternalSend(ServertalkPacketType type, EQ::Net::Packet &p);
|
||||||
void ProcessHandshake(EQ::Net::Packet &p);
|
void ProcessHandshake(EQ::Net::Packet &p);
|
||||||
void ProcessMessage(EQ::Net::Packet &p);
|
void ProcessMessage(EQ::Net::Packet &p);
|
||||||
|
void ProcessMessageOld(uint16_t opcode, EQ::Net::Packet &p);
|
||||||
|
|
||||||
std::shared_ptr<EQ::Net::TCPConnection> m_connection;
|
std::shared_ptr<EQ::Net::TCPConnection> m_connection;
|
||||||
ServertalkServer *m_parent;
|
ServertalkServer *m_parent;
|
||||||
@@ -41,6 +43,7 @@ namespace EQ
|
|||||||
std::function<void(uint16_t, EQ::Net::Packet&)> m_message_callback;
|
std::function<void(uint16_t, EQ::Net::Packet&)> m_message_callback;
|
||||||
std::string m_identifier;
|
std::string m_identifier;
|
||||||
std::string m_uuid;
|
std::string m_uuid;
|
||||||
|
bool m_legacy_mode;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
+2
-16
@@ -1634,20 +1634,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
|
||||||
@@ -1863,8 +1849,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;
|
||||||
eq->unknown880 = 50;
|
OUT(LavaDamage);
|
||||||
eq->unknown884 = 10;
|
OUT(MinLavaDamage);
|
||||||
eq->unknown888 = 1;
|
eq->unknown888 = 1;
|
||||||
eq->unknown889 = 0;
|
eq->unknown889 = 0;
|
||||||
eq->unknown890 = 1;
|
eq->unknown890 = 1;
|
||||||
|
|||||||
+2
-16
@@ -1683,20 +1683,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
|
||||||
@@ -1919,8 +1905,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
|
||||||
eq->LavaDamage = 50;
|
OUT(LavaDamage);
|
||||||
eq->MinLavaDamage = 10;
|
OUT(MinLavaDamage);
|
||||||
eq->bDisallowManaStone = 1;
|
eq->bDisallowManaStone = 1;
|
||||||
eq->bNoBind = 0;
|
eq->bNoBind = 0;
|
||||||
eq->bNoAttack = 0;
|
eq->bNoAttack = 0;
|
||||||
|
|||||||
@@ -93,7 +93,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)
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -4361,8 +4361,8 @@ struct UseAA_Struct {
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
/*16*/
|
/*16*/
|
||||||
};
|
};
|
||||||
@@ -5218,6 +5218,11 @@ struct SayLinkBodyFrame_Struct {
|
|||||||
/*056*/
|
/*056*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Checksum_Struct {
|
||||||
|
uint64_t checksum;
|
||||||
|
uint8_t data[2048];
|
||||||
|
};
|
||||||
|
|
||||||
}; /*structs*/
|
}; /*structs*/
|
||||||
|
|
||||||
}; /*RoF2*/
|
}; /*RoF2*/
|
||||||
|
|||||||
@@ -79,7 +79,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)
|
||||||
|
|||||||
@@ -581,8 +581,8 @@ struct NewZone_Struct {
|
|||||||
/*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 SuspendBuffs;
|
||||||
/*0880*/ uint32 unknown880; // Seen 50
|
/*0880*/ uint32 LavaDamage; // Seen 50
|
||||||
/*0884*/ uint32 unknown884; // Seen 10
|
/*0884*/ uint32 MinLavaDamage; // 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
|
||||||
@@ -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
|
||||||
@@ -4305,8 +4305,8 @@ struct UseAA_Struct {
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
/*16*/
|
/*16*/
|
||||||
};
|
};
|
||||||
|
|||||||
+4
-18
@@ -1170,20 +1170,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
|
||||||
@@ -1388,8 +1374,8 @@ namespace SoD
|
|||||||
/*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;
|
||||||
eq->unknown880 = 50;
|
OUT(LavaDamage);
|
||||||
eq->unknown884 = 10;
|
OUT(MinLavaDamage);
|
||||||
eq->unknown888 = 1;
|
eq->unknown888 = 1;
|
||||||
eq->unknown889 = 0;
|
eq->unknown889 = 0;
|
||||||
eq->unknown890 = 1;
|
eq->unknown890 = 1;
|
||||||
@@ -1874,8 +1860,8 @@ namespace SoD
|
|||||||
|
|
||||||
for(auto i = 0; i < eq->total_abilities; ++i) {
|
for(auto i = 0; i < eq->total_abilities; ++i) {
|
||||||
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base1 = inapp->ReadUInt32();
|
eq->abilities[i].base_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base2 = inapp->ReadUInt32();
|
eq->abilities[i].limit_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].slot = inapp->ReadUInt32();
|
eq->abilities[i].slot = inapp->ReadUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,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)
|
||||||
|
|||||||
@@ -450,8 +450,8 @@ struct NewZone_Struct {
|
|||||||
/*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 SuspendBuffs;
|
||||||
/*0880*/ uint32 unknown880; //seen 50
|
/*0880*/ uint32 LavaDamage; //seen 50
|
||||||
/*0884*/ uint32 unknown884; //seen 10
|
/*0884*/ uint32 MinLavaDamage; //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
|
||||||
@@ -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;
|
||||||
@@ -3748,8 +3748,8 @@ struct UseAA_Struct {
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
/*16*/
|
/*16*/
|
||||||
};
|
};
|
||||||
|
|||||||
+4
-18
@@ -966,20 +966,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);
|
||||||
@@ -1066,8 +1052,8 @@ namespace SoF
|
|||||||
/*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;
|
||||||
eq->unknown876 = 50;
|
OUT(LavaDamage);
|
||||||
eq->unknown880 = 10;
|
OUT(MinLavaDamage);
|
||||||
eq->unknown884 = 1;
|
eq->unknown884 = 1;
|
||||||
eq->unknown885 = 0;
|
eq->unknown885 = 0;
|
||||||
eq->unknown886 = 1;
|
eq->unknown886 = 1;
|
||||||
@@ -1545,8 +1531,8 @@ namespace SoF
|
|||||||
|
|
||||||
for(auto i = 0; i < eq->total_abilities; ++i) {
|
for(auto i = 0; i < eq->total_abilities; ++i) {
|
||||||
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base1 = inapp->ReadUInt32();
|
eq->abilities[i].base_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base2 = inapp->ReadUInt32();
|
eq->abilities[i].limit_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].slot = inapp->ReadUInt32();
|
eq->abilities[i].slot = inapp->ReadUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,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)
|
||||||
|
|||||||
@@ -454,8 +454,8 @@ struct NewZone_Struct {
|
|||||||
/*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 SuspendBuffs;
|
||||||
/*0876*/ uint32 unknown876; //seen 50
|
/*0876*/ uint32 LavaDamage; //seen 50
|
||||||
/*0880*/ uint32 unknown880; //seen 10
|
/*0880*/ uint32 MinLavaDamage; //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
|
||||||
@@ -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;
|
||||||
@@ -3673,8 +3673,8 @@ struct UseAA_Struct {
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
/*16*/
|
/*16*/
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -932,6 +932,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);
|
||||||
@@ -1338,8 +1351,8 @@ namespace Titanium
|
|||||||
|
|
||||||
for(auto i = 0; i < eq->total_abilities; ++i) {
|
for(auto i = 0; i < eq->total_abilities; ++i) {
|
||||||
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base1 = inapp->ReadUInt32();
|
eq->abilities[i].base_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base2 = inapp->ReadUInt32();
|
eq->abilities[i].limit_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].slot = inapp->ReadUInt32();
|
eq->abilities[i].slot = inapp->ReadUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,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)
|
||||||
|
|||||||
@@ -3180,8 +3180,8 @@ struct UseAA_Struct {
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+4
-18
@@ -1390,20 +1390,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
|
||||||
@@ -1614,8 +1600,8 @@ namespace UF
|
|||||||
/*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;
|
||||||
eq->unknown880 = 50;
|
OUT(LavaDamage);
|
||||||
eq->unknown884 = 10;
|
OUT(MinLavaDamage);
|
||||||
eq->unknown888 = 1;
|
eq->unknown888 = 1;
|
||||||
eq->unknown889 = 0;
|
eq->unknown889 = 0;
|
||||||
eq->unknown890 = 1;
|
eq->unknown890 = 1;
|
||||||
@@ -2139,8 +2125,8 @@ namespace UF
|
|||||||
|
|
||||||
for(auto i = 0; i < eq->total_abilities; ++i) {
|
for(auto i = 0; i < eq->total_abilities; ++i) {
|
||||||
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
eq->abilities[i].skill_id = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base1 = inapp->ReadUInt32();
|
eq->abilities[i].base_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].base2 = inapp->ReadUInt32();
|
eq->abilities[i].limit_value = inapp->ReadUInt32();
|
||||||
eq->abilities[i].slot = inapp->ReadUInt32();
|
eq->abilities[i].slot = inapp->ReadUInt32();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,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)
|
||||||
|
|||||||
@@ -450,8 +450,8 @@ struct NewZone_Struct {
|
|||||||
/*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 SuspendBuffs;
|
||||||
/*0880*/ uint32 unknown880; //seen 50
|
/*0880*/ uint32 LavaDamage; //seen 50
|
||||||
/*0884*/ uint32 unknown884; //seen 10
|
/*0884*/ uint32 MinLavaDamage; //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
|
||||||
@@ -3803,8 +3803,8 @@ struct UseAA_Struct {
|
|||||||
|
|
||||||
struct AA_Ability {
|
struct AA_Ability {
|
||||||
/*00*/ uint32 skill_id;
|
/*00*/ uint32 skill_id;
|
||||||
/*04*/ uint32 base1;
|
/*04*/ uint32 base_value;
|
||||||
/*08*/ uint32 base2;
|
/*08*/ uint32 limit_value;
|
||||||
/*12*/ uint32 slot;
|
/*12*/ uint32 slot;
|
||||||
/*16*/
|
/*16*/
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -221,9 +221,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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -260,9 +260,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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2232,3 +2232,15 @@ bool PlayerAppearance::IsValidWoad(uint16 race_id, uint8 gender_id, uint8 woad_v
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* GetGenderName(uint32 gender_id) {
|
||||||
|
const char* gender_name = "Unknown";
|
||||||
|
if (gender_id == MALE) {
|
||||||
|
gender_name = "Male";
|
||||||
|
} else if (gender_id == FEMALE) {
|
||||||
|
gender_name = "Female";
|
||||||
|
} else if (gender_id == NEUTER) {
|
||||||
|
gender_name = "Neuter";
|
||||||
|
}
|
||||||
|
return gender_name;
|
||||||
|
}
|
||||||
@@ -851,6 +851,7 @@
|
|||||||
|
|
||||||
const char* GetRaceIDName(uint16 race_id);
|
const char* GetRaceIDName(uint16 race_id);
|
||||||
const char* GetPlayerRaceName(uint32 player_race_value);
|
const char* GetPlayerRaceName(uint32 player_race_value);
|
||||||
|
const char* GetGenderName(uint32 gender_id);
|
||||||
|
|
||||||
uint32 GetPlayerRaceValue(uint16 race_id);
|
uint32 GetPlayerRaceValue(uint16 race_id);
|
||||||
uint32 GetPlayerRaceBit(uint16 race_id);
|
uint32 GetPlayerRaceBit(uint16 race_id);
|
||||||
@@ -1602,6 +1603,14 @@ namespace PlayerAppearance
|
|||||||
#define RACE_FALLEN_KNIGHT_722 722
|
#define RACE_FALLEN_KNIGHT_722 722
|
||||||
#define RACE_SERVANT_OF_SHADOW_723 723
|
#define RACE_SERVANT_OF_SHADOW_723 723
|
||||||
#define RACE_LUCLIN_724 724
|
#define RACE_LUCLIN_724 724
|
||||||
|
#define RACE_XARIC_725 725
|
||||||
|
#define RACE_DERVISH_726 726
|
||||||
|
#define RACE_DERVISH_727 727
|
||||||
|
#define RACE_LUCLIN_728 728
|
||||||
|
#define RACE_LUCLIN_729 729
|
||||||
|
#define RACE_ORB_730 730
|
||||||
|
#define RACE_LUCLIN_731 731
|
||||||
|
#define RACE_PEGASUS_732 732
|
||||||
#define RACE_INTERACTIVE_OBJECT_2250 2250
|
#define RACE_INTERACTIVE_OBJECT_2250 2250
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAaAbilityRepository {
|
class BaseAaAbilityRepository {
|
||||||
public:
|
public:
|
||||||
@@ -59,11 +60,36 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"category",
|
||||||
|
"classes",
|
||||||
|
"races",
|
||||||
|
"drakkin_heritage",
|
||||||
|
"deities",
|
||||||
|
"status",
|
||||||
|
"type",
|
||||||
|
"charges",
|
||||||
|
"grant_only",
|
||||||
|
"first_rank_id",
|
||||||
|
"enabled",
|
||||||
|
"reset_on_death",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("aa_ability");
|
return std::string("aa_ability");
|
||||||
@@ -73,7 +99,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAaRankEffectsRepository {
|
class BaseAaRankEffectsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -41,11 +42,27 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"rank_id",
|
||||||
|
"slot",
|
||||||
|
"effect_id",
|
||||||
|
"base1",
|
||||||
|
"base2",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("aa_rank_effects");
|
return std::string("aa_rank_effects");
|
||||||
@@ -55,7 +72,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAaRankPrereqsRepository {
|
class BaseAaRankPrereqsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -37,11 +38,25 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"rank_id",
|
||||||
|
"aa_id",
|
||||||
|
"points",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("aa_rank_prereqs");
|
return std::string("aa_rank_prereqs");
|
||||||
@@ -51,7 +66,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAaRanksRepository {
|
class BaseAaRanksRepository {
|
||||||
public:
|
public:
|
||||||
@@ -57,11 +58,35 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"upper_hotkey_sid",
|
||||||
|
"lower_hotkey_sid",
|
||||||
|
"title_sid",
|
||||||
|
"desc_sid",
|
||||||
|
"cost",
|
||||||
|
"level_req",
|
||||||
|
"spell",
|
||||||
|
"spell_type",
|
||||||
|
"recast_time",
|
||||||
|
"expansion",
|
||||||
|
"prev_id",
|
||||||
|
"next_id",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("aa_ranks");
|
return std::string("aa_ranks");
|
||||||
@@ -71,7 +96,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAccountFlagsRepository {
|
class BaseAccountFlagsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -37,11 +38,25 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"p_accid",
|
||||||
|
"p_flag",
|
||||||
|
"p_value",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("account_flags");
|
return std::string("account_flags");
|
||||||
@@ -51,7 +66,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAccountIpRepository {
|
class BaseAccountIpRepository {
|
||||||
public:
|
public:
|
||||||
@@ -39,11 +40,26 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"accid",
|
||||||
|
"ip",
|
||||||
|
"count",
|
||||||
|
"lastused",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("account_ip");
|
return std::string("account_ip");
|
||||||
@@ -53,7 +69,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -74,7 +90,7 @@ public:
|
|||||||
entry.accid = 0;
|
entry.accid = 0;
|
||||||
entry.ip = "";
|
entry.ip = "";
|
||||||
entry.count = 1;
|
entry.count = 1;
|
||||||
entry.lastused = "";
|
entry.lastused = std::time(nullptr);
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAccountRepository {
|
class BaseAccountRepository {
|
||||||
public:
|
public:
|
||||||
@@ -32,11 +33,14 @@ public:
|
|||||||
std::string minilogin_ip;
|
std::string minilogin_ip;
|
||||||
int hideme;
|
int hideme;
|
||||||
int rulesflag;
|
int rulesflag;
|
||||||
std::string suspendeduntil;
|
time_t suspendeduntil;
|
||||||
int time_creation;
|
int time_creation;
|
||||||
int expansion;
|
int expansion;
|
||||||
std::string ban_reason;
|
std::string ban_reason;
|
||||||
std::string suspend_reason;
|
std::string suspend_reason;
|
||||||
|
std::string crc_eqgame;
|
||||||
|
std::string crc_skillcaps;
|
||||||
|
std::string crc_basedata;
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::string PrimaryKey()
|
static std::string PrimaryKey()
|
||||||
@@ -66,6 +70,37 @@ public:
|
|||||||
"expansion",
|
"expansion",
|
||||||
"ban_reason",
|
"ban_reason",
|
||||||
"suspend_reason",
|
"suspend_reason",
|
||||||
|
"crc_eqgame",
|
||||||
|
"crc_skillcaps",
|
||||||
|
"crc_basedata",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"charname",
|
||||||
|
"sharedplat",
|
||||||
|
"password",
|
||||||
|
"status",
|
||||||
|
"ls_id",
|
||||||
|
"lsaccount_id",
|
||||||
|
"gmspeed",
|
||||||
|
"revoked",
|
||||||
|
"karma",
|
||||||
|
"minilogin_ip",
|
||||||
|
"hideme",
|
||||||
|
"rulesflag",
|
||||||
|
"UNIX_TIMESTAMP(suspendeduntil)",
|
||||||
|
"time_creation",
|
||||||
|
"expansion",
|
||||||
|
"ban_reason",
|
||||||
|
"suspend_reason",
|
||||||
|
"crc_eqgame",
|
||||||
|
"crc_skillcaps",
|
||||||
|
"crc_basedata",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,6 +109,11 @@ public:
|
|||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("account");
|
return std::string("account");
|
||||||
@@ -83,7 +123,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -115,11 +155,14 @@ public:
|
|||||||
entry.minilogin_ip = "";
|
entry.minilogin_ip = "";
|
||||||
entry.hideme = 0;
|
entry.hideme = 0;
|
||||||
entry.rulesflag = 0;
|
entry.rulesflag = 0;
|
||||||
entry.suspendeduntil = "0000-00-00 00:00:00";
|
entry.suspendeduntil = 0;
|
||||||
entry.time_creation = 0;
|
entry.time_creation = 0;
|
||||||
entry.expansion = 0;
|
entry.expansion = 0;
|
||||||
entry.ban_reason = "";
|
entry.ban_reason = "";
|
||||||
entry.suspend_reason = "";
|
entry.suspend_reason = "";
|
||||||
|
entry.crc_eqgame = "";
|
||||||
|
entry.crc_skillcaps = "";
|
||||||
|
entry.crc_basedata = "";
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@@ -169,11 +212,14 @@ public:
|
|||||||
entry.minilogin_ip = row[11] ? row[11] : "";
|
entry.minilogin_ip = row[11] ? row[11] : "";
|
||||||
entry.hideme = atoi(row[12]);
|
entry.hideme = atoi(row[12]);
|
||||||
entry.rulesflag = atoi(row[13]);
|
entry.rulesflag = atoi(row[13]);
|
||||||
entry.suspendeduntil = row[14] ? row[14] : "";
|
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
|
||||||
entry.time_creation = atoi(row[15]);
|
entry.time_creation = atoi(row[15]);
|
||||||
entry.expansion = atoi(row[16]);
|
entry.expansion = atoi(row[16]);
|
||||||
entry.ban_reason = row[17] ? row[17] : "";
|
entry.ban_reason = row[17] ? row[17] : "";
|
||||||
entry.suspend_reason = row[18] ? row[18] : "";
|
entry.suspend_reason = row[18] ? row[18] : "";
|
||||||
|
entry.crc_eqgame = row[19] ? row[19] : "";
|
||||||
|
entry.crc_skillcaps = row[20] ? row[20] : "";
|
||||||
|
entry.crc_basedata = row[21] ? row[21] : "";
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
@@ -220,11 +266,14 @@ public:
|
|||||||
update_values.push_back(columns[11] + " = '" + EscapeString(account_entry.minilogin_ip) + "'");
|
update_values.push_back(columns[11] + " = '" + EscapeString(account_entry.minilogin_ip) + "'");
|
||||||
update_values.push_back(columns[12] + " = " + std::to_string(account_entry.hideme));
|
update_values.push_back(columns[12] + " = " + std::to_string(account_entry.hideme));
|
||||||
update_values.push_back(columns[13] + " = " + std::to_string(account_entry.rulesflag));
|
update_values.push_back(columns[13] + " = " + std::to_string(account_entry.rulesflag));
|
||||||
update_values.push_back(columns[14] + " = '" + EscapeString(account_entry.suspendeduntil) + "'");
|
update_values.push_back(columns[14] + " = FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
|
||||||
update_values.push_back(columns[15] + " = " + std::to_string(account_entry.time_creation));
|
update_values.push_back(columns[15] + " = " + std::to_string(account_entry.time_creation));
|
||||||
update_values.push_back(columns[16] + " = " + std::to_string(account_entry.expansion));
|
update_values.push_back(columns[16] + " = " + std::to_string(account_entry.expansion));
|
||||||
update_values.push_back(columns[17] + " = '" + EscapeString(account_entry.ban_reason) + "'");
|
update_values.push_back(columns[17] + " = '" + EscapeString(account_entry.ban_reason) + "'");
|
||||||
update_values.push_back(columns[18] + " = '" + EscapeString(account_entry.suspend_reason) + "'");
|
update_values.push_back(columns[18] + " = '" + EscapeString(account_entry.suspend_reason) + "'");
|
||||||
|
update_values.push_back(columns[19] + " = '" + EscapeString(account_entry.crc_eqgame) + "'");
|
||||||
|
update_values.push_back(columns[20] + " = '" + EscapeString(account_entry.crc_skillcaps) + "'");
|
||||||
|
update_values.push_back(columns[21] + " = '" + EscapeString(account_entry.crc_basedata) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -260,11 +309,14 @@ public:
|
|||||||
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
|
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
|
||||||
insert_values.push_back(std::to_string(account_entry.hideme));
|
insert_values.push_back(std::to_string(account_entry.hideme));
|
||||||
insert_values.push_back(std::to_string(account_entry.rulesflag));
|
insert_values.push_back(std::to_string(account_entry.rulesflag));
|
||||||
insert_values.push_back("'" + EscapeString(account_entry.suspendeduntil) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
|
||||||
insert_values.push_back(std::to_string(account_entry.time_creation));
|
insert_values.push_back(std::to_string(account_entry.time_creation));
|
||||||
insert_values.push_back(std::to_string(account_entry.expansion));
|
insert_values.push_back(std::to_string(account_entry.expansion));
|
||||||
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(account_entry.crc_eqgame) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(account_entry.crc_skillcaps) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(account_entry.crc_basedata) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -308,11 +360,14 @@ public:
|
|||||||
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
|
insert_values.push_back("'" + EscapeString(account_entry.minilogin_ip) + "'");
|
||||||
insert_values.push_back(std::to_string(account_entry.hideme));
|
insert_values.push_back(std::to_string(account_entry.hideme));
|
||||||
insert_values.push_back(std::to_string(account_entry.rulesflag));
|
insert_values.push_back(std::to_string(account_entry.rulesflag));
|
||||||
insert_values.push_back("'" + EscapeString(account_entry.suspendeduntil) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (account_entry.suspendeduntil > 0 ? std::to_string(account_entry.suspendeduntil) : "null") + ")");
|
||||||
insert_values.push_back(std::to_string(account_entry.time_creation));
|
insert_values.push_back(std::to_string(account_entry.time_creation));
|
||||||
insert_values.push_back(std::to_string(account_entry.expansion));
|
insert_values.push_back(std::to_string(account_entry.expansion));
|
||||||
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
insert_values.push_back("'" + EscapeString(account_entry.ban_reason) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
insert_values.push_back("'" + EscapeString(account_entry.suspend_reason) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(account_entry.crc_eqgame) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(account_entry.crc_skillcaps) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(account_entry.crc_basedata) + "'");
|
||||||
|
|
||||||
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||||
}
|
}
|
||||||
@@ -360,11 +415,14 @@ public:
|
|||||||
entry.minilogin_ip = row[11] ? row[11] : "";
|
entry.minilogin_ip = row[11] ? row[11] : "";
|
||||||
entry.hideme = atoi(row[12]);
|
entry.hideme = atoi(row[12]);
|
||||||
entry.rulesflag = atoi(row[13]);
|
entry.rulesflag = atoi(row[13]);
|
||||||
entry.suspendeduntil = row[14] ? row[14] : "";
|
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
|
||||||
entry.time_creation = atoi(row[15]);
|
entry.time_creation = atoi(row[15]);
|
||||||
entry.expansion = atoi(row[16]);
|
entry.expansion = atoi(row[16]);
|
||||||
entry.ban_reason = row[17] ? row[17] : "";
|
entry.ban_reason = row[17] ? row[17] : "";
|
||||||
entry.suspend_reason = row[18] ? row[18] : "";
|
entry.suspend_reason = row[18] ? row[18] : "";
|
||||||
|
entry.crc_eqgame = row[19] ? row[19] : "";
|
||||||
|
entry.crc_skillcaps = row[20] ? row[20] : "";
|
||||||
|
entry.crc_basedata = row[21] ? row[21] : "";
|
||||||
|
|
||||||
all_entries.push_back(entry);
|
all_entries.push_back(entry);
|
||||||
}
|
}
|
||||||
@@ -403,11 +461,14 @@ public:
|
|||||||
entry.minilogin_ip = row[11] ? row[11] : "";
|
entry.minilogin_ip = row[11] ? row[11] : "";
|
||||||
entry.hideme = atoi(row[12]);
|
entry.hideme = atoi(row[12]);
|
||||||
entry.rulesflag = atoi(row[13]);
|
entry.rulesflag = atoi(row[13]);
|
||||||
entry.suspendeduntil = row[14] ? row[14] : "";
|
entry.suspendeduntil = strtoll(row[14] ? row[14] : "-1", nullptr, 10);
|
||||||
entry.time_creation = atoi(row[15]);
|
entry.time_creation = atoi(row[15]);
|
||||||
entry.expansion = atoi(row[16]);
|
entry.expansion = atoi(row[16]);
|
||||||
entry.ban_reason = row[17] ? row[17] : "";
|
entry.ban_reason = row[17] ? row[17] : "";
|
||||||
entry.suspend_reason = row[18] ? row[18] : "";
|
entry.suspend_reason = row[18] ? row[18] : "";
|
||||||
|
entry.crc_eqgame = row[19] ? row[19] : "";
|
||||||
|
entry.crc_skillcaps = row[20] ? row[20] : "";
|
||||||
|
entry.crc_basedata = row[21] ? row[21] : "";
|
||||||
|
|
||||||
all_entries.push_back(entry);
|
all_entries.push_back(entry);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAccountRewardsRepository {
|
class BaseAccountRewardsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -37,11 +38,25 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"account_id",
|
||||||
|
"reward_id",
|
||||||
|
"amount",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("account_rewards");
|
return std::string("account_rewards");
|
||||||
@@ -51,7 +66,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAdventureDetailsRepository {
|
class BaseAdventureDetailsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -49,11 +50,31 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"adventure_id",
|
||||||
|
"instance_id",
|
||||||
|
"count",
|
||||||
|
"assassinate_count",
|
||||||
|
"status",
|
||||||
|
"time_created",
|
||||||
|
"time_zoned",
|
||||||
|
"time_completed",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("adventure_details");
|
return std::string("adventure_details");
|
||||||
@@ -63,7 +84,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAdventureMembersRepository {
|
class BaseAdventureMembersRepository {
|
||||||
public:
|
public:
|
||||||
@@ -35,11 +36,24 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"charid",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("adventure_members");
|
return std::string("adventure_members");
|
||||||
@@ -49,7 +63,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAdventureStatsRepository {
|
class BaseAdventureStatsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -53,11 +54,33 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"player_id",
|
||||||
|
"guk_wins",
|
||||||
|
"mir_wins",
|
||||||
|
"mmc_wins",
|
||||||
|
"ruj_wins",
|
||||||
|
"tak_wins",
|
||||||
|
"guk_losses",
|
||||||
|
"mir_losses",
|
||||||
|
"mmc_losses",
|
||||||
|
"ruj_losses",
|
||||||
|
"tak_losses",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("adventure_stats");
|
return std::string("adventure_stats");
|
||||||
@@ -67,7 +90,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAdventureTemplateEntryFlavorRepository {
|
class BaseAdventureTemplateEntryFlavorRepository {
|
||||||
public:
|
public:
|
||||||
@@ -35,11 +36,24 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"text",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("adventure_template_entry_flavor");
|
return std::string("adventure_template_entry_flavor");
|
||||||
@@ -49,7 +63,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAdventureTemplateEntryRepository {
|
class BaseAdventureTemplateEntryRepository {
|
||||||
public:
|
public:
|
||||||
@@ -35,11 +36,24 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"template_id",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("adventure_template_entry");
|
return std::string("adventure_template_entry");
|
||||||
@@ -49,7 +63,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAdventureTemplateRepository {
|
class BaseAdventureTemplateRepository {
|
||||||
public:
|
public:
|
||||||
@@ -97,11 +98,55 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"zone",
|
||||||
|
"zone_version",
|
||||||
|
"is_hard",
|
||||||
|
"is_raid",
|
||||||
|
"min_level",
|
||||||
|
"max_level",
|
||||||
|
"type",
|
||||||
|
"type_data",
|
||||||
|
"type_count",
|
||||||
|
"assa_x",
|
||||||
|
"assa_y",
|
||||||
|
"assa_z",
|
||||||
|
"assa_h",
|
||||||
|
"text",
|
||||||
|
"duration",
|
||||||
|
"zone_in_time",
|
||||||
|
"win_points",
|
||||||
|
"lose_points",
|
||||||
|
"theme",
|
||||||
|
"zone_in_zone_id",
|
||||||
|
"zone_in_x",
|
||||||
|
"zone_in_y",
|
||||||
|
"zone_in_object_id",
|
||||||
|
"dest_x",
|
||||||
|
"dest_y",
|
||||||
|
"dest_z",
|
||||||
|
"dest_h",
|
||||||
|
"graveyard_zone_id",
|
||||||
|
"graveyard_x",
|
||||||
|
"graveyard_y",
|
||||||
|
"graveyard_z",
|
||||||
|
"graveyard_radius",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("adventure_template");
|
return std::string("adventure_template");
|
||||||
@@ -111,7 +156,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAlternateCurrencyRepository {
|
class BaseAlternateCurrencyRepository {
|
||||||
public:
|
public:
|
||||||
@@ -35,11 +36,24 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"item_id",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("alternate_currency");
|
return std::string("alternate_currency");
|
||||||
@@ -49,7 +63,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseAurasRepository {
|
class BaseAurasRepository {
|
||||||
public:
|
public:
|
||||||
@@ -53,11 +54,33 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"type",
|
||||||
|
"npc_type",
|
||||||
|
"name",
|
||||||
|
"spell_id",
|
||||||
|
"distance",
|
||||||
|
"aura_type",
|
||||||
|
"spawn_type",
|
||||||
|
"movement",
|
||||||
|
"duration",
|
||||||
|
"icon",
|
||||||
|
"cast_time",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("auras");
|
return std::string("auras");
|
||||||
@@ -67,7 +90,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseBaseDataRepository {
|
class BaseBaseDataRepository {
|
||||||
public:
|
public:
|
||||||
@@ -51,11 +52,32 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"level",
|
||||||
|
"`class`",
|
||||||
|
"hp",
|
||||||
|
"mana",
|
||||||
|
"end",
|
||||||
|
"unk1",
|
||||||
|
"unk2",
|
||||||
|
"hp_fac",
|
||||||
|
"mana_fac",
|
||||||
|
"end_fac",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("base_data");
|
return std::string("base_data");
|
||||||
@@ -65,7 +87,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseBlockedSpellsRepository {
|
class BaseBlockedSpellsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -55,11 +56,34 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"spellid",
|
||||||
|
"type",
|
||||||
|
"zoneid",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z",
|
||||||
|
"x_diff",
|
||||||
|
"y_diff",
|
||||||
|
"z_diff",
|
||||||
|
"message",
|
||||||
|
"description",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("blocked_spells");
|
return std::string("blocked_spells");
|
||||||
@@ -69,7 +93,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,326 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* This repository was automatically generated and is NOT to be modified directly.
|
||||||
|
* Any repository modifications are meant to be made to the repository extending the base.
|
||||||
|
* Any modifications to base repositories are to be made by the generator only
|
||||||
|
*
|
||||||
|
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||||
|
* @docs https://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_BOOKS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_BOOKS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
class BaseBooksRepository {
|
||||||
|
public:
|
||||||
|
struct Books {
|
||||||
|
int id;
|
||||||
|
std::string name;
|
||||||
|
std::string txtfile;
|
||||||
|
int language;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"txtfile",
|
||||||
|
"language",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"name",
|
||||||
|
"txtfile",
|
||||||
|
"language",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("books");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Books NewEntity()
|
||||||
|
{
|
||||||
|
Books entry{};
|
||||||
|
|
||||||
|
entry.id = 0;
|
||||||
|
entry.name = "";
|
||||||
|
entry.txtfile = "";
|
||||||
|
entry.language = 0;
|
||||||
|
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Books GetBooksEntry(
|
||||||
|
const std::vector<Books> &bookss,
|
||||||
|
int books_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &books : bookss) {
|
||||||
|
if (books.id == books_id) {
|
||||||
|
return books;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Books FindOne(
|
||||||
|
Database& db,
|
||||||
|
int books_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE id = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
books_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
Books entry{};
|
||||||
|
|
||||||
|
entry.id = atoi(row[0]);
|
||||||
|
entry.name = row[1] ? row[1] : "";
|
||||||
|
entry.txtfile = row[2] ? row[2] : "";
|
||||||
|
entry.language = atoi(row[3]);
|
||||||
|
|
||||||
|
return entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int books_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
books_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
Books books_entry
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> update_values;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
update_values.push_back(columns[1] + " = '" + EscapeString(books_entry.name) + "'");
|
||||||
|
update_values.push_back(columns[2] + " = '" + EscapeString(books_entry.txtfile) + "'");
|
||||||
|
update_values.push_back(columns[3] + " = " + std::to_string(books_entry.language));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
implode(", ", update_values),
|
||||||
|
PrimaryKey(),
|
||||||
|
books_entry.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Books InsertOne(
|
||||||
|
Database& db,
|
||||||
|
Books books_entry
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_values;
|
||||||
|
|
||||||
|
insert_values.push_back(std::to_string(books_entry.id));
|
||||||
|
insert_values.push_back("'" + EscapeString(books_entry.name) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'");
|
||||||
|
insert_values.push_back(std::to_string(books_entry.language));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
implode(",", insert_values)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
books_entry.id = results.LastInsertedID();
|
||||||
|
return books_entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
books_entry = NewEntity();
|
||||||
|
|
||||||
|
return books_entry;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
std::vector<Books> books_entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &books_entry: books_entries) {
|
||||||
|
std::vector<std::string> insert_values;
|
||||||
|
|
||||||
|
insert_values.push_back(std::to_string(books_entry.id));
|
||||||
|
insert_values.push_back("'" + EscapeString(books_entry.name) + "'");
|
||||||
|
insert_values.push_back("'" + EscapeString(books_entry.txtfile) + "'");
|
||||||
|
insert_values.push_back(std::to_string(books_entry.language));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> insert_values;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<Books> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<Books> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
Books entry{};
|
||||||
|
|
||||||
|
entry.id = atoi(row[0]);
|
||||||
|
entry.name = row[1] ? row[1] : "";
|
||||||
|
entry.txtfile = row[2] ? row[2] : "";
|
||||||
|
entry.language = atoi(row[3]);
|
||||||
|
|
||||||
|
all_entries.push_back(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<Books> GetWhere(Database& db, std::string where_filter)
|
||||||
|
{
|
||||||
|
std::vector<Books> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
Books entry{};
|
||||||
|
|
||||||
|
entry.id = atoi(row[0]);
|
||||||
|
entry.name = row[1] ? row[1] : "";
|
||||||
|
entry.txtfile = row[2] ? row[2] : "";
|
||||||
|
entry.language = atoi(row[3]);
|
||||||
|
|
||||||
|
all_entries.push_back(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, std::string where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_BOOKS_REPOSITORY_H
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseBugReportsRepository {
|
class BaseBugReportsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -45,9 +46,9 @@ public:
|
|||||||
int _unknown_value;
|
int _unknown_value;
|
||||||
std::string bug_report;
|
std::string bug_report;
|
||||||
std::string system_info;
|
std::string system_info;
|
||||||
std::string report_datetime;
|
time_t report_datetime;
|
||||||
int bug_status;
|
int bug_status;
|
||||||
std::string last_review;
|
time_t last_review;
|
||||||
std::string last_reviewer;
|
std::string last_reviewer;
|
||||||
std::string reviewer_notes;
|
std::string reviewer_notes;
|
||||||
};
|
};
|
||||||
@@ -95,11 +96,54 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"zone",
|
||||||
|
"client_version_id",
|
||||||
|
"client_version_name",
|
||||||
|
"account_id",
|
||||||
|
"character_id",
|
||||||
|
"character_name",
|
||||||
|
"reporter_spoof",
|
||||||
|
"category_id",
|
||||||
|
"category_name",
|
||||||
|
"reporter_name",
|
||||||
|
"ui_path",
|
||||||
|
"pos_x",
|
||||||
|
"pos_y",
|
||||||
|
"pos_z",
|
||||||
|
"heading",
|
||||||
|
"time_played",
|
||||||
|
"target_id",
|
||||||
|
"target_name",
|
||||||
|
"optional_info_mask",
|
||||||
|
"_can_duplicate",
|
||||||
|
"_crash_bug",
|
||||||
|
"_target_info",
|
||||||
|
"_character_flags",
|
||||||
|
"_unknown_value",
|
||||||
|
"bug_report",
|
||||||
|
"system_info",
|
||||||
|
"UNIX_TIMESTAMP(report_datetime)",
|
||||||
|
"bug_status",
|
||||||
|
"UNIX_TIMESTAMP(last_review)",
|
||||||
|
"last_reviewer",
|
||||||
|
"reviewer_notes",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("bug_reports");
|
return std::string("bug_reports");
|
||||||
@@ -109,7 +153,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -154,9 +198,9 @@ public:
|
|||||||
entry._unknown_value = 0;
|
entry._unknown_value = 0;
|
||||||
entry.bug_report = "";
|
entry.bug_report = "";
|
||||||
entry.system_info = "";
|
entry.system_info = "";
|
||||||
entry.report_datetime = "";
|
entry.report_datetime = std::time(nullptr);
|
||||||
entry.bug_status = 0;
|
entry.bug_status = 0;
|
||||||
entry.last_review = "";
|
entry.last_review = std::time(nullptr);
|
||||||
entry.last_reviewer = "None";
|
entry.last_reviewer = "None";
|
||||||
entry.reviewer_notes = "";
|
entry.reviewer_notes = "";
|
||||||
|
|
||||||
@@ -221,9 +265,9 @@ public:
|
|||||||
entry._unknown_value = atoi(row[24]);
|
entry._unknown_value = atoi(row[24]);
|
||||||
entry.bug_report = row[25] ? row[25] : "";
|
entry.bug_report = row[25] ? row[25] : "";
|
||||||
entry.system_info = row[26] ? row[26] : "";
|
entry.system_info = row[26] ? row[26] : "";
|
||||||
entry.report_datetime = row[27] ? row[27] : "";
|
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
|
||||||
entry.bug_status = atoi(row[28]);
|
entry.bug_status = atoi(row[28]);
|
||||||
entry.last_review = row[29] ? row[29] : "";
|
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
|
||||||
entry.last_reviewer = row[30] ? row[30] : "";
|
entry.last_reviewer = row[30] ? row[30] : "";
|
||||||
entry.reviewer_notes = row[31] ? row[31] : "";
|
entry.reviewer_notes = row[31] ? row[31] : "";
|
||||||
|
|
||||||
@@ -285,9 +329,9 @@ public:
|
|||||||
update_values.push_back(columns[24] + " = " + std::to_string(bug_reports_entry._unknown_value));
|
update_values.push_back(columns[24] + " = " + std::to_string(bug_reports_entry._unknown_value));
|
||||||
update_values.push_back(columns[25] + " = '" + EscapeString(bug_reports_entry.bug_report) + "'");
|
update_values.push_back(columns[25] + " = '" + EscapeString(bug_reports_entry.bug_report) + "'");
|
||||||
update_values.push_back(columns[26] + " = '" + EscapeString(bug_reports_entry.system_info) + "'");
|
update_values.push_back(columns[26] + " = '" + EscapeString(bug_reports_entry.system_info) + "'");
|
||||||
update_values.push_back(columns[27] + " = '" + EscapeString(bug_reports_entry.report_datetime) + "'");
|
update_values.push_back(columns[27] + " = FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
|
||||||
update_values.push_back(columns[28] + " = " + std::to_string(bug_reports_entry.bug_status));
|
update_values.push_back(columns[28] + " = " + std::to_string(bug_reports_entry.bug_status));
|
||||||
update_values.push_back(columns[29] + " = '" + EscapeString(bug_reports_entry.last_review) + "'");
|
update_values.push_back(columns[29] + " = FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
|
||||||
update_values.push_back(columns[30] + " = '" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
update_values.push_back(columns[30] + " = '" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||||
update_values.push_back(columns[31] + " = '" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
update_values.push_back(columns[31] + " = '" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||||
|
|
||||||
@@ -338,9 +382,9 @@ public:
|
|||||||
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
|
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.report_datetime) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
|
||||||
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
|
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_review) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||||
|
|
||||||
@@ -399,9 +443,9 @@ public:
|
|||||||
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
|
insert_values.push_back(std::to_string(bug_reports_entry._unknown_value));
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.bug_report) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.system_info) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.report_datetime) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.report_datetime > 0 ? std::to_string(bug_reports_entry.report_datetime) : "null") + ")");
|
||||||
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
|
insert_values.push_back(std::to_string(bug_reports_entry.bug_status));
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_review) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (bug_reports_entry.last_review > 0 ? std::to_string(bug_reports_entry.last_review) : "null") + ")");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.last_reviewer) + "'");
|
||||||
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
insert_values.push_back("'" + EscapeString(bug_reports_entry.reviewer_notes) + "'");
|
||||||
|
|
||||||
@@ -464,9 +508,9 @@ public:
|
|||||||
entry._unknown_value = atoi(row[24]);
|
entry._unknown_value = atoi(row[24]);
|
||||||
entry.bug_report = row[25] ? row[25] : "";
|
entry.bug_report = row[25] ? row[25] : "";
|
||||||
entry.system_info = row[26] ? row[26] : "";
|
entry.system_info = row[26] ? row[26] : "";
|
||||||
entry.report_datetime = row[27] ? row[27] : "";
|
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
|
||||||
entry.bug_status = atoi(row[28]);
|
entry.bug_status = atoi(row[28]);
|
||||||
entry.last_review = row[29] ? row[29] : "";
|
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
|
||||||
entry.last_reviewer = row[30] ? row[30] : "";
|
entry.last_reviewer = row[30] ? row[30] : "";
|
||||||
entry.reviewer_notes = row[31] ? row[31] : "";
|
entry.reviewer_notes = row[31] ? row[31] : "";
|
||||||
|
|
||||||
@@ -520,9 +564,9 @@ public:
|
|||||||
entry._unknown_value = atoi(row[24]);
|
entry._unknown_value = atoi(row[24]);
|
||||||
entry.bug_report = row[25] ? row[25] : "";
|
entry.bug_report = row[25] ? row[25] : "";
|
||||||
entry.system_info = row[26] ? row[26] : "";
|
entry.system_info = row[26] ? row[26] : "";
|
||||||
entry.report_datetime = row[27] ? row[27] : "";
|
entry.report_datetime = strtoll(row[27] ? row[27] : "-1", nullptr, 10);
|
||||||
entry.bug_status = atoi(row[28]);
|
entry.bug_status = atoi(row[28]);
|
||||||
entry.last_review = row[29] ? row[29] : "";
|
entry.last_review = strtoll(row[29] ? row[29] : "-1", nullptr, 10);
|
||||||
entry.last_reviewer = row[30] ? row[30] : "";
|
entry.last_reviewer = row[30] ? row[30] : "";
|
||||||
entry.reviewer_notes = row[31] ? row[31] : "";
|
entry.reviewer_notes = row[31] ? row[31] : "";
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseBugsRepository {
|
class BaseBugsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -57,11 +58,35 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"zone",
|
||||||
|
"name",
|
||||||
|
"ui",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z",
|
||||||
|
"type",
|
||||||
|
"flag",
|
||||||
|
"target",
|
||||||
|
"bug",
|
||||||
|
"date",
|
||||||
|
"status",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("bugs");
|
return std::string("bugs");
|
||||||
@@ -71,7 +96,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseBuyerRepository {
|
class BaseBuyerRepository {
|
||||||
public:
|
public:
|
||||||
@@ -43,11 +44,28 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"charid",
|
||||||
|
"buyslot",
|
||||||
|
"itemid",
|
||||||
|
"itemname",
|
||||||
|
"quantity",
|
||||||
|
"price",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("buyer");
|
return std::string("buyer");
|
||||||
@@ -57,7 +75,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharCreateCombinationsRepository {
|
class BaseCharCreateCombinationsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -43,11 +44,28 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"allocation_id",
|
||||||
|
"race",
|
||||||
|
"`class`",
|
||||||
|
"deity",
|
||||||
|
"start_zone",
|
||||||
|
"expansions_req",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("char_create_combinations");
|
return std::string("char_create_combinations");
|
||||||
@@ -57,7 +75,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharCreatePointAllocationsRepository {
|
class BaseCharCreatePointAllocationsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -61,11 +62,37 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"base_str",
|
||||||
|
"base_sta",
|
||||||
|
"base_dex",
|
||||||
|
"base_agi",
|
||||||
|
"base_int",
|
||||||
|
"base_wis",
|
||||||
|
"base_cha",
|
||||||
|
"alloc_str",
|
||||||
|
"alloc_sta",
|
||||||
|
"alloc_dex",
|
||||||
|
"alloc_agi",
|
||||||
|
"alloc_int",
|
||||||
|
"alloc_wis",
|
||||||
|
"alloc_cha",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("char_create_point_allocations");
|
return std::string("char_create_point_allocations");
|
||||||
@@ -75,7 +102,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharRecipeListRepository {
|
class BaseCharRecipeListRepository {
|
||||||
public:
|
public:
|
||||||
@@ -37,11 +38,25 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"char_id",
|
||||||
|
"recipe_id",
|
||||||
|
"madecount",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("char_recipe_list");
|
return std::string("char_recipe_list");
|
||||||
@@ -51,7 +66,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterActivitiesRepository {
|
class BaseCharacterActivitiesRepository {
|
||||||
public:
|
public:
|
||||||
@@ -41,11 +42,27 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"charid",
|
||||||
|
"taskid",
|
||||||
|
"activityid",
|
||||||
|
"donecount",
|
||||||
|
"completed",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_activities");
|
return std::string("character_activities");
|
||||||
@@ -55,7 +72,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterAltCurrencyRepository {
|
class BaseCharacterAltCurrencyRepository {
|
||||||
public:
|
public:
|
||||||
@@ -37,11 +38,25 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"char_id",
|
||||||
|
"currency_id",
|
||||||
|
"amount",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_alt_currency");
|
return std::string("character_alt_currency");
|
||||||
@@ -51,7 +66,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterAlternateAbilitiesRepository {
|
class BaseCharacterAlternateAbilitiesRepository {
|
||||||
public:
|
public:
|
||||||
@@ -39,11 +40,26 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"aa_id",
|
||||||
|
"aa_value",
|
||||||
|
"charges",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_alternate_abilities");
|
return std::string("character_alternate_abilities");
|
||||||
@@ -53,7 +69,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterAurasRepository {
|
class BaseCharacterAurasRepository {
|
||||||
public:
|
public:
|
||||||
@@ -37,11 +38,25 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"slot",
|
||||||
|
"spell_id",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_auras");
|
return std::string("character_auras");
|
||||||
@@ -51,7 +66,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterBandolierRepository {
|
class BaseCharacterBandolierRepository {
|
||||||
public:
|
public:
|
||||||
@@ -43,11 +44,28 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"bandolier_id",
|
||||||
|
"bandolier_slot",
|
||||||
|
"item_id",
|
||||||
|
"icon",
|
||||||
|
"bandolier_name",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_bandolier");
|
return std::string("character_bandolier");
|
||||||
@@ -57,7 +75,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterBindRepository {
|
class BaseCharacterBindRepository {
|
||||||
public:
|
public:
|
||||||
@@ -47,11 +48,30 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"slot",
|
||||||
|
"zone_id",
|
||||||
|
"instance_id",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z",
|
||||||
|
"heading",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_bind");
|
return std::string("character_bind");
|
||||||
@@ -61,7 +81,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterBuffsRepository {
|
class BaseCharacterBuffsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -65,11 +66,39 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"character_id",
|
||||||
|
"slot_id",
|
||||||
|
"spell_id",
|
||||||
|
"caster_level",
|
||||||
|
"caster_name",
|
||||||
|
"ticsremaining",
|
||||||
|
"counters",
|
||||||
|
"numhits",
|
||||||
|
"melee_rune",
|
||||||
|
"magic_rune",
|
||||||
|
"persistent",
|
||||||
|
"dot_rune",
|
||||||
|
"caston_x",
|
||||||
|
"caston_y",
|
||||||
|
"caston_z",
|
||||||
|
"ExtraDIChance",
|
||||||
|
"instrument_mod",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_buffs");
|
return std::string("character_buffs");
|
||||||
@@ -79,7 +108,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterCorpseItemsRepository {
|
class BaseCharacterCorpseItemsRepository {
|
||||||
public:
|
public:
|
||||||
@@ -53,11 +54,33 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"corpse_id",
|
||||||
|
"equip_slot",
|
||||||
|
"item_id",
|
||||||
|
"charges",
|
||||||
|
"aug_1",
|
||||||
|
"aug_2",
|
||||||
|
"aug_3",
|
||||||
|
"aug_4",
|
||||||
|
"aug_5",
|
||||||
|
"aug_6",
|
||||||
|
"attuned",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_corpse_items");
|
return std::string("character_corpse_items");
|
||||||
@@ -67,7 +90,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterCorpsesRepository {
|
class BaseCharacterCorpsesRepository {
|
||||||
public:
|
public:
|
||||||
@@ -27,7 +28,7 @@ public:
|
|||||||
float y;
|
float y;
|
||||||
float z;
|
float z;
|
||||||
float heading;
|
float heading;
|
||||||
std::string time_of_death;
|
time_t time_of_death;
|
||||||
int guild_consent_id;
|
int guild_consent_id;
|
||||||
int is_rezzed;
|
int is_rezzed;
|
||||||
int is_buried;
|
int is_buried;
|
||||||
@@ -125,11 +126,69 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"charid",
|
||||||
|
"charname",
|
||||||
|
"zone_id",
|
||||||
|
"instance_id",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"z",
|
||||||
|
"heading",
|
||||||
|
"UNIX_TIMESTAMP(time_of_death)",
|
||||||
|
"guild_consent_id",
|
||||||
|
"is_rezzed",
|
||||||
|
"is_buried",
|
||||||
|
"was_at_graveyard",
|
||||||
|
"is_locked",
|
||||||
|
"exp",
|
||||||
|
"size",
|
||||||
|
"level",
|
||||||
|
"race",
|
||||||
|
"gender",
|
||||||
|
"`class`",
|
||||||
|
"deity",
|
||||||
|
"texture",
|
||||||
|
"helm_texture",
|
||||||
|
"copper",
|
||||||
|
"silver",
|
||||||
|
"gold",
|
||||||
|
"platinum",
|
||||||
|
"hair_color",
|
||||||
|
"beard_color",
|
||||||
|
"eye_color_1",
|
||||||
|
"eye_color_2",
|
||||||
|
"hair_style",
|
||||||
|
"face",
|
||||||
|
"beard",
|
||||||
|
"drakkin_heritage",
|
||||||
|
"drakkin_tattoo",
|
||||||
|
"drakkin_details",
|
||||||
|
"wc_1",
|
||||||
|
"wc_2",
|
||||||
|
"wc_3",
|
||||||
|
"wc_4",
|
||||||
|
"wc_5",
|
||||||
|
"wc_6",
|
||||||
|
"wc_7",
|
||||||
|
"wc_8",
|
||||||
|
"wc_9",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_corpses");
|
return std::string("character_corpses");
|
||||||
@@ -139,7 +198,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -166,7 +225,7 @@ public:
|
|||||||
entry.y = 0;
|
entry.y = 0;
|
||||||
entry.z = 0;
|
entry.z = 0;
|
||||||
entry.heading = 0;
|
entry.heading = 0;
|
||||||
entry.time_of_death = "0000-00-00 00:00:00";
|
entry.time_of_death = 0;
|
||||||
entry.guild_consent_id = 0;
|
entry.guild_consent_id = 0;
|
||||||
entry.is_rezzed = 0;
|
entry.is_rezzed = 0;
|
||||||
entry.is_buried = 0;
|
entry.is_buried = 0;
|
||||||
@@ -248,7 +307,7 @@ public:
|
|||||||
entry.y = static_cast<float>(atof(row[6]));
|
entry.y = static_cast<float>(atof(row[6]));
|
||||||
entry.z = static_cast<float>(atof(row[7]));
|
entry.z = static_cast<float>(atof(row[7]));
|
||||||
entry.heading = static_cast<float>(atof(row[8]));
|
entry.heading = static_cast<float>(atof(row[8]));
|
||||||
entry.time_of_death = row[9] ? row[9] : "";
|
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
|
||||||
entry.guild_consent_id = atoi(row[10]);
|
entry.guild_consent_id = atoi(row[10]);
|
||||||
entry.is_rezzed = atoi(row[11]);
|
entry.is_rezzed = atoi(row[11]);
|
||||||
entry.is_buried = atoi(row[12]);
|
entry.is_buried = atoi(row[12]);
|
||||||
@@ -327,7 +386,7 @@ public:
|
|||||||
update_values.push_back(columns[6] + " = " + std::to_string(character_corpses_entry.y));
|
update_values.push_back(columns[6] + " = " + std::to_string(character_corpses_entry.y));
|
||||||
update_values.push_back(columns[7] + " = " + std::to_string(character_corpses_entry.z));
|
update_values.push_back(columns[7] + " = " + std::to_string(character_corpses_entry.z));
|
||||||
update_values.push_back(columns[8] + " = " + std::to_string(character_corpses_entry.heading));
|
update_values.push_back(columns[8] + " = " + std::to_string(character_corpses_entry.heading));
|
||||||
update_values.push_back(columns[9] + " = '" + EscapeString(character_corpses_entry.time_of_death) + "'");
|
update_values.push_back(columns[9] + " = FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
|
||||||
update_values.push_back(columns[10] + " = " + std::to_string(character_corpses_entry.guild_consent_id));
|
update_values.push_back(columns[10] + " = " + std::to_string(character_corpses_entry.guild_consent_id));
|
||||||
update_values.push_back(columns[11] + " = " + std::to_string(character_corpses_entry.is_rezzed));
|
update_values.push_back(columns[11] + " = " + std::to_string(character_corpses_entry.is_rezzed));
|
||||||
update_values.push_back(columns[12] + " = " + std::to_string(character_corpses_entry.is_buried));
|
update_values.push_back(columns[12] + " = " + std::to_string(character_corpses_entry.is_buried));
|
||||||
@@ -395,7 +454,7 @@ public:
|
|||||||
insert_values.push_back(std::to_string(character_corpses_entry.y));
|
insert_values.push_back(std::to_string(character_corpses_entry.y));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.z));
|
insert_values.push_back(std::to_string(character_corpses_entry.z));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.heading));
|
insert_values.push_back(std::to_string(character_corpses_entry.heading));
|
||||||
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
|
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
|
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
|
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
|
||||||
@@ -471,7 +530,7 @@ public:
|
|||||||
insert_values.push_back(std::to_string(character_corpses_entry.y));
|
insert_values.push_back(std::to_string(character_corpses_entry.y));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.z));
|
insert_values.push_back(std::to_string(character_corpses_entry.z));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.heading));
|
insert_values.push_back(std::to_string(character_corpses_entry.heading));
|
||||||
insert_values.push_back("'" + EscapeString(character_corpses_entry.time_of_death) + "'");
|
insert_values.push_back("FROM_UNIXTIME(" + (character_corpses_entry.time_of_death > 0 ? std::to_string(character_corpses_entry.time_of_death) : "null") + ")");
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
|
insert_values.push_back(std::to_string(character_corpses_entry.guild_consent_id));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
|
insert_values.push_back(std::to_string(character_corpses_entry.is_rezzed));
|
||||||
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
|
insert_values.push_back(std::to_string(character_corpses_entry.is_buried));
|
||||||
@@ -551,7 +610,7 @@ public:
|
|||||||
entry.y = static_cast<float>(atof(row[6]));
|
entry.y = static_cast<float>(atof(row[6]));
|
||||||
entry.z = static_cast<float>(atof(row[7]));
|
entry.z = static_cast<float>(atof(row[7]));
|
||||||
entry.heading = static_cast<float>(atof(row[8]));
|
entry.heading = static_cast<float>(atof(row[8]));
|
||||||
entry.time_of_death = row[9] ? row[9] : "";
|
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
|
||||||
entry.guild_consent_id = atoi(row[10]);
|
entry.guild_consent_id = atoi(row[10]);
|
||||||
entry.is_rezzed = atoi(row[11]);
|
entry.is_rezzed = atoi(row[11]);
|
||||||
entry.is_buried = atoi(row[12]);
|
entry.is_buried = atoi(row[12]);
|
||||||
@@ -622,7 +681,7 @@ public:
|
|||||||
entry.y = static_cast<float>(atof(row[6]));
|
entry.y = static_cast<float>(atof(row[6]));
|
||||||
entry.z = static_cast<float>(atof(row[7]));
|
entry.z = static_cast<float>(atof(row[7]));
|
||||||
entry.heading = static_cast<float>(atof(row[8]));
|
entry.heading = static_cast<float>(atof(row[8]));
|
||||||
entry.time_of_death = row[9] ? row[9] : "";
|
entry.time_of_death = strtoll(row[9] ? row[9] : "-1", nullptr, 10);
|
||||||
entry.guild_consent_id = atoi(row[10]);
|
entry.guild_consent_id = atoi(row[10]);
|
||||||
entry.is_rezzed = atoi(row[11]);
|
entry.is_rezzed = atoi(row[11]);
|
||||||
entry.is_buried = atoi(row[12]);
|
entry.is_buried = atoi(row[12]);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "../../database.h"
|
#include "../../database.h"
|
||||||
#include "../../string_util.h"
|
#include "../../string_util.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
class BaseCharacterCurrencyRepository {
|
class BaseCharacterCurrencyRepository {
|
||||||
public:
|
public:
|
||||||
@@ -65,11 +66,39 @@ public:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"platinum",
|
||||||
|
"gold",
|
||||||
|
"silver",
|
||||||
|
"copper",
|
||||||
|
"platinum_bank",
|
||||||
|
"gold_bank",
|
||||||
|
"silver_bank",
|
||||||
|
"copper_bank",
|
||||||
|
"platinum_cursor",
|
||||||
|
"gold_cursor",
|
||||||
|
"silver_cursor",
|
||||||
|
"copper_cursor",
|
||||||
|
"radiant_crystals",
|
||||||
|
"career_radiant_crystals",
|
||||||
|
"ebon_crystals",
|
||||||
|
"career_ebon_crystals",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static std::string ColumnsRaw()
|
static std::string ColumnsRaw()
|
||||||
{
|
{
|
||||||
return std::string(implode(", ", Columns()));
|
return std::string(implode(", ", Columns()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
static std::string TableName()
|
static std::string TableName()
|
||||||
{
|
{
|
||||||
return std::string("character_currency");
|
return std::string("character_currency");
|
||||||
@@ -79,7 +108,7 @@ public:
|
|||||||
{
|
{
|
||||||
return fmt::format(
|
return fmt::format(
|
||||||
"SELECT {} FROM {}",
|
"SELECT {} FROM {}",
|
||||||
ColumnsRaw(),
|
SelectColumnsRaw(),
|
||||||
TableName()
|
TableName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user